Expand description
STL export: a RasterizedModel’s faces as a triangle mesh file.
STL is a bag of triangles, each with a normal and its three corners
listed counter-clockwise seen from outside. The triangles here are the
ones the viewer draws (see crate::rasterize), so an
exported mesh is exactly what is on screen. Their winding comes from the
(u, v) triangulation, which says nothing about outside; the surface
normals do — every face’s surface normal points out of its solid (see
geop_core_topology::validation::face_orientation) — so each triangle
is wound to agree with them.
Faces meet along their edges’ shared samples, and at each other’s
points along them (see crate::rasterize): a solid’s mesh is closed, every
side of a triangle the side of one other, the other way round.
Structs§
- StlTriangle
- One STL facet: its outward normal, and its corners counter-clockwise seen from outside.
Enums§
- StlFormat
- Which of STL’s two encodings to write.
Functions§
- enclosed_
volume - The volume
triangles, wound outward, enclose: the sum of the signed tetrahedra they span with a corner of the mesh, negative if they are wound in. Exact for a closed mesh, up to itsf32corners. - outward
tas an STL facet, wound to face the way its surface does: outward. A triangle without surface normals (at a pole) keeps its winding.- stl_
triangles - The triangles of
facesofraster, in the order given, wound outward. - write_
stl - Write
trianglesas an STL file namedname(the solid name an ASCII file carries, and the header of a binary one).