pub struct Weighted<P> {
pub scaled: P,
pub weight: f64,
}Expand description
A control point carrying a weight, for rational geometry.
Stored in homogeneous form (the point is already multiplied through by the weight) because that is the form every algorithm needs, and converting on each access would be both slower and a source of drift.
Fields§
§scaled: PThe point scaled by the weight.
weight: f64The weight.
Implementations§
Source§impl<P: Blend> Weighted<P>
impl<P: Blend> Weighted<P>
Sourcepub fn new(point: P, weight: f64, tol: Tolerances) -> OgeomResult<Self>
pub fn new(point: P, weight: f64, tol: Tolerances) -> OgeomResult<Self>
A weighted control point from a position and a weight.
§Errors
OgeomError::Construction if the weight
is not finite and positive. A zero weight makes the projection undefined
and a negative one makes the curve leave its control polygon’s convex
hull, so neither is admitted.
Trait Implementations§
impl<P: Copy> Copy for Weighted<P>
Source§impl<P: PartialEq> PartialEq for Weighted<P>
impl<P: PartialEq> PartialEq for Weighted<P>
impl<P: PartialEq> StructuralPartialEq for Weighted<P>
Auto Trait Implementations§
impl<P> Freeze for Weighted<P>where
P: Freeze,
impl<P> RefUnwindSafe for Weighted<P>where
P: RefUnwindSafe,
impl<P> Send for Weighted<P>where
P: Send,
impl<P> Sync for Weighted<P>where
P: Sync,
impl<P> Unpin for Weighted<P>where
P: Unpin,
impl<P> UnsafeUnpin for Weighted<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for Weighted<P>where
P: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Scalar for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
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
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
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
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.