Skip to main content

OffsetNormal

Enum OffsetNormal 

Source
pub enum OffsetNormal {
    Raw,
    Face {
        same_sense: bool,
    },
    FaceStable {
        same_sense: bool,
    },
    ExactAnalytic {
        same_sense: bool,
    },
}
Expand description

Which unit normal the offset rides, and how it is recovered where the parametric normal degenerates.

Every variant names an existing in-tree formula and is bit-identical to it. They differ ONLY where the parameter leaves the domain or the cross product S_u × S_v collapses; a shared evaluator that silently picked one for everybody would move behaviour at exactly the singular points the callers each decided about on purpose.

Variants§

§

Raw

The bare S_u × S_v, normalized, through the C¹ domain extension (deriv1_extended). Orientation is the caller’s business — the blend march carries it in the sign of ρ instead (signed_radii), which is why this variant must not apply same_sense.

No singular recovery: where the cross product collapses this is an error, deliberately, so the march keeps refusing exactly where it refuses today.

Bit-identical to blending::blend::stations::raw_normal (and to evaluate_extended for the point).

§

Face

NurbsSurface::normal — the in-domain derivatives(u, v, 1) cross — negated when same_sense is false. Clamped, not extended, and no singular recovery.

Bit-identical to the let mut normal = surface.normal(u, v)?; if !face.same_sense { normal = normal.scale(-1.0) } block written out in face_offset_revolution.rs, face_offset_freeform.rs, face_offset_torus.rs and offset_shell/smooth_sync.rs::face_normal.

Fields

§same_sense: bool
§

FaceStable

OffsetNormal::Face plus the singular-row recovery that offset_surface depends on: nudge off a point where the normal is undefined, and at a collapsed parameter row (a cone apex) walk deep inward for the true per-ruling limit rather than accept the axis direction the at-point cross degenerates to.

Bit-identical to the former offset::stable_face_normal, whose body this is. The blend march must NOT inherit it — the recovery would change the residual at poles, so it stays opt-in (audit slice 1, “keep it as an opt-in flag”).

Fields

§same_sense: bool
§

ExactAnalytic

The exact closed-form normal of the recognised analytic carrier, oriented like OffsetNormal::Face.

This is the “exact per analytic surface type” lane: a sphere’s normal is (p − centre)/r — defined at the poles, where S_u × S_v vanishes — a cylinder’s is its radial direction, a cone’s is the meridian perpendicular (defined even AT the apex, from the ruling’s own azimuth), a torus’s is (p − tube centre)/r. Where there is no exact form (the general Revolution, and every free-form patch) it falls back to OffsetNormal::Face, so this variant is always at least as defined as that one.

NurbsSurface::analytic memoizes per instance, so recognition is paid once per surface, not once per point.

No consumer rides this lane yet. It exists as the exact half of the evaluator’s contract and as the diagnostic’s comparator; switching a caller onto it changes that caller’s last digits and is a separate, measured step. See [offset_normal_diagnostic].

Fields

§same_sense: bool

Trait Implementations§

Source§

impl Clone for OffsetNormal

Source§

fn clone(&self) -> OffsetNormal

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 Copy for OffsetNormal

Source§

impl Debug for OffsetNormal

Source§

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

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

impl Eq for OffsetNormal

Source§

impl PartialEq for OffsetNormal

Source§

fn eq(&self, other: &OffsetNormal) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for OffsetNormal

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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