Skip to main content

Module offset_surface

Module offset_surface 

Source
Expand description

Offset surface generation and signed distance field (SDF) operations.

Provides SDF primitives, CSG operations, mesh offsetting, and voxel SDF grids.

Structs§

OffsetMesh
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-angle angle_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). normal should be unit length.
SdfScaled
Uniformly scale an SDF (scale > 1 makes the shape larger).
SdfSmoothIntersection
Polynomial smooth intersection with blending radius k.
SdfSmoothUnion
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).
VoxelSdf
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 d along a fixed normal direction.
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.