pub trait Sdf {
// Required method
fn distance(&self, p: [f64; 3]) -> f64;
// Provided method
fn normal(&self, p: [f64; 3]) -> [f64; 3] { ... }
}Expand description
A Signed Distance Field: maps a 3-D point to the signed distance to the nearest surface (negative inside, positive outside).