Thursday, December 13, 2012

Open Source Topology Optimization for 3D Printing

Rough Hex Output & Smooth Surface Reconstruction for Dogleg
This post describes a set of open source tools for simple topology optimization for parts destined for 3D printing. The two Matlab codes (both are plain vanilla Matlab, so they work successfully in Octave too) are good introductions to topology optimization. The papers that go along with the codes provide great documentation and examples of tweaking and changing the scripts to treat various problems. The python implementation is more capable (and a few more lines of code).

  • 99 line Matlab code: 2D, multiple load cases, works in Octave
  • 88 line Matlab code: 2D, faster, multiple load cases, filtering options, works in Octave
  • ToPy: implementation of 99 line method, extension to 3D, can also do heat conduction topology optimization, VTK output
The ToPy code outputs results in VTK format. I used paraview to convert the VTK file to an x3d file. I then read the x3d file into Meshlab. Once in meshlab I delete all of the faces, Filters-->Selection-->Select All, Filters-->Selection-->Delete Selected Faces, and then reconstruct the surface from the remaining point cloud, Filters-->Remeshing, simplification and reconstruction-->Surface Reconstruction: Poisson.

The default settings seem to give pretty nice results that can be exported in stl format for 3D printing.

Here's the dogleg part printed on Dayton Diode's printrbot:


  1. More free codes here and here from Dr Suresh's group at University of Wisconsin; some youtube vids as well.

  2. Printing service can mean a lot of things. For printing companies, this means having the right equipment in order to offer clients a particular printing service. Hence, it involves printing machines and tools, and even the skills of the personnel.
    best cheap 3d printer

  3. You don't have to have news to get publicity. There are now, more than ever, a growing number of opportunities to get free publicity on the back of other people's news stories. Letter Printing