Skip to main content

FlatPatch

Struct FlatPatch 

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

The box around curves drawn in a plane, as a bilinear patch of it: a plane point (x, y) lies at origin + x e1 + y e2, and the patch is parametrized over [0, 1]² along (x, y) — or along (y, x) if swapped, whichever makes its loops wind the way a face’s must.

The box encloses every curve: a NURBS curve stays within the convex hull of its control points, and the box is the outer bounds of their enclosures. A curve drawn in the plane is mapped into the patch’s parameters by an affine map of its control points (FlatPatch::pcurve), exact for any NURBS.

Implementations§

Source§

impl FlatPatch

Source

pub fn around<'a>( origin: Vector3, e1: Vector3, e2: Vector3, curves: impl IntoIterator<Item = &'a NurbCurve2D>, swapped: bool, ) -> GeopResult<Self>

The patch of the plane (origin, e1, e2) around curves, given in its coordinates.

Source

pub fn past(&self, [low, high]: [Vector2; 2]) -> Self

The patch grown to reach past [low, high], a box in the plane’s coordinates, on every side by its own larger size.

The box’s sides pass through the curves’ extreme points, and a line of another body lying in the plane through such a point, along the box’s side, runs along the patch’s boundary to within rounding: where the two enclosures miss each other by less than their widths, no search can tell that apart from an overlap. Where the patch ends is a free choice. Past the extent of everything that could lie in the plane, nothing lies along its sides, whatever the dimensions.

Source

pub fn reach(&self) -> [Vector2; 2]

How far the patch reaches along the plane’s two axes: its lowest corner and its highest, in the plane’s coordinates.

Source

pub fn pcurve(&self, curve: &NurbCurve2D) -> GeopResult<NurbCurve2D>

curve, drawn in the plane, in the patch’s parameters.

Source

pub fn surface(&self) -> GeopResult<NurbSurface3D>

The patch itself.

Trait Implementations§

Source§

impl Clone for FlatPatch

Source§

fn clone(&self) -> FlatPatch

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 FlatPatch

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 = 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.