FCBmpImport - macro to import black and white bmp images

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
TheMarkster
Veteran
Posts: 5513
Joined: Thu Apr 05, 2018 1:53 am

Re: FCBmpImport - macro to import black and white bmp images

Post by TheMarkster »

New feature for version 2018.06.25: Gray scale lithophanes as Solid import subtype. I was looking on thingiverse and saw some of these and thought I might try adding that capability to the macro. A lithophane, when printed on a 3d printer, would show (or project) an image when a source of light is applied behind it. Each pixel's thickness is according to the shade, darker being thicker, lighter being thinner. A back plate is created to go behind the lithophane (or else the white pixels would be holes, something I discovered the hard way).

The part height parameter sets the thickness baseline. For example, if you select 2 millimeters as part height and the shade is exactly half way between white and black you would get a pixel thickness of 1 mm for that pixel. White pixels would be 0 thickness, black pixels the full 2 mm. X and Y offsets are ignored for this type of import, but Z offset is used to determine the thickness of the back plate. Scale is ignored for this import, too. You can, of course, scale the image using Gimp2 prior to importing. Image will come in upside down, so you might want to flip it before importing. You might also want to mirror it before importing if you plan to project it and there some text or whatever in the image.
Post Reply