solid.Shape.write
solid.Shape: write (S, FILE)
solid.Shape: write (S, FILE, 'Tolerance', TOL)
Write a solid to a STEP, STL, OBJ, PLY or 3MF file.
write (S, FILE) writes the shape S in the format
named by the extension of FILE, in either case:
.stepsolid.Shape.Colour..stl, .obj, .ply, .3mfsolid.Shape.tessellate makes, written by
polymesh.Mesh.write: binary STL, OBJ, binary PLY, or 3MF, the
archive slicers take. The facets approximate every curved surface;
their vertices lie on it. OBJ, PLY and 3MF carry the solids’ colours on
their triangles; STL has none. write (…, sets, for a
mesh, the largest distance in millimetres between a facet and the true
surface. It is 0.01 by default, well below what a printer resolves; a
larger value gives a smaller file. No facet spans more than 20 degrees
of a curved surface, whatever TOL. A STEP file is exact and takes
no tolerance.
'Tolerance', TOL)
The empty shape has nothing to write and is refused, and so is a folder that does not exist.
## Exact for a CAD program, and a coarser mesh for a slicer
S = subtract (solid.box (40, 30, 10), ...
translate (solid.cylinder (5, 10), [20, 15, 0]));
write (S, 'block.step');
write (S, 'block.stl', 'Tolerance', 0.05);
|
See also: solid.read, solid.Shape.tessellate, polymesh.Mesh.write
Source Code: solid.Shape