cad-editor/src/modules/draw
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Hakan Seven d0cc3284d2 refactor(modify): take plane geometry from cadkernel
TRIM, FILLET and EXPLODE each carried their own copy of the same plane
maths. The copies had already drifted apart: `ll` differed only in
parameter names between trim.rs and fillet.rs, `arc_pts` only in which
angle helper it called, and `norm` meant angle normalisation in trim.rs
and explode.rs while meaning vector normalisation in two other files.

The implementations now live in cadkernel's geom2d. A new local `geom`
module adapts the call shapes — the kernel takes `[f64; 2]` points and
returns `[f64; 3]`, while these commands pass loose scalars and feed
`WireModel::points`, which is `[f32; 3]`. Narrowing stays on this side
because only the caller knows whether it is a preview wire, which leaves
`points_low` empty and accepts the loss, or resident geometry, which
splits the f64 into a high/low pair instead.

Call sites are untouched: the kernel functions are imported under the old
local names, so the signatures they were written against still hold.

This also fixes ELLIPSE trim and extend previews. `ellipse_pts` wrote its
components as [x, z, y] while `arc_pts` — reached from the same match in
`entity_pts`, feeding the same `[f32; 3]` — wrote [x, y, z], and
`WireModel::points` is documented as world-space positions. Ellipse
previews were collapsing onto y = 0 and displacing along Z. The kernel's
`ellipse_arc` orders them correctly, so delegating corrects it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-08 15:27:45 +03:00
..
clipboard feat(locale): localize full interface 2026-08-02 22:09:25 +03:00
draw feat(units): read back every form the drawing writes 2026-08-07 23:46:49 +03:00
groups feat(locale): localize full interface 2026-08-02 22:09:25 +03:00
inquiry feat(ucs): integrate coordinate systems 2026-08-04 23:17:54 +03:00
layers feat(layers): add LAYTRANS to translate layers onto a standard 2026-08-07 16:51:15 +03:00
modify refactor(modify): take plane geometry from cadkernel 2026-08-08 15:27:45 +03:00
properties feat(locale): localize full interface 2026-08-02 22:09:25 +03:00
changelog.rs refactor(modules): rename home module to draw, restore first-tab order 2026-06-16 11:49:14 +03:00
defaults.rs refactor(precision): widen command transform scalars and defaults to f64 (#311) 2026-07-12 00:34:38 +03:00
donate.rs refactor(modules): rename home module to draw, restore first-tab order 2026-06-16 11:49:14 +03:00
fence.rs feat(select): offer the selection modes at "Select objects" 2026-08-07 13:32:11 +03:00
mod.rs fix(units): make the units selector reach what it names 2026-08-07 19:59:09 +03:00
report.rs refactor(modules): rename home module to draw, restore first-tab order 2026-06-16 11:49:14 +03:00
select.rs feat(select): offer the selection modes at "Select objects" 2026-08-07 13:32:11 +03:00
units.rs fix(units): make the units selector reach what it names 2026-08-07 19:59:09 +03:00