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: Scalar) -> Option<Scalar>
pub fn solve_cell(&self, cell: &ImplicitCell, free: Scalar) -> Option<Scalar>
The solved value of cell at free value free.
Sourcepub fn point(&self, t: Scalar) -> Option<Point2>
pub fn point(&self, t: Scalar) -> Option<Point2>
The point at t, or None outside [0, cells.len()].
Sourcepub fn derivative(&self, t: Scalar) -> Option<Vec2>
pub fn derivative(&self, t: Scalar) -> Option<Vec2>
dP/dt.
Sourcepub fn second_derivative(&self, t: Scalar) -> Option<Vec2>
pub fn second_derivative(&self, t: Scalar) -> Option<Vec2>
d2P/dt2.
Sourcepub fn parameter_of(&self, p: Point2) -> Option<Scalar>
pub fn parameter_of(&self, p: Point2) -> Option<Scalar>
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: Scalar, dv: Scalar) -> Self
pub fn shifted(&self, du: Scalar, dv: Scalar) -> Self
The same curve moved by whole periods (du, dv) in parameters.
Sourcepub fn closure(&self, periodic_u: bool, periodic_v: bool) -> Option<Vec2>
pub fn closure(&self, periodic_u: bool, periodic_v: bool) -> Option<Vec2>
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: Scalar, t1: Scalar, closure: Option<Vec2>) -> Option<Self>
pub fn sub(&self, t0: Scalar, t1: Scalar, closure: Option<Vec2>) -> Option<Self>
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: Scalar, closure: Vec2) -> Option<Self>
pub fn rotated(&self, t: Scalar, closure: Vec2) -> Option<Self>
A closed curve’s whole loop, starting at t instead of at 0.
Sourcepub fn clipped(&self, lo: Point2, hi: Point2) -> Vec<Self>
pub fn clipped(&self, lo: Point2, hi: Point2) -> Vec<Self>
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 turning_points(&self, lo: Scalar, hi: Scalar) -> Vec<Scalar> ⓘ
pub fn turning_points(&self, lo: Scalar, hi: Scalar) -> Vec<Scalar> ⓘ
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 more