fix(zoom): include 3D solid meshes in model-space extents
ZOOM EXTENTS / auto-fit derived the drawing bounds from wire AABBs and tessellated key-vertices only. 3D solids (Solid3D/Region/Body) render as meshes with an empty wire path, so they contributed nothing and a drawing containing only solids zoomed to nothing. Fold each mesh's offset-relative XY AABB into the extents on both the wire-cache and tessellate-fallback paths. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
5fa93b9cb0
commit
8eeb155bfe
1 changed files with 19 additions and 0 deletions
|
|
@ -2652,6 +2652,16 @@ impl Scene {
|
|||
any = true;
|
||||
}
|
||||
}
|
||||
// 3D solids render as meshes, not wires, so fold their
|
||||
// XY AABBs in too — otherwise ZOOM EXTENTS ignores them.
|
||||
for set in self.meshes.values() {
|
||||
let [ax, ay, bx, by] = set.world_aabb;
|
||||
if ax.is_finite() && bx.is_finite() {
|
||||
min = min.min(glam::Vec3::new(ax + ox as f32, ay + oy as f32, 0.0));
|
||||
max = max.max(glam::Vec3::new(bx + ox as f32, by + oy as f32, 0.0));
|
||||
any = true;
|
||||
}
|
||||
}
|
||||
return if any { Some((min, max)) } else { None };
|
||||
}
|
||||
}
|
||||
|
|
@ -2690,6 +2700,15 @@ impl Scene {
|
|||
}
|
||||
}
|
||||
}
|
||||
// Same mesh inclusion for the tessellate fallback path.
|
||||
for set in self.meshes.values() {
|
||||
let [ax, ay, bx, by] = set.world_aabb;
|
||||
if ax.is_finite() && bx.is_finite() {
|
||||
min = min.min(glam::Vec3::new(ax + ox as f32, ay + oy as f32, oz));
|
||||
max = max.max(glam::Vec3::new(bx + ox as f32, by + oy as f32, oz));
|
||||
any = true;
|
||||
}
|
||||
}
|
||||
if any {
|
||||
return Some((min, max));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue