Skip to main content

OffsetSurface

Struct OffsetSurface 

Source
pub struct OffsetSurface { /* private fields */ }
Expand description

A surface displaced a constant signed distance along its basis’s normal, sharing the basis’s parameterization.

Point and first derivatives are exact; the normal’s derivative is the projection formula over the basis’s second derivatives. The second derivative would need the basis’s third, which the vocabulary does not carry, so d2_at refuses by name rather than differencing quietly. For an analytic basis the offset is itself analytic and the direct type is the better spelling; this type exists for the free-form bases that have no such spelling.

Implementations§

Source§

impl OffsetSurface

Source

pub fn new(basis: SurfaceGeometry, distance: f64) -> OgeomResult<Self>

Offset basis by a signed distance along its own normal.

§Errors

OgeomError::Construction if the distance is not finite and non-zero.

Source

pub const fn basis(&self) -> &SurfaceGeometry

The surface being offset.

Source

pub const fn distance(&self) -> f64

The signed displacement along the basis normal.

Source

pub fn analytic(&self, tol: Tolerances) -> OgeomResult<Option<SurfaceGeometry>>

The offset as the analytic surface it is, where the basis is one: a plane moved along its normal, a drum, ball or ring’s tube grown or shrunk, a cone’s reference radius changed by d / cos α over the same half-angle. Which way the offset grows is read off the basis’s own normal at a point, not assumed from its parameterization. None for any other basis, or for an offset that would turn the surface inside out (a radius through zero).

§Errors

As the basis’s evaluation, or as the analytic constructors.

Trait Implementations§

Source§

impl Clone for OffsetSurface

Source§

fn clone(&self) -> OffsetSurface

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 OffsetSurface

Source§

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

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

impl PartialEq for OffsetSurface

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for OffsetSurface

Source§

impl Surface for OffsetSurface

Source§

fn domain(&self) -> ((f64, f64), (f64, f64))

The u and v parameter intervals.
Source§

fn point_at(&self, u: f64, v: f64, tol: Tolerances) -> OgeomResult<Point>

The point at (u, v). Read more
Source§

fn d1_at( &self, u: f64, v: f64, tol: Tolerances, ) -> OgeomResult<(Vector, Vector)>

The two first derivatives at (u, v). Read more
Source§

fn d2_at( &self, _u: f64, _v: f64, _tol: Tolerances, ) -> OgeomResult<(Vector, Vector, Vector)>

The three second derivatives at (u, v): d2u, duv, d2v. Read more
Source§

fn kind(&self) -> SurfaceKind

What kind of surface this is.
Source§

fn continuity(&self) -> Continuity

How smooth the surface is across its domain.
Source§

fn is_closed_u(&self, tol: Tolerances) -> bool

Whether the surface closes on itself along u.
Source§

fn is_closed_v(&self, tol: Tolerances) -> bool

Whether the surface closes on itself along v.
Source§

fn is_periodic_u(&self) -> bool

Whether u repeats past the domain.
Source§

fn is_periodic_v(&self) -> bool

Whether v repeats past the domain.
Source§

fn jet_at(&self, u: f64, v: f64, tol: Tolerances) -> OgeomResult<SurfaceJet>

The point and every derivative through second order, together. Read more
Source§

fn normal_at(&self, u: f64, v: f64, tol: Tolerances) -> OgeomResult<Direction>

The unit normal at (u, v), following du x dv. Read more
Source§

fn curvature_at( &self, u: f64, v: f64, tol: Tolerances, ) -> OgeomResult<SurfaceCurvature>

The principal curvatures and directions at (u, v). Read more
Source§

fn is_degenerate_at(&self, u: f64, v: f64, tol: Tolerances) -> OgeomResult<bool>

Whether the surface degenerates at (u, v). Read more
Source§

fn normalize_parameters( &self, u: f64, v: f64, tol: Tolerances, ) -> OgeomResult<(f64, f64)>

Bring (u, v) into the domain, wrapping in whichever directions are periodic, or closed. Read more
Source§

fn parameter_outside( &self, t: f64, a: f64, b: f64, periodic: bool, across: bool, tol: Tolerances, ) -> OgeomResult<f64>

A parameter outside its domain, or on a periodic direction: wrapped where the direction repeats or closes on itself, refused otherwise. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.