Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • ManifoldOperations

Index

Constructors

constructor

  • new ManifoldOperations(manifoldWorkerManager: ManifoldWorkerManager): ManifoldOperations
  • Parameters

    • manifoldWorkerManager: ManifoldWorkerManager

    Returns ManifoldOperations

Methods

asOriginal

  • 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.

    group

    basic

    shortname

    as original

    drawable

    true

    Parameters

    Returns Promise<ManifoldPointer>

    original manifold

calculateCurvature

  • 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.

    group

    adjustments

    shortname

    calculate curvature

    drawable

    true

    Parameters

    Returns Promise<ManifoldPointer>

    manifold with calculated curvature

calculateNormals

  • Fills in vertex properties for normal vectors, calculated from the mesh geometry. Flat faces composed of three or more triangles will remain flat.

    group

    adjustments

    shortname

    calculate normals

    drawable

    true

    Parameters

    Returns Promise<ManifoldPointer>

    manifold with calculated normals

compose

  • 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().

    group

    composition

    shortname

    compose

    drawable

    true

    Parameters

    Returns Promise<ManifoldPointer>

    composed manifold

decompose

  • 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().

    group

    composition

    shortname

    decompose

    drawable

    true

    Parameters

    Returns Promise<ManifoldPointer[]>

    decomposed manifold shapes

hull

  • Computes convex hull of the manifold shape provided

    group

    hulls

    shortname

    convex hull

    drawable

    true

    Parameters

    Returns Promise<ManifoldPointer>

    hulled manifold shape

hullPoints

project

  • Creates a projection on xy plane from the shape outline

    group

    cross sections

    shortname

    project

    drawable

    true

    Parameters

    Returns Promise<CrossSectionPointer>

    projected cross section

refine

  • 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.

    group

    adjustments

    shortname

    refine

    drawable

    true

    Parameters

    Returns Promise<ManifoldPointer>

    refined manifold

refineToLength

  • 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.

    group

    adjustments

    shortname

    refine to length

    drawable

    true

    Parameters

    Returns Promise<ManifoldPointer>

    refined manifold

refineToTolerance

  • 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.

    group

    adjustments

    shortname

    refine to tolerance

    drawable

    true

    Parameters

    Returns Promise<ManifoldPointer>

    refined manifold

reserveIds

  • reserveIds(inputs: CountDto): Promise<number>
  • 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.

    group

    basic

    shortname

    reserve id

    drawable

    false

    Parameters

    Returns Promise<number>

    void

setTolerance

  • Return a copy of the manifold with the set tolerance value. This performs mesh simplification when the tolerance value is increased.

    group

    basic

    shortname

    set tolerance

    drawable

    false

    Parameters

    Returns Promise<ManifoldPointer>

    manifold with new tolerance

slice

  • Returns the cross section of this object parallel to the X-Y plane at the specified height. Using a height equal to the bottom of the bounding box will return the bottom faces, while using a height equal to the top of the bounding box will return empty.

    group

    cross sections

    shortname

    slice

    drawable

    true

    Parameters

    Returns Promise<CrossSectionPointer>

    sliced cross section

smoothByNormals

  • 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.

    group

    adjustments

    shortname

    smooth by normals

    drawable

    true

    Parameters

    Returns Promise<ManifoldPointer>

    smoothed manifold

smoothOut

  • 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.

    group

    adjustments

    shortname

    smooth out

    drawable

    true

    Parameters

    Returns Promise<ManifoldPointer>

    smoothed manifold

Generated using TypeDoc