pub fn smooth(
tx: &mut Transaction<'_>,
options: &SmoothOptions,
) -> Result<SmoothReport>Expand description
Smooths the vertices under the brush, Taubin λ/μ or plain Laplacian.
- Region: every live vertex closer than
radiustocenter(brute-force distance check). Vertices outside it never move but still serve as neighbor sources. - Each of the
cyclesruns one pass per method constant (λ then μ for [SmoothMethod::Taubin(TAUBIN_LAMBDA,TAUBIN_MU)), a single full pass forSmoothMethod::Laplacian); every pass moves each region vertex byw * k * (centroid - p), wherewisstrength * falloffat its normalized distance,kthe pass constant, andcentroidthe mean of its neighbor vertices (the deduped vertices of its fan triangles, excluding itself). Both the moved positions and the neighbor sources come from a snapshot taken before the pass. - The move is written once, in a single
set_positionscall over the vertices whose total displacement is above 0; an empty region writes nothing. History is untouched.
§Errors
OpsError::InvalidInputwhen the radius is not positive, or any brush number (center, radius, strength) is not finite.OpsError::Storewhen memory runs out.
Nothing is written in any of these cases.