From 567b764b93df4813c02e937c73bd0b8e014d697c Mon Sep 17 00:00:00 2001 From: jyviko <2501648+jyviko@users.noreply.github.com> Date: Thu, 29 Oct 2026 15:23:18 -0400 Subject: [PATCH] Viewport tests: the offset ellipse ring's 512 wall joins are all smooth SMLib now sweeps a curve within the tolerance of a circle as itself, not as that circle's cylinder (tangency-labs/smlib#31, 3cfbbdd), so the offset curves' pieces meet with one curvature at every wall join of the ring (the largest curvature jump 4.2e-7): all 512 are smooth, where 400 were and the other 112 jumped by 0.9-3.6%. The comments that said the pieces meet only tangentially, or at small real creases, go. Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/viewport.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/ui-egui/src/viewport.rs b/crates/ui-egui/src/viewport.rs index 4a59d6adf..a59485328 100644 --- a/crates/ui-egui/src/viewport.rs +++ b/crates/ui-egui/src/viewport.rs @@ -8567,10 +8567,10 @@ mod tests { let b = st.bodies.first().unwrap(); let mesh = b.mesh(); assert_eq!(mesh.edges.len(), 1536); - // Of the 512 wall joins, the offset curves' pieces meet with one curvature at 400; at the - // other 112 the curvature jumps by 0.9-3.6% (the offsets' pieces meet only tangentially) - // and the join is drawn. - assert_eq!(mesh.smooth_edges.iter().filter(|f| **f).count(), 400); + // SMLib sweeps each piece of the offset curves as itself (none is taken for a circle + // near it), so the pieces meet with one curvature at all 512 wall joins (the largest + // curvature jump 4.2e-7) and no join is drawn. + assert_eq!(mesh.smooth_edges.iter().filter(|f| **f).count(), 512); let smooth = mesh.smooth_edges.iter().position(|f| *f).unwrap(); let expected = mesh.edges.iter().enumerate().filter(|(i, _)| mesh.shaded_edge_visible(*i)).map(|(_, e)| e.len() - 1).sum::(); let shaded = build_scene(&app).merged(); @@ -8578,8 +8578,8 @@ mod tests { assert!(!shaded.tris.is_empty()); app.ui.visual_style = 2; let wire = build_scene(&app).merged(); - // The wireframe draws every edge but seams, and a seam measured as a crease (the offset - // ellipse's pieces meet at small real creases) is no seam. + // The wireframe draws every edge but seams, the smooth wall joins among them: they are + // edges between faces, hidden only when shaded. let expected_wire = mesh.edges.iter().enumerate().filter(|(i, _)| mesh.edge_visible(*i)).map(|(_, e)| e.len() - 1).sum::(); assert_eq!(wire.lines.len() / crate::gpu::LINE_SIZE, expected_wire); assert!(expected_wire > expected);