Struct truck_geometry::decorators::TrimmedCurve

source ·
pub struct TrimmedCurve<C> { /* private fields */ }
Expand description

trimmed curve for parametric curve

Implementations§

source§

impl<C> TrimmedCurve<C>

source

pub const fn new(curve: C, range: (f64, f64)) -> Self

constructor

source

pub const fn curve(&self) -> &C

Returns the reference of non-trimmed curve

source

pub fn curve_mut(&mut self) -> &mut C

Returns the mutable reference of non-trimmed curve

Trait Implementations§

source§

impl<C: ParametricCurve> BoundedCurve for TrimmedCurve<C>

source§

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

Return the ends of parameter_range by tuple.
source§

fn front(&self) -> Self::Point

The front end point of the curve.
source§

fn back(&self) -> Self::Point

The back end point of the curve.
source§

impl<C: Clone> Clone for TrimmedCurve<C>

source§

fn clone(&self) -> TrimmedCurve<C>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<C: ParametricCurve> Cut for TrimmedCurve<C>

source§

fn cut(&mut self, t: f64) -> Self

Cuts one curve into two curves. Assigns the former curve to self and returns the later curve.
source§

impl<C: Debug> Debug for TrimmedCurve<C>

source§

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

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

impl<'de, C> Deserialize<'de> for TrimmedCurve<C>
where C: Deserialize<'de>,

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<C: ParameterDivision1D> ParameterDivision1D for TrimmedCurve<C>

source§

type Point = <C as ParameterDivision1D>::Point

The curve is in the space of Self::Point.
source§

fn parameter_division( &self, range: (f64, f64), tol: f64, ) -> (Vec<f64>, Vec<Self::Point>)

Creates the curve division (parameters, corresponding points). Read more
source§

impl<C: ParametricCurve> ParametricCurve for TrimmedCurve<C>

source§

type Point = <C as ParametricCurve>::Point

The curve is in the space of Self::Point.
source§

type Vector = <C as ParametricCurve>::Vector

The derivation vector of the curve.
source§

fn subs(&self, t: f64) -> Self::Point

Substitutes the parameter t.
source§

fn der(&self, t: f64) -> Self::Vector

Returns the derivation.
source§

fn der2(&self, t: f64) -> Self::Vector

Returns the 2nd-order derivation.
source§

fn period(&self) -> Option<f64>

None in default implementation; Some(period) if periodic.
source§

fn parameter_range(&self) -> ParameterRange

Returns default parameter range
source§

fn try_range_tuple(&self) -> Option<(f64, f64)>

Return the ends of parameter_range by tuple. If the range is unbounded, return `None``.
source§

impl<C: PartialEq> PartialEq for TrimmedCurve<C>

source§

fn eq(&self, other: &TrimmedCurve<C>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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<C: SearchNearestParameter<D1>> SearchNearestParameter<D1> for TrimmedCurve<C>

source§

type Point = <C as SearchNearestParameter<D1>>::Point

point
source§

fn search_nearest_parameter<H: Into<SPHint1D>>( &self, pt: C::Point, hint: H, trials: usize, ) -> Option<f64>

Search nearest parameter t such that self.subs(t) is nearest point.
Returns None if could not find such parameter.
source§

impl<C: SearchParameter<D1>> SearchParameter<D1> for TrimmedCurve<C>

source§

type Point = <C as SearchParameter<D1>>::Point

point
source§

fn search_parameter<H: Into<SPHint1D>>( &self, pt: C::Point, hint: H, trials: usize, ) -> Option<f64>

Search parameter t such that self.subs(t) is near point.
Returns None if could not find such parameter.
source§

impl<C> Serialize for TrimmedCurve<C>
where C: Serialize,

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<C: Copy> Copy for TrimmedCurve<C>

source§

impl<C> StructuralPartialEq for TrimmedCurve<C>

Auto Trait Implementations§

§

impl<C> Freeze for TrimmedCurve<C>
where C: Freeze,

§

impl<C> RefUnwindSafe for TrimmedCurve<C>
where C: RefUnwindSafe,

§

impl<C> Send for TrimmedCurve<C>
where C: Send,

§

impl<C> Sync for TrimmedCurve<C>
where C: Sync,

§

impl<C> Unpin for TrimmedCurve<C>
where C: Unpin,

§

impl<C> UnwindSafe for TrimmedCurve<C>
where C: UnwindSafe,

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, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

source§

impl<C> ParametricCurve2D for C
where C: ParametricCurve<Point = Point2<f64>, Vector = Vector2<f64>>,

source§

impl<C> ParametricCurve3D for C
where C: ParametricCurve<Point = Point3<f64>, Vector = Vector3<f64>>,