Skip to main content

Engineering my cat into keychain charm.

 Cats. What can I say that hasn't already been said.

But this is about a process to turn a picture of my cat into a lithophane. The difficulty: the shape should match the outline of the cat.

To go about this I needed 4 tools: image editing software, an image to lithophane converter, Inkscape, and a STL editor.

The first step was to isolate my cat in the picture:


This was probably the most time consuming aspect, carefully tracing her outline and removing the background. For this I used paint.net but you can use whatever you are familiar with. The result:

After isolating her I also made a 2nd image, which will be used later for creating the outline. This image is simply the area where the background was but filled black, the inverse of above. You can see I smoothed the edges a bit too:

The next step is to use a lithophane generator to create the STL. My favorite is: http://3dp.rocks/lithophane/ . You will want to use a flat model, turn off the border, and set base/stand depth to 0. Save the model to your documents.

Now you will use Inkscape to open up the outline image and trace the outline into a SVG. I won't be covering this process, but you can find a tutorial here: https://inkscape.org/doc/tutorials/tracing/tutorial-tracing.html

I highly recommend that you adjust the smooth corners and optimize. You don't want jagged edges here, as it will be the outline of your model. Make sure to save the file type as SVG, I have had the most luck with this.

The final step is to use your newly generated SVG file to cut out the unwanted parts of the lithophane STL. I'm sure there are a few editors that can do this, but surprisingly the most effective I have found is OpenScad. You will be doing a boolean operation. You do not want to do an Intersection operation, as it would need to calculate those thousands of points to see if they intersect! Instead, you want to do a difference. Create a rather large box that is much larger than the STL. Extrude cut the outline from that box, then use the box to remove the unwanted portions of the Lithophane.
Example OpenScad Code:

difference() 
{
    import("hazel.stl", convexity=3);
    
    difference()
    {
    translate([-100,-100,-10])
      cube([200,200,20]);
    translate([0,0,-12])
      linear_extrude(height = 40, center = false, convexity = 10)
        scale(v = [.075, .075, .075])
          translate([-81,-77,0])
            import(file = "hazel.svg");
    }
}
You will need to adjust the sizes and scale to fit your model. Change the translate() functions and check the output to see if it looks how you would like. With a little luck you will get a nice looking output:

Click the render button in OpenScad and go have a coffee, this might take a few minutes.
You can also add a keychain loop by modelling one in openscad, or editing the outline jpg before converting it to a SVG. If it takes too long to render, reduce the complexity of the lithophane used.
Save your STL and print it out!

Comments

Popular posts from this blog

Reverse Engineering a Wand Vibrator

You ever want to take apart something prohibitively expensive and find out what's inside? I do, all the time. Lucky for me this cast aluminum massager is broken (it won't turn off). So I get to try to fix it (hopefully). It's likely just a bad mosfet. But it'd be fun to upgrade. It's surprisingly low power. 19.5W, 13v @ 1.5A 13v is a bit strange to see, but whatever. Could very likely be replaced by a 12v supply without significant loss in power. One screw came out halfway and appears to stop. Maybe it has a retaining clip? The other at the end won't budge. Time for a bigger screwdriver. It took a bit of prying. The retaining ring is glued on (I was worried it was screwed on). A bit of wiggling and it's free. The screw that I thought had a retaining clip actually has a screw standoff to hold the PCB in. I might try to take them apart, but it's not necessary to. And now for what you've all been waiting for. It's an incredibly simple...

Engineering a Project List

I like to make things. I also have ADHD. The two of them don't always go together. I sometimes get ideas on what I want to make, get really into it, start a few things like ordering parts and a design, and maybe even assemble a few parts. And then I find something new. Something shiny and interesting. It's easy for me to burned out on a project, expending all my energy into it until a point of exhaustion. Or getting stuck due to lack of parts, lack of ideas on how to continue, or a lack of tooling. To combat this, I've decided to make this blog post, which I will update from time to time with my current projects, and what is keeping me from completing them. Hopefully having them listed out will allow me to sort through them, work on what I can, and get what I need to complete what I can't. So without further ado, I bring you... The Project List: CoreXY 3d printer build Lap Bed plate flat Assemble Z Axis Ballscrew Assemble Extruder Carriage...