Lampshade script

by phooky, published

Lampshade script by phooky Apr 8, 2011

Featured Thing!



Lampshade script by phooky is licensed under the GNU - GPL license.

Liked By

View All

Give a Shout Out

If you print this Thing and display it in public proudly give attribution by printing and displaying this tag.

Print Thing Tag


Thing Statistics

4947Views 662Downloads


By request, this is the famous, fabulous lampshade script. We've used it to produce lampshades, bracelets, faux ABS LPs, small storage cups, and in any situation where a hollow cylindrical or conical form optionally with a solid bottom is called for.

This script takes an image file as input and produces a gcode file that will create a conical form of the specified parameters, with the image embossed on the surface. It's recommended that you use the -c flag, which will cause the form to be built as a single, continuous spiral.

You may need to edit the script or its output to add your own pre- and post- print gcodes. Be sure to cast an eye over the output before you print!

Printing these forms in clear PLA is particularly pleasing!

The code is maintained in git; the latest version is always available at:


Have fun!


Here's the usage info. Go crazy!

Usage: lampshade.py [options] image.png

-h, --help show this help message and exit
-r RADIUS, --radius=RADIUS
set the top and bottom radius of a right cylinder
set the height of a single layer, in mm
--rtop=RTOP set the top radius of a conical shade
--rbot=RBOT set the bottom radius of a conical shade
-H HEIGHT, --height=HEIGHT
set the height of the shade
the factor to multiply the feedrate by for a
completely dark pixel
-c, --continuous use continuous Z movement
-a, --ABP use automated build platform
number of layers in the floor
-f FEEDRATE, --feedrate=FEEDRATE
set the base feedrate

All Apps

Upgrade this Thing with Thingiverse Apps

No results.

I wonder if you could make a replica of early record players with these cylinders. Early record players used wax cylinders with grooves in them. Maybe it is possible to encode an mp3 into these. It would be way retro.

I've got an old record player that plays wax cylinders, I could test it :)

This should be possible. Also, creating cylinders and then constructing a lathe might be a project within reach. I must admit that I used this lamp script to create the "3D Printed Vinyl Records" you might have seen on the MakerBot blog early this month...

Well I already edited the http://lampshade.pylampshade.py to automatically insert my start and end gcode settings, but for some reason I can't get this to print well. If I leave the speed setting as default, it just looks like a normal round object, nothing on the shade. If I set it low enough that something can be seen, after it is done slowing down (to make the picture visible), it speeds up for an equal amount of distance, creating a kind of smear on the lampshade.

It seems like it is trying to catchup to something after it slows down, which messes up the entire thing.

Anyone else having smear problems? DONT_KNOW

B.t.w. here's a patch to make it more configurable, output to a file and have 5D support for several other firmware types.


Thanks for uploading, I got the script working on my Thing-O-Matic without too much trouble. I generated the G-Code and then copied my start.gcode to the start of the script, replacing the Cupcake block.

I did have a few issues with the bot stalling when I tried to print initially but after I copied to to the SD card it was working fine. Translucent blue PLA 4043D makes it hard to take a picture of but you can see the detail. I'm not sure if it's my bot or settings but I noticed that certain parts
of the print came out much better than others (mostly the top and bottom). This was not printed using continuous mode, there is a seam at the back.

Good job! What I did was edit the lines of the http://lampshade.pylampshade.py to match my ToM settings, before I generated the gcode. It didn't work out at all. I was wondering... are you using a stepper extruder on your ToM?

No, just the standard MK5 DC motor, Firmware 2.7 on the MB and EC.

Yeah, that makes sense then. The gcode this script generates uses commands to control a dc extruder. Getting it to work with the stepper extruder is going to require a bit more work and know how than changing the start. I might see if I can figure it out, but I doubt I will be able to get it to work. I don't know my gcode or python very well.

The script is controlling the X/Y feedrate to deposit more or less plastic. The extruder is running at a constant speed so it should only be a case of replacing the "M108 S255" to fix the stepped extruder at a specific RPM.

Yeah, I tried setting it to the proper stepper extruder speed using M108. Then at the beginning of the code, the extruder is supposed to turn on using M101. For some reason, I can get the script to work (it moves in a spiral pattern) but I can't get the extruder stepper to actually turn on. I've looked hard for some kind of typo or something, but I just don't SEE any thing wrong with it. For some reason my extruder just won't turn on.

Hmm, when I edit the http://lampshade.pylampshade.py file, it specifies a cupcake. What would I need to edit to get this to work on my Thing-O-Matic using PLA?

I gave it all I got to change the settings in http://lampshade.pylampshade.py to work on my Mk6 ToM.

I changed all the start.gcode to basically do most of things my start.gcode does for PLA. Whenever I try to either upload it to my ToM or build to file in repG, it just acts crazy (like flashy repeating text) and never gets past .01% done. In the console window it just repeats rapidly running warm
up commands, running build, until I press stop.

Thanks for trying - I didn't even dare to, given my past experiences with other people's gcode.

Actually, I made a typo and that's why it didn't work. I pretty much have it working right now, it is doing everything it should with the exception of turning on the extruder. I must have something else wrong. But shouldn't be hard to fix. I am in the process of making a derivative of this for the ToM so other people won't have to do all this to get it to work.

thanks for uploading this, been hoping thta you would for a while now. very cool.