pub trait ParametricSurface {
// Required methods
fn evaluate(&self, u: f64, v: f64) -> Point3;
fn normal(&self, u: f64, v: f64) -> Vec3;
fn project_point(&self, point: Point3) -> (f64, f64);
fn partial_u(&self, u: f64, v: f64) -> Vec3;
fn partial_v(&self, u: f64, v: f64) -> Vec3;
}Expand description
Unified interface for parametric surface evaluation.
Implemented by analytic surfaces (CylindricalSurface, ConicalSurface,
SphericalSurface, ToroidalSurface) and NurbsSurface.
Required Methods§
Sourcefn normal(&self, u: f64, v: f64) -> Vec3
fn normal(&self, u: f64, v: f64) -> Vec3
Surface normal at parameters (u, v).
Returns the unit normal. For NURBS surfaces at degenerate points,
implementations should return a best-effort fallback (e.g. Vec3::Z).
Sourcefn project_point(&self, point: Point3) -> (f64, f64)
fn project_point(&self, point: Point3) -> (f64, f64)
Project a 3D point onto the surface, returning (u, v) parameters.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".