forked from 1b-agent/opencadstudio-upstream
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 <[email protected]>
This commit is contained in:
1 parent
051272ad71
commit
d0cc3284d2
6 files changed
+152
-272
No files matched your search
Generated
+1
-1
@@ -946,7 +946,7 @@ checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04"
|
||||
[[package]]
|
||||
name = "cadkernel"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/HakanSeven12/cadkernel.git#53e15eccfb5c476a04c49cbea2809c5c4e13b691"
|
||||
source = "git+https://github.com/HakanSeven12/cadkernel.git#0e4b23845de75242e00f016feed9fc2341b4a85a"
|
||||
|
||||
[[package]]
|
||||
name = "calloop"
|
||||
|
||||
Reference in new issue
Block a user