Introduction: Convert Any 2D Image to a 3D Object Using OpenSCAD (and Only Free Software)

I have recently become quite obsessed with 3D design and printing, since I have very little design experience I have been relying extensively on OpenSCAD, it makes designing 3D objects just too easy not to try, if you want to make 3D models from an image or SVG file, you can do it very easily - there are other ways to convert to other 3D formats, so this is only if you want to use SCAD.

If you need to remove the background image check my tutorial for removing background here: https://www.instructables.com/id/Remove-image-backg...

Please vote for me if you find this handy :) If I win a Form1Labs printer, I am hoping I will be able to open the first hackerspace \ makerspace in our area :)

Step 1: Download Your Tools

1- Download Inkscape from http://inkscape.org/download/

2- Download OpenScad from http://www.openscad.org/

3- Download the InkScape to OpenSCAD converter from http://www.thingiverse.com/thing:24808 - Follow the instructions to install the extension to InkScape

Step 2: Convert Image to SVG

1- Pick an image and open the image with InkScape

2- Convert the image to path by selecting Trace Bitmap from the Path menu

3- Play around with the settings until you get the result you want, if you choose Edge Detection you can actually get a hollow 3D object, in this case I am looking for a solid object, so I chose to cut off based on color

Step 3: Delete Image and Use Newly Created Path Instead

Now you can delete the image and keep the path you just created, select the original image and press delete. Move the path to the center of the window

Step 4: Convert Paths to OpenSCAD

Go to the menu, choose "Generate From Paths"->"Paths to OpenSCAD"

If you do not see this option, make sure you closed and reopened InkSpace after pasting the extension

Step 5: Choose the Height and Smoothing

You will be able to easily adjust the height later in OpenSCAD, so don't worry too much about it

Step 6: Edit & Export Your File With OpenSCAD

Open the file in OpenSCAD, you can see that the objects are described in terms of Polygons and other basic objects, you can edit the object without much 3D design experience

- Edit your object as needed

- Press F6 to compile it

- Go to Design -> Export, and choose your file format

Step 7: You Are Done! Print Your Object and Enjoy :)

Print your object if you have a printer, or send it to Ponoko, Shapeways or any other printing service!

Comments

author
Dimitrios made it! (author)2015-02-13

Hello, very nice instructable, and I did follow every step, the problem I am having is let's say I do a shape like a letter O, hollow circle in a circle, after rendering in Openscad, it will show me just the outside circle, not the hollowed center logo. I tried simple stuff, same thing, a rectangle, cut in a larger rectangle, it will only render the big rectangle without the smaller one hollowed out. I tried combining, cutting, object to path, it's not doing it.

author
XTL made it! (author)XTL2016-01-11

Try using improved version of the exporter:
http://www.thingiverse.com/thing:1065500

author
obertie made it! (author)obertie2015-09-24

use hgt2stl its awesome

author
jdawgaz made it! (author)jdawgaz2015-11-17

it appears hgt2stl is only on windows. can't use it then.

author
R-I-H-A-M made it! (author)R-I-H-A-M2015-09-22

Hi Dimitros, I am not sure but maybe one of the various tracing options in InkScape will make it work better for you? I do have a hollow circle in the picture I used that seemed to work fine , but it could also be specific to the file you are using.

author
fqantonio made it! (author)2015-10-20

If you don't want to use that extension "Paths to OpenSCAD", you should, after the conversion to SVG, select the SVG image and ungroup it. It will show all the images inside the png/gif image. Delete all and keep one. And continue with this tutorial. Anyone disagree or have another way to do it?

author
fqantonio made it! (author)2015-10-19

Very good tutuorial

author
obertie made it! (author)2015-09-24

you should use hgt2stl its much less hassle i checked it out

author
R-I-H-A-M made it! (author)R-I-H-A-M2015-10-02

thanks Obrtie, I will give it a shot :)

author
alejandro.lozdziejski made it! (author)2015-02-10

you can do exactly the same thing in only one step using selva (www.selva3d.com)

author
Dimitrios made it! (author)Dimitrios2015-02-13

I tried the service, however, it looks like it only works for JPG's not vector files. I tried pdf, eps, svg, doesnt work, it did do a jpg (created from a vector) but that doesn't make sense it was very jagged, eventhough the jpg was large and crisp.

author

Dimitrios! Thank you so much ofr your feedback

Can you post the image, so I can check what is happening

Best!

author
obertie made it! (author)obertie2015-09-24

try hgt2stl perhaps

author
TG33 made it! (author)2015-06-09

I have been unable to get "Paths to OpenSCAD" to show up in Inkscape under "Extensions" and "Generate From Paths". I have re-started the computer after downloading from Thingiverse as advised in the directions.

I am using a 64 bit machine and using Window 7. I would appreciate any help that anyone can give me.

Thanks, TG33

author
R-I-H-A-M made it! (author)R-I-H-A-M2015-09-22

Hi TG33, which version are you using? I see a new version has been released, can you try it? http://www.thingiverse.com/thing:25036
If it still doesn't work I would try posting the question in the extension page on Thingiverse.

author
TG33 made it! (author)TG332015-09-23

R-I-H-A-M thanks for replying to my problem. I will try the new release that you suggested. My posting was three months ago. I will have to try and figure out what all I was trying at that time. My personal memory fades. Thanks for trying to help. TG33

author
Uncle Kudzu made it! (author)2014-09-25

Very interesting! I'm a little familiar with Inkscape; I'll have to take a look at openSCAD. Thanks for mentioning the free and open stuff!

author
IanW1 made it! (author)2014-09-25

Thank you for the tip.

I have been looking for some software more than sketchup.

3D.219.jpg
author
R-I-H-A-M made it! (author)R-I-H-A-M2014-09-25

OpenSCAD is very nice, you can create models with dynamic parameters and allow users to customize it, check the thingiverse customizer projects, very neat!

author
tomatoskins made it! (author)2014-09-23

That's a great walkthrough! I love it. Sadly I haven't gotten into 3D printing but I keep thinging that I need to.

author
R-I-H-A-M made it! (author)R-I-H-A-M2014-09-24

thanks tomatoskins, I am thinking now that maybe my next tutorial should be about getting into 3D printing, different technologies, printer comparison, ...

author
tomatoskins made it! (author)tomatoskins2014-09-24

That would be great for someone like me looking to get into it!

author
JM1999 made it! (author)2014-09-23

Very nicely done!

About This Instructable

68,985views

89favorites

License:

More by R-I-H-A-M:Phone Controlled Watch Dogs Wrench MaskAlert system for children or pets trapped inside motor vehicles.Duct tape woven purse
Add instructable to: