forked from 1b-agent/opencadstudio-upstream
fix(scene): drop Z gate in fit_all so high-elevation entities show
Civil 3D files can legitimately carry profile geometry at huge Z (10^6+ units) inside an otherwise small XY footprint — long-section polylines on a road, for example. fit_all's outlier gate previously filtered any point whose |x|, |y|, or |z| exceeded 10× the header extent half-size, which dropped those polylines and made ZOOM EXTENTS center on the main drawing only, leaving the profile geometry permanently invisible. The gate exists to reject origin-stuck entities and Ray/XLine far points, both of which manifest as large XY excursions after world_offset subtraction. Z-axis outliers are not a known garbage pattern, so the gate now only checks XY. Co-Authored-By: Claude Opus 4.7 <[email protected]>
This commit is contained in:
1 parent
b2588e1790
commit
2f751c08f4
1 file changed
+6
-4
+6
-4
@@ -3274,16 +3274,18 @@ impl Scene {
|
||||
|
||||
let mut min = glam::Vec3::splat(f32::MAX);
|
||||
let mut max = glam::Vec3::splat(f32::MIN);
|
||||
// Reject points beyond 10× the drawing's EXTMIN→EXTMAX half-size.
|
||||
// These come from origin-stuck entities (y ≈ -world_offset.y after subtraction),
|
||||
// Ray/XLine far-points with bad direction vectors, or corrupt coordinates.
|
||||
// Reject XY points beyond 10× the drawing's EXTMIN→EXTMAX half-size.
|
||||
// These come from origin-stuck entities (y ≈ -world_offset.y after subtraction)
|
||||
// or Ray/XLine far-points with bad direction vectors. The gate is XY-only:
|
||||
// Civil 3D files can legitimately carry profile geometry at huge Z (10^6+
|
||||
// units) inside an otherwise small XY footprint, and gating on Z hides them.
|
||||
let lim = self.local_extent_max;
|
||||
for wire in &wires {
|
||||
for &[x, y, z] in &wire.points {
|
||||
if !x.is_finite() || !y.is_finite() || !z.is_finite() {
|
||||
continue;
|
||||
}
|
||||
if x.abs() > lim || y.abs() > lim || z.abs() > lim {
|
||||
if x.abs() > lim || y.abs() > lim {
|
||||
continue;
|
||||
}
|
||||
min = min.min(glam::Vec3::new(x, y, z));
|
||||
|
||||
Reference in new issue
Block a user