solid.Shape

Methods

Method Reference: solid.Shape.tessellate

solid.Shape: M = tessellate (S)

solid.Shape: M = tessellate (S, TOL)

A triangle mesh of a shape.

M = tessellate (S, TOL) returns a polymesh.Mesh of the surface of S: flat triangles whose corners lie on it and which stray from it by at most TOL millimetres, 0.01 by default, nor span more than 20 degrees of a curved face. The triangles meet edge to edge, sharing their corners, and are turned outwards, so the mesh of a solid is closed. A coloured shape gives each triangle the colour of its solid as the mesh’s FaceColour, and the grey [0.72, 0.74, 0.78] where its solid has none. The empty shape gives the empty mesh.

This is the mesh write writes to STL, OBJ, PLY and 3MF, and it can be shown, cut, measured, coloured and written as any other.

 
 M = tessellate (solid.cylinder (4, 12), 0.05);
 write (M, 'pin.obj');

See also: polymesh.Mesh, solid.Shape.write, solid.polyhedron

Source Code: solid.Shape