From f6fb1af003d704a1c10123cd65302489c27a9402 Mon Sep 17 00:00:00 2001 From: jyviko <2501648+jyviko@users.noreply.github.com> Date: Thu, 22 Oct 2026 00:58:54 -0400 Subject: [PATCH] kernel: an arc's knots built without a borrowed temporary (not built: base in progress) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_017itGh5fpMEousnZ91cYcVt --- crates/kernel/src/freeform.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/crates/kernel/src/freeform.rs b/crates/kernel/src/freeform.rs index 89114d1a6..1f1f496b2 100644 --- a/crates/kernel/src/freeform.rs +++ b/crates/kernel/src/freeform.rs @@ -45,7 +45,11 @@ fn net(s: &Seg2) -> Result<(Vec, Vec, Vec)> { pts.push(at(a0 + d, radius)); weights.push(1.0); let u = (j + 1) as f64 / m as f64; - knots.extend(if j + 1 < m { [u, u].as_slice() } else { [1.0, 1.0, 1.0].as_slice() }); + if j + 1 < m { + knots.extend([u, u]); + } else { + knots.extend([1.0; 3]); + } } (pts, weights, knots) } @@ -95,6 +99,7 @@ pub(crate) fn segment(plane: &Plane, s: &Seg2) -> Result<(Curve, Curve2)> { [x * h, y * h, z * h, *h] }) .collect(); - let pcurve = Curve2::RationalSpline { knots: knots.clone(), homogeneous: pts.iter().zip(&weights).map(|(q, h)| [q.x * h, q.y * h, *h]).collect() }; + let pcurve = + Curve2::RationalSpline { knots: knots.clone(), homogeneous: pts.iter().zip(&weights).map(|(q, h)| [q.x * h, q.y * h, *h]).collect() }; Ok((Curve::RationalSpline { knots, homogeneous }, pcurve)) }