Skip to main content

ProfileProcessor

Struct ProfileProcessor 

Source
pub struct ProfileProcessor { /* private fields */ }
Expand description

Profile processor - processes IFC profiles into 2D contours

Implementations§

Source§

impl ProfileProcessor

Source

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.

Source

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

Source

pub fn new(schema: IfcSchema) -> Self

Create new profile processor

Source

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.

Source

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.

Source

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.

Source

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§

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<U> As for U

Source§

fn as_<T>(self) -> T
where T: CastFrom<U>, U: Sized,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. 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
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.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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.