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 get_directrix_points( &self, directrix: &DecodedEntity, decoder: &mut EntityDecoder<'_>, start_param: Option<f64>, end_param: Option<f64>, quality: TessellationQuality, ) -> Result<Vec<Point3<f64>>>

Sample a swept solid’s directrix in 3D over the solid’s [StartParam, EndParam], in the directrix’s own IFC parametrisation:

  • IfcCompositeCurve: the running sum of each segment’s parameter span (see Self::get_composite_curve_points_trimmed).
  • IfcPolyline: point index, [0, N-1].
  • IfcLine: P(u) = Pnt + u·V.
  • IfcCircle / IfcEllipse: angle in the project’s plane-angle unit.

Any other directrix (an IfcTrimmedCurve carries its own Trim1/Trim2, so a redundant solid-level range is a no-op; a spline’s knot-based parameter is not supported) is sampled whole.

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 a swept solid’s StartParam/EndParam. Per ISO 10303-42 a composite curve’s parameter is the running sum of its segments’ parameter spans, each span that of the segment’s ParentCurve (crate::analytic reads it: N - 1 for a polyline, the trimmed length in IfcVector units for a trimmed line, the swept angle in plane-angle units for a trimmed circle). A Tekla U-bar’s EndParam is exactly that sum; reading each segment as a unit interval instead swept the wrong extent for any partial range (#5566).

Segments fully outside [start, end] are dropped; boundary segments are truncated by linearly interpolating along their sampled point list, which is exact in each supported parent’s parameter (a polyline is sampled at its vertices, an arc uniformly in angle). An out-of-range bound clamps to the curve’s domain. When any segment’s parametrisation is unsupported the composite has no well-defined parameter and is sampled whole.

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.

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
§

impl<U> As for U

§

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

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

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

Initializes a with the given initializer. Read more
§

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

Dereferences the given pointer. Read more
§

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

Mutably dereferences the given pointer. Read more
§

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
§

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

§

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

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

fn is_in_subset(&self) -> bool

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

fn to_subset_unchecked(&self) -> SS

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

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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more