From ac70662d636578781380decaa1bcb4f8955cf36a Mon Sep 17 00:00:00 2001 From: jyviko <2501648+jyviko@users.noreply.github.com> Date: Thu, 29 Oct 2026 00:34:55 -0400 Subject: [PATCH] Sweeps: a path through a drawn 3D arc follows the arc, not a spline through its three points MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit path_points took any wire with three or more fit points as a fitted spline, and a 3D arc keeps its start, through and end points as its fit: the pipe along a quarter arc of radius 20 ran along the cubic through those three points and came out 388.06 mm³, not π·2²·10π = 394.78. A wire with its exact arc (Wire::arc) now goes to the kernel as that circle, from its start counter-clockwise about its normal through its sweep (kernel::curve_path of the record circle). Co-Authored-By: Claude Opus 5.5 --- crates/doc/src/eval.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/doc/src/eval.rs b/crates/doc/src/eval.rs index 0ea238841..289dab12a 100644 --- a/crates/doc/src/eval.rs +++ b/crates/doc/src/eval.rs @@ -5118,6 +5118,15 @@ fn path_points(ps: &SolvedSketch, ids: &[String], start: Vec3) -> Result { + let x = (arc.start - arc.center).normalized().ok_or_else(|| DocError::Invalid("a 3D arc of no radius".into()))?; + let y = arc.normal.cross(x); + let frame = solidcraft_geom::brep::Frame { origin: arc.center.into(), x_axis: x.into(), y_axis: y.into() }; + let circle = solidcraft_geom::brep::Curve::Circle { frame, radius: arc.radius }; + kernel::PathPiece::Segs(kernel::curve_path(&circle, [0.0, solidcraft_sketch::arc_sweep(arc)])?) + } Some(w) if w.fit.len() >= 3 => kernel::PathPiece::Spline { fit: w.fit.clone(), reversed: false }, Some(w) if !w.exact.is_empty() => { let mut segs = Vec::new();