3D Printing with the Surface Evolver

I have used my Surface Evolver to make files suitable for 3D printing. See my results. I do my printing by sending STL-format files to Shapeways.com, so this page describes how to get suitable files from Evolver.

Since Shapeways.com charges by volume, I make my surfaces as an open mesh, tubed to meet the minimum thickness demands of Shapeways.com (about 1mm, depending on the material chosen). The Evolver script "edge_tuber" (in edge_tuber.cmd in the Evolver distribution) is the main workhorse.

The STL file is basically a list of triangles that define the surface of the object. They must form a "manifold" surface, which means all edges are adjacent to two facets and the surface never crosses itself. This is necessary to have a well-defined interior.

Basic Procedure

The example done here is a catenoid, but the method works for surfaces with triple junctions and other topological complications, as long as the surface does not cross itself.
  1. Start with an Evolver surface refined and evolved to your liking. The facets cannot be too small, since the tubed edges have a minimimum diameter. For a 10 cm size final model, you would want 3mm size facets. You can experiment with the degree of refinement you want; edge_tuber will complain if the tube radius is too large for the given mesh.
  2. If you are running in the torus model or another symmetry model, you should use the "detorus" command to unwrap the model to normal Euclidean space.
  3. Scale your surface to the desired size. I like to do 10 cm size models, and Shapeways takes measurments for STL files in millimeters, so I calculate a bounding box and scale my surface to fit in a 100x100x100 bounding box. This may require removing vertices from constraints and boundaries.
  4. Set the option parameters for edge_tuber. These are: Some illustrations of various parameter values:
    Capped tube Capped tube Capped tube
    6 sides, 2 zones 12 sides, 4 zones 20 sides, 6 zones
    Capped L tube Capped L tube Capped T tube Capped T tube
    6 sides, 2 zones 12 sides, 4 zones 6 sides, 2 zones 12 sides, 4 zones
  5. Call one of the versions of edge_tuber:
    • edge_tuber(radius) This is the basic tubing procedure. Before calling, you need to mark the edges you want tubed by setting the edge attribute tuber_status to the value tuber_edge_to_do and the other edges to value 0. radius is the desired tube radius. Tubes will be added around the designated edges, with the original surface still there. There is no logical connection between the tubes and the original surface, even though geometrically they may intersect.
    Tubed edges and film
    • edge_tuber_naked(radius) This dissolves all facets and puts tubes around all edges. You do not have to set tuber_status yourself.
    Tubed edges with no film
    • edge_tuber_dual(radius) This puts tubes around the dual network, which produces a more hexagonal mesh. I favor this over edge_tuber_naked. The dual network is formed by creating a new vertex in the center of each facet (by refining each facet) and at the center of each edge whose valence is not 2. Then each original valence-2 edge is swapped (as in equiangulation, but forcibly swapped). The facets are deleted, and the new edges introduced by facet refining are deleted. The remaining mesh is then tubed.
    Tubed dual edges
  6. If you pick too small a radius, then edge_tuber will report an error, such as
      edge_tube_check: tube radius too small on edge 6930
      ERROR 3234: Command aborted.
      (source file edge_tuber.cmd, line 639)
    
  7. Use the "stl" command from stl.cmd to produce an STL file for Shapeways.com.

Example Script

Here is an example of a script such as I use to make my models:
// stl_export.cmd

// Handy script for making 3D print files from polyhedron datafiles.
// Measurements in mm for shapeways.

read "stl.cmd"
read "edge_tuber.cmd"

procedure stl_export(real the_size)  {
  local xsize,ysize,zsize,start_size,newb;

  // Scale to the desired size
  xsize := max(vertex,x)-min(vertex,x);
  ysize := max(vertex,y)-min(vertex,y);
  zsize := max(vertex,z)-min(vertex,z);
  start_size := maximum(xsize,maximum(ysize,zsize));
  set vertex __x the_size*__x/start_size;
  show_trans "eRrrdd";  // re-adjust graphics to new size

  // Do the tubing
  edge_tuber_sides := 6;
  edge_tuber_cap_zones := 2;
  edge_tuber_dual(0.5); // 1.0 mm diameter

  // Output the STL file
  quiet on; // so don't get "dissolved" messages in stl file
  stl >>> sprintf "%s_%dmm.stl",datafilename,the_size;
  quiet off;

  // Report estimated cost, based on "strong white plastic" material
  newb := new_body;
  set facet frontbody newb;
  printf "%40s Volume %6.2f cm^3, Shapeways cost $%5.2f.\n",datafilename,body[1].volume/1000,
      body[1].volume/1000*1.40 + 1.50 ;
}
The incoming argument the_size is the maximum bounding box size, such as 100, since I work in millimeters for Shapeways.com.

Torus Model

If you want to print a torus domain model, then follow one of these procedures:

Connected cells

For doing a mesh in the style described above,
  1. Set the graphics display mode to connected.
  2. Do detorus.
  3. Follow the steps above in the Basic Procedure section.

Clipped unit cell

If you already have a surface bounding a domain, such as the Plateau borders of a wet foam, then you can do this:
  1. Set the graphics display mode to clipped.
  2. Make sure only the facets you want are showing (use the "show" command, or dissolve everything you don't want).
  3. Do detorus
  4. Call the detorus_capper script (from detorus_capper.cmd). This will put surfaces across holes in the body where it intersects the bounding box.
  5. Scale the surface to the desired size, for example a 100 mm bounding box.
  6. Use the stl command to produce the STL file.

Surface Evolver home page
Ken Brakke's home page