pub struct PosedEfd<const D: usize>{ /* private fields */ }
Expand description
An open-curve shape with a pose described by EFD.
These are the same as Efd
except that it has a pose, and the data are
always normalized and readonly.
Start with PosedEfd::from_series()
and its related methods.
§Pose Representation
Pose is represented by an unit vector, which is rotated by the rotation of the original shape.
Implementations§
source§impl PosedEfd<2>
impl PosedEfd<2>
sourcepub fn from_angles<C>(curve: C, angles: &[f64]) -> Selfwhere
C: Curve<2>,
pub fn from_angles<C>(curve: C, angles: &[f64]) -> Selfwhere
C: Curve<2>,
Calculate the coefficients from a curve and its angles from each point.
sourcepub fn from_angles_harmonic<C>(
curve: C,
angles: &[f64],
harmonic: usize
) -> Selfwhere
C: Curve<2>,
pub fn from_angles_harmonic<C>(
curve: C,
angles: &[f64],
harmonic: usize
) -> Selfwhere
C: Curve<2>,
Calculate the coefficients from a curve and its angles from each point.
The harmonic
is the number of the coefficients to be calculated.
source§impl<const D: usize> PosedEfd<D>
impl<const D: usize> PosedEfd<D>
sourcepub const fn from_parts_unchecked(efd: Efd<D>, posed: Efd<D>) -> Self
pub const fn from_parts_unchecked(efd: Efd<D>, posed: Efd<D>) -> Self
Create object from an Efd
object.
Posed EFD is a special shape to describe the pose, efd
is only used to
describe this motion signature.
See also PosedEfd::into_inner()
.
sourcepub fn from_series<C1, C2>(curve_p: C1, curve_q: C2) -> Self
pub fn from_series<C1, C2>(curve_p: C1, curve_q: C2) -> Self
Calculate the coefficients from two series of points.
The second series is the pose series, the curve2[i]
has the same time
as curve[i]
.
sourcepub fn from_series_harmonic<C1, C2>(
curve_p: C1,
curve_q: C2,
harmonic: usize
) -> Self
pub fn from_series_harmonic<C1, C2>( curve_p: C1, curve_q: C2, harmonic: usize ) -> Self
Calculate the coefficients from two series of points.
The harmonic
is the number of the coefficients to be calculated.
sourcepub fn from_uvec<C, V>(curve: C, vectors: V) -> Self
pub fn from_uvec<C, V>(curve: C, vectors: V) -> Self
Calculate the coefficients from a curve and its unit vectors from each point.
If the unit vectors is not normalized, the length of the first vector will be used as the scaling factor.
sourcepub fn from_uvec_harmonic<C, V>(curve: C, vectors: V, harmonic: usize) -> Self
pub fn from_uvec_harmonic<C, V>(curve: C, vectors: V, harmonic: usize) -> Self
Calculate the coefficients from a curve and its unit vectors from each point.
If the unit vectors is not normalized, the length of the first vector will be used as the scaling factor.
The harmonic
is the number of the coefficients to be calculated.
sourcepub fn fourier_power_anaysis<T>(self, threshold: T) -> Self
pub fn fourier_power_anaysis<T>(self, threshold: T) -> Self
Use Fourier Power Anaysis (FPA) to reduce the harmonic number.
The default threshold is 99.99%.
See also Efd::fourier_power_anaysis()
.
§Panics
Panics if the threshold is not in 0..1, or the harmonic is zero.
sourcepub fn into_inner(self) -> (Efd<D>, Efd<D>)
pub fn into_inner(self) -> (Efd<D>, Efd<D>)
Consume self and return the parts of this type. The first is the curve coefficients, and the second is the pose coefficients.
See also PosedEfd::from_parts_unchecked()
.
Trait Implementations§
Auto Trait Implementations§
impl<const D: usize> !Freeze for PosedEfd<D>
impl<const D: usize> !RefUnwindSafe for PosedEfd<D>
impl<const D: usize> !Send for PosedEfd<D>
impl<const D: usize> !Sync for PosedEfd<D>
impl<const D: usize> !Unpin for PosedEfd<D>
impl<const D: usize> !UnwindSafe for PosedEfd<D>
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
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.