pub trait Curve2d {
// Required methods
fn domain(&self) -> (f64, f64);
fn point_at(&self, u: f64, tol: Tolerances) -> OgeomResult<Point2>;
fn d1_at(&self, u: f64, tol: Tolerances) -> OgeomResult<Vector2>;
fn derivatives_at(
&self,
u: f64,
n: usize,
tol: Tolerances,
) -> OgeomResult<Vec<Vector2>>;
fn kind(&self) -> CurveKind;
fn is_closed(&self, tol: Tolerances) -> bool;
fn is_periodic(&self) -> bool;
// Provided methods
fn start(&self, tol: Tolerances) -> OgeomResult<Point2> { ... }
fn end(&self, tol: Tolerances) -> OgeomResult<Point2> { ... }
}Expand description
A parametric curve in the plane.
The same contract as Curve3d, one dimension down. Kept as a separate
trait rather than a generic parameter because pcurves (curves in a
surface’s parameter space) are used differently enough from spatial curves
that conflating them invites mistakes.
Required Methods§
Sourcefn point_at(&self, u: f64, tol: Tolerances) -> OgeomResult<Point2>
fn point_at(&self, u: f64, tol: Tolerances) -> OgeomResult<Point2>
The point at u.
§Errors
OgeomError::Domain if u is outside the
domain and the curve is not periodic.
Sourcefn derivatives_at(
&self,
u: f64,
n: usize,
tol: Tolerances,
) -> OgeomResult<Vec<Vector2>>
fn derivatives_at( &self, u: f64, n: usize, tol: Tolerances, ) -> OgeomResult<Vec<Vector2>>
Sourcefn is_periodic(&self) -> bool
fn is_periodic(&self) -> bool
Whether the curve continues past its domain by repeating.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".