From e0545b2bda0ef203c1ce681093db2d6391da47c2 Mon Sep 17 00:00:00 2001 From: jyviko <2501648+jyviko@users.noreply.github.com> Date: Wed, 28 Oct 2026 22:11:05 -0400 Subject: [PATCH] Measure: an arc edge's angle is its span on the circle, not its NURBS parameter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit edge_circle took a circle edge's interval as its angle. A circle SMLib holds on its NURBS form is parameterised on that form (a fillet's quarter circle over 0..1), so the fillet's edge measured 57.3° and an arc length of R·1 (a_fillet_edge_is_an_arc). The span is the edge's curve_interval, the angles of its ends on the circle, as the lip already reads it. Co-Authored-By: Claude Opus 5.5 --- crates/kernel/src/surface_kind.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/kernel/src/surface_kind.rs b/crates/kernel/src/surface_kind.rs index d0105ca49..94e65c7ac 100644 --- a/crates/kernel/src/surface_kind.rs +++ b/crates/kernel/src/surface_kind.rs @@ -87,11 +87,12 @@ pub fn edge_circle(b: &Body, edge: usize) -> Option { let [t0, t1] = e.interval; let (start, end) = (c.point(t0)?, c.point(t1)?); if let Curve::Circle { frame, radius } = &e.curve { - // The record's parameter is the angle about the frame's z: the edge runs counter-clockwise - // about it from its start to its end. + // The edge runs counter-clockwise about the frame's z from its start to its end, over the + // angles of its interval on the circle itself (a NURBS form is parameterised otherwise). let axis = Vec3::from(frame.x_axis).cross(Vec3::from(frame.y_axis)).unit()?; let closed = e.vertices[0] == e.vertices[1]; - let angle = if closed { std::f64::consts::TAU } else { (t1 - t0).min(std::f64::consts::TAU) }; + let [a0, a1] = e.curve_interval()?; + let angle = if closed { std::f64::consts::TAU } else { (a1 - a0).min(std::f64::consts::TAU) }; return Some(EdgeCircle { center: Vec3::from(frame.origin), axis, radius: *radius, start, end, angle }); } let tol = (b.size() * 1e-7).max(1e-9) * 100.0;