pub trait Curve3d {
Show 13 methods
// Required methods
fn domain(&self) -> (f64, f64);
fn point_at(&self, u: f64, tol: Tolerances) -> OgeomResult<Point>;
fn d1_at(&self, u: f64, tol: Tolerances) -> OgeomResult<Vector>;
fn derivatives_at(
&self,
u: f64,
n: usize,
tol: Tolerances,
) -> OgeomResult<Vec<Vector>>;
fn kind(&self) -> CurveKind;
fn continuity(&self) -> Continuity;
fn is_closed(&self, tol: Tolerances) -> bool;
fn is_periodic(&self) -> bool;
// Provided methods
fn tangent_at(&self, u: f64, tol: Tolerances) -> OgeomResult<Direction> { ... }
fn curvature_at(&self, u: f64, tol: Tolerances) -> OgeomResult<f64> { ... }
fn start(&self, tol: Tolerances) -> OgeomResult<Point> { ... }
fn end(&self, tol: Tolerances) -> OgeomResult<Point> { ... }
fn normalize_parameter(&self, u: f64, tol: Tolerances) -> OgeomResult<f64> { ... }
}Expand description
A parametric curve in space.
Implementors must guarantee:
Curve3d::domainreturns(a, b)witha < b, both finite;Curve3d::point_atand the derivative methods agree:d1_atis the derivative ofpoint_at, and so on;- a periodic curve’s period is exactly its domain width.
Required Methods§
Sourcefn point_at(&self, u: f64, tol: Tolerances) -> OgeomResult<Point>
fn point_at(&self, u: f64, tol: Tolerances) -> OgeomResult<Point>
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<Vector>>
fn derivatives_at( &self, u: f64, n: usize, tol: Tolerances, ) -> OgeomResult<Vec<Vector>>
Sourcefn continuity(&self) -> Continuity
fn continuity(&self) -> Continuity
How smooth the curve is across its domain.
Sourcefn is_periodic(&self) -> bool
fn is_periodic(&self) -> bool
Whether the curve continues past its domain by repeating.
Distinct from being closed: a full circle is both, a closed B-spline whose ends merely coincide is closed but not periodic, and evaluating the latter outside its domain is an error.
Provided Methods§
Sourcefn tangent_at(&self, u: f64, tol: Tolerances) -> OgeomResult<Direction>
fn tangent_at(&self, u: f64, tol: Tolerances) -> OgeomResult<Direction>
Sourcefn curvature_at(&self, u: f64, tol: Tolerances) -> OgeomResult<f64>
fn curvature_at(&self, u: f64, tol: Tolerances) -> OgeomResult<f64>
Sourcefn normalize_parameter(&self, u: f64, tol: Tolerances) -> OgeomResult<f64>
fn normalize_parameter(&self, u: f64, tol: Tolerances) -> OgeomResult<f64>
Bring u into the domain, wrapping if the curve is periodic.
§Errors
OgeomError::Domain if u is outside the
domain of a non-periodic curve by more than tol.parametric().
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".