pub struct ProfileProcessor { /* private fields */ }Expand description
Profile processor - processes IFC profiles into 2D contours
Implementations§
Source§impl ProfileProcessor
impl ProfileProcessor
Sourcepub fn get_line_points_3d(
&self,
line: &DecodedEntity,
decoder: &mut EntityDecoder<'_>,
t_start: f64,
t_end: f64,
) -> Result<Vec<Point3<f64>>>
pub fn get_line_points_3d( &self, line: &DecodedEntity, decoder: &mut EntityDecoder<'_>, t_start: f64, t_end: f64, ) -> Result<Vec<Point3<f64>>>
Sample a bare (untrimmed) IfcLine as the two-point segment spanning the
parameter range [t_start, t_end]. Public so the swept-disk processor can
apply a solid’s StartParam/EndParam to a raw line directrix.
Sourcepub fn get_polyline_points_trimmed(
&self,
curve: &DecodedEntity,
decoder: &mut EntityDecoder<'_>,
start_param: Option<f64>,
end_param: Option<f64>,
) -> Result<Vec<Point3<f64>>>
pub fn get_polyline_points_trimmed( &self, curve: &DecodedEntity, decoder: &mut EntityDecoder<'_>, start_param: Option<f64>, end_param: Option<f64>, ) -> Result<Vec<Point3<f64>>>
Sample an IfcPolyline directrix and trim by parameter range.
IFC parameterises a polyline as [0, N-1] where N is the number of points
and each segment between consecutive points contributes 1.0 to the parameter.
StartParam / EndParam are converted to a fraction of the polyline and
trim_polyline does the actual cutting (linear interpolation between sampled
vertices, which is exact for piecewise-linear input).
Source§impl ProfileProcessor
impl ProfileProcessor
Sourcepub fn set_tessellation_quality(&self, quality: TessellationQuality)
pub fn set_tessellation_quality(&self, quality: TessellationQuality)
Set the tessellation detail for subsequent curve sampling.
process and get_curve_points
set this themselves; call it explicitly before the lower-level samplers
(get_composite_curve_points_trimmed, get_polyline_points_trimmed)
that don’t take a quality argument.
Sourcepub fn process(
&self,
profile: &DecodedEntity,
decoder: &mut EntityDecoder<'_>,
quality: TessellationQuality,
) -> Result<Profile2D>
pub fn process( &self, profile: &DecodedEntity, decoder: &mut EntityDecoder<'_>, quality: TessellationQuality, ) -> Result<Profile2D>
Process any IFC profile definition at the given tessellation quality.
Profile-plane tessellation (the 2D outline that becomes an extruded cap
or an opening cutter) never gets finer above Medium — denser opening
circles only multiply the earcut cap-bridge slivers that show up as scar
lines on plates with bolt holes (issue #976). Below Medium they do get
coarser: circular profiles via
TessellationQuality::circle_profile_segments, and profile arcs/fillets
(rounded rectangles, steel-section root fillets, trimmed conics,
indexed-polycurve arcs) via TessellationQuality::profile_arc_segments.
The quality knob drives the curved 3D surfaces instead — swept paths (via
get_curve_points), cylinders, surfaces of
revolution, NURBS, and brep edges — where faceting is actually visible.
Sourcepub fn get_curve_points(
&self,
curve: &DecodedEntity,
decoder: &mut EntityDecoder<'_>,
quality: TessellationQuality,
) -> Result<Vec<Point3<f64>>>
pub fn get_curve_points( &self, curve: &DecodedEntity, decoder: &mut EntityDecoder<'_>, quality: TessellationQuality, ) -> Result<Vec<Point3<f64>>>
Get 3D points from a curve (for swept disk solid, etc.) at the given
tessellation quality.
Sourcepub fn get_composite_curve_points_trimmed(
&self,
curve: &DecodedEntity,
decoder: &mut EntityDecoder<'_>,
start_param: Option<f64>,
end_param: Option<f64>,
) -> Result<Vec<Point3<f64>>>
pub fn get_composite_curve_points_trimmed( &self, curve: &DecodedEntity, decoder: &mut EntityDecoder<'_>, start_param: Option<f64>, end_param: Option<f64>, ) -> Result<Vec<Point3<f64>>>
Process composite curve into 3D points, honoring IfcSweptDiskSolid’s
StartParam/EndParam. Per IFC, a composite curve is parameterised so
segment i covers [i, i+1]. Segments fully outside [start, end] are
dropped; boundary segments are truncated by linearly interpolating along
their sampled point list (a per-segment normalised parameter).
Non-conformant out-of-range EndParam values (notably Revit, which
emits a cumulative-per-segment parameter that can exceed num_segments)
are clamped to the upper bound of the spec domain — this matches the
authoring tool’s effective intent (render the whole curve) without
guessing at a length-unit interpretation that proved wrong on real
files (see #631 follow-up notes).
Auto Trait Implementations§
impl !Freeze for ProfileProcessor
impl !RefUnwindSafe for ProfileProcessor
impl !Sync for ProfileProcessor
impl Send for ProfileProcessor
impl Unpin for ProfileProcessor
impl UnsafeUnpin for ProfileProcessor
impl UnwindSafe for ProfileProcessor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.