forked from 1b-agent/opencadstudio-upstream
refactor(snap): widen key_vertices to f64 (world_offset removal P4)
WireModel/LocalWire/BatchEntry key_vertices are now Vec<[f64; 3]>; tessellation keeps them in f64 (no f32 cast at offset subtraction), producers (dimension, leader, multileader) build them from the acadrust f64 source, the block-cache transform keeps f64, and the face3d Face3D quad path splits them into the double-single (high, low) pair. Consumers (snap endpoint/midpoint, xclip) read via f32 at the leaf. Still offset-relative (inert); endpoint/midpoint snap is no longer f32-capped. Co-Authored-By: Claude Opus 4.7 <[email protected]>
This commit is contained in:
1 parent
cd1d3bb619
commit
cca1086696
10 files changed
+54
-40
No files matched your search
+6
-3
@@ -542,7 +542,10 @@ impl Snapper {
|
||||
if !wire.key_vertices.is_empty() {
|
||||
// Use explicit vertices (Line, LwPolyline): every vertex is an endpoint.
|
||||
for &p in &wire.key_vertices {
|
||||
try_pt(Vec3::from(p), SnapType::Endpoint);
|
||||
try_pt(
|
||||
Vec3::new(p[0] as f32, p[1] as f32, p[2] as f32),
|
||||
SnapType::Endpoint,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
// Tessellated curves (Circle, Arc, Ellipse): only arc endpoints.
|
||||
@@ -571,8 +574,8 @@ impl Snapper {
|
||||
}
|
||||
if !wire.key_vertices.is_empty() {
|
||||
for seg in wire.key_vertices.windows(2) {
|
||||
let a = Vec3::from(seg[0]);
|
||||
let b = Vec3::from(seg[1]);
|
||||
let a = Vec3::new(seg[0][0] as f32, seg[0][1] as f32, seg[0][2] as f32);
|
||||
let b = Vec3::new(seg[1][0] as f32, seg[1][1] as f32, seg[1][2] as f32);
|
||||
if a.distance_squared(b) > 1e-12 {
|
||||
try_pt((a + b) * 0.5, SnapType::Midpoint);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user