Skip to main content

Trim

Struct Trim 

Source
pub struct Trim {
    pub cartesian: Option<EntityId>,
    pub parameter: Option<f64>,
}
Expand description

One end of the trim: up to one point and up to one parameter.

The schema’s SET [1:2] means “at least one, at most one of each kind”. Modelling it as two Options rather than a list makes the both-present case impossible to overlook and the duplicate-kind case impossible to represent.

Fields§

§cartesian: Option<EntityId>

The Cartesian form, if the file supplied one.

§parameter: Option<f64>

The parameter form, if the file supplied one.

Implementations§

Source§

impl Trim

Source

pub fn preferred(&self, preference: TrimmingPreference) -> Option<TrimPoint>

The representation preference selects, falling back to whichever exists.

Under Unspecified the parameter is preferred: it is exact for conics, whereas a Cartesian trim point must be inverted back to a parameter with a tolerance the schema never specifies.

Source

pub fn is_over_specified(&self) -> bool

Does this trim carry both a point and a parameter?

When true, MasterRepresentation is not decoration: the two forms may disagree by more than any sane tolerance in a rounded export.

Source

pub fn is_empty(&self) -> bool

Is this trim empty, i.e. the file supplied neither form?

The schema forbids it (SET [1:2]), so an empty trim means a broken file, not a defaultable value.

Source

pub fn cartesian_point<'v>( &self, model: &'v Model, referrer: EntityId, ) -> GeometryResult<Option<CartesianPoint<'v>>>

The Cartesian form as a typed point view, Ok(None) when absent.

referrer is the IfcTrimmedCurve holding this trim, so a dangling point is reported against the record that is wrong.

Trait Implementations§

Source§

impl Clone for Trim

Source§

fn clone(&self) -> Trim

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 Copy for Trim

Source§

impl Debug for Trim

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for Trim

Source§

fn default() -> Trim

Returns the “default value” for a type. Read more
Source§

impl PartialEq for Trim

Source§

fn eq(&self, other: &Trim) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Trim

Auto Trait Implementations§

§

impl Freeze for Trim

§

impl RefUnwindSafe for Trim

§

impl Send for Trim

§

impl Sync for Trim

§

impl Unpin for Trim

§

impl UnsafeUnpin for Trim

§

impl UnwindSafe for Trim

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.