pub struct BSplineCurve<'m> { /* private fields */ }Expand description
A borrowed view of any IfcBSplineCurve subtype.
The knot and weight accessors return Ok(None) when the entity is a
plainer subtype that does not carry them, so one view serves the whole
family without the caller re-dispatching on the type name.
Implementations§
Source§impl<'m> BSplineCurve<'m>
impl<'m> BSplineCurve<'m>
Sourcepub fn new(id: EntityId, entity: &'m Entity) -> Self
pub fn new(id: EntityId, entity: &'m Entity) -> Self
Wrap an entity known to be an IfcBSplineCurve subtype.
Sourcepub fn degree(&self) -> GeometryResult<usize>
pub fn degree(&self) -> GeometryResult<usize>
The polynomial degree, guaranteed to be at least 1 and smaller than the number of control points.
IFC requires Degree <= UpperIndexOnControlPoints; because the upper
index is control_points.len() - 1, degree >= len is invalid.
Sourcepub fn control_point_refs(&self) -> GeometryResult<Vec<EntityId>>
pub fn control_point_refs(&self) -> GeometryResult<Vec<EntityId>>
The IfcCartesianPoint control point references, in order.
Order defines the curve; sorting or deduplicating them destroys it.
Sourcepub fn control_points<'v>(
&self,
model: &'v Model,
) -> GeometryResult<Vec<CartesianPoint<'v>>>
pub fn control_points<'v>( &self, model: &'v Model, ) -> GeometryResult<Vec<CartesianPoint<'v>>>
The control points as typed point views, resolved from the model.
All or nothing: a missing control point changes the curve, so one bad reference fails the call.
Sourcepub fn curve_form(&self) -> BSplineCurveForm
pub fn curve_form(&self) -> BSplineCurveForm
The declared original form, defaulting to Unspecified.
Sourcepub fn closed_curve(&self) -> Option<bool>
pub fn closed_curve(&self) -> Option<bool>
The asserted ClosedCurve flag; None for .U. or absent.
A hint only: nothing verifies that the first and last control points coincide.
Sourcepub fn self_intersect(&self) -> Option<bool>
pub fn self_intersect(&self) -> Option<bool>
The asserted SelfIntersect flag; None for .U. or absent.
Sourcepub fn is_rational(&self) -> bool
pub fn is_rational(&self) -> bool
Whether the entity declares the rational subtype.
Subtype identity, not accidental trailing-slot presence, owns this semantic. A malformed rational entity with missing weights must fail; it must never be silently downgraded to a polynomial curve.
Sourcepub fn knots(&self) -> GeometryResult<Option<KnotVector>>
pub fn knots(&self) -> GeometryResult<Option<KnotVector>>
The compressed knot vector: distinct values with their multiplicities.
Returns Ok(None) for a curve without knots. When present, the two
lists are validated to be the same length and the total multiplicity is
checked against ControlPoints + Degree + 1, which is the invariant
that silently produces garbage when violated.
Sourcepub fn weights(&self) -> GeometryResult<Option<Vec<f64>>>
pub fn weights(&self) -> GeometryResult<Option<Vec<f64>>>
The rational weights, one per control point, all finite and positive.
Returns Ok(None) for a non-rational curve. A zero weight is a
division by zero at evaluation time and a negative one flips the curve
through infinity; both are rejected here rather than in the kernel.
Trait Implementations§
Source§impl<'m> Clone for BSplineCurve<'m>
impl<'m> Clone for BSplineCurve<'m>
Source§fn clone(&self) -> BSplineCurve<'m>
fn clone(&self) -> BSplineCurve<'m>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more