bitbybit.dev v1.0.0-rc.1
    Preparing search index...

    Class ManifoldOperations

    Index

    Constructors

    • Parameters

      • manifoldWorkerManager: ManifoldWorkerManager

      Returns ManifoldOperations

    adjustments

    • Curvature is the inverse of the radius of curvature, and signed such that positive is convex and negative is concave. There are two orthogonal principal curvatures at any point on a manifold, with one maximum and the other minimum. Gaussian curvature is their product, while mean curvature is their sum. This approximates them for every vertex and assigns them as vertex properties on the given channels.

      Parameters

      Returns Promise<ManifoldPointer>

      manifold with calculated curvature

      calculate curvature

      true

    • Increase the density of the mesh by splitting each edge into pieces such that any point on the resulting triangles is roughly within tolerance of the smoothly curved surface defined by the tangent vectors. This means tightly curving regions will be divided more finely than smoother regions. If halfedgeTangents are not present, the result will simply be a copy of the original. Quads will ignore their interior triangle bisector.

      Parameters

      Returns Promise<ManifoldPointer>

      refined manifold

      refine to tolerance

      true

    • Increase the density of the mesh by splitting each edge into pieces of roughly the input length. Interior verts are added to keep the rest of the triangulation edges also of roughly the same length. If halfedgeTangents are present (e.g. from the Smooth() constructor), the new vertices will be moved to the interpolated surface according to their barycentric coordinates.

      Parameters

      Returns Promise<ManifoldPointer>

      refined manifold

      refine to length

      true

    • Increase the density of the mesh by splitting every edge into n pieces. For instance, with n = 2, each triangle will be split into 4 triangles. These will all be coplanar (and will not be immediately collapsed) unless the Mesh/Manifold has halfedgeTangents specified (e.g. from the Smooth() constructor), in which case the new vertices will be moved to the interpolated surface according to their barycentric coordinates.

      Parameters

      Returns Promise<ManifoldPointer>

      refined manifold

      refine

      true

    • Smooths out the Manifold by filling in the halfedgeTangent vectors. The geometry will remain unchanged until Refine or RefineToLength is called to interpolate the surface. This version uses the geometry of the triangles and pseudo-normals to define the tangent vectors.

      Parameters

      Returns Promise<ManifoldPointer>

      smoothed manifold

      smooth out

      true

    • Smooths out the Manifold by filling in the halfedgeTangent vectors. The geometry will remain unchanged until Refine or RefineToLength is called to interpolate the surface. This version uses the supplied vertex normal properties to define the tangent vectors.

      Parameters

      Returns Promise<ManifoldPointer>

      smoothed manifold

      smooth by normals

      true

    • Return a copy of the manifold simplified to the given tolerance, but with its actual tolerance value unchanged. The result will contain a subset of the original verts and all surfaces will have moved by less than tolerance.

      Parameters

      Returns Promise<ManifoldPointer>

      simplified manifold

      simplify

      true

    • Create a new copy of this manifold with updated vertex properties by supplying a function that takes the existing position and properties as input. You may specify any number of output properties, allowing creation and removal of channels. Note: undefined behavior will result if you read past the number of input properties or write past the number of output properties.

      Parameters

      Returns Promise<ManifoldPointer>

      manifold with updated properties

      set properties

      true

    basic

    • Returns the first of n sequential new unique mesh IDs for marking sets of triangles that can be looked up after further operations. Assign to Mesh.runOriginalID vector.

      Parameters

      Returns Promise<number>

      void

      reserve id

      false

    • If you copy a manifold, but you want this new copy to have new properties (e.g. a different UV mapping), you can reset its IDs to a new original, meaning it will now be referenced by its descendants instead of the meshes it was built from, allowing you to differentiate the copies when applying your properties to the final result.

      This function also condenses all coplanar faces in the relation, and collapses those edges. If you want to have inconsistent properties across these faces, meaning you want to preserve some of these edges, you should instead call GetMesh(), calculate your properties and use these to construct a new manifold.

      Parameters

      Returns Promise<ManifoldPointer>

      original manifold

      as original

      true

    composition

    • Constructs a new manifold from a list of other manifolds. This is a purely topological operation, so care should be taken to avoid creating overlapping results. It is the inverse operation of Decompose().

      Parameters

      Returns Promise<ManifoldPointer>

      composed manifold

      compose

      true

    • This operation returns a vector of Manifolds that are topologically disconnected. If everything is connected, the vector is length one, containing a copy of the original. It is the inverse operation of Compose().

      Parameters

      Returns Promise<ManifoldPointer[]>

      decomposed manifold shapes

      decompose

      true

    cross sections

    hulls