Skip to main content

NurbsSurface

Struct NurbsSurface 

Source
pub struct NurbsSurface {
    pub degree_u: usize,
    pub degree_v: usize,
    pub knots_u: Vec<f64>,
    pub knots_v: Vec<f64>,
    pub control_points: Vec<Vec<Vec4>>,
    /* private fields */
}

Fields§

§degree_u: usize§degree_v: usize§knots_u: Vec<f64>§knots_v: Vec<f64>§control_points: Vec<Vec<Vec4>>

Implementations§

Source§

impl NurbsSurface

Source

pub fn new( degree_u: usize, degree_v: usize, knots_u: Vec<f64>, knots_v: Vec<f64>, control_points: Vec<Vec<Vec4>>, ) -> Result<Self, String>

Source

pub fn closed_directions(&self) -> Result<(bool, bool), String>

Whether the surface joins itself along u (first) and v (second): opposite domain edges coincide at three sampled fractions. The 1e-6 threshold matches the historical LINEAR_TOLERANCE * 10 used by the projection and curve×surface intersection modules.

Source

pub fn domain_u(&self) -> Result<[f64; 2], String>

Source

pub fn domain_v(&self) -> Result<[f64; 2], String>

Source

pub fn analytic(&self) -> Option<&AnalyticSurface>

The recognized analytic carrier, if this exact rational patch is a plane or a full revolution quadric/torus. Computed once per instance.

Source

pub fn evaluate_homogeneous(&self, u: f64, v: f64) -> Result<Vec4, String>

Source

pub fn evaluate(&self, u: f64, v: f64) -> Result<Vec3, String>

Source

pub fn evaluate_extended(&self, u: f64, v: f64) -> Result<Vec3, String>

Value beyond the domain (Golovanov §3.15): closed directions wrap cyclically; open directions extend along the boundary tangent plane, with the bilinear corner form when both parameters are outside. Intersection and projection algorithms probe outside the domain, so this is a required capability of every surface.

Source

pub fn derivatives_extended( &self, u: f64, v: f64, derivative_count: usize, ) -> Result<Vec<Vec<Vec3>>, String>

Derivatives beyond the domain (§3.15). The extension is C¹: first derivatives follow the ruled/bilinear extension, second derivatives are taken at the boundary anchor (zero across an extended direction).

Source

pub fn derivatives( &self, u: f64, v: f64, derivative_count: usize, ) -> Result<Vec<Vec<Vec3>>, String>

Source

pub fn normal(&self, u: f64, v: f64) -> Result<Vec3, String>

Source

pub fn principal_curvatures(&self, u: f64, v: f64) -> Result<(f64, f64), String>

Principal curvatures (κ_min, κ_max) at (u, v), signed with respect to the parametrization normal n = Su × Sv / |Su × Sv| via the shape operator I⁻¹·II. Convention check: a cylinder of radius R whose normal points AWAY from the axis has κ = −1/R along the circular direction, so an offset’s regularity factor 1 − d·κ vanishes exactly when an inward offset (d = −R) reaches the axis.

Source

pub fn is_affine(&self) -> Result<bool, String>

Whether this is a genuinely affine degree-1 by degree-1 patch.

A tapered bilinear patch is planar but not affine, so degree alone is insufficient for exact inverse-parameter and integration shortcuts.

Source

pub fn iso_curve_u(&self, u: f64) -> Result<NurbsCurve, String>

Source

pub fn iso_curve_v(&self, v: f64) -> Result<NurbsCurve, String>

Trait Implementations§

Source§

impl Clone for NurbsSurface

Source§

fn clone(&self) -> NurbsSurface

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for NurbsSurface

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for NurbsSurface

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for NurbsSurface

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more