Skip to main content

Module deform

Module deform 

Source
Expand description

Brush deformation: moving vertices along their normals under a falloff.

inflate pushes the vertices under a Brush along their smooth normals (compute_vertex_normals), scaled by the brush strength and the falloff weight of their distance from the brush center. A negative strength pulls instead of pushing.

inflate, smooth and grab cost O(mesh) per call: they scan every vertex, and the first two compute over the whole mesh. inflate_region, smooth_region and grab_region move the same vertices to the same positions, bit for bit, from a candidate list and the mesh’s incidence index, so that their cost follows the brush region. Scene::dab in fast-mesh-scene finds the candidates through the BVH.

Structs§

Brush
A deform brush: a sphere of influence with a falloff and a strength.
GrabOptions
Options for grab.
GrabOptionsBuilder
A builder for GrabOptions, see GrabOptions::builder.
GrabReport
What grab did.
InflateOptions
Options for inflate.
InflateOptionsBuilder
A builder for InflateOptions, see InflateOptions::builder.
InflateReport
What inflate did.
SmoothOptions
Options for smooth.
SmoothOptionsBuilder
A builder for SmoothOptions, see SmoothOptions::builder.
SmoothReport
What smooth did.

Enums§

Falloff
How a brush’s effect fades from its center (t = 0) to its rim (t = 1).
SmoothMethod
How smooth relaxes: volume-preserving Taubin λ/μ cycles, or plain Laplacian passes that melt toward the centroid (sculpt smoothing).

Constants§

TAUBIN_LAMBDA
The shrinking Taubin step: each pass moves a vertex w * λ of the way from its position toward its neighbors’ centroid.
TAUBIN_MU
The inflating Taubin step: each pass moves a vertex w * μ of the way from its position toward its neighbors’ centroid, which with the negative μ pushes it back out past where the λ pass left it.

Functions§

grab
Drags the vertices under the brush along one vector.
grab_region
grab over the candidates in region, with its cost following them instead of the mesh; see inflate_region for what region must hold. Grab needs no incidence index. A vertex no triangle uses moves only if it is listed.
inflate
Pushes the vertices under the brush along their smooth normals.
inflate_region
inflate over the candidates in region, with its cost following them instead of the mesh: the same vertices move to the same positions, bit for bit, as long as region is ascending and holds every vertex under the brush that is used by a triangle. Candidates outside the brush, or dead, are ignored.
smooth
Smooths the vertices under the brush, Taubin λ/μ or plain Laplacian.
smooth_region
smooth over the candidates in region, with its cost following them instead of the mesh; see inflate_region for what region must hold.