fix(commands): finish the world-XY coordinate migration (#54)

The drawing plane is world XY, but break, join, rectangular array, the
stretch/window move, the spline preview wire and several doc comments
still used the stale "Y-up XZ" mapping (world Z = DXF Y). That made
those commands operate against a constant-elevation axis: arc/circle/
line/spline break and join picked the wrong points, rectangular array
stepped rows along the Z (elevation) axis, window-stretch tested the
wrong window bound, and the spline wire drew in the wrong plane.

Map every drawing-plane coordinate through .y (elevation on .z),
matching the entity builders, the inquiry commands and the central
transform. Stale Y-up comments updated to avoid future confusion.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hakan SevenandClaude Opus 4.8 committed 2026-06-04 10:39:43 +03:00
1 parent c04bdcf846
commit c7a7f2f742
9 files changed
+35 -34

No files matched your search

+3 -3
View File
@@ -92,13 +92,13 @@ pub fn join_entities(entities: &[(Handle, &EntityType)]) -> Option<(Vec<Handle>,
}
fn try_join_lines(lines: &[&(Handle, &EntityType)]) -> Option<(Vec<Handle>, Vec<EntityType>)> {
// Collect endpoints in XZ plane
// Collect endpoints in the world XY plane
let segs: Vec<_> = lines
.iter()
.map(|(h, e)| {
if let EntityType::Line(l) = e {
let s = Vec3::new(l.start.x as f32, l.start.z as f32, 0.0);
let e2 = Vec3::new(l.end.x as f32, l.end.z as f32, 0.0);
let s = Vec3::new(l.start.x as f32, l.start.y as f32, 0.0);
let e2 = Vec3::new(l.end.x as f32, l.end.y as f32, 0.0);
(*h, l, s, e2)
} else {
unreachable!()