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

+9 -9
View File
@@ -15,7 +15,7 @@ use acadrust::entities::{
};
use acadrust::types::Vector3;
use acadrust::{EntityType, Handle};
use glam::Vec3;
use glam::{DVec3, Vec3};
use truck_modeling::base::{BoundedCurve, Cut};
use crate::command::{CadCommand, CmdResult};
@@ -382,7 +382,7 @@ impl CadCommand for BreakInteractiveCommand {
self.target.is_none()
}
fn on_entity_pick(&mut self, handle: Handle, pt: Vec3) -> CmdResult {
fn on_entity_pick(&mut self, handle: Handle, pt: DVec3) -> CmdResult { let pt = pt.as_vec3();
if handle.is_null() {
return CmdResult::NeedPoint;
}
@@ -391,7 +391,7 @@ impl CadCommand for BreakInteractiveCommand {
CmdResult::NeedPoint
}
fn on_point(&mut self, pt: Vec3) -> CmdResult {
fn on_point(&mut self, pt: DVec3) -> CmdResult { let pt = pt.as_vec3();
let handle = match self.target {
Some(h) => h,
None => return CmdResult::Cancel,
@@ -403,14 +403,14 @@ impl CadCommand for BreakInteractiveCommand {
return CmdResult::NeedPoint;
}
};
CmdResult::BreakEntity { handle, p1, p2: pt }
CmdResult::BreakEntity { handle, p1: p1.as_dvec3(), p2: pt.as_dvec3() }
}
fn on_enter(&mut self) -> CmdResult {
CmdResult::Cancel
}
fn on_mouse_move(&mut self, _pt: Vec3) -> Option<WireModel> {
fn on_mouse_move(&mut self, _pt: DVec3) -> Option<WireModel> {
None
}
}
@@ -444,7 +444,7 @@ impl CadCommand for BreakAtPointCommand {
self.target.is_none()
}
fn on_entity_pick(&mut self, handle: Handle, _pt: Vec3) -> CmdResult {
fn on_entity_pick(&mut self, handle: Handle, _pt: DVec3) -> CmdResult {
if handle.is_null() {
return CmdResult::NeedPoint;
}
@@ -452,12 +452,12 @@ impl CadCommand for BreakAtPointCommand {
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.target {
Some(handle) => CmdResult::BreakEntity {
handle,
p1: pt,
p2: pt,
p1: pt.as_dvec3(),
p2: pt.as_dvec3(),
},
None => CmdResult::Cancel,
}