Ask Your Question

Revision history [back]

To reformulate:

  • you have a number of points in space, given by their three coordinates,
  • you want to save the polyhedron having these points as vertices in STL format.

One way to do that is:

sage: p = [[0,0,0],[1,2,3],[2,3,1],[2,1,0],[1,3,2],[3,2,1]]
sage: P = Polyhedron(p)
sage: G = P.plot(aspect_ratio=1)
sage: G.all[-1].save('polyhedron.stl')

You need a recent enough version of Sage, as STL support was introduced only a few versions ago.

To reformulate:

  • you have a number of points in 3D space, given by their three coordinates,
  • you want to save the polyhedron having with these points as vertices in STL format.

One way to do that is:

sage: p = [[0,0,0],[1,2,3],[2,3,1],[2,1,0],[1,3,2],[3,2,1]]
sage: P = Polyhedron(p)
sage: G = P.plot(aspect_ratio=1)
sage: G.all[-1].save('polyhedron.stl')

You need a recent enough version of Sage, as Sage.

Basic export to STL support was introduced only a few versions ago.around July 2015, and improved by allowing export to binary STL (faster for shapes with many faces) around February 2017. See the corresponding tickets: