refactor(snap): producers emit f64 snap points (world_offset removal P3)

TruckEntity.snap_pts is now DVec3 and every entity producer builds snap
candidates straight from the acadrust f64 coordinates instead of casting
to f32 first (text, mtext, arc, circle, ellipse, point, shape, solid,
mline, mtext, attribute, tolerance, table, underlay, ole2frame, mesh,
multileader, dimension, block-cache). offset_snap_pts stays f64
throughout. Still offset-relative (inert) — but snap precision is no
longer capped at ~0.5 m by an early f32 cast, which fixes a latent
UTM-scale snap error and sets up the absolute-coordinate switch.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Hakan SevenandClaude Opus 4.7 committed 2026-06-23 22:10:29 +03:00
1 parent a7a1fac09a
commit cd1d3bb619
18 files changed
+43 -85

No files matched your search

+2 -9
View File
@@ -77,17 +77,10 @@ fn to_truck(ml: &MultiLeader, document: &acadrust::CadDocument) -> Option<TruckE
let mut points: Vec<[f64; 3]> = Vec::new();
let mut tangents: Vec<TangentGeom> = Vec::new();
let mut key_verts: Vec<[f64; 3]> = Vec::new();
// This builds a TruckEntity (snap_pts in Vec3); tessellate's
// offset_snap_pts widens it to the f64 WireModel buffer afterwards.
let mut snap_pts: Vec<(Vec3, SnapHint)> = Vec::new();
let mut snap_pts: Vec<(glam::DVec3, SnapHint)> = Vec::new();
let mut first = true;
let node = |arr: [f64; 3]| {
(
Vec3::new(arr[0] as f32, arr[1] as f32, arr[2] as f32),
SnapHint::Node,
)
};
let node = |arr: [f64; 3]| (glam::DVec3::new(arr[0], arr[1], arr[2]), SnapHint::Node);
// Text-side geometry, recomputed every frame so dragging the arrow or the
// text re-mirrors the whole layout. The text block is centred on its grip