Skip to main content

ParametricSurface

Trait ParametricSurface 

Source
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§

Source

fn evaluate(&self, u: f64, v: f64) -> Point3

Evaluate the surface at parameters (u, v).

Source

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).

Source

fn project_point(&self, point: Point3) -> (f64, f64)

Project a 3D point onto the surface, returning (u, v) parameters.

Source

fn partial_u(&self, u: f64, v: f64) -> Vec3

Partial derivative ∂S/∂u at (u, v).

Source

fn partial_v(&self, u: f64, v: f64) -> Vec3

Partial derivative ∂S/∂v at (u, v).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§