The abstract class from which other classes inherit. Common methods and properties live here.
Position a manifold model for later export.
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.
Include an imported model for visualization purposes.
Get a list of GLTF nodes that have been created in this model.
Is this module running in manifoldCAD evaluator?
Clear the list of cached GLTF nodes.
Triangulates a set of /epsilon-valid polygons.
Get the current duruation of the animation, in seconds.
Get the current animation frame rate.
Get the current animation repeat mode.
Determine the result of the setMinCircularAngle, setMinCircularEdgeLength, and setCircularSegments defaults.
Get the current angle constraint.
Get the current edge length constraint.
Reset the circular construction parameters to their defaults if setMinCircularAngle, setMinCircularEdgeLength, or setCircularSegments have been called.
Set the duration of the animation, in seconds.
Set the animation frame rate.
Set the animation repeat mode.
Set the default number of segments in a circle. Overrides the edge length and angle constraints and sets the number of segments to exactly this value.
Set an angle constraint when calculating the number of segments in a circle. The number of segments will be rounded up to the nearest factor of four.
Set a length constraint when calculating the number segments in a circle. The number of segments will be rounded up to the nearest factor of four.
These objects and functions are specific to top-level scripts running within manifoldCAD.
They are only accessible as global objects by a top level script evaluated by the worker. Libraries will not have access to them.
Import a model, and convert it to a Manifold object for manipulation.
Import a model, for display only.
Wrap any shape object with this method to display it and any copies as the
result, while ghosting out the final result in transparent gray. Helpful for
debugging as it allows you to see objects that may be hidden in the interior
of the result. Multiple objects marked only() will all be shown.
Return a shallow copy of the input manifold with the given material properties applied. They will be carried along through operations.
Apply a morphing animation to the input manifold. Specify the end function which will be applied to the vertex positions of the last frame and linearly interpolated across the length of the overall animation. This animation will only be shown if this manifold is used directly on a GLTFNode.
Apply a morphing animation to the input manifold. Specify the start function which will be applied to the vertex positions of the first frame and linearly interpolated across the length of the overall animation. This animation will only be shown if this manifold is used directly on a GLTFNode.
Wrap any shape object with this method to display it and any copies in
transparent red. This is particularly useful for debugging subtract() as it
will allow you find the object even if it doesn't currently intersect the
result.
These are the objects and functions that are available within manifoldCAD itself.
All of the classes, functions and properties of this module are implemented elsewhere and re-exported here.
This is an isomorphic module. When imported within manifoldCAD, the bundler will swap it out for an identical module running in the worker context. When imported as an ES module, it will implicitly instantiate a manifold wasm module, and export it along with everything else listed here. This allows models to behave identically when running on manifoldCAD.org, through the CLI, or through nodejs.
It can be imported as
manifold-3d/manifoldCAD.See
Using ManifoldCAD