pub struct ModelBounds {
pub min_x: f64,
pub min_y: f64,
pub min_z: f64,
pub max_x: f64,
pub max_y: f64,
pub max_z: f64,
pub sample_count: usize,
}Expand description
Model bounds in f64 precision
Fields§
§min_x: f64Minimum X coordinate found
min_y: f64Minimum Y coordinate found
min_z: f64Minimum Z coordinate found
max_x: f64Maximum X coordinate found
max_y: f64Maximum Y coordinate found
max_z: f64Maximum Z coordinate found
sample_count: usizeNumber of points sampled
Implementations§
Source§impl ModelBounds
impl ModelBounds
Sourcepub fn has_large_coordinates(&self, length_unit_scale: f64) -> bool
pub fn has_large_coordinates(&self, length_unit_scale: f64) -> bool
Check if bounds reach more than crate::limits::LARGE_COORD_THRESHOLD_METERS
(1 km, in METRES; was 10 km before #4934) from the origin.
The sampled values are raw IfcCartesianPoint coordinates in the
file’s length unit, so the caller passes length_unit_scale (file
unit to metres, e.g. 0.001 for millimetres, 1000.0 for kilometres)
and the comparison happens in metres. Gating on the raw values against
a metre-shaped constant let a kilometre-unit model 500 000 km out read
as “500 < 1000” and skip the RTC rebase, and the caller’s scaling
afterwards could not undo a decision already taken.
Sourcepub fn rtc_offset(&self, length_unit_scale: f64) -> Option<RtcVerdict>
pub fn rtc_offset(&self, length_unit_scale: f64) -> Option<RtcVerdict>
The RTC verdict in metres: None when no point was sampled, Large
with the unit-scaled bbox centre when a corner is past the threshold
(see has_large_coordinates), Small
otherwise. The centre can be inside the threshold while a corner is not,
which is why the decision is carried rather than re-derived from it.
Trait Implementations§
Source§impl Clone for ModelBounds
impl Clone for ModelBounds
Source§fn clone(&self) -> ModelBounds
fn clone(&self) -> ModelBounds
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more