Lithophane Sphere Lampshade

Built with OpenSCAD with Processing data preparation script Code to generate a spherical lithophane lampshade
9
78
0
578
updated March 3, 2024

Description

PDF

Introduction

This parametric OpenSCAD code builds a spherical lithophane lampshade from an image. The code should work for any size of image but to render the model in a reasonable time you should plan for around 500 pixels across, 200 pixels high. The image has to be pre-processed in some Processing code that is also supplied to convert the image into an OpenSCAD array that the code can read directly.

If you want to print the “eye” shade in the photos you do not need to use or run the Processing or OpenSCAD code as the STL for that is provided. You only need to run the code if you want to use your own image.

The instructions below cover how to make a lampshade using your own image. The first time you run the code I would suggest using the example files.

Processing the Image

If you don't already have it install Processing from https://processing.org/download - the latest version should work but older versions shouldn't have problems because this is very simple code. When you run Processing the first time there should be a folder created as your “sketchbook” folder for Processing “sketches”. You will need to unzip the Processing code containing the code and example files into this sketchbook folder. On Windows this is normally a folder in Documents called “Processing”. For example the path might be:

[Your Drive Letter]:\Documents\Processing\blockRender

In the Zip file all of the files are in a folder called “blockRender” and this folder should sit in your sketchbook folder, if the processing file called blockRender.pde that contains the code insn't in a folder also called blockRender then the sketch will not work.

  • Resize your image to around 500 x 150 pixels, you can use more but this will be slow. Fewer pixels will work but will give less detail.
  • Check the comments in the Processing code, you will need to change the input file name and output path in the code to the ones you want to use - your sketch may not be in the same place as mine so check that the output path is correct
  • Ensure that your image file is placed in the “data” folder inside the blockRender folder as this is the default location for Processing to load files
  • When you run the sketch using the play button the code will create the vEye.scad file in the path you gave it in the output file path; it's easiest if you don't change this file name as this is what the OpenSCAD file is expecting. If you change the exported file name here you will need to change it in the main OpenSCAD file also.

Move or copy the vEye.scad file into the folder where you have the main lampLitho.scad file

Creating the Lampshade

Open lampLitho.scad in OpenSCAD. I highly recommend using one of the development snapshots of OpenSCAD and enabling the ‘manifold’ renderer in settings as this is much faster when rendering large objects. This model was built in OpenSCAD 2023.09.10

To generate the shade only you will need to comment out the line that creates the base, type // at the start of the line or press CTRL + D with the cursor on the line so the line looks like:

//base();

Once this is done press F5 or click the “Preview” button in the toolbar to check that the file can be built with your image. You should see the inner wall change shape with the data in the file. The darkest parts of the image will be thicker, the lighter parts thinner.

If you're happy press F6 or click the “Render” button in the toolbar. This will take some time as in the test array there are 200,000 points and nearly as many polygons. Once the file has rendered you can export the file as STL.

Slicing the Lampshade

You will need to ensure that there is no sparse infill used in your print - you want it to be 100% solid for the lithophane effect to work. Thicker parts will appear darker as they will block more light, if you don't have 100% infill this effect may not work.

Layer heights can be as you choose, I used 0.2mm layers. Lighter coloured filaments will probably work best.

Modifying the Code

If for any reason you want to adapt the code I hope you will find the comments useful. The code works by creating an array of points from the image supplied. The code should be able to deal with changes in image size but you will need to check the final dimensions of the lampshade and the proportions of the image created.

You can change the minimum and maximum thicknesses of the lampshade if you wish. Dimesions can also be changed if you wish. The default dimensions are printable on the Prusa Mini.

Base

The STL file supplied was developed to work with a broken IKEA childrens wall lamp - the inside fitting was fully intact but the outer shape was broken and not usable. The lamp looked similar to the style at this link but I don't know if this lamp still contains the required fitting: https://www.ikea.com/gb/en/p/upplyst-led-wall-lamp-flower-lilac-90440783/

If your fitting is different you may need to make your own base design. Some parameters of the base are variable enough that you may be able to alter it to work with other fittings.

Only use mains-powered lamps if you have a safe, properly designed light fitting. Low voltage lights, such as battery powered tealights will work very well to show the lithophane pattern, although the base is designed to work with the IKEA lamp fitting it will also support a battery powered tealight. Do not use tealights with a flame sitting on or in plastic parts

The base holds the shade by the use of M3 machine screws, I used 5 M3x3 socket cap screws after tapping the 2.5mm holes for the M3 thread. You could also drill out the holes to 3mm and use nuts to hold the screws in place.

Tags



Model origin

The author marked this model as their own original creation.

License