Expand description
GPU-accelerated Signed Distance Field (SDF) computation (CPU mock).
This module provides:
- Primitive SDF shapes (
SdfPrimitive) - CSG boolean operations (
SdfOp) - A tree-based SDF scene (
SdfNode) - A volumetric grid (
SdfGrid) that can be filled from any SDF function - A mock GPU dispatcher (
GpuSdfCompute) that evaluates primitives over a grid - Free-standing SDF evaluation helpers
Structs§
- GpuSdf
Compute - Mock GPU dispatcher for SDF field computation.
- SdfGrid
- A regular 3-D grid that stores SDF values as
f32.
Enums§
- SdfNode
- A node in a CSG (Constructive Solid Geometry) SDF tree.
- SdfOp
- Boolean / blending operations that combine two SDF values.
- SdfPrimitive
- A primitive signed distance field shape.
Functions§
- sdf_box
- Signed distance from point
pto an axis-aligned box centred atcenterwith half-extentsb. - sdf_
cylinder - Signed distance from point
pto a finite cylinder (Y-axis aligned) centred atcenterwith radiusradiusand total heightheight. - sdf_
gradient - Estimate the surface normal at
pusing central differences onsdf. - sdf_
smooth_ union - Polynomial smooth-minimum of
d1andd2with blend radiusk. - sdf_
sphere - Signed distance from point
pto a sphere atcenterwith radiusr. - sdf_
torus - Signed distance from point
pto a torus (Y-axis aligned) centred atcenterwith major radiusr_majorand minor radiusr_minor.