solid.polyhedron
drafting: S = solid.polyhedron (M)
drafting: S = solid.polyhedron (M, ’Merge’, TF)
A solid bounded by a closed triangle mesh.
S = solid.polyhedron (M) returns the
solid.Shape enclosed by the triangles of the polymesh.Mesh
M. The solid takes part in booleans as any other, so a scanned or
downloaded part can be cut, joined and measured. This is OpenSCAD’s
polyhedron. Vertices and faces in any other form, such as the
struct isosurface returns, become a mesh first through the
polymesh.Mesh constructor.
The mesh must be closed, every edge shared by exactly two triangles, or it
is an error that says how many edges are not. Points that are equal are
one vertex, and a triangle with no area is left out. The triangles need
not be turned the same way: each is turned to agree with its neighbours,
and each closed piece of the mesh outwards. A piece lying inside another
and turned inwards, against it, is a void in it. Pieces that overlap are
united, as by union, and pieces apart are separate solids of one
shape, counted by solid.Shape.numsolids.
By default, triangles that lie in one plane and meet are merged into one
face, so a box meshed with twelve triangles has six faces. With
'Merge' set to false every triangle stays a face.
## A tetrahedron with a corner cut away V = [0, 0, 0; 10, 0, 0; 0, 10, 0; 0, 0, 10]; F = [1, 3, 2; 1, 2, 4; 2, 3, 4; 3, 1, 4]; S = subtract (solid.polyhedron (polymesh.Mesh (V, F)), solid.sphere (3)); |
See also: polymesh.Mesh, polymesh.read, solid.read, solid.Shape
Source Code: solid.polyhedron