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.
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.
RawIfc
Neither anchor applies: subtract nothing.
Implementations§
Source§impl MeshFrame
impl MeshFrame
Sourcepub fn select(
site_placement: Option<&[f64]>,
detected: Option<RtcVerdict>,
) -> Self
pub fn select( site_placement: Option<&[f64]>, detected: Option<RtcVerdict>, ) -> Self
The three-tier selection.
site_placement: theIfcSiteplacement as a column-major 4x4 in metres (GeometryRouter::resolve_scaled_placement),Nonewhen the pipeline has no site tier (the browser pre-pass and the appearance authoring path mesh in world axes and passNonedeliberately: seestream_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 (seeGeometryRouter::detect_rtc_offset_for_file). ALargeverdict 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 toRawIfc.
Sourcepub fn for_overlay(
router: &GeometryRouter,
content: &[u8],
decoder: &mut EntityDecoder<'_>,
) -> Self
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).
Sourcepub fn rtc_offset(self) -> (f64, f64, f64)
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.
Sourcepub fn rotate_into_frame(self, v: [f64; 3]) -> [f64; 3]
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.
Sourcepub fn needs_shift(self) -> bool
pub fn needs_shift(self) -> bool
True when the frame subtracts anything at all.
Sourcepub fn coordinate_space(self) -> MeshCoordinateSpace
pub fn coordinate_space(self) -> MeshCoordinateSpace
The wire tag for this frame.
Trait Implementations§
impl Copy for MeshFrame
impl StructuralPartialEq for MeshFrame
Auto Trait Implementations§
impl Freeze for MeshFrame
impl RefUnwindSafe for MeshFrame
impl Send for MeshFrame
impl Sync for MeshFrame
impl Unpin for MeshFrame
impl UnsafeUnpin for MeshFrame
impl UnwindSafe for MeshFrame
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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
impl<T> Scalar 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.