refactor(precision): widen command transform scalars and defaults to f64 (#311)

Completes the f64 migration on the CPU data path: the only f32 left now
is the GPU/render/screen layer, which is architecturally required (wgpu
vertex buffers and iced are f32; f64 vertices would double memory).

- EntityTransform::Rotate.angle_rad and Scale.factor are now f64 (the
  transform was already applied in f64 around the DVec3 center, so this
  only preserves the typed angle/factor). apply_standard_transform and
  apply_standard_scale take f64.
- CmdResult::ExtrudeEntity.height and AlignSelected.{angle_rad,scale}
  are f64; the EXTRUDE height parses as f64.
- defaults.rs (last-used construction values: circle radius/diameter,
  rotate angle, scale factor, offset/fillet/chamfer distance, array
  spacing/counts/angle) moved from Cell<f32> to Cell<f64>. Array counts
  round-trip through u32 (exact below 2^53).
- Consumers in circle/array/fillet/offset/rotate/scale/align/solid3d and
  dimension.rs rotate_point/scale_point follow. `as f32` is kept only
  where a value feeds a WireModel rubber-band/ghost (the preview path is
  screen-space f32).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Opus 4.8 committed 2026-07-12 00:34:38 +03:00
1 parent 553b91015f
commit 62bd360e46
12 files changed
+100 -102

No files matched your search

+5 -5
View File
@@ -28,9 +28,9 @@ pub enum EntityTransform {
/// Move every point by the given world-space delta (world XY plane).
Translate(DVec3),
/// Rotate around `center` by `angle_rad` in the world XY plane.
Rotate { center: DVec3, angle_rad: f32 },
Rotate { center: DVec3, angle_rad: f64 },
/// Uniform scale from `center` by `factor`.
Scale { center: DVec3, factor: f32 },
Scale { center: DVec3, factor: f64 },
/// Mirror across the line through `p1`→`p2` in the world XY plane.
Mirror { p1: DVec3, p2: DVec3 },
}
@@ -236,8 +236,8 @@ pub enum CmdResult {
handles: Vec<Handle>,
src1: DVec3,
dst1: DVec3,
angle_rad: f32,
scale: f32,
angle_rad: f64,
scale: f64,
},
/// Set the plot window on the active layout's PlotSettings.
SetPlotWindow { p1: DVec3, p2: DVec3 },
@@ -291,7 +291,7 @@ pub enum CmdResult {
/// Extrude the profile entity `handle` by `height` along Z.
ExtrudeEntity {
handle: Handle,
height: f32,
height: f64,
color: [f32; 4],
},
/// Revolve the profile entity `handle` around the given axis by `angle_deg`.