pub struct Polyline<'m> { /* private fields */ }Expand description
A borrowed view of an IfcPolyline.
Implementations§
Source§impl<'m> Polyline<'m>
impl<'m> Polyline<'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 IfcPolyline.
Sourcepub fn point_refs(&self) -> GeometryResult<Vec<EntityId>>
pub fn point_refs(&self) -> GeometryResult<Vec<EntityId>>
The IfcCartesianPoint references, in order.
At least two are required by the schema; fewer is
crate::GeometryError::Degenerate because a one-point polyline has
no edge and would silently contribute nothing to a profile.
Sourcepub fn points<'v>(
&self,
model: &'v Model,
) -> GeometryResult<Vec<CartesianPoint<'v>>>
pub fn points<'v>( &self, model: &'v Model, ) -> GeometryResult<Vec<CartesianPoint<'v>>>
The vertices as typed point views, resolved from the model, in order.
One dangling or mistyped vertex fails the whole call: dropping it would change the shape without saying so.
Sourcepub fn closes_by_repeating_first_point(&self) -> GeometryResult<bool>
pub fn closes_by_repeating_first_point(&self) -> GeometryResult<bool>
Is the last point the same entity as the first?
IFC closes a polyline by repeating the point reference, not with a flag. A consumer building a face bound must know whether to add a closing edge, and comparing coordinates instead of references would need a tolerance the schema never defines.
Note the converse is not guaranteed: a file may close a polyline with
two distinct IfcCartesianPoint records holding identical
coordinates. This reports only the reference-identity case, which is
what conforming exporters emit.