Skip to main content

BSplineSurface

Struct BSplineSurface 

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

A tensor-product B-spline patch, polynomial or rational.

Implementations§

Source§

impl BSplineSurface

Source

pub fn restricted_to_degree( &self, max_degree: usize, tolerance: f64, tol: Tolerances, ) -> OgeomResult<Fitted<Self>>

This patch at degrees no higher than max_degree in either direction, to a stated tolerance: itself where it already is, and otherwise a fit through a grid of its own points, the grid doubled until the fit holds every sample to the tolerance or the budget runs out. The fit’s parameterization is its own (chord-length through the grid, not the patch’s), so a pcurve spoken against the patch must be re-derived against the result.

§Errors

OgeomError::Construction if max_degree is zero or the tolerance is not a distance; as fit::fit_surface_grid.

Source§

impl BSplineSurface

Source

pub fn new( u_knots: KnotVector, v_knots: KnotVector, grid: &ControlGrid<Point>, tol: Tolerances, ) -> OgeomResult<Self>

A polynomial patch.

§Errors

OgeomError::Dimension on a shape mismatch.

Source

pub fn rational( u_knots: KnotVector, v_knots: KnotVector, grid: ControlGrid<Weighted<Point>>, ) -> OgeomResult<Self>

A rational patch.

§Errors

OgeomError::Dimension on a shape mismatch.

Source

pub fn extended( &self, along_u: bool, at_end: bool, length: f64, continuity: usize, tol: Tolerances, ) -> OgeomResult<Self>

This patch continued past one of its four sides by about length in space: every column of the control net continued along u (or every row along v), as BSplineCurve::extended continues a curve, over one shared span so the net stays a grid. The span is the length over the mean speed along that side, so the continuation reaches the length where the side runs at its mean speed and less where the surface stretches faster. The original patch keeps its parameters; the domain grows at the side continued.

§Errors

OgeomError::Construction if the side stands still, or the length is not positive; as [ogeom_math::bspline::extend].

Source

pub fn iso_u_curve(&self, at: f64, tol: Tolerances) -> OgeomResult<BSplineCurve>

The u = at iso-curve: a B-spline over the v knots whose controls are the control columns blended by the u basis at at, weights and all: exactly the curve the surface traces up that column.

§Errors

OgeomError::Domain if at is outside the u domain.

Source

pub fn iso_v_curve(&self, at: f64, tol: Tolerances) -> OgeomResult<BSplineCurve>

The v = at iso-curve, as BSplineSurface::iso_u_curve the other way round.

§Errors

As BSplineSurface::iso_u_curve.

Source

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

The patch of this surface over u by v, exactly and keeping its parameters: the patch at (u, v) is this surface at (u, v).

§Errors

OgeomError::Domain if either range is empty or leaves the domain.

Source

pub const fn u_knots(&self) -> &KnotVector

The u knot vector.

Source

pub const fn v_knots(&self) -> &KnotVector

The v knot vector.

Source

pub const fn grid(&self) -> &ControlGrid<Weighted<Point>>

The control grid.

Source

pub const fn is_rational(&self) -> bool

Whether the weights differ, so the patch is genuinely rational.

Trait Implementations§

Source§

impl Clone for BSplineSurface

Source§

fn clone(&self) -> BSplineSurface

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 BSplineSurface

Source§

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

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

impl From<BSplineSurface> for SurfaceGeometry

Source§

fn from(s: BSplineSurface) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for BSplineSurface

Source§

fn eq(&self, other: &BSplineSurface) -> 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 BSplineSurface

Source§

impl Surface for BSplineSurface

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 jet_at(&self, u: f64, v: f64, tol: Tolerances) -> OgeomResult<SurfaceJet>

The point and every derivative through second order, together. 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 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.