You would think it was simple to extrude a 2D black & white image into 3D space.  I tried a number of avenues.  They all pretty much have two large steps: 1) Provide a vector file like SVG or DXF and 2) Extrude in a 3D.

I tried out a number of 3D modeling programs.

Blender

Blender is definitely intimidating.  However, it does understand how to read/write to/from several formats and is the only one of the bunch that understood SVG, natively.  It does have a couple methods to extrude from the SVG with varying levels of success.  It is a bit odd that the SVG is very tiny and when extruding, the scalar value used to extrude should be something very low like 0.01.

MeshMixer

Looks like a mini-Maya.  There is a stamp/stencil tool available here that allows PNGs to be extruded from or recessed into a plane, sphere, etc.  The baked-in textures always worked, but custom stencils never seems to impact the mesh.  Thought is that stencil was very small, as is noticed in Blender.

OpenSCAD

OpenSCAD is generally pretty awesome.  It has a function, “import”, that can load DXF files.  The limitation I discovered here is that OpenSCAD’s DXF importer is working off of version R12, which only supports straight lines and largely nothing else.  So, if you have a graphic that has any curve to it – you will not just be able to go into Illustrator and export a DXF.  Instead, you must prep the file so that all path lines are straight.

SketchUp

The Pro version has the ability to import DXF.  There appears to be no 3D Warehouse plugins that understand this, so the SketchUp Make (the free version) cannot be used.  Nice thing about SketchUp is that sizing is very precise and the resizing capability using the Measuring Tool is fairly easy to invoke.

 

And to prepare the 2D asset, there are a few possibilities.

Illustrator

Illustrator can import and export DXF and SVG.  Unfortunately, the earliest DXF version that can be exported is R13, later than OpenSCAD’s R12.  To get around this, you’ll want to: 1) Add more anchor points to make for a better look in curvy situations and 2) “Simplify” the path with the checkbox for “straight lines” (found under the “Path” submenu).

Inkscape

Inkscape is the “free” Illustrator similar to how Gimp is the “free” Photoshop.  There are several plugins that understand how to prep a DXF file for OpenSCAD.  To install a plugin, you’ll take the INX and PY files and put them into Program Files / Inkscape / Share / Extensions.

Photoshop

If exporting an SVG, you can skip Illustrator and Inkscape in some cases.  Right-click on a layer and select “Export As…”  There will be an option for SVG.

 

My Solution

I ended up going with Photoshop >> SVG >> Blender >> STL.  Some notes for this:

  • As long as the layer being exported in Photoshop is a Path or Shape, the file will contain <path> nodes and be interpreted by Blender properly.  If exporting a rasterized layer into PNG, Blender seems to have a problem with the resulting <image> tag.
  • After importing the SVG into Blender, zoom in really close towards the origin to find the curves.  Remember to select “Set Origin to Geometry” so that any transformation changes are centered around the axis.
  • Some SVGs may come in with broken curves.  If that is the case, you can repair the curves by shift-clicking the loose curves in question and pressing ‘F’.  This shortcut key is what makes the curves into a face.
  • Avoid the extrude functionality within the viewport toolbar (press “T” to toggle it).  This one seems to only work on X and Z axes.  Instead, use the extrude value under the Data tab of the Properties window.
  • The SVG could come in super-tiny.  If that is the case, ensure that the extruding value is very small.  Eventually, you’ll want to select the unit of measurement under Scene Properties and use the Scale tool to precisely size the mesh to the desired dimensions.
  • If the extruded object is too dark, switch over to the Material tab and change the Diffuse color to something brighter.

I would have loved to see OpenSCAD work, but their importer just does not recognize several nodes (e.g. “HATCH”).

 

Reference

There were a “ton” of sites with instructions.  Below are some – and I even included some I never got to researching completely, but look like they have potential to be useful or at least interesting.