Login - Register -

Converting Inkscape 2D drawings to 3D

This guide shows you how to convert text and other 2D vector drawings into 3D objects that you can incorporate into your OpenSCAD designs.

First we need a drawing of some kind, for this we are going to use Inkscape but you can use any vector drawing program that can output EPS format files, or any 2D cad system that can output EPS or DXF format files.

First we create a new drawing, and add a piece of text, try to choose a reasonably chunky font without too many fancy edges, so that printing the shape is fairly simple.

Now we convert this from editable text into a line drawing using Path -> Object to Path

Then save the object to an EPS file File -> Save As select Encapsulated Postscript' as the file type, i'm going to call the file mytext.eps.

Now we will convert the EPS file into Autocad DXF format using the pstoedit command.

 
  $> pstoedit -dt -f dxf:-polyaslines mytext.eps mytext.dxf

This now gives us a DXF format file that we can import into OpenSCAD

import("mytext.dxf");

This imports the 2D definition into OpenSCAD, however, this is just a 2D object and although it will show in the quick view window, it will not Compile and Render sensibly.

What we need to do is extrude this 2D object into a 3D one, for this we use the linear_extrude command.

linear_extrude(height=3) {
  import("/home/justin/Desktop/inkscape/mytext.dxf");
}

This gave the object a height of 3(mm) but we can immediately see that this is out of proportion, so we shall scale the whole object as well to give it a reasonable size.

scale([10,10,1]) linear_extrude(height=3) {
  import("/home/justin/Desktop/inkscape/mytext.dxf");
}

Now before we print this out, we need to join these letters together into a single object, this could be done using a shallow cube as a backing plate, but in this case i will join all of the letters together with a thin bar. Selecting the size, and moving it so that it just joins the centres of all the letters together.

union() {
  scale([10,10,1]) linear_extrude(height=3) {
    import("/home/justin/Desktop/inkscape/mytext.dxf");
  }

  translate([5,3,0]) cube([38,2,1]);
}

Now all that remains is to save the file, and export it in STL format so that it can be sliced and printed.

Be sure to save the file first: File -> Save As -> mytext.scad Compile the design: Design -> Compile and Render Export to STL: Design -> Export as STL...

Your text is now ready for you to print.

- Last change January 08, 2014, at 04:30 PM
- Registered in England and Wales 08777436