Skip to main content

AnalyticSurface

Enum AnalyticSurface 

Source
pub enum AnalyticSurface {
    Plane {
        origin: Vec3,
        u_dir: Vec3,
        v_dir: Vec3,
        u_domain: [f64; 2],
        v_domain: [f64; 2],
    },
    RuledRevolution {
        frame: RevolutionFrame,
        rho0: f64,
        rho1: f64,
        height: f64,
    },
    Sphere {
        frame: RevolutionFrame,
        radius: f64,
    },
    Torus {
        frame: RevolutionFrame,
        major_radius: f64,
        minor_radius: f64,
    },
    Revolution {
        frame: RevolutionFrame,
        spans: usize,
        sweep: f64,
        generatrix: NurbsCurve,
    },
}

Variants§

§

Plane

Affine patch: S(u,v) = origin + u·u_dir + v·v_dir over the knot domain.

Fields

§origin: Vec3
§u_dir: Vec3
§v_dir: Vec3
§u_domain: [f64; 2]
§v_domain: [f64; 2]
§

RuledRevolution

Full revolution of a straight generatrix: cylinders (rho0 == rho1) and cones/frusta, with v linear along the generatrix over [0, 1].

Fields

§rho0: f64
§rho1: f64
§height: f64
§

Sphere

Full revolution of a -π/2..π/2 polar meridian arc (two 90° spans).

Fields

§radius: f64
§

Torus

Full revolution of a full tube circle (four 90° spans in v).

Fields

§major_radius: f64
§minor_radius: f64
§

Revolution

GENERAL revolution (full or partial sweep) of an arbitrary generatrix — every other make_revolution product the classic quadric variants above do not cover. The closest surface point to a query lies in the query’s meridian half-plane, so projection reduces exactly to a 1D projection onto the generatrix (rotated rigidly about the axis); out-of-sweep queries compare the two boundary meridians instead (Golovanov §4.13: prefer analytic constructions — this was the unrecognized carrier that sent tangent glue pairs into the marcher).

Fields

§spans: usize
§sweep: f64
§generatrix: NurbsCurve

Implementations§

Source§

impl AnalyticSurface

Source

pub fn kind_label(&self) -> &'static str

A short, human-readable classification of this analytic carrier for the Properties Info panel: "Plane", "Cylinder", "Cone", "Sphere", "Torus", or "Surface of revolution". A RuledRevolution is a cylinder when its two generatrix radii match (relative tolerance, same style as recognition) and a cone otherwise — a zero end-radius apex is still a cone, no special case needed. A partial-sweep revolve of a straight profile recognizes as the general Revolution (not RuledRevolution), so it reads “Surface of revolution” rather than “Cylinder”/“Cone”.

Source§

impl AnalyticSurface

Source

pub fn project( &self, surface: &NurbsSurface, point: Vec3, ) -> Option<SurfaceProjection>

Closed-form point projection in the surface’s own parameterization. Returns the exact nearest parameter; the caller evaluates the NURBS at that parameter so results stay bit-consistent with the carrier.

Source

pub fn frame(&self) -> Option<&RevolutionFrame>

True when the closed-form projection is the exact global minimizer (everywhere except on-axis queries, where any meridian ties).

Trait Implementations§

Source§

impl Clone for AnalyticSurface

Source§

fn clone(&self) -> AnalyticSurface

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 AnalyticSurface

Source§

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

Formats the value using the given formatter. 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> 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