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
impl Trim
Sourcepub fn preferred(&self, preference: TrimmingPreference) -> Option<TrimPoint>
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.
Sourcepub fn is_over_specified(&self) -> bool
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.
Sourcepub fn is_empty(&self) -> bool
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.
Sourcepub fn cartesian_point<'v>(
&self,
model: &'v Model,
referrer: EntityId,
) -> GeometryResult<Option<CartesianPoint<'v>>>
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.