Skip to main content

surface_normal

Function surface_normal 

Source
pub fn surface_normal(
    sdf: &dyn ImplicitSurface,
    p: [f64; 3],
    eps: f64,
) -> [f64; 3]
Expand description

Estimate the outward unit normal of an implicit surface at p using central differences with step size eps.

ยงArguments

  • sdf โ€” implicit surface
  • p โ€” query point (should be near or on the surface)
  • eps โ€” finite difference step (typical: 1e-4 to 1e-6)