Skip to main content

MeshFrame

Enum MeshFrame 

Source
pub enum MeshFrame {
    SiteLocal {
        placement: [f64; 16],
    },
    ModelRtc {
        anchor: (f64, f64, f64),
    },
    RawIfc,
}
Expand description

The frame a pipeline meshes into: the translation it subtracts and, in the site tier, the rotation it removes.

Both pipelines build it with MeshFrame::select. The offset, the rotation, the needs-shift bit and the wire tag are read off the one value, so they cannot disagree with each other.

Variants§

§

SiteLocal

IfcSite has a non-identity translation: subtract it. Vertices land relative to the site origin, small floats in a relatable frame. The native pipeline also removes the site rotation (convert_mesh_to_site_local) for this tier.

Carries the whole site placement (column-major 4x4, metres), not just the translation it subtracts, so the frame describes BOTH halves of what the bake did: a baked point is Rᵀ · (P − t). A consumer that has to land in the same frame — the symbolic stream the server ships beside these meshes (#4706) — reads the rotation through MeshFrame::rotate_into_frame instead of fetching the site placement itself and re-deriving the tier rule.

Fields

§placement: [f64; 16]
§

ModelRtc

IfcSite is identity or missing but the sampled geometry lives at large world coordinates: subtract the detected anchor so f32 keeps its precision. No rotation is removed.

Fields

§anchor: (f64, f64, f64)
§

RawIfc

Neither anchor applies: subtract nothing.

Implementations§

Source§

impl MeshFrame

Source

pub fn select( site_placement: Option<&[f64]>, detected: Option<RtcVerdict>, ) -> Self

The three-tier selection.

  • site_placement: the IfcSite placement as a column-major 4x4 in metres (GeometryRouter::resolve_scaled_placement), None when the pipeline has no site tier (the browser pre-pass and the appearance authoring path mesh in world axes and pass None deliberately: see stream_meta::resolve_stream_meta). A matrix with fewer than 16 elements is not a placement this can read, so it falls through to the detector rather than indexing past its end.
  • detected: the RTC detector’s verdict (see GeometryRouter::detect_rtc_offset_for_file). A Large verdict is honoured whatever its anchor’s own magnitude: the placement-bounds fallback decides on the bbox corners and anchors on the centre, which can be inside 10 km while the coordinates are not. Only an anchor at the origin (nothing to subtract) falls through to RawIfc.
Source

pub fn for_overlay( router: &GeometryRouter, content: &[u8], decoder: &mut EntityDecoder<'_>, ) -> Self

Frame for file-parsing consumers: grid/alignment overlays and the browser symbolic stream (#4665). It uses the same file-scoped sample window as the browser meshes, so their anchors agree (#4611).

NOT for a consumer that ran the native pipeline over the same bytes: there is a site tier there, and this has none, so the two frames disagree on every translated IfcSite. Such a caller passes the frame its meshes were baked in (ProcessingResult::frame, #4706).

Also NOT guaranteed to match the STREAMING browser pre-pass, which samples only the indexed head when it emits mid-scan. A model whose head does not represent its tail can therefore differ; closing that requires handing the emitted frame to the overlay APIs (#4611).

Source

pub fn rtc_offset(self) -> (f64, f64, f64)

The translation the router subtracts from every world vertex before the f32 cast; (0,0,0) for MeshFrame::RawIfc.

Source

pub fn rotate_into_frame(self, v: [f64; 3]) -> [f64; 3]

An IFC world DIRECTION expressed in this frame’s own axes: Rᵀ · v.

The other half of the frame, beside MeshFrame::rtc_offset. A world POINT lands at rotate_into_frame(p − rtc_offset), which is exactly what processor::site_local::convert_mesh_to_site_local bakes into the vertices for the MeshFrame::SiteLocal tier — same Rᵀ, and applied under the same [rotation_is_identity] condition, so a consumer that re-bases with this cannot disagree with the meshes.

The identity for MeshFrame::ModelRtc and MeshFrame::RawIfc: neither tier removes a rotation.

Source

pub fn needs_shift(self) -> bool

True when the frame subtracts anything at all.

Source

pub fn coordinate_space(self) -> MeshCoordinateSpace

The wire tag for this frame.

Trait Implementations§

Source§

impl Clone for MeshFrame

Source§

fn clone(&self) -> MeshFrame

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for MeshFrame

Source§

impl Debug for MeshFrame

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for MeshFrame

Source§

fn eq(&self, other: &MeshFrame) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for MeshFrame

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

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
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<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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

impl<T> WithSubscriber for T

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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