Expand description
Offset surface generation and signed distance field (SDF) operations.
Provides SDF primitives, CSG operations, mesh offsetting, and voxel SDF grids.
Structs§
- Offset
Mesh - A triangle mesh with per-vertex normals, supporting inward/outward offsetting.
- SdfBox
- Axis-aligned box SDF (exact).
- SdfCapsule
- Capsule (line-segment rounded) SDF (exact).
- SdfCone
- Cone SDF: tip at
apex, opening downward along -Y, with half-angleangle_rad. - SdfCylinder
- Cylinder SDF aligned with the Y axis (exact).
- SdfDifference
- Boolean difference: A minus B (max(da, -db)).
- SdfIntersection
- Boolean intersection (max).
- SdfOffset
- Offset (shell expansion / shrinkage):
d(p) - offset. - SdfPlane
- Half-space plane SDF:
n·p - offset(exact).normalshould be unit length. - SdfScaled
- Uniformly scale an SDF (scale > 1 makes the shape larger).
- SdfSmooth
Intersection - Polynomial smooth intersection with blending radius
k. - SdfSmooth
Union - Polynomial smooth union with blending radius
k. - SdfSphere
- Sphere SDF (exact).
- SdfTorus
- Torus SDF lying in the XZ plane, centred at
center(exact). - SdfTranslated
- Translate an SDF by a fixed offset.
- SdfUnion
- Boolean union (min).
- Voxel
Sdf - Discretised signed distance field on a regular axis-aligned grid.
Traits§
- Sdf
- Signed distance function: negative inside the shape, positive outside.
Functions§
- approximate_
medial_ axis - Approximate medial axis computation using a voxel SDF.
- detect_
edge_ features - Detect feature edges in a triangle mesh, classifying interior edges as convex (dihedral angle < π) or concave (dihedral angle > π).
- extract_
zero_ crossings_ slice - A simple marching-squares (2-D) contour extractor for a 2-D slice of a VoxelSdf.
- generate_
shell - Generate a solid “shell” mesh from a surface mesh.
- inward_
offset - Compute an inward-offset (shrunk) mesh.
- offset_
curve_ 3d - Offset a 3D polyline by
dalong a fixednormaldirection. - offset_
polyhedron - Offset a closed polyhedron mesh outward (or inward for negative
d). - outward_
offset - Compute an outward-offset mesh from a triangle soup.
- variable_
offset - Apply a different offset distance to each vertex along its averaged normal.