2D Image to 3D Model Conversion

Using Inkscape and Alibre Design

Not advertising, I swear

From Logo to Model to Solid Object

 

  • Turn a photo or drawing into a 3D Model
  • Vectorise a drawing with Inkscape
  • Import a .dxf to Alibre Design as a sketch

In this tutorial you will learn a easy and effective way of turning your 2D drawing, logo or photo into a 3D printable model.

The method described here uses the Open Source graphics editor Inkscape to vectorise the image and generate the 2D .dxf file. You then import the drawing into Alibre Design to extrude the 2D file into a 3D model and export it for 3D Printing. However once you have the .svg or .dxf file, you can substitute in your modelling software of choice.

For the following example, I am going to use the Channel 10 Network logo that I used earlier to generate the Channel 10 logo print for The Project night at the Innovation Lab. I chose this example as it is an easy to trace, high contrast logo which I had converted using my previously discussed method. This allowed me to compare the results.

Process Description

The basic process of going from a 2D logo to a 3D Model is:

  • Start with a bitmap image. This could be a scan, something you’ve downloaded or a photo that you’ve taken. (eg: .bmp, .jpg files)
  • Vectorise the bitmap image. This changes your image from ‘what the picture looks like’ to ‘how the picture is generated’. This change allows you to manipulate the drawing with CAD software. (eg: .svg file)
  • Import your vectorised image into your CAD software. You may need to convert from a .svg to another file type depending on your CAD package. (eg: .dxf file)
  • Use the vectorised image as a basis for your 3D model.
  • Export your model as a .stl and proceed to the nearest 3D Printer.

Step By Step

  • Install Inkscape
    Inkscape is an Open Source vector graphics editor. Download (http://inkscape.org/) the appropriate Inkscape version for your computer and install.
  • Install Inkscape .dxf Export Tool
    Download and install Big Blue Saw’s DXF Export for Inkscape as per the instructions on their website. Apparently the native .dxf export utility in Inkscape doesn’t play so nicely with CAD software.
  • Inkscape: .jpg to vector .svg
    Now you can use Inkscape’s ‘Trace Bitmap’ function to convert your bitmap to vector art. I found this tutorial helpful and the process is summarised below:

    • Open your bitmap file. When asked whether to open it as a Link or embed image select embed.
    • Select your image (click on it, or hit ctrl + A to select all).
    • Select Path | Trace Bitmap from the menu.
    • The Trace Bitmap window, shown below, has several options to create paths. The tutorial linked above illustrates the different uses of the different scan types. In this case, with a fairly high contrast image, I used the edge detection option, and adjusted the threshold value until I got a result I was happy with.

      Trace Bitmap

      Trace Bitmap window showing Logo

    • Click OK. Your vectorised image will now be overlaid on top of the original image. Click on it and drag it aside to compare.

      Trace Bitmap Edge Trace Results

    • Click on the original image and delete it. If you can’t click on it make sure that your pointer is set to select and transform objects and not edit nodes in the left toolbox column.
    • Now is a good time to save your image as a .svg file. Click File | Save As. You have the option of saving your file as an Inkscape SVG or a Plain SVG. Inkscape says that their version has some more information on the image generation included for use when you reopen the file in Inkscape. However some .svg importers are a little temperamental, so if you are going to use the .svg to import into another program, try Plain SVG first.
  • Inkscape: Cleaning up the .svg
    Vector to the Node!

    Vectorised Logo with Nodes

    • Double click on the logo. This will show you the paths and nodes generated by the Trace Bitmap tool. These are the vectors that your image is made up from. Depending on the complexity of your image, you might have have some clean up to do. 
    • I found these pages helpful in explaining what was going on with nodes, and options for modifying them:
      http://inkscape.org/doc/advanced/tutorial-advanced.html
      http://www.microugly.com/inkscape-quickguide/
    • As can be seen from the picture below, my path has a gap in it. I clicked and dragged the nodes to close the gap. Investigate the node joining and path segment options when cleaning up your image.
       

      Closing the nodes

      Left – Open Path, Right – Closed Path

    • Path Simplification: If your path has tonnes of nodes in it, you can use the simplify option to reduce the node count, however this can be at the expense of detail.
    • Save your .svg file.
  • Inkscape: Save to .dxf
    • If your CAD software allows you to import .svg files, you can skip this step. Alibre Design PE doesn’t allow this, so you need to convert the file to .dxf format. Follow the instructions on the Big Blue Saw website for saving to .dxf. The instructions from their website are:
      • Ungroup all items by selecting everything (Ctrl-A or Edit | Select All from the menu) and then ungrouping repeatedly (Shift-Ctrl-G or Object | Ungroup) until all groups are broken apart.
      • Convert all objects to paths. You can do this items by selecting everything (Ctrl-A or Edit | Select All from the menu) and then pressing Shift-Ctrl-C or choosing Path | Object to Path from the menu.
      • Choose File | Save As from the menu. In the dialog box that appears, choose “Big Blue Saw DXF Output” and click the Save button.
    • Note: Big Blue Saw’s DXF Export is set to export in Inches by default. Remember this when you import the .dxf into your CAD package.
  • Alibre: Import the .dxf
    • From the Alibre Design Home window, select File | Import from the menu and select AutoCAD DXF Files (*.dxf) from the file type dialog box.
    • Remember that BBS exports the .dxf in inches, so select File Units of inches in the Import DXF/DWG File window.
    • The .dwf will now open as a sheet within Alibre’s Drawing editor.

      The .dxf Imported into Alibre Design as a Drawing

  • Alibre: From Drawing to Sketch
    • Now you need to copy the drawing out into a 2D Sketch.
    • In the Drawing Explorer tree, Right click on Model and select Activate Sketch on Sheet.

      When selected it reads “Activate 2D Sketch”

    • Select all and copy using Ctrl + A and Ctrl + C.
    • From the Alibre Home window, select Create New Part.
    • In the new part window, open up a sketch window using Part Modelling | Activate 2D Sketch and select a sketch plane.
    • Paste in the drawing with Ctrl + V. Now zoom out until your sketch is visible.

      I'm over here!

      Zoom around until you find the Sketch

  • Alibre: Clean up the Sketch
    • Now you can edit the sketch as you would any other 2D Sketch.
    • Use the Analyse Sketch function, shown below, to inspect the sketch and close open paths.

      oh balls...

      Now imagine if we didn’t simplify those paths before…

    • In this example, I removed the inner path from the sketch, with the intent to replace that detail with a chamfer once I had extruded the model.

      Gimme' tennnnn.....

      Cleaned up Sketch

    • Finish the sketch.
  • Alibre: Part Modelling
    • Create new features by using the original sketch and the Project to Sketch function. This allows you to create the basic body of the logo, and then use that basis. In the sequence of pictures below; the left illustrates the extrusion based on the outer ring of the logo, then the center picture shows the cut using the inner ring, followed by an extrusion of the letters down to the recessed surface.

      All together now...

      Left to Right: Extrude, Cut, Extrude Text

    • Add details as required. In this case, I added a chamfer to the top surfaces of the logo to give it a little bit of detail and depth.
  • Export and Printing
    • From the Alibre Gem Menu, select Export. Select the File Type as STL File and save.
    • At this point, I like to check that the .stl file is suitable for printing. Use your prefered .stl viewer/manipulator for this. I used Netfabb Studio Basic and ran a standard analysis on the model. This showed that the model’s surface was closed, consisted of one shell and didn’t have any bad features (generally shown in red in Netfabb).

      Nothing to see here...

      Netfabb .stl Analysis Results

    • From here, load the .stl file into your printing software. Check the orientation and scale, adjust your print settings, make sure your printer is ready to go and hit print!

Results

Here’s a picture of what the .dxf looked like when I imported it the first time, using the free-online conversion tool.

Octagoning the circle?

It’s free for a reason…

And here’s a comparison of the .iges file work around I ended up using for the first print, and the sketch I ended up with via the Inkscape method.

Excuse the blue...

IGS File: Confused pathing

Inkscape BBS DXF Export: Much cleaner

As you can see, using the Inkscape method of vectorising the image resulted in a much cleaner .dxf file, which itself was then easier to work with in Alibre.

Something's fishy

Left: First Attempt, Right: Inkscape Conversion Method

Summary

Well, that was lengthy, Matt, I thought you said that this was the quick and easy way? Well, it is, compared to the rather involved method that I discovered last week.

The Inkscape method of generating the .dxf file addresses the issues I highlighted with the 2D to 3D Conversion process I used earlier, namely:

  • Control over the vectorisation process of the image.
  • Reliable conversion from .svg to .dxf file.
  • Reduced design time reducing the amount of steps in the process, as well as by increasing the reliability & control of the process, reducing the amount of rework required.
  • Use of free, open source software as opposed to online conversion tools which only allowed a limited number of free conversions.

I hope that you have found this tutorial useful. Let me know if you have any questions or have found any useful little hints or tips of your own for converting 2D images into 3D models for 3D printing.

facebooktwittergoogle_plusredditpinterestlinkedinmailby feather

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>