pub struct GeoVar<R: RotHint<D>, const D: usize> { /* private fields */ }Expand description
Geometric variables.
This type record the information of raw coefficients.
Implementations§
source§impl<R, const D: usize> GeoVar<R, D>where
R: RotHint<D>,
impl<R, const D: usize> GeoVar<R, D>where
R: RotHint<D>,
sourcepub fn transform_pt(&self, p: Coord<D>) -> Coord<D>
pub fn transform_pt(&self, p: Coord<D>) -> Coord<D>
Transform a point.
Please see GeoVar::transform() for more information.
sourcepub fn transform<C>(&self, curve: C) -> Vec<Coord<D>>
pub fn transform<C>(&self, curve: C) -> Vec<Coord<D>>
Transform a contour with this information.
This function rotates first, then translates.
use efd::{tests::*, *};
let path1 = efd.as_geo().transform(&path);
let path1_inv = geo.inverse().transform(&path1);sourcepub fn transform_inplace<C>(&self, curve: C)
pub fn transform_inplace<C>(&self, curve: C)
Transform a contour in-placed with this information.
sourcepub fn transform_iter<'a, C>(
&'a self,
curve: C
) -> impl Iterator<Item = Coord<D>> + 'awhere
C: IntoIterator<Item = Coord<D>> + 'a,
pub fn transform_iter<'a, C>(
&'a self,
curve: C
) -> impl Iterator<Item = Coord<D>> + 'awhere
C: IntoIterator<Item = Coord<D>> + 'a,
Transform an iterator contour.
sourcepub fn to(&self, rhs: &Self) -> Self
pub fn to(&self, rhs: &Self) -> Self
Merge inverse self and rhs matrices.
It can be used on a not normalized contour a transforming to b.
use efd::{tests::*, Efd2};
let a = Efd2::from_curve(path1, false);
let b = Efd2::from_curve(path2, false);
let geo = a.as_geo().to(b.as_geo());
assert!(curve_diff(&geo.transform(path1), path2) < EPS);sourcepub fn apply(&self, rhs: &Self) -> Self
pub fn apply(&self, rhs: &Self) -> Self
Merge two matrices.
Same as rhs * self.
use efd::{tests::*, Efd2};
let a = Efd2::from_curve(path1, false);
let b = Efd2::from_curve(path2, false);
let geo = b.as_geo() * a.as_geo().inverse();
assert!(curve_diff(&geo.transform(path1), path2) < EPS);Trait Implementations§
Auto Trait Implementations§
impl<R, const D: usize> RefUnwindSafe for GeoVar<R, D>where
R: RefUnwindSafe,
impl<R, const D: usize> Send for GeoVar<R, D>where
R: Send,
impl<R, const D: usize> Sync for GeoVar<R, D>where
R: Sync,
impl<R, const D: usize> Unpin for GeoVar<R, D>where
R: Unpin,
impl<R, const D: usize> UnwindSafe for GeoVar<R, D>where
R: 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
§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.