feat(f64): command layer compiles on DVec3

Whole command/snap/grip/cursor chain now builds on f64 DVec3 end to end,
so picked points, snaps and grip drags stay precise at UTM-scale
coordinates instead of quantizing to ~0.5 m through f32.

- All ~80 command files migrated: draw (line/circle/arc/ellipse/shapes
  in full f64; others via point methods), modify, annotate, insert, view,
  inquiry, layers, groups, clipboard, layout.
- Entity apply_grip impls updated for GripApply::{Absolute,Translate}(DVec3).
- Construction sites (EntityTransform/CmdResult/DynAnchor) emit DVec3;
  wire-preview boundaries cast to f32 only at the GPU edge.
- Modify/annotate commands keep internal Vec3 geometry where precision is
  non-critical, casting at the DVec3 boundary; key draw commands store f64.

Builds clean (no warnings). Visual verification of crosshair/snap/grip at
extreme UTM zoom pending.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hakan SevenandClaude Opus 4.8 committed 2026-06-24 03:51:50 +03:00
1 parent 3da71698b1
commit 4f7a98a2ad
84 files changed
+358 -336

No files matched your search

+6 -6
View File
@@ -10,7 +10,7 @@
// With 2 pairs: translate + rotate (+ optional uniform scale to fit)
use acadrust::Handle;
use glam::Vec3;
use glam::{DVec3, Vec3};
use crate::command::{CadCommand, CmdResult, EntityTransform};
@@ -74,7 +74,7 @@ impl CadCommand for AlignCommand {
CmdResult::NeedPoint
}
fn on_point(&mut self, pt: Vec3) -> CmdResult {
fn on_point(&mut self, pt: DVec3) -> CmdResult { let pt = pt.as_vec3();
match self.state {
AlignState::Gathering => CmdResult::NeedPoint,
AlignState::Src1 => {
@@ -117,7 +117,7 @@ impl CadCommand for AlignCommand {
let delta = d - s;
CmdResult::TransformSelected(
self.handles.clone(),
EntityTransform::Translate(delta),
EntityTransform::Translate(delta.as_dvec3()),
)
}
_ => CmdResult::Cancel,
@@ -163,7 +163,7 @@ impl AlignCommand {
let delta = d1 - s1;
return CmdResult::TransformSelected(
self.handles.clone(),
EntityTransform::Translate(delta),
EntityTransform::Translate(delta.as_dvec3()),
);
}
@@ -182,8 +182,8 @@ impl AlignCommand {
// Compose via AlignTransform CmdResult
CmdResult::AlignSelected {
handles: self.handles.clone(),
src1: s1,
dst1: d1,
src1: s1.as_dvec3(),
dst1: d1.as_dvec3(),
angle_rad: angle,
scale: scale_factor,
}