This library's internal representation of an oriented, 2-manifold, triangle mesh - a simple boundary-representation of a solid object. Use this class to store and operate on solids, and use MeshGL for input and output, or potentially Mesh if only basic geometry is required.
In addition to storing geometric data, a Manifold can also store an arbitrary number of vertex properties. These could be anything, e.g. normals, UV coordinates, colors, etc, but this library is completely agnostic. All properties are merely float values indexed by channel number. It is up to the user to associate channel numbers with meaning.
Manifold allows vertex properties to be shared for efficient storage, or to have multiple property verts associated with a single geometric vertex, allowing sudden property changes, e.g. at Boolean intersections, without sacrificing manifoldness.
Manifolds also keep track of their relationships to their inputs, via OriginalIDs and the faceIDs and transforms accessible through MeshGL. This allows object-level properties to be re-associated with the output after many operations, particularly useful for materials. Since separate object's properties are not mixed, there is no requirement that channels have consistent meaning between different inputs.
An alternative to Mesh for output suitable for pushing into graphics libraries directly. This may not be manifold since the verts are duplicated along property boundaries that do not match. The additional merge vectors store this missing information, allowing the manifold to be reconstructed.
Determine the result of the setMinCircularAngle, setMinCircularEdgeLength, and setCircularSegments defaults.
Resets the circular construction parameters to their defaults if setMinCircularAngle, setMinCircularEdgeLength, or setCircularSegments have been called.
Sets the default number of circular segments for the CrossSection.circle, Manifold.cylinder, Manifold.sphere, and Manifold.revolve constructors. Overrides the edge length and angle constraints and sets the number of segments to exactly this value.
Sets an angle constraint the default number of circular segments for the CrossSection.circle, Manifold.cylinder, Manifold.sphere, and Manifold.revolve constructors. The number of segments will be rounded up to the nearest factor of four.
Sets a length constraint the default number of circular segments for the CrossSection.circle, Manifold.cylinder, Manifold.sphere, and Manifold.revolve constructors. The number of segments will be rounded up to the nearest factor of four.
Triangulates a set of /epsilon-valid polygons.
The core WASM bindings with no frills.
See