Skip to main content

BSplineCurve

Struct BSplineCurve 

Source
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>

Source

pub fn new(id: EntityId, entity: &'m Entity) -> Self

Wrap an entity known to be an IfcBSplineCurve subtype.

Source

pub fn id(&self) -> EntityId

The entity id.

Source

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.

Source

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.

Source

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.

Source

pub fn curve_form(&self) -> BSplineCurveForm

The declared original form, defaulting to Unspecified.

Source

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.

Source

pub fn self_intersect(&self) -> Option<bool>

The asserted SelfIntersect flag; None for .U. or absent.

Source

pub fn knot_spec(&self) -> KnotType

The declared knot type, defaulting to Unspecified.

Source

pub fn has_knots(&self) -> bool

Is this the knotted subtype?

Source

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.

Source

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.

Source

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>

Source§

fn clone(&self) -> BSplineCurve<'m>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'m> Copy for BSplineCurve<'m>

Source§

impl<'m> Debug for BSplineCurve<'m>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'m> Freeze for BSplineCurve<'m>

§

impl<'m> RefUnwindSafe for BSplineCurve<'m>

§

impl<'m> Send for BSplineCurve<'m>

§

impl<'m> Sync for BSplineCurve<'m>

§

impl<'m> Unpin for BSplineCurve<'m>

§

impl<'m> UnsafeUnpin for BSplineCurve<'m>

§

impl<'m> UnwindSafe for BSplineCurve<'m>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.