Computes a normal for every vertex from the mesh and stores it in three property channels
starting at normalIdx.
Edges sharper than minSharpAngle, in degrees, keep separate normals on each side and stay
crisp; at 0 every triangle keeps its own normal. Flat faces of several triangles stay flat.
The solid, the first normal channel and the sharp angle in degrees
The solid with normals stored
Computes how strongly the surface bends at every vertex and stores it in property channels:
Gaussian curvature at gaussianIdx, mean curvature at meanIdx.
Curvature is the inverse of the bending radius, positive where the surface is convex and negative where it is concave; an index below 0 skips that channel.
The solid and the two channels to store into
The solid with curvature stored
Adds triangles to a smoothed solid until every point of its mesh lies within tolerance of
the smooth surface, so tightly curved regions get more triangles than flat ones.
Only a solid that was smoothed with smoothOut or smoothByNormals changes; any other comes
back as a copy.
The solid and the tolerance in model units
The refined solid
Adds triangles to a solid by splitting every edge into pieces of roughly the given length, adding inner vertices to keep the triangles even.
On a solid smoothed with smoothOut or smoothByNormals the new vertices move onto the
smooth surface; otherwise the surface stays as it is.
The solid and the target edge length in model units
The refined solid
Adds triangles to a solid by splitting every edge into number pieces; with 2, each triangle
becomes four.
On a solid smoothed with smoothOut or smoothByNormals the new vertices move onto the
smooth surface; otherwise the new triangles stay flat.
The solid and how many pieces to split each edge into
The refined solid
Marks a solid for smoothing by working out tangents from its triangles, so a later refine
or refineToLength bends the new triangles into a smooth surface.
Edges sharper than minSharpAngle, in degrees, stay sharp; minSmoothness above 0 rounds
those a little, and 1 smooths everything. The geometry itself does not change until it is
refined.
The solid, the sharp angle in degrees and the smoothness of sharp edges
The solid with smoothing tangents
Marks a solid for smoothing using the normals stored in its vertex properties, so a later
refine or refineToLength bends the new triangles into a smooth surface.
normalIdx is the first of the three normal channels, as calculateNormals stores them;
where the normals on a vertex disagree the edge stays sharp.
The solid and the first normal channel
The solid with smoothing tangents
Removes vertices from a solid's mesh while keeping every surface within tolerance of where
it was, to cut the triangle count.
The result keeps a subset of the original vertices; the solid's own tolerance value stays unchanged.
The solid and how far surfaces may move, in model units
The simplified solid
Rewrites the vertex properties of a solid with a function that receives each vertex's position and old properties and fills in the new ones.
numProp sets how many properties each vertex has afterwards, so channels can be added or
dropped; reading past the old count or writing past the new one is undefined.
The solid, the new property count and the function that fills the properties
The solid with the new properties
Gives a solid a new tolerance, the rounding error it is allowed to carry, and simplifies its mesh when the tolerance grows.
Triangles thinner than the tolerance are treated as degenerate and removed.
The solid and the tolerance in model units
The solid with the new tolerance
Reserves a run of count unique mesh ids and returns the first, for marking sets of
triangles that can be found again after later operations.
Assign them to a mesh's runOriginalID before building a solid from it, for instance to keep
several materials apart.
How many ids to reserve
The first of the reserved ids; the rest follow in sequence
Makes a copy of a solid that counts as a new original, so the copy can carry its own vertex properties, such as a different UV mapping, and be told apart from what it was built from.
Coplanar faces are merged and the edges between them collapsed on the way; keep the mesh route instead when those edges must stay.
The solid
The copy marked as an original
Packs several solids into one, the inverse of decompose.
Solids that overlap are fused, as a boolean union would; solids kept apart stay separate pieces of the one result.
The solids to pack together
One solid holding all of them
Splits a solid into its separate, unconnected pieces, the inverse of compose.
A solid that is all one piece comes back as a list of one copy.
The solid
The separate pieces
Cuts a solid with a plane parallel to the XY plane at the given Z height and returns the flat section as a cross-section.
A height at the bottom of the solid's bounding box gives its bottom faces; a height at the top gives an empty cross-section.
The solid and the Z height of the cut
The section as a cross-section
Flattens a solid onto the XY plane and returns its outline as a cross-section, like its shadow under a light straight above.
The solid
The outline as a cross-section
Wraps a solid in its convex hull, the smallest shape without dents that contains it, like shrink-wrap pulled tight over it.
The solid
The convex hull
Wraps points, solids or a mix of both in one convex hull, the smallest shape without dents that contains them all.
The points and solids to wrap
The convex hull
Changing Manifold solids beyond booleans: wrapping them in a convex hull, slicing and projecting them into cross-sections, refining and smoothing their meshes, simplifying them, composing and decomposing them, and computing normals and curvature into vertex property channels. A property channel is one number per vertex stored on the mesh, such as the three channels of a normal. Every method returns a new solid.