Skip to main content

Module functions

Module functions 

Source
Expand description

Auto-generated module

🤖 Generated with SplitRS

Traits§

Sdf
Signed distance function trait.

Functions§

count_surface_cells
Count the number of grid cells that straddle the zero isosurface.
extract_isosurface
Extract the zero isosurface from an SdfGrid using Marching Cubes.
fbm_noise
Fractal (octaved) value noise: fBm with octaves levels.
ray_march
March a ray defined by origin + t * direction through an SDF.
ray_march_relaxed
Ray march with over-relaxation for faster convergence.
sdf_ambient_occlusion
Estimate ambient occlusion at surface point p with normal n from an SDF.
sdf_closest_point
Project point p to the nearest surface point of the SDF using gradient descent on the absolute distance.
sdf_contact_manifold
Generate a contact manifold between a convex set of sample points and an SDF.
sdf_gradient
Estimate the gradient of an SDF at p via central finite differences.
sdf_mean_curvature
Mean curvature of an SDF at p estimated from the Laplacian of the SDF.
sdf_normal
Compute the unit outward surface normal at p by finite-difference gradient.
sdf_point_query
Test whether point p is inside the SDF and return contact data.
sdf_smooth_difference
Polynomial smooth-difference kernel (subtract b from a).
sdf_smooth_intersection
Polynomial smooth-intersection kernel.
sdf_smooth_union
Polynomial smooth-union kernel (Quilez).
sdf_soft_shadow
Estimate a soft-shadow factor for a point p toward a light at light_pos.
sdf_sphere_sweep
Simple swept-sphere vs SDF collision proxy.