From 2f751c08f4feffde6ae141d080b551759b635ff1 Mon Sep 17 00:00:00 2001 From: Hakan Date: Wed, 13 May 2026 10:05:38 +0300 Subject: [PATCH] fix(scene): drop Z gate in fit_all so high-elevation entities show MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/scene/mod.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/scene/mod.rs b/src/scene/mod.rs index cc67dea0b..ed1f8384e 100644 --- a/src/scene/mod.rs +++ b/src/scene/mod.rs @@ -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));