forked from 1b-agent/opencadstudio-upstream
refactor(scene): remove the world_offset field (P7)
Delete the world_offset field from Scene and DerivedCaches and the load-time assignment; every reader now uses a zero origin. Geometry is absolute and the double-single relative-to-eye pipeline keeps it precise, so the coarse origin is gone. world_offset_from_centers still derives local_extent_max (camera/cull span) but returns no offset. The remaining `world_offset: [f64;3]` function parameters are now always zero — dead plumbing left for a later mechanical sweep; behaviour is unchanged. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
1 parent
b473f6a8cb
commit
ccc933e7b0
8 files changed
+61
-68
No files matched your search
+3
-4
@@ -633,7 +633,6 @@ impl OpenCADStudio {
|
||||
));
|
||||
|
||||
// Caches were built on the background thread inside open_path().
|
||||
self.tabs[i].scene.world_offset = caches.world_offset;
|
||||
self.tabs[i].scene.local_extent_max = caches.local_extent_max;
|
||||
self.tabs[i].scene.hatches = caches.hatches;
|
||||
self.tabs[i].scene.images = caches.images;
|
||||
@@ -2678,7 +2677,7 @@ impl OpenCADStudio {
|
||||
// Paper-space entities use sheet coordinates (no world_offset).
|
||||
// Only add world_offset when converting local → DXF space in model space.
|
||||
let wo_vec = if self.tabs[i].scene.current_layout == "Model" {
|
||||
let wo = self.tabs[i].scene.world_offset;
|
||||
let wo = [0.0_f64; 3];
|
||||
glam::Vec3::new(wo[0] as f32, wo[1] as f32, wo[2] as f32)
|
||||
} else {
|
||||
glam::Vec3::ZERO
|
||||
@@ -2930,7 +2929,7 @@ impl OpenCADStudio {
|
||||
// offset-relative frame the renderer expects (model space
|
||||
// only; paper-space entities use sheet coordinates).
|
||||
let wo_local = if self.tabs[i].scene.current_layout == "Model" {
|
||||
self.tabs[i].scene.world_offset
|
||||
[0.0_f64; 3]
|
||||
} else {
|
||||
[0.0; 3]
|
||||
};
|
||||
@@ -3526,7 +3525,7 @@ impl OpenCADStudio {
|
||||
// TRIM/EXTEND/FILLET pick the wrong side on UTM-scale files.
|
||||
let pick_wcs = {
|
||||
let wo = if self.tabs[i].scene.current_layout == "Model" {
|
||||
self.tabs[i].scene.world_offset
|
||||
[0.0_f64; 3]
|
||||
} else {
|
||||
[0.0; 3]
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user