From b3dfcf1ff23c362a40f4c6bb9c37e9863e937d7a Mon Sep 17 00:00:00 2001 From: jyviko <2501648+jyviko@users.noreply.github.com> Date: Thu, 29 Oct 2026 01:30:09 -0400 Subject: [PATCH] =?UTF-8?q?Tests:=20an=20engraved=20face's=20letters=20pro?= =?UTF-8?q?ject=20as=20conics,=20their=20exact=20quadratic=20B=C3=A9ziers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit a_face_engraved_with_text_projects_its_letters_exactly_and_extrudes counted the letters' pieces as control-point splines. A TrueType outline's curves are quadratic Béziers, which are parabolic arcs, and the cut made on SMLib keeps them exact: the projection gives 222 conics and 154 lines, no splines. The count now takes conics with the splines. (The cut itself needs SMLib 1a1bebc; with it the test passes.) Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/sketch_project_tests.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/crates/engine/src/cmd/sketch_project_tests.rs b/crates/engine/src/cmd/sketch_project_tests.rs index 66a72de6d..000d36759 100644 --- a/crates/engine/src/cmd/sketch_project_tests.rs +++ b/crates/engine/src/cmd/sketch_project_tests.rs @@ -709,11 +709,18 @@ fn a_face_engraved_with_text_projects_its_letters_exactly_and_extrudes() { assert!(r.error.is_none(), "{r:?}"); let face = before - volume(&mut s); assert!((face - taken).abs() < 1e-6 * before, "{face} {taken}"); - // Its sketch got the letters as Bézier pieces. + // Its sketch got the letters as their exact pieces: the outline's quadratic Béziers, which are + // parabolic arcs, come in as conics (or as control-point splines). let st = s.model.state(); let sketch = &st.sketches.last().unwrap().sketch; - let pieces = - sketch.curves.iter().filter(|c| c.link.is_some() && matches!(c.kind, solidcraft_sketch::CurveKind::Spline { control: true, .. })).count(); + let pieces = sketch + .curves + .iter() + .filter(|c| { + c.link.is_some() + && matches!(c.kind, solidcraft_sketch::CurveKind::Spline { control: true, .. } | solidcraft_sketch::CurveKind::Conic { .. }) + }) + .count(); assert!(pieces > 100, "{pieces}"); }