Skip to main content

Curve3d

Trait Curve3d 

Source
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::domain returns (a, b) with a < b, both finite;
  • Curve3d::point_at and the derivative methods agree: d1_at is the derivative of point_at, and so on;
  • a periodic curve’s period is exactly its domain width.

Required Methods§

Source

fn domain(&self) -> (f64, f64)

The parameter interval over which the curve is defined.

Source

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.

Source

fn d1_at(&self, u: f64, tol: Tolerances) -> OgeomResult<Vector>

The first derivative at u.

§Errors

As Curve3d::point_at.

Source

fn derivatives_at( &self, u: f64, n: usize, tol: Tolerances, ) -> OgeomResult<Vec<Vector>>

Derivatives up to order n, with result[0] the point itself.

§Errors

As Curve3d::point_at.

Source

fn kind(&self) -> CurveKind

What kind of curve this is.

Source

fn continuity(&self) -> Continuity

How smooth the curve is across its domain.

Source

fn is_closed(&self, tol: Tolerances) -> bool

Whether the curve’s ends meet.

Source

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§

Source

fn tangent_at(&self, u: f64, tol: Tolerances) -> OgeomResult<Direction>

The unit tangent at u.

§Errors

OgeomError::Construction at a cusp, where the derivative vanishes.

Source

fn curvature_at(&self, u: f64, tol: Tolerances) -> OgeomResult<f64>

The curvature at u.

§Errors

As Curve3d::point_at.

Source

fn start(&self, tol: Tolerances) -> OgeomResult<Point>

The start point.

§Errors

As Curve3d::point_at.

Source

fn end(&self, tol: Tolerances) -> OgeomResult<Point>

The end point.

§Errors

As Curve3d::point_at.

Source

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".

Implementors§