Message Boards Message Boards

Exporting a MeshRegion to STL format

I just got my hands on mma 10, and I'm experimenting with MeshRegion and related commands with an eye toward generating STL files for 3D printing. I'm seeing the following message: Export::type: "MeshRegion cannot be exported to the \!(\"STL\") format." Are there plans to (eventually) enable this functionality (or is this not possible for some reason)? And in the short term is there a sensible means to export a 3D MeshRegion or a 3D ImplicitRegion to STL?

POSTED BY: Bruce Torrence

Ok, the code below seems to work. Any tips for improvement are welcome!

With[{epsilon = .1}, s1 = ImplicitRegion[x^2 + y^2 <= 1 + epsilon, {x, y}]; s2 = ImplicitRegion[x^2 + y^2 >= 1 - epsilon, {x, y}]; s = RegionIntersection[s1, s2]];

washerSolid = DiscretizeRegion[ RegionProduct[DiscretizeRegion[s], MeshRegion[{{0}, {1}}, Line[{1, 2}]]]]

washerBoundary = BoundaryMesh[washerSolid]

washer = Graphics3D[ GraphicsComplex[MeshCoordinates[washerBoundary], MeshCells[washerBoundary, 2]]]

Export["washer.stl", washer]

POSTED BY: Bruce Torrence
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract