pub struct ImplicitCurve2 {
pub field: Field2,
pub cells: Vec<ImplicitCell>,
}Expand description
A stretch of a field’s zero set, in the parameters of the surface the
field lives on. The parameter t runs over [0, cells.len()]: cell i
covers [i, i + 1], its free parameter moving linearly from from to
to.
Fields§
§field: Field2The field whose zero the curve is.
cells: Vec<ImplicitCell>The cells, each starting where the previous ends.
Implementations§
Source§impl ImplicitCurve2
impl ImplicitCurve2
Sourcepub fn solve_cell(&self, cell: &ImplicitCell, free: f64) -> Option<f64>
pub fn solve_cell(&self, cell: &ImplicitCell, free: f64) -> Option<f64>
The solved value of cell at free value free.
Sourcepub fn derivative(&self, t: f64) -> Option<DVec2>
pub fn derivative(&self, t: f64) -> Option<DVec2>
dP/dt.
Sourcepub fn second_derivative(&self, t: f64) -> Option<DVec2>
pub fn second_derivative(&self, t: f64) -> Option<DVec2>
d2P/dt2.
Sourcepub fn parameter_of(&self, p: DVec2) -> Option<f64>
pub fn parameter_of(&self, p: DVec2) -> Option<f64>
The parameter of a point on the curve: the cell whose box holds it, and where its free value falls in the cell.
Sourcepub fn shifted(&self, du: f64, dv: f64) -> ImplicitCurve2
pub fn shifted(&self, du: f64, dv: f64) -> ImplicitCurve2
The same curve moved by whole periods (du, dv) in parameters.
Sourcepub fn closure(&self, periodic_u: bool, periodic_v: bool) -> Option<DVec2>
pub fn closure(&self, periodic_u: bool, periodic_v: bool) -> Option<DVec2>
The offset from the curve’s start to its end in parameters when it
closes up to whole periods of 2 pi in the periodic parameters
((0, 0) for a loop that does not wind), or None when it is open.
Sourcepub fn sub(
&self,
t0: f64,
t1: f64,
closure: Option<DVec2>,
) -> Option<ImplicitCurve2>
pub fn sub( &self, t0: f64, t1: f64, closure: Option<DVec2>, ) -> Option<ImplicitCurve2>
The stretch from t0 to t1, as a curve of its own over
[0, cells]. With t0 > t1 the stretch runs on past the end and
round from the start, which needs the curve’s closure offset.
Sourcepub fn rotated(&self, t: f64, closure: DVec2) -> Option<ImplicitCurve2>
pub fn rotated(&self, t: f64, closure: DVec2) -> Option<ImplicitCurve2>
A closed curve’s whole loop, starting at t instead of at 0.
Sourcepub fn clipped(&self, lo: DVec2, hi: DVec2) -> Vec<ImplicitCurve2>
pub fn clipped(&self, lo: DVec2, hi: DVec2) -> Vec<ImplicitCurve2>
The stretches of the curve inside the box [lo, hi], each as a curve
of its own. Crossings of the box’s sides are found by a scan of each
cell and bisection on the distance to the box.
Sourcepub fn reversed(&self) -> ImplicitCurve2
pub fn reversed(&self) -> ImplicitCurve2
The same curve run backwards: t becomes cells.len() - t.
Sourcepub fn turning_points(&self, lo: f64, hi: f64) -> Vec<f64>
pub fn turning_points(&self, lo: f64, hi: f64) -> Vec<f64>
Parameters in (lo, hi) where the curve may stop being monotone in
u or v: every cell boundary, and inside each cell every point
where the solved parameter turns (the field’s partial along the free
parameter changes sign on the curve). Between consecutive values the
curve is monotone in both parameters.
Each turning point is isolated with interval bounds of that partial
over boxes that certainly hold the curve (the solved parameter moves
at most max |F_free| / min |F_solved| per unit of the free one), so
none is missed; a double root, where the sign does not change, is
not a turn and is not reported.
Trait Implementations§
Source§impl Clone for ImplicitCurve2
impl Clone for ImplicitCurve2
Source§fn clone(&self) -> ImplicitCurve2
fn clone(&self) -> ImplicitCurve2
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ImplicitCurve2
impl Debug for ImplicitCurve2
Source§impl PartialEq for ImplicitCurve2
impl PartialEq for ImplicitCurve2
impl StructuralPartialEq for ImplicitCurve2
Auto Trait Implementations§
impl Freeze for ImplicitCurve2
impl RefUnwindSafe for ImplicitCurve2
impl Send for ImplicitCurve2
impl Sync for ImplicitCurve2
impl Unpin for ImplicitCurve2
impl UnwindSafe for ImplicitCurve2
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more