From 1bc8b204f13d9fa056c86eed0b04d2b8fca5c133 Mon Sep 17 00:00:00 2001 From: jyviko <2501648+jyviko@users.noreply.github.com> Date: Thu, 29 Oct 2026 22:25:14 -0400 Subject: [PATCH 1/9] Kernel tests: a circle is one closed arc, a round wall one face MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since 09c979a4b a full circle in a profile is one arc of a whole turn, so what is built from it is one closed edge and one wall closed along its seam. Five kernel tests still expected truck's halves: - a_small_hole_in_a_large_spline_face_cuts_cleanly: the Ø1 hole adds one face (its wall), not two; the removed volume (π · 0.25 · 40) is unchanged. - fit_loop (two mesh_convert tests): a fitted circle is Loop2::circle, one segment. - tight_bend_counts: a Ø10 tube swept up 20, round a quarter turn of radius 5, along 20. The circle starts at (5, 0), which runs up to (5, 0, 20) on the bend's axis, where the turn leaves it: the bend face has no seam and both straights' seams end there. By the ladder's rule (each whole curve once, each seam): 5 faces (2 caps, one per path segment), 6 edges (4 circles, 2 seams), 3 vertices (the seams' ends: (5,0,0), (5,0,20), (25,0,20)), the record's own counts. - extruded_circles_go_as_cylinders: the record holds the wall as the cylinder it is (one face of three), no longer a rational spline; it still goes into SMLib as its cylinder. Co-Authored-By: Claude Opus 5.5 --- crates/kernel/src/issue_1038_tests.rs | 6 +++--- crates/kernel/src/mesh_convert.rs | 6 ++++-- crates/kernel/src/native/smlib_import_tests.rs | 6 ++++-- crates/kernel/src/tests.rs | 7 ++++++- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/crates/kernel/src/issue_1038_tests.rs b/crates/kernel/src/issue_1038_tests.rs index b8d22f48d..5f944df39 100644 --- a/crates/kernel/src/issue_1038_tests.rs +++ b/crates/kernel/src/issue_1038_tests.rs @@ -34,9 +34,9 @@ fn intersection_curves(body: &Body) -> Vec { fn a_small_hole_in_a_large_spline_face_cuts_cleanly() { let (block, cut) = holed(); assert!(cut.validity().is_empty(), "{:?}", cut.validity()); - // The hole adds its wall (two half cylinders) and splits nothing: the bottom and the wave - // each gain a loop. - assert_eq!(cut.face_count(), block.face_count() + 2); + // The hole adds its wall (one cylinder, closed along its seam) and splits nothing: the + // bottom and the wave each gain a loop. + assert_eq!(cut.face_count(), block.face_count() + 1); let curves = intersection_curves(&cut); assert!(!curves.is_empty(), "the hole's rim on the wave is an intersection edge"); // The wave is within a few tenths of a millimetre of flat across a Ø1 hole, so the hole diff --git a/crates/kernel/src/mesh_convert.rs b/crates/kernel/src/mesh_convert.rs index e5cf84141..2ddbed539 100644 --- a/crates/kernel/src/mesh_convert.rs +++ b/crates/kernel/src/mesh_convert.rs @@ -478,7 +478,8 @@ mod tests { }) .collect(); assert_eq!(fit_loop(&points, 0.001, 1e-6).segs.len(), 16); - assert_eq!(fit_loop(&points, 0.2, 1e-6).segs.len(), 2); + // A circle is one closed arc. + assert_eq!(fit_loop(&points, 0.2, 1e-6).segs.len(), 1); } #[test] @@ -549,7 +550,8 @@ mod tests { .collect(); let inner = Loop2::polygon(&points); let fitted = fit_loop(&points, 0.05, 1e-6); - assert_eq!(fitted.segs.len(), 2); + // Fitted as a circle: one closed arc. + assert_eq!(fitted.segs.len(), 1); assert!(certify_nesting(&[outer.clone(), inner], &[outer, fitted], 1e-6, 3.).is_err()); } diff --git a/crates/kernel/src/native/smlib_import_tests.rs b/crates/kernel/src/native/smlib_import_tests.rs index d1f558543..c71e1732d 100644 --- a/crates/kernel/src/native/smlib_import_tests.rs +++ b/crates/kernel/src/native/smlib_import_tests.rs @@ -62,13 +62,15 @@ fn smlib_results_go_back_into_smlib() { } /// Extruded circles go into SMLib as its cylinder, so a boolean with one intersects a plane with -/// a cylinder, not with a spline. +/// a cylinder, not with a spline. The record holds the wall as the cylinder it is (one face, +/// closed along its seam). #[test] fn extruded_circles_go_as_cylinders() { use solidcraft_smlib::flat; let body = cylinder(v(0., 50., -60.), v(0., 0., 1.), 40.0, 120.0).unwrap(); let record = super::brep_record(&body).unwrap(); - assert!(record.faces.iter().any(|f| matches!(f.surface, solidcraft_geom::brep::Surface::RationalSpline { .. }))); + let walls = record.faces.iter().filter(|f| matches!(f.surface, solidcraft_geom::brep::Surface::Cylinder { .. })).count(); + assert_eq!((walls, record.faces.len()), (1, 3)); let arrays = solidcraft_smlib::import::arrays(&record, true).unwrap(); let kinds = &arrays.ints[&flat::FACE_SURFACE_TYPE]; assert!(kinds.iter().all(|k| *k == i64::from(flat::SURFACE_PLANE) || *k == i64::from(flat::SURFACE_CYLINDER)), "{kinds:?}"); diff --git a/crates/kernel/src/tests.rs b/crates/kernel/src/tests.rs index d3387b1b3..41b32ae2b 100644 --- a/crates/kernel/src/tests.rs +++ b/crates/kernel/src/tests.rs @@ -2327,7 +2327,11 @@ fn tight_bend_counts() { ]; let b = sweep(&Plane::XY, ®ion, &path).unwrap(); let m = measure(&b).unwrap().merged; - assert_eq!((m.faces, m.edges, m.vertices), (5, 6, 4), "{m:?}"); + // Two caps and a face per path segment. The circle starts (one closed arc) at (5, 0), which + // runs up the first straight to (5, 0, 20) on the bend's axis: the turn leaves it there, so + // the bend has no seam, and the second straight's seam runs on from it to (25, 0, 20). Edges: + // the four circles and the two straights' seams; vertices: the seams' ends. + assert_eq!((m.faces, m.edges, m.vertices), (5, 6, 3), "{m:?}"); } #[test] @@ -2752,3 +2756,4 @@ fn a_box_cut_round_a_small_hole_of_a_long_plate_keeps_the_hole() { } } } + From add3ebdb0316c2eb4f1da3c07ec5bd77cec5c4b4 Mon Sep 17 00:00:00 2001 From: jyviko <2501648+jyviko@users.noreply.github.com> Date: Thu, 29 Oct 2026 22:25:14 -0400 Subject: [PATCH 2/9] Kernel: the box-and-fillet wire records are SMLib's box_and_fillet_have_stable_wire_records compared the encoding of a box and a filleted box with records truck built (2f4d6acac). Since f11c0c571 an operation's result is the record SMLib gives, which numbers the box's faces in its own order and the fillet's edges by its history, so the golden differed in face order, face sources and edge history, not in the encoding. Rewritten with NATIVE_BREP_BLESS=1 and checked against the geometry: the box 6 planes, 12 edges, 8 vertices, each face source's plane its face's; the filleted box 7 faces, 15 edges, 10 vertices (one edge replaced by a face: +1, +3, +2), the round a cylinder of radius 2 along x on the axis (y, z) = (2, 8), 2 from y = 0 and z = 10. Co-Authored-By: Claude Opus 5.5 --- .../src/native/fixtures/box-fillet-v5.json | 4520 ++++++++--------- 1 file changed, 2162 insertions(+), 2358 deletions(-) diff --git a/crates/kernel/src/native/fixtures/box-fillet-v5.json b/crates/kernel/src/native/fixtures/box-fillet-v5.json index 573633d7a..3ca39e625 100644 --- a/crates/kernel/src/native/fixtures/box-fillet-v5.json +++ b/crates/kernel/src/native/fixtures/box-fillet-v5.json @@ -6,69 +6,23 @@ "face_sources": [ { "axis": 2, - "high": false, - "kind": "box_face", - "plane": { - "origin": [ - 0.0, - 0.0, - 0.0 - ], - "x_axis": [ - 1.0, - 0.0, - 0.0 - ], - "y_axis": [ - -0.0, - -1.0, - -0.0 - ] - }, - "producer": null - }, - { - "axis": 1, - "high": false, - "kind": "box_face", - "plane": { - "origin": [ - 0.0, - 0.0, - 0.0 - ], - "x_axis": [ - 1.0, - 0.0, - 0.0 - ], - "y_axis": [ - 0.0, - 0.0, - 1.0 - ] - }, - "producer": null - }, - { - "axis": 0, "high": true, "kind": "box_face", "plane": { "origin": [ - 40.0, 0.0, - 0.0 + 0.0, + 10.0 ], "x_axis": [ - 0.0, 1.0, + 0.0, 0.0 ], "y_axis": [ 0.0, - 0.0, - 1.0 + 1.0, + 0.0 ] }, "producer": null @@ -120,14 +74,14 @@ "producer": null }, { - "axis": 2, - "high": true, + "axis": 1, + "high": false, "kind": "box_face", "plane": { "origin": [ 0.0, 0.0, - 10.0 + 0.0 ], "x_axis": [ 1.0, @@ -135,9 +89,55 @@ 0.0 ], "y_axis": [ + 0.0, + 0.0, + 1.0 + ] + }, + "producer": null + }, + { + "axis": 0, + "high": true, + "kind": "box_face", + "plane": { + "origin": [ + 40.0, + 0.0, + 0.0 + ], + "x_axis": [ 0.0, 1.0, 0.0 + ], + "y_axis": [ + 0.0, + 0.0, + 1.0 + ] + }, + "producer": null + }, + { + "axis": 2, + "high": false, + "kind": "box_face", + "plane": { + "origin": [ + 0.0, + 0.0, + 0.0 + ], + "x_axis": [ + 1.0, + 0.0, + 0.0 + ], + "y_axis": [ + -0.0, + -1.0, + -0.0 ] }, "producer": null @@ -148,7 +148,7 @@ { "faces": [ 0, - 4 + 2 ], "origins": [] }, @@ -162,7 +162,7 @@ { "faces": [ 0, - 2 + 4 ], "origins": [] }, @@ -176,7 +176,7 @@ { "faces": [ 1, - 2 + 4 ], "origins": [] }, @@ -190,7 +190,14 @@ { "faces": [ 1, - 4 + 2 + ], + "origins": [] + }, + { + "faces": [ + 2, + 5 ], "origins": [] }, @@ -203,7 +210,7 @@ }, { "faces": [ - 2, + 3, 5 ], "origins": [] @@ -215,13 +222,6 @@ ], "origins": [] }, - { - "faces": [ - 3, - 5 - ], - "origins": [] - }, { "faces": [ 4, @@ -235,29 +235,11 @@ "change": "generated", "origins": [ { - "end": false, + "end": true, "kind": "cap" } ] }, - { - "change": "generated", - "origins": [ - { - "kind": "profile", - "segment": 0 - } - ] - }, - { - "change": "generated", - "origins": [ - { - "kind": "profile", - "segment": 1 - } - ] - }, { "change": "generated", "origins": [ @@ -280,7 +262,25 @@ "change": "generated", "origins": [ { - "end": true, + "kind": "profile", + "segment": 0 + } + ] + }, + { + "change": "generated", + "origins": [ + { + "kind": "profile", + "segment": 1 + } + ] + }, + { + "change": "generated", + "origins": [ + { + "end": false, "kind": "cap" } ] @@ -293,10 +293,7 @@ "version": 1 }, "runtime": { - "coarse_missing": [ - 0.5099019513592785, - 0 - ], + "coarse_missing": null, "size": 50.99019513592785 }, "solid": { @@ -306,32 +303,32 @@ "end": [ 0.0, 0.0, - 0.0 + 10.0 ], "kind": "line", "start": [ 0.0, 30.0, - 0.0 + 10.0 ] }, "interval": [ 0.0, 1.0 ], - "tolerance": 0.00005099019513592785, + "tolerance": 0.00002, "uses": [ { "face": 0, "loop": 0, - "position": 3, + "position": 0, "upper": false }, { - "face": 4, + "face": 2, "loop": 0, - "position": 0, - "upper": false + "position": 3, + "upper": true } ], "vertices": [ @@ -342,22 +339,60 @@ { "curve": { "end": [ + 40.0, 0.0, - 30.0, - 0.0 + 10.0 ], "kind": "line", "start": [ - 40.0, - 30.0, - 0.0 + 0.0, + 0.0, + 10.0 ] }, "interval": [ 0.0, 1.0 ], - "tolerance": 0.00005099019513592785, + "tolerance": 0.00002, + "uses": [ + { + "face": 0, + "loop": 0, + "position": 1, + "upper": false + }, + { + "face": 3, + "loop": 0, + "position": 3, + "upper": true + } + ], + "vertices": [ + 1, + 2 + ] + }, + { + "curve": { + "end": [ + 40.0, + 30.0, + 10.0 + ], + "kind": "line", + "start": [ + 40.0, + 0.0, + 10.0 + ] + }, + "interval": [ + 0.0, + 1.0 + ], + "tolerance": 0.00002, "uses": [ { "face": 0, @@ -366,14 +401,52 @@ "upper": false }, { - "face": 3, + "face": 4, "loop": 0, - "position": 0, - "upper": false + "position": 3, + "upper": true } ], "vertices": [ 2, + 3 + ] + }, + { + "curve": { + "end": [ + 0.0, + 30.0, + 10.0 + ], + "kind": "line", + "start": [ + 40.0, + 30.0, + 10.0 + ] + }, + "interval": [ + 0.0, + 1.0 + ], + "tolerance": 0.00002, + "uses": [ + { + "face": 0, + "loop": 0, + "position": 3, + "upper": false + }, + { + "face": 1, + "loop": 0, + "position": 3, + "upper": true + } + ], + "vertices": [ + 3, 0 ] }, @@ -382,12 +455,12 @@ "end": [ 40.0, 30.0, - 0.0 + 10.0 ], "kind": "line", "start": [ 40.0, - 0.0, + 30.0, 0.0 ] }, @@ -395,75 +468,37 @@ 0.0, 1.0 ], - "tolerance": 0.00005099019513592785, + "tolerance": 0.00002, "uses": [ - { - "face": 0, - "loop": 0, - "position": 1, - "upper": false - }, - { - "face": 2, - "loop": 0, - "position": 0, - "upper": false - } - ], - "vertices": [ - 3, - 2 - ] - }, - { - "curve": { - "end": [ - 40.0, - 0.0, - 0.0 - ], - "kind": "line", - "start": [ - 0.0, - 0.0, - 0.0 - ] - }, - "interval": [ - 0.0, - 1.0 - ], - "tolerance": 0.00005099019513592785, - "uses": [ - { - "face": 0, - "loop": 0, - "position": 0, - "upper": false - }, { "face": 1, "loop": 0, "position": 0, + "upper": true + }, + { + "face": 4, + "loop": 0, + "position": 2, "upper": false } ], "vertices": [ - 1, + 4, 3 ] }, { "curve": { "end": [ - 40.0, 0.0, - 10.0 + 30.0, + 0.0 ], "kind": "line", "start": [ 40.0, - 0.0, + 30.0, 0.0 ] }, @@ -471,7 +506,7 @@ 0.0, 1.0 ], - "tolerance": 0.00005099019513592785, + "tolerance": 0.00002, "uses": [ { "face": 1, @@ -479,170 +514,18 @@ "position": 1, "upper": false }, - { - "face": 2, - "loop": 0, - "position": 3, - "upper": true - } - ], - "vertices": [ - 3, - 4 - ] - }, - { - "curve": { - "end": [ - 40.0, - 0.0, - 10.0 - ], - "kind": "line", - "start": [ - 0.0, - 0.0, - 10.0 - ] - }, - "interval": [ - 0.0, - 1.0 - ], - "tolerance": 0.00005099019513592785, - "uses": [ - { - "face": 1, - "loop": 0, - "position": 2, - "upper": true - }, { "face": 5, "loop": 0, - "position": 0, - "upper": false - } - ], - "vertices": [ - 5, - 4 - ] - }, - { - "curve": { - "end": [ - 0.0, - 0.0, - 10.0 - ], - "kind": "line", - "start": [ - 0.0, - 0.0, - 0.0 - ] - }, - "interval": [ - 0.0, - 1.0 - ], - "tolerance": 0.00005099019513592785, - "uses": [ - { - "face": 1, - "loop": 0, - "position": 3, - "upper": true - }, - { - "face": 4, - "loop": 0, "position": 1, - "upper": false + "upper": true } ], "vertices": [ - 1, + 4, 5 ] }, - { - "curve": { - "end": [ - 40.0, - 30.0, - 10.0 - ], - "kind": "line", - "start": [ - 40.0, - 30.0, - 0.0 - ] - }, - "interval": [ - 0.0, - 1.0 - ], - "tolerance": 0.00005099019513592785, - "uses": [ - { - "face": 2, - "loop": 0, - "position": 1, - "upper": false - }, - { - "face": 3, - "loop": 0, - "position": 3, - "upper": true - } - ], - "vertices": [ - 2, - 6 - ] - }, - { - "curve": { - "end": [ - 40.0, - 30.0, - 10.0 - ], - "kind": "line", - "start": [ - 40.0, - 0.0, - 10.0 - ] - }, - "interval": [ - 0.0, - 1.0 - ], - "tolerance": 0.00005099019513592785, - "uses": [ - { - "face": 2, - "loop": 0, - "position": 2, - "upper": true - }, - { - "face": 5, - "loop": 0, - "position": 1, - "upper": false - } - ], - "vertices": [ - 4, - 6 - ] - }, { "curve": { "end": [ @@ -661,7 +544,121 @@ 0.0, 1.0 ], - "tolerance": 0.00005099019513592785, + "tolerance": 0.00002, + "uses": [ + { + "face": 1, + "loop": 0, + "position": 2, + "upper": false + }, + { + "face": 2, + "loop": 0, + "position": 0, + "upper": true + } + ], + "vertices": [ + 5, + 0 + ] + }, + { + "curve": { + "end": [ + 0.0, + 0.0, + 0.0 + ], + "kind": "line", + "start": [ + 0.0, + 30.0, + 0.0 + ] + }, + "interval": [ + 0.0, + 1.0 + ], + "tolerance": 0.00002, + "uses": [ + { + "face": 2, + "loop": 0, + "position": 1, + "upper": false + }, + { + "face": 5, + "loop": 0, + "position": 0, + "upper": true + } + ], + "vertices": [ + 5, + 6 + ] + }, + { + "curve": { + "end": [ + 0.0, + 0.0, + 10.0 + ], + "kind": "line", + "start": [ + 0.0, + 0.0, + 0.0 + ] + }, + "interval": [ + 0.0, + 1.0 + ], + "tolerance": 0.00002, + "uses": [ + { + "face": 2, + "loop": 0, + "position": 2, + "upper": false + }, + { + "face": 3, + "loop": 0, + "position": 0, + "upper": true + } + ], + "vertices": [ + 6, + 1 + ] + }, + { + "curve": { + "end": [ + 40.0, + 0.0, + 0.0 + ], + "kind": "line", + "start": [ + 0.0, + 0.0, + 0.0 + ] + }, + "interval": [ + 0.0, + 1.0 + ], + "tolerance": 0.00002, "uses": [ { "face": 3, @@ -670,50 +667,12 @@ "upper": false }, { - "face": 4, + "face": 5, "loop": 0, "position": 3, "upper": true } ], - "vertices": [ - 0, - 7 - ] - }, - { - "curve": { - "end": [ - 0.0, - 30.0, - 10.0 - ], - "kind": "line", - "start": [ - 40.0, - 30.0, - 10.0 - ] - }, - "interval": [ - 0.0, - 1.0 - ], - "tolerance": 0.00005099019513592785, - "uses": [ - { - "face": 3, - "loop": 0, - "position": 2, - "upper": true - }, - { - "face": 5, - "loop": 0, - "position": 2, - "upper": false - } - ], "vertices": [ 6, 7 @@ -722,39 +681,77 @@ { "curve": { "end": [ - 0.0, + 40.0, 0.0, 10.0 ], "kind": "line", "start": [ + 40.0, 0.0, - 30.0, - 10.0 + 0.0 ] }, "interval": [ 0.0, 1.0 ], - "tolerance": 0.00005099019513592785, + "tolerance": 0.00002, "uses": [ + { + "face": 3, + "loop": 0, + "position": 2, + "upper": false + }, { "face": 4, "loop": 0, - "position": 2, + "position": 0, "upper": true - }, - { - "face": 5, - "loop": 0, - "position": 3, - "upper": false } ], "vertices": [ 7, - 5 + 2 + ] + }, + { + "curve": { + "end": [ + 40.0, + 30.0, + 0.0 + ], + "kind": "line", + "start": [ + 40.0, + 0.0, + 0.0 + ] + }, + "interval": [ + 0.0, + 1.0 + ], + "tolerance": 0.00002, + "uses": [ + { + "face": 4, + "loop": 0, + "position": 1, + "upper": false + }, + { + "face": 5, + "loop": 0, + "position": 2, + "upper": true + } + ], + "vertices": [ + 7, + 4 ] } ], @@ -763,527 +760,11 @@ "domain": [ [ 0.0, - 1.0 + 55.0 ], [ 0.0, - 1.0 - ] - ], - "loops": [ - { - "edges": [ - { - "edge": 3, - "forward": true, - "pcurve": { - "kind": "spline", - "knots": [ - 0.0, - 0.0, - 1.0, - 1.0 - ], - "points": [ - [ - 1.0, - 1.0 - ], - [ - 0.0, - 1.0 - ] - ] - } - }, - { - "edge": 2, - "forward": true, - "pcurve": { - "kind": "spline", - "knots": [ - 0.0, - 0.0, - 1.0, - 1.0 - ], - "points": [ - [ - 0.0, - 1.0 - ], - [ - 0.0, - 0.0 - ] - ] - } - }, - { - "edge": 1, - "forward": true, - "pcurve": { - "kind": "spline", - "knots": [ - 0.0, - 0.0, - 1.0, - 1.0 - ], - "points": [ - [ - 0.0, - 0.0 - ], - [ - 1.0, - 0.0 - ] - ] - } - }, - { - "edge": 0, - "forward": true, - "pcurve": { - "kind": "spline", - "knots": [ - 0.0, - 0.0, - 1.0, - 1.0 - ], - "points": [ - [ - 1.0, - 0.0 - ], - [ - 1.0, - 1.0 - ] - ] - } - } - ], - "kind": "edges" - } - ], - "surface": { - "kind": "plane_through", - "origin": [ - 40.0, - 30.0, - 0.0 - ], - "u_point": [ - 0.0, - 30.0, - 0.0 - ], - "v_point": [ - 40.0, - 0.0, - 0.0 - ] - } - }, - { - "domain": [ - [ - 0.0, - 1.0 - ], - [ - 0.0, - 1.0 - ] - ], - "loops": [ - { - "edges": [ - { - "edge": 3, - "forward": true, - "pcurve": { - "kind": "spline", - "knots": [ - 0.0, - 0.0, - 1.0, - 1.0 - ], - "points": [ - [ - 0.0, - 0.0 - ], - [ - 1.0, - 0.0 - ] - ] - } - }, - { - "edge": 4, - "forward": true, - "pcurve": { - "kind": "spline", - "knots": [ - 0.0, - 0.0, - 1.0, - 1.0 - ], - "points": [ - [ - 1.0, - 0.0 - ], - [ - 1.0, - 1.0 - ] - ] - } - }, - { - "edge": 5, - "forward": false, - "pcurve": { - "kind": "spline", - "knots": [ - 0.0, - 0.0, - 1.0, - 1.0 - ], - "points": [ - [ - 0.0, - 1.0 - ], - [ - 1.0, - 1.0 - ] - ] - } - }, - { - "edge": 6, - "forward": false, - "pcurve": { - "kind": "spline", - "knots": [ - 0.0, - 0.0, - 1.0, - 1.0 - ], - "points": [ - [ - 0.0, - 0.0 - ], - [ - 0.0, - 1.0 - ] - ] - } - } - ], - "kind": "edges" - } - ], - "surface": { - "kind": "plane_through", - "origin": [ - 0.0, - 0.0, - 0.0 - ], - "u_point": [ - 40.0, - 0.0, - 0.0 - ], - "v_point": [ - 0.0, - 0.0, - 10.0 - ] - } - }, - { - "domain": [ - [ - 0.0, - 1.0 - ], - [ - 0.0, - 1.0 - ] - ], - "loops": [ - { - "edges": [ - { - "edge": 2, - "forward": true, - "pcurve": { - "kind": "spline", - "knots": [ - 0.0, - 0.0, - 1.0, - 1.0 - ], - "points": [ - [ - 0.0, - 0.0 - ], - [ - 1.0, - 0.0 - ] - ] - } - }, - { - "edge": 7, - "forward": true, - "pcurve": { - "kind": "spline", - "knots": [ - 0.0, - 0.0, - 1.0, - 1.0 - ], - "points": [ - [ - 1.0, - 0.0 - ], - [ - 1.0, - 1.0 - ] - ] - } - }, - { - "edge": 8, - "forward": false, - "pcurve": { - "kind": "spline", - "knots": [ - 0.0, - 0.0, - 1.0, - 1.0 - ], - "points": [ - [ - 0.0, - 1.0 - ], - [ - 1.0, - 1.0 - ] - ] - } - }, - { - "edge": 4, - "forward": false, - "pcurve": { - "kind": "spline", - "knots": [ - 0.0, - 0.0, - 1.0, - 1.0 - ], - "points": [ - [ - 0.0, - 0.0 - ], - [ - 0.0, - 1.0 - ] - ] - } - } - ], - "kind": "edges" - } - ], - "surface": { - "kind": "plane_through", - "origin": [ - 40.0, - 0.0, - 0.0 - ], - "u_point": [ - 40.0, - 30.0, - 0.0 - ], - "v_point": [ - 40.0, - 0.0, - 10.0 - ] - } - }, - { - "domain": [ - [ - 0.0, - 1.0 - ], - [ - 0.0, - 1.0 - ] - ], - "loops": [ - { - "edges": [ - { - "edge": 1, - "forward": true, - "pcurve": { - "kind": "spline", - "knots": [ - 0.0, - 0.0, - 1.0, - 1.0 - ], - "points": [ - [ - 0.0, - 0.0 - ], - [ - 1.0, - 0.0 - ] - ] - } - }, - { - "edge": 9, - "forward": true, - "pcurve": { - "kind": "spline", - "knots": [ - 0.0, - 0.0, - 1.0, - 1.0 - ], - "points": [ - [ - 1.0, - 0.0 - ], - [ - 1.0, - 1.0 - ] - ] - } - }, - { - "edge": 10, - "forward": false, - "pcurve": { - "kind": "spline", - "knots": [ - 0.0, - 0.0, - 1.0, - 1.0 - ], - "points": [ - [ - 0.0, - 1.0 - ], - [ - 1.0, - 1.0 - ] - ] - } - }, - { - "edge": 7, - "forward": false, - "pcurve": { - "kind": "spline", - "knots": [ - 0.0, - 0.0, - 1.0, - 1.0 - ], - "points": [ - [ - 0.0, - 0.0 - ], - [ - 0.0, - 1.0 - ] - ] - } - } - ], - "kind": "edges" - } - ], - "surface": { - "kind": "plane_through", - "origin": [ - 40.0, - 30.0, - 0.0 - ], - "u_point": [ - 0.0, - 30.0, - 0.0 - ], - "v_point": [ - 40.0, - 30.0, - 10.0 - ] - } - }, - { - "domain": [ - [ - 0.0, - 1.0 - ], - [ - 0.0, - 1.0 + 55.0 ] ], "loops": [ @@ -1292,6 +773,135 @@ { "edge": 0, "forward": true, + "pcurve": { + "kind": "spline", + "knots": [ + 0.0, + 0.0, + 1.0, + 1.0 + ], + "points": [ + [ + 42.5, + 47.5 + ], + [ + 12.500000000000002, + 47.5 + ] + ] + } + }, + { + "edge": 1, + "forward": true, + "pcurve": { + "kind": "spline", + "knots": [ + 0.0, + 0.0, + 1.0, + 1.0 + ], + "points": [ + [ + 12.500000000000004, + 47.5 + ], + [ + 12.500000000000004, + 7.499999999999999 + ] + ] + } + }, + { + "edge": 2, + "forward": true, + "pcurve": { + "kind": "spline", + "knots": [ + 0.0, + 0.0, + 1.0, + 1.0 + ], + "points": [ + [ + 12.500000000000004, + 7.499999999999999 + ], + [ + 42.5, + 7.499999999999999 + ] + ] + } + }, + { + "edge": 3, + "forward": true, + "pcurve": { + "kind": "spline", + "knots": [ + 0.0, + 0.0, + 1.0, + 1.0 + ], + "points": [ + [ + 42.5, + 7.499999999999999 + ], + [ + 42.5, + 47.5 + ] + ] + } + } + ], + "kind": "edges" + } + ], + "surface": { + "kind": "plane", + "origin": [ + 47.5, + -12.500000000000004, + 10.0 + ], + "u_axis": [ + 0.0, + 1.0, + 0.0 + ], + "v_axis": [ + -1.0, + 0.0, + 0.0 + ] + } + }, + { + "domain": [ + [ + 0.0, + 40.0 + ], + [ + 0.0, + 10.0 + ] + ], + "loops": [ + { + "edges": [ + { + "edge": 4, + "forward": false, "pcurve": { "kind": "spline", "knots": [ @@ -1306,7 +916,30 @@ 0.0 ], [ - 1.0, + 0.0, + 10.0 + ] + ] + } + }, + { + "edge": 5, + "forward": true, + "pcurve": { + "kind": "spline", + "knots": [ + 0.0, + 0.0, + 1.0, + 1.0 + ], + "points": [ + [ + 0.0, + 0.0 + ], + [ + 40.0, 0.0 ] ] @@ -1325,18 +958,18 @@ ], "points": [ [ - 1.0, + 40.0, 0.0 ], [ - 1.0, - 1.0 + 40.0, + 10.0 ] ] } }, { - "edge": 11, + "edge": 3, "forward": false, "pcurve": { "kind": "spline", @@ -1349,34 +982,11 @@ "points": [ [ 0.0, - 1.0 + 10.0 ], [ - 1.0, - 1.0 - ] - ] - } - }, - { - "edge": 9, - "forward": false, - "pcurve": { - "kind": "spline", - "knots": [ - 0.0, - 0.0, - 1.0, - 1.0 - ], - "points": [ - [ - 0.0, - 0.0 - ], - [ - 0.0, - 1.0 + 40.0, + 10.0 ] ] } @@ -1386,21 +996,21 @@ } ], "surface": { - "kind": "plane_through", + "kind": "plane", "origin": [ - 0.0, + 40.0, 30.0, 0.0 ], - "u_point": [ - 0.0, + "u_axis": [ + -1.0, 0.0, 0.0 ], - "v_point": [ + "v_axis": [ 0.0, - 30.0, - 10.0 + 0.0, + 1.0 ] } }, @@ -1408,18 +1018,41 @@ "domain": [ [ 0.0, - 1.0 + 30.0 ], [ 0.0, - 1.0 + 10.0 ] ], "loops": [ { "edges": [ { - "edge": 5, + "edge": 6, + "forward": false, + "pcurve": { + "kind": "spline", + "knots": [ + 0.0, + 0.0, + 1.0, + 1.0 + ], + "points": [ + [ + 0.0, + 0.0 + ], + [ + 0.0, + 10.0 + ] + ] + } + }, + { + "edge": 7, "forward": true, "pcurve": { "kind": "spline", @@ -1431,12 +1064,12 @@ ], "points": [ [ - 1.0, - 1.0 + 0.0, + 0.0 ], [ - 0.0, - 1.0 + 30.0, + 0.0 ] ] } @@ -1444,6 +1077,29 @@ { "edge": 8, "forward": true, + "pcurve": { + "kind": "spline", + "knots": [ + 0.0, + 0.0, + 1.0, + 1.0 + ], + "points": [ + [ + 30.0, + 0.0 + ], + [ + 30.0, + 10.0 + ] + ] + } + }, + { + "edge": 0, + "forward": false, "pcurve": { "kind": "spline", "knots": [ @@ -1455,10 +1111,93 @@ "points": [ [ 0.0, - 1.0 + 10.0 + ], + [ + 30.0, + 10.0 + ] + ] + } + } + ], + "kind": "edges" + } + ], + "surface": { + "kind": "plane", + "origin": [ + 0.0, + 30.0, + 0.0 + ], + "u_axis": [ + 0.0, + -1.0, + 0.0 + ], + "v_axis": [ + 0.0, + 0.0, + 1.0 + ] + } + }, + { + "domain": [ + [ + 0.0, + 40.0 + ], + [ + 0.0, + 10.0 + ] + ], + "loops": [ + { + "edges": [ + { + "edge": 8, + "forward": false, + "pcurve": { + "kind": "spline", + "knots": [ + 0.0, + 0.0, + 1.0, + 1.0 + ], + "points": [ + [ + 0.0, + 0.0 ], [ 0.0, + 10.0 + ] + ] + } + }, + { + "edge": 9, + "forward": true, + "pcurve": { + "kind": "spline", + "knots": [ + 0.0, + 0.0, + 1.0, + 1.0 + ], + "points": [ + [ + 0.0, + 0.0 + ], + [ + 40.0, 0.0 ] ] @@ -1467,6 +1206,89 @@ { "edge": 10, "forward": true, + "pcurve": { + "kind": "spline", + "knots": [ + 0.0, + 0.0, + 1.0, + 1.0 + ], + "points": [ + [ + 40.0, + 0.0 + ], + [ + 40.0, + 10.0 + ] + ] + } + }, + { + "edge": 1, + "forward": false, + "pcurve": { + "kind": "spline", + "knots": [ + 0.0, + 0.0, + 1.0, + 1.0 + ], + "points": [ + [ + 0.0, + 10.0 + ], + [ + 40.0, + 10.0 + ] + ] + } + } + ], + "kind": "edges" + } + ], + "surface": { + "kind": "plane", + "origin": [ + 0.0, + 0.0, + 0.0 + ], + "u_axis": [ + 1.0, + 0.0, + 0.0 + ], + "v_axis": [ + -0.0, + 0.0, + 1.0 + ] + } + }, + { + "domain": [ + [ + 0.0, + 30.0 + ], + [ + 0.0, + 10.0 + ] + ], + "loops": [ + { + "edges": [ + { + "edge": 10, + "forward": false, "pcurve": { "kind": "spline", "knots": [ @@ -1481,8 +1303,8 @@ 0.0 ], [ - 1.0, - 0.0 + 0.0, + 10.0 ] ] } @@ -1500,12 +1322,58 @@ ], "points": [ [ - 1.0, + 0.0, 0.0 ], [ - 1.0, - 1.0 + 30.0, + 0.0 + ] + ] + } + }, + { + "edge": 4, + "forward": true, + "pcurve": { + "kind": "spline", + "knots": [ + 0.0, + 0.0, + 1.0, + 1.0 + ], + "points": [ + [ + 30.0, + 0.0 + ], + [ + 30.0, + 10.0 + ] + ] + } + }, + { + "edge": 2, + "forward": false, + "pcurve": { + "kind": "spline", + "knots": [ + 0.0, + 0.0, + 1.0, + 1.0 + ], + "points": [ + [ + 0.0, + 10.0 + ], + [ + 30.0, + 10.0 ] ] } @@ -1515,21 +1383,150 @@ } ], "surface": { - "kind": "plane_through", + "kind": "plane", "origin": [ 40.0, - 30.0, - 10.0 - ], - "u_point": [ 0.0, - 30.0, - 10.0 + 0.0 ], - "v_point": [ - 40.0, + "u_axis": [ 0.0, - 10.0 + 1.0, + 0.0 + ], + "v_axis": [ + 0.0, + 0.0, + 1.0 + ] + } + }, + { + "domain": [ + [ + 0.0, + 55.0 + ], + [ + 0.0, + 55.0 + ] + ], + "loops": [ + { + "edges": [ + { + "edge": 7, + "forward": false, + "pcurve": { + "kind": "spline", + "knots": [ + 0.0, + 0.0, + 1.0, + 1.0 + ], + "points": [ + [ + 47.499999999999986, + 42.499999999999986 + ], + [ + 47.5, + 12.499999999999991 + ] + ] + } + }, + { + "edge": 5, + "forward": false, + "pcurve": { + "kind": "spline", + "knots": [ + 0.0, + 0.0, + 1.0, + 1.0 + ], + "points": [ + [ + 7.49999999999999, + 42.5 + ], + [ + 47.499999999999986, + 42.499999999999986 + ] + ] + } + }, + { + "edge": 11, + "forward": false, + "pcurve": { + "kind": "spline", + "knots": [ + 0.0, + 0.0, + 1.0, + 1.0 + ], + "points": [ + [ + 7.4999999999999964, + 12.500000000000002 + ], + [ + 7.49999999999999, + 42.5 + ] + ] + } + }, + { + "edge": 9, + "forward": false, + "pcurve": { + "kind": "spline", + "knots": [ + 0.0, + 0.0, + 1.0, + 1.0 + ], + "points": [ + [ + 47.5, + 12.499999999999993 + ], + [ + 7.4999999999999964, + 12.500000000000002 + ] + ] + } + } + ], + "kind": "edges" + } + ], + "surface": { + "kind": "plane", + "origin": [ + 47.5, + -12.500000000000004, + 0.0 + ], + "u_axis": [ + -1.0, + 0.0, + 0.0 + ], + "v_axis": [ + 0.0, + 1.0, + 0.0 ] } } @@ -1553,7 +1550,7 @@ "faces": [ { "face": 0, - "forward": false + "forward": true }, { "face": 1, @@ -1580,48 +1577,16 @@ "wires": [] } ], - "tolerance": 0.00005099019513592785, + "tolerance": 0.00002, "version": 4, "vertices": [ { "point": [ 0.0, 30.0, - 0.0 - ], - "tolerance": 0.00005099019513592785 - }, - { - "point": [ - 0.0, - 0.0, - 0.0 - ], - "tolerance": 0.00005099019513592785 - }, - { - "point": [ - 40.0, - 30.0, - 0.0 - ], - "tolerance": 0.00005099019513592785 - }, - { - "point": [ - 40.0, - 0.0, - 0.0 - ], - "tolerance": 0.00005099019513592785 - }, - { - "point": [ - 40.0, - 0.0, 10.0 ], - "tolerance": 0.00005099019513592785 + "tolerance": 0.00002 }, { "point": [ @@ -1629,7 +1594,15 @@ 0.0, 10.0 ], - "tolerance": 0.00005099019513592785 + "tolerance": 0.00002 + }, + { + "point": [ + 40.0, + 0.0, + 10.0 + ], + "tolerance": 0.00002 }, { "point": [ @@ -1637,15 +1610,39 @@ 30.0, 10.0 ], - "tolerance": 0.00005099019513592785 + "tolerance": 0.00002 + }, + { + "point": [ + 40.0, + 30.0, + 0.0 + ], + "tolerance": 0.00002 }, { "point": [ 0.0, 30.0, - 10.0 + 0.0 ], - "tolerance": 0.00005099019513592785 + "tolerance": 0.00002 + }, + { + "point": [ + 0.0, + 0.0, + 0.0 + ], + "tolerance": 0.00002 + }, + { + "point": [ + 40.0, + 0.0, + 0.0 + ], + "tolerance": 0.00002 } ] } @@ -1660,33 +1657,34 @@ { "faces": [ 0, - 4 + 6 ], "origins": [ { - "edge": 0, - "kind": "edge", - "operand": 0 + "kind": "meeting", + "sides": [ + [ + { + "face": 0, + "kind": "face", + "operand": 0 + } + ], + [ + { + "edge": 1, + "kind": "edge", + "operand": 0 + } + ] + ] } ] }, { "faces": [ 0, - 3 - ], - "origins": [ - { - "edge": 1, - "kind": "edge", - "operand": 0 - } - ] - }, - { - "faces": [ - 0, - 2 + 5 ], "origins": [ { @@ -1709,10 +1707,23 @@ } ] }, + { + "faces": [ + 0, + 4 + ], + "origins": [ + { + "edge": 0, + "kind": "edge", + "operand": 0 + } + ] + }, { "faces": [ 1, - 2 + 5 ], "origins": [ { @@ -1725,27 +1736,13 @@ { "faces": [ 1, - 6 + 2 ], "origins": [ { - "kind": "meeting", - "sides": [ - [ - { - "face": 1, - "kind": "face", - "operand": 0 - } - ], - [ - { - "edge": 5, - "kind": "edge", - "operand": 0 - } - ] - ] + "edge": 5, + "kind": "edge", + "operand": 0 } ] }, @@ -1765,7 +1762,7 @@ { "faces": [ 2, - 3 + 4 ], "origins": [ { @@ -1782,7 +1779,7 @@ ], "origins": [ { - "edge": 8, + "edge": 11, "kind": "edge", "operand": 0 } @@ -1791,6 +1788,19 @@ { "faces": [ 2, + 3 + ], + "origins": [ + { + "edge": 9, + "kind": "edge", + "operand": 0 + } + ] + }, + { + "faces": [ + 3, 6 ], "origins": [ @@ -1799,14 +1809,14 @@ "sides": [ [ { - "face": 2, + "face": 3, "kind": "face", "operand": 0 } ], [ { - "edge": 5, + "edge": 1, "kind": "edge", "operand": 0 } @@ -1822,7 +1832,7 @@ ], "origins": [ { - "edge": 9, + "edge": 8, "kind": "edge", "operand": 0 } @@ -1852,14 +1862,14 @@ "sides": [ [ { - "face": 4, + "face": 2, "kind": "face", "operand": 0 } ], [ { - "edge": 5, + "edge": 1, "kind": "edge", "operand": 0 } @@ -1868,19 +1878,6 @@ } ] }, - { - "faces": [ - 4, - 5 - ], - "origins": [ - { - "edge": 11, - "kind": "edge", - "operand": 0 - } - ] - }, { "faces": [ 5, @@ -1892,14 +1889,14 @@ "sides": [ [ { - "face": 5, + "face": 4, "kind": "face", "operand": 0 } ], [ { - "edge": 5, + "edge": 1, "kind": "edge", "operand": 0 } @@ -1911,7 +1908,7 @@ ], "faces": [ { - "change": "kept", + "change": "modified", "origins": [ { "face": 0, @@ -1921,7 +1918,7 @@ ] }, { - "change": "modified", + "change": "kept", "origins": [ { "face": 1, @@ -1930,6 +1927,26 @@ } ] }, + { + "change": "kept", + "origins": [ + { + "face": 5, + "kind": "face", + "operand": 0 + } + ] + }, + { + "change": "modified", + "origins": [ + { + "face": 3, + "kind": "face", + "operand": 0 + } + ] + }, { "change": "modified", "origins": [ @@ -1940,16 +1957,6 @@ } ] }, - { - "change": "kept", - "origins": [ - { - "face": 3, - "kind": "face", - "operand": 0 - } - ] - }, { "change": "modified", "origins": [ @@ -1960,21 +1967,11 @@ } ] }, - { - "change": "modified", - "origins": [ - { - "face": 5, - "kind": "face", - "operand": 0 - } - ] - }, { "change": "generated", "origins": [ { - "edge": 5, + "edge": 1, "kind": "edge", "operand": 0 } @@ -1988,45 +1985,42 @@ "version": 1 }, "runtime": { - "coarse_missing": [ - 0.5099019513592785, - 0 - ], - "size": 50.99019513592785 + "coarse_missing": null, + "size": 50.990195135927856 }, "solid": { "edges": [ { "curve": { "end": [ - 0.0, - 0.0, - 0.0 + 60.0, + 1.9999999999999964, + 10.0 ], "kind": "line", "start": [ - 0.0, - 30.0, - 0.0 + -20.0, + 1.9999999999999964, + 10.0 ] }, "interval": [ - 0.0, - 1.0 + 0.25, + 0.75 ], - "tolerance": 0.00005099019513592785, + "tolerance": 0.00008, "uses": [ { "face": 0, "loop": 0, - "position": 3, + "position": 0, "upper": false }, { - "face": 4, + "face": 6, "loop": 0, "position": 0, - "upper": false + "upper": true } ], "vertices": [ @@ -2034,25 +2028,63 @@ 1 ] }, + { + "curve": { + "end": [ + 40.0, + 30.0, + 10.0 + ], + "kind": "line", + "start": [ + 40.0, + 0.0, + 10.0 + ] + }, + "interval": [ + 0.06666666666666655, + 1.0 + ], + "tolerance": 0.00002, + "uses": [ + { + "face": 0, + "loop": 0, + "position": 1, + "upper": false + }, + { + "face": 5, + "loop": 0, + "position": 4, + "upper": true + } + ], + "vertices": [ + 1, + 2 + ] + }, { "curve": { "end": [ 0.0, 30.0, - 0.0 + 10.0 ], "kind": "line", "start": [ 40.0, 30.0, - 0.0 + 10.0 ] }, "interval": [ 0.0, 1.0 ], - "tolerance": 0.00005099019513592785, + "tolerance": 0.00002, "uses": [ { "face": 0, @@ -2061,14 +2093,52 @@ "upper": false }, { - "face": 3, + "face": 1, "loop": 0, - "position": 0, - "upper": false + "position": 3, + "upper": true } ], "vertices": [ 2, + 3 + ] + }, + { + "curve": { + "end": [ + 0.0, + 0.0, + 10.0 + ], + "kind": "line", + "start": [ + 0.0, + 30.0, + 10.0 + ] + }, + "interval": [ + 0.0, + 0.9333333333333335 + ], + "tolerance": 0.00002, + "uses": [ + { + "face": 0, + "loop": 0, + "position": 3, + "upper": false + }, + { + "face": 4, + "loop": 0, + "position": 1, + "upper": true + } + ], + "vertices": [ + 3, 0 ] }, @@ -2077,12 +2147,12 @@ "end": [ 40.0, 30.0, - 0.0 + 10.0 ], "kind": "line", "start": [ 40.0, - 0.0, + 30.0, 0.0 ] }, @@ -2090,37 +2160,37 @@ 0.0, 1.0 ], - "tolerance": 0.00005099019513592785, + "tolerance": 0.00002, "uses": [ { - "face": 0, - "loop": 0, - "position": 1, - "upper": false - }, - { - "face": 2, + "face": 1, "loop": 0, "position": 0, + "upper": true + }, + { + "face": 5, + "loop": 0, + "position": 3, "upper": false } ], "vertices": [ - 3, + 4, 2 ] }, { "curve": { "end": [ - 40.0, 0.0, + 30.0, 0.0 ], "kind": "line", "start": [ - 0.0, - 0.0, + 40.0, + 30.0, 0.0 ] }, @@ -2128,45 +2198,7 @@ 0.0, 1.0 ], - "tolerance": 0.00005099019513592785, - "uses": [ - { - "face": 0, - "loop": 0, - "position": 0, - "upper": false - }, - { - "face": 1, - "loop": 0, - "position": 0, - "upper": false - } - ], - "vertices": [ - 1, - 3 - ] - }, - { - "curve": { - "end": [ - 40.0, - 0.0, - 8.0 - ], - "kind": "line", - "start": [ - 40.0, - 0.0, - 0.0 - ] - }, - "interval": [ - 0.0, - 1.0 - ], - "tolerance": 0.00005099019513592785, + "tolerance": 0.00002, "uses": [ { "face": 1, @@ -2177,101 +2209,25 @@ { "face": 2, "loop": 0, - "position": 4, - "upper": true - } - ], - "vertices": [ - 3, - 4 - ] - }, - { - "curve": { - "end": [ - 40.0, - 0.0, - 8.0 - ], - "kind": "line", - "start": [ - 0.0, - 0.0, - 8.0 - ] - }, - "interval": [ - 0.0, - 1.0 - ], - "tolerance": 0.00005099019513592785, - "uses": [ - { - "face": 1, - "loop": 0, - "position": 2, - "upper": true - }, - { - "face": 6, - "loop": 0, - "position": 0, - "upper": false - } - ], - "vertices": [ - 5, - 4 - ] - }, - { - "curve": { - "end": [ - 0.0, - 0.0, - 8.0 - ], - "kind": "line", - "start": [ - 0.0, - 0.0, - 0.0 - ] - }, - "interval": [ - 0.0, - 1.0 - ], - "tolerance": 0.00005099019513592785, - "uses": [ - { - "face": 1, - "loop": 0, - "position": 3, - "upper": true - }, - { - "face": 4, - "loop": 0, "position": 1, - "upper": false + "upper": true } ], "vertices": [ - 1, + 4, 5 ] }, { "curve": { "end": [ - 40.0, + 0.0, 30.0, 10.0 ], "kind": "line", "start": [ - 40.0, + 0.0, 30.0, 0.0 ] @@ -2280,201 +2236,86 @@ 0.0, 1.0 ], - "tolerance": 0.00005099019513592785, + "tolerance": 0.00002, "uses": [ { - "face": 2, - "loop": 0, - "position": 1, - "upper": false - }, - { - "face": 3, - "loop": 0, - "position": 3, - "upper": true - } - ], - "vertices": [ - 2, - 6 - ] - }, - { - "curve": { - "end": [ - 40.0, - 30.0, - 10.0 - ], - "kind": "line", - "start": [ - 40.0, - 2.0000000000000004, - 10.0 - ] - }, - "interval": [ - 0.0, - 1.0 - ], - "tolerance": 0.00005099019513592785, - "uses": [ - { - "face": 2, + "face": 1, "loop": 0, "position": 2, - "upper": true - }, - { - "face": 5, - "loop": 0, - "position": 1, - "upper": false - } - ], - "vertices": [ - 7, - 6 - ] - }, - { - "curve": { - "homogeneous": [ - [ - 40.0, - 0.0, - 8.0, - 1.0 - ], - [ - 37.07106781186547, - -2.220446049250313e-16, - 7.767766952966368, - 0.9267766952966368 - ], - [ - 34.142135623730944, - 0.2499999999999991, - 7.785533905932737, - 0.8535533905932736 - ], - [ - 34.142135623730944, - 0.7499999999999988, - 8.285533905932736, - 0.8535533905932736 - ], - [ - 37.07106781186547, - 1.4999999999999982, - 9.267766952966369, - 0.9267766952966368 - ], - [ - 40.0, - 1.9999999999999984, - 10.0, - 1.0 - ] - ], - "kind": "rational_spline", - "knots": [ - 0.0, - 0.0, - 0.0, - 0.25, - 0.5, - 0.75, - 1.0, - 1.0, - 1.0 - ] - }, - "interval": [ - 0.0, - 1.0 - ], - "tolerance": 0.00005099019513592785, - "uses": [ - { - "face": 2, - "loop": 0, - "position": 3, - "upper": true - }, - { - "face": 6, - "loop": 0, - "position": 1, - "upper": false - } - ], - "vertices": [ - 4, - 7 - ] - }, - { - "curve": { - "end": [ - 0.0, - 30.0, - 10.0 - ], - "kind": "line", - "start": [ - 0.0, - 30.0, - 0.0 - ] - }, - "interval": [ - 0.0, - 1.0 - ], - "tolerance": 0.00005099019513592785, - "uses": [ - { - "face": 3, - "loop": 0, - "position": 1, "upper": false }, { "face": 4, "loop": 0, - "position": 4, + "position": 2, "upper": true } ], "vertices": [ - 0, - 8 + 5, + 3 ] }, { "curve": { "end": [ 0.0, - 30.0, - 10.0 + 0.0, + 0.0 ], "kind": "line", "start": [ - 40.0, + 0.0, 30.0, - 10.0 + 0.0 ] }, "interval": [ 0.0, 1.0 ], - "tolerance": 0.00005099019513592785, + "tolerance": 0.00002, "uses": [ { - "face": 3, + "face": 2, + "loop": 0, + "position": 0, + "upper": true + }, + { + "face": 4, + "loop": 0, + "position": 3, + "upper": false + } + ], + "vertices": [ + 5, + 6 + ] + }, + { + "curve": { + "end": [ + 40.0, + 30.0, + 0.0 + ], + "kind": "line", + "start": [ + 40.0, + 0.0, + 0.0 + ] + }, + "interval": [ + 0.0, + 1.0 + ], + "tolerance": 0.00002, + "uses": [ + { + "face": 2, "loop": 0, "position": 2, "upper": true @@ -2486,118 +2327,79 @@ "upper": false } ], + "vertices": [ + 7, + 4 + ] + }, + { + "curve": { + "end": [ + 40.0, + 0.0, + 0.0 + ], + "kind": "line", + "start": [ + 0.0, + 0.0, + 0.0 + ] + }, + "interval": [ + 0.0, + 1.0 + ], + "tolerance": 0.00002, + "uses": [ + { + "face": 2, + "loop": 0, + "position": 3, + "upper": true + }, + { + "face": 3, + "loop": 0, + "position": 2, + "upper": false + } + ], "vertices": [ 6, - 8 - ] - }, - { - "curve": { - "homogeneous": [ - [ - 0.0, - 0.0, - 8.0, - 1.0 - ], - [ - 0.0, - -2.220446049250313e-16, - 7.767766952966368, - 0.9267766952966368 - ], - [ - 0.0, - 0.2499999999999991, - 7.785533905932737, - 0.8535533905932736 - ], - [ - 0.0, - 0.7499999999999988, - 8.285533905932736, - 0.8535533905932736 - ], - [ - 0.0, - 1.4999999999999982, - 9.267766952966369, - 0.9267766952966368 - ], - [ - 0.0, - 1.9999999999999984, - 10.0, - 1.0 - ] - ], - "kind": "rational_spline", - "knots": [ - 0.0, - 0.0, - 0.0, - 0.25, - 0.5, - 0.75, - 1.0, - 1.0, - 1.0 - ] - }, - "interval": [ - 0.0, - 1.0 - ], - "tolerance": 0.00005099019513592785, - "uses": [ - { - "face": 4, - "loop": 0, - "position": 2, - "upper": false - }, - { - "face": 6, - "loop": 0, - "position": 3, - "upper": true - } - ], - "vertices": [ - 5, - 9 + 7 ] }, { "curve": { "end": [ + 60.0, 0.0, - 2.0000000000000004, - 10.0 + 8.0 ], "kind": "line", "start": [ + -20.0, 0.0, - 30.0, - 10.0 + 8.0 ] }, "interval": [ - 0.0, - 1.0 + 0.25, + 0.75 ], - "tolerance": 0.00005099019513592785, + "tolerance": 0.00008, "uses": [ { - "face": 4, + "face": 3, "loop": 0, - "position": 3, + "position": 0, "upper": true }, { - "face": 5, + "face": 6, "loop": 0, - "position": 3, + "position": 2, "upper": false } ], @@ -2609,39 +2411,231 @@ { "curve": { "end": [ - 40.0, - 2.0000000000000004, + 0.0, + 0.0, 10.0 ], "kind": "line", "start": [ 0.0, - 2.0000000000000004, - 10.0 + 0.0, + 0.0 ] }, + "interval": [ + 0.0, + 0.8 + ], + "tolerance": 0.00002, + "uses": [ + { + "face": 3, + "loop": 0, + "position": 1, + "upper": true + }, + { + "face": 4, + "loop": 0, + "position": 4, + "upper": false + } + ], + "vertices": [ + 6, + 8 + ] + }, + { + "curve": { + "end": [ + 40.0, + 0.0, + 10.0 + ], + "kind": "line", + "start": [ + 40.0, + 0.0, + 0.0 + ] + }, + "interval": [ + 0.0, + 0.8 + ], + "tolerance": 0.00002, + "uses": [ + { + "face": 3, + "loop": 0, + "position": 3, + "upper": false + }, + { + "face": 5, + "loop": 0, + "position": 1, + "upper": true + } + ], + "vertices": [ + 7, + 9 + ] + }, + { + "curve": { + "frame": { + "origin": [ + 0.0, + 2.000000000000002, + 7.999999999999997 + ], + "x_axis": [ + 0.0, + -2.886579864025403e-15, + 1.0 + ], + "y_axis": [ + 0.0, + -1.0, + -2.886579864025403e-15 + ] + }, + "kind": "circle", + "radius": 2.000000000000003 + }, "interval": [ 0.0, 1.0 ], - "tolerance": 0.00005099019513592785, + "nurbs": { + "homogeneous": [ + [ + 0.0, + 1.9999999999999964, + 10.0, + 1.0 + ], + [ + 0.0, + 1.0638579009562312e-15, + 7.071067811865485, + 0.7071067811865489 + ], + [ + 0.0, + -8.881784197001252e-16, + 7.999999999999999, + 1.0 + ] + ], + "kind": "rational_spline", + "knots": [ + 0.0, + 0.0, + 0.0, + 1.0, + 1.0, + 1.0 + ] + }, + "tolerance": 0.00008, + "uses": [ + { + "face": 4, + "loop": 0, + "position": 0, + "upper": true + }, + { + "face": 6, + "loop": 0, + "position": 1, + "upper": false + } + ], + "vertices": [ + 0, + 8 + ] + }, + { + "curve": { + "frame": { + "origin": [ + 40.0, + 2.000000000000002, + 7.999999999999997 + ], + "x_axis": [ + 0.0, + -2.886579864025403e-15, + 1.0 + ], + "y_axis": [ + 0.0, + 1.0, + 2.886579864025403e-15 + ] + }, + "kind": "circle", + "radius": 2.000000000000003 + }, + "interval": [ + 0.0, + 1.0 + ], + "nurbs": { + "homogeneous": [ + [ + 40.0, + -8.881784197001252e-16, + 7.999999999999999, + 1.0 + ], + [ + 28.284271247461955, + 1.0638579009562312e-15, + 7.071067811865485, + 0.7071067811865489 + ], + [ + 40.0, + 1.9999999999999964, + 10.0, + 1.0 + ] + ], + "kind": "rational_spline", + "knots": [ + 0.0, + 0.0, + 0.0, + 1.0, + 1.0, + 1.0 + ] + }, + "tolerance": 0.00008, "uses": [ { "face": 5, "loop": 0, "position": 0, - "upper": false + "upper": true }, { "face": 6, "loop": 0, - "position": 2, - "upper": true + "position": 3, + "upper": false } ], "vertices": [ 9, - 7 + 1 ] } ], @@ -2650,35 +2644,58 @@ "domain": [ [ 0.0, - 1.0 + 55.0 ], [ 0.0, - 1.0 + 55.0 ] ], "loops": [ { "edges": [ { - "edge": 3, + "edge": 0, "forward": true, "pcurve": { "kind": "spline", "knots": [ - 0.0, - 0.0, + 0.25, + 0.25, + 0.75, + 0.75 + ], + "points": [ + [ + 14.5, + 47.5 + ], + [ + 14.5, + 7.5 + ] + ] + } + }, + { + "edge": 1, + "forward": true, + "pcurve": { + "kind": "spline", + "knots": [ + 0.06666666666666655, + 0.06666666666666655, 1.0, 1.0 ], "points": [ [ - 1.0, - 1.0 + 14.5, + 7.5 ], [ - 0.0, - 1.0 + 42.5, + 7.5 ] ] } @@ -2696,58 +2713,35 @@ ], "points": [ [ - 0.0, - 1.0 + 42.5, + 7.5 ], [ - 0.0, - 0.0 + 42.5, + 47.5 ] ] } }, { - "edge": 1, + "edge": 3, "forward": true, "pcurve": { "kind": "spline", "knots": [ 0.0, 0.0, - 1.0, - 1.0 + 0.9333333333333335, + 0.9333333333333335 ], "points": [ [ - 0.0, - 0.0 + 42.5, + 47.5 ], [ - 1.0, - 0.0 - ] - ] - } - }, - { - "edge": 0, - "forward": true, - "pcurve": { - "kind": "spline", - "knots": [ - 0.0, - 0.0, - 1.0, - 1.0 - ], - "points": [ - [ - 1.0, - 0.0 - ], - [ - 1.0, - 1.0 + 14.5, + 47.5 ] ] } @@ -2757,19 +2751,19 @@ } ], "surface": { - "kind": "plane_through", + "kind": "plane", "origin": [ - 40.0, - 30.0, - 0.0 + 47.5, + -12.500000000000004, + 10.0 ], - "u_point": [ + "u_axis": [ 0.0, - 30.0, + 1.0, 0.0 ], - "v_point": [ - 40.0, + "v_axis": [ + -1.0, 0.0, 0.0 ] @@ -2779,18 +2773,41 @@ "domain": [ [ 0.0, - 1.0 + 40.0 ], [ 0.0, - 0.8 + 10.0 ] ], "loops": [ { "edges": [ { - "edge": 3, + "edge": 4, + "forward": false, + "pcurve": { + "kind": "spline", + "knots": [ + 0.0, + 0.0, + 1.0, + 1.0 + ], + "points": [ + [ + 0.0, + 0.0 + ], + [ + 0.0, + 10.0 + ] + ] + } + }, + { + "edge": 5, "forward": true, "pcurve": { "kind": "spline", @@ -2806,14 +2823,14 @@ 0.0 ], [ - 1.0, + 40.0, 0.0 ] ] } }, { - "edge": 4, + "edge": 6, "forward": true, "pcurve": { "kind": "spline", @@ -2825,12 +2842,95 @@ ], "points": [ [ - 1.0, + 40.0, 0.0 ], [ - 1.0, - 0.8 + 40.0, + 10.0 + ] + ] + } + }, + { + "edge": 2, + "forward": false, + "pcurve": { + "kind": "spline", + "knots": [ + 0.0, + 0.0, + 1.0, + 1.0 + ], + "points": [ + [ + 0.0, + 10.0 + ], + [ + 40.0, + 10.0 + ] + ] + } + } + ], + "kind": "edges" + } + ], + "surface": { + "kind": "plane", + "origin": [ + 40.0, + 30.0, + 0.0 + ], + "u_axis": [ + -1.0, + 0.0, + 0.0 + ], + "v_axis": [ + 0.0, + 0.0, + 1.0 + ] + } + }, + { + "domain": [ + [ + 0.0, + 55.0 + ], + [ + 0.0, + 55.0 + ] + ], + "loops": [ + { + "edges": [ + { + "edge": 7, + "forward": false, + "pcurve": { + "kind": "spline", + "knots": [ + 0.0, + 0.0, + 1.0, + 1.0 + ], + "points": [ + [ + 47.5, + 42.5 + ], + [ + 47.5, + 12.500000000000004 ] ] } @@ -2848,12 +2948,279 @@ ], "points": [ [ - 0.0, - 0.8 + 7.5, + 42.5 ], [ - 1.0, - 0.8 + 47.5, + 42.5 + ] + ] + } + }, + { + "edge": 8, + "forward": false, + "pcurve": { + "kind": "spline", + "knots": [ + 0.0, + 0.0, + 1.0, + 1.0 + ], + "points": [ + [ + 7.5, + 12.500000000000004 + ], + [ + 7.5, + 42.5 + ] + ] + } + }, + { + "edge": 9, + "forward": false, + "pcurve": { + "kind": "spline", + "knots": [ + 0.0, + 0.0, + 1.0, + 1.0 + ], + "points": [ + [ + 47.5, + 12.500000000000004 + ], + [ + 7.5, + 12.500000000000004 + ] + ] + } + } + ], + "kind": "edges" + } + ], + "surface": { + "kind": "plane", + "origin": [ + 47.5, + -12.500000000000004, + 0.0 + ], + "u_axis": [ + -1.0, + 0.0, + 0.0 + ], + "v_axis": [ + 0.0, + 1.0, + 0.0 + ] + } + }, + { + "domain": [ + [ + 0.0, + 40.0 + ], + [ + 0.0, + 10.0 + ] + ], + "loops": [ + { + "edges": [ + { + "edge": 10, + "forward": false, + "pcurve": { + "kind": "spline", + "knots": [ + 0.25, + 0.25, + 0.75, + 0.75 + ], + "points": [ + [ + 0.0, + 8.0 + ], + [ + 40.0, + 8.0 + ] + ] + } + }, + { + "edge": 11, + "forward": false, + "pcurve": { + "kind": "spline", + "knots": [ + 0.0, + 0.0, + 0.8, + 0.8 + ], + "points": [ + [ + 0.0, + 0.0 + ], + [ + 0.0, + 8.0 + ] + ] + } + }, + { + "edge": 9, + "forward": true, + "pcurve": { + "kind": "spline", + "knots": [ + 0.0, + 0.0, + 1.0, + 1.0 + ], + "points": [ + [ + 0.0, + 0.0 + ], + [ + 40.0, + 0.0 + ] + ] + } + }, + { + "edge": 12, + "forward": true, + "pcurve": { + "kind": "spline", + "knots": [ + 0.0, + 0.0, + 0.8, + 0.8 + ], + "points": [ + [ + 40.0, + 0.0 + ], + [ + 40.0, + 8.0 + ] + ] + } + } + ], + "kind": "edges" + } + ], + "surface": { + "kind": "plane", + "origin": [ + 0.0, + 0.0, + 0.0 + ], + "u_axis": [ + 1.0, + 0.0, + 0.0 + ], + "v_axis": [ + -0.0, + 0.0, + 1.0 + ] + } + }, + { + "domain": [ + [ + 0.0, + 30.0 + ], + [ + 0.0, + 10.0 + ] + ], + "loops": [ + { + "edges": [ + { + "edge": 13, + "forward": false, + "pcurve": { + "homogeneous": [ + [ + 28.000000000000004, + 10.0, + 1.0 + ], + [ + 21.213203435596466, + 7.071067811865485, + 0.7071067811865489 + ], + [ + 30.0, + 7.999999999999999, + 1.0 + ] + ], + "kind": "rational_spline", + "knots": [ + 0.0, + 0.0, + 0.0, + 1.0, + 1.0, + 1.0 + ] + } + }, + { + "edge": 3, + "forward": false, + "pcurve": { + "kind": "spline", + "knots": [ + 0.0, + 0.0, + 0.9333333333333335, + 0.9333333333333335 + ], + "points": [ + [ + 0.0, + 10.0 + ], + [ + 28.000000000000004, + 10.0 ] ] } @@ -2876,67 +3243,7 @@ ], [ 0.0, - 0.8 - ] - ] - } - } - ], - "kind": "edges" - } - ], - "surface": { - "kind": "plane_through", - "origin": [ - 0.0, - 0.0, - 0.0 - ], - "u_point": [ - 40.0, - 0.0, - 0.0 - ], - "v_point": [ - 0.0, - 0.0, - 10.0 - ] - } - }, - { - "domain": [ - [ - -7.986267747556337e-18, - 1.0 - ], - [ - 0.0, - 1.0000000000000002 - ] - ], - "loops": [ - { - "edges": [ - { - "edge": 2, - "forward": true, - "pcurve": { - "kind": "spline", - "knots": [ - 0.0, - 0.0, - 1.0, - 1.0 - ], - "points": [ - [ - 0.0, - 0.0 - ], - [ - 1.0, - 0.0 + 10.0 ] ] } @@ -2954,72 +3261,94 @@ ], "points": [ [ - 1.0, + 0.0, 0.0 ], [ - 1.0, - 1.0 + 30.0, + 0.0 ] ] } }, { - "edge": 8, - "forward": false, + "edge": 11, + "forward": true, "pcurve": { "kind": "spline", "knots": [ 0.0, 0.0, - 1.0, - 1.0 + 0.8, + 0.8 ], "points": [ [ - 0.0666666666666667, - 1.0 + 30.0, + 0.0 ], [ - 1.0, - 1.0 + 30.0, + 8.0 ] ] } - }, + } + ], + "kind": "edges" + } + ], + "surface": { + "kind": "plane", + "origin": [ + 0.0, + 30.0, + 0.0 + ], + "u_axis": [ + 0.0, + -1.0, + 0.0 + ], + "v_axis": [ + 0.0, + 0.0, + 1.0 + ] + } + }, + { + "domain": [ + [ + 0.0, + 30.0 + ], + [ + 0.0, + 10.0 + ] + ], + "loops": [ + { + "edges": [ { - "edge": 9, + "edge": 14, "forward": false, "pcurve": { "homogeneous": [ [ 0.0, - 0.8, + 7.999999999999999, 1.0 ], [ - -7.401486830834377e-18, - 0.7767766952966368, - 0.9267766952966368 + 1.0638579009562312e-15, + 7.071067811865485, + 0.7071067811865489 ], [ - 0.008333333333333304, - 0.7785533905932737, - 0.8535533905932736 - ], - [ - 0.024999999999999963, - 0.8285533905932736, - 0.8535533905932736 - ], - [ - 0.04999999999999994, - 0.926776695296637, - 0.9267766952966368 - ], - [ - 0.06666666666666661, - 1.0, + 1.9999999999999964, + 10.0, 1.0 ] ], @@ -3028,18 +3357,61 @@ 0.0, 0.0, 0.0, - 0.25, - 0.5, - 0.75, 1.0, 1.0, 1.0 ] } }, + { + "edge": 12, + "forward": false, + "pcurve": { + "kind": "spline", + "knots": [ + 0.0, + 0.0, + 0.8, + 0.8 + ], + "points": [ + [ + 0.0, + 0.0 + ], + [ + 0.0, + 8.0 + ] + ] + } + }, + { + "edge": 8, + "forward": true, + "pcurve": { + "kind": "spline", + "knots": [ + 0.0, + 0.0, + 1.0, + 1.0 + ], + "points": [ + [ + 0.0, + 0.0 + ], + [ + 30.0, + 0.0 + ] + ] + } + }, { "edge": 4, - "forward": false, + "forward": true, "pcurve": { "kind": "spline", "knots": [ @@ -3050,141 +3422,35 @@ ], "points": [ [ - 0.0, + 30.0, 0.0 ], [ - 0.0, - 0.8 + 30.0, + 10.0 ] ] } - } - ], - "kind": "edges" - } - ], - "surface": { - "kind": "plane_through", - "origin": [ - 40.0, - 0.0, - 0.0 - ], - "u_point": [ - 40.0, - 30.0, - 0.0 - ], - "v_point": [ - 40.0, - 0.0, - 10.0 - ] - } - }, - { - "domain": [ - [ - 0.0, - 1.0 - ], - [ - 0.0, - 1.0 - ] - ], - "loops": [ - { - "edges": [ + }, { "edge": 1, - "forward": true, - "pcurve": { - "kind": "spline", - "knots": [ - 0.0, - 0.0, - 1.0, - 1.0 - ], - "points": [ - [ - 0.0, - 0.0 - ], - [ - 1.0, - 0.0 - ] - ] - } - }, - { - "edge": 10, - "forward": true, - "pcurve": { - "kind": "spline", - "knots": [ - 0.0, - 0.0, - 1.0, - 1.0 - ], - "points": [ - [ - 1.0, - 0.0 - ], - [ - 1.0, - 1.0 - ] - ] - } - }, - { - "edge": 11, "forward": false, "pcurve": { "kind": "spline", "knots": [ - 0.0, - 0.0, + 0.06666666666666655, + 0.06666666666666655, 1.0, 1.0 ], "points": [ [ - 0.0, - 1.0 + 1.9999999999999967, + 10.0 ], [ - 1.0, - 1.0 - ] - ] - } - }, - { - "edge": 7, - "forward": false, - "pcurve": { - "kind": "spline", - "knots": [ - 0.0, - 0.0, - 1.0, - 1.0 - ], - "points": [ - [ - 0.0, - 0.0 - ], - [ - 0.0, - 1.0 + 30.0, + 10.0 ] ] } @@ -3194,21 +3460,21 @@ } ], "surface": { - "kind": "plane_through", + "kind": "plane", "origin": [ 40.0, - 30.0, - 0.0 - ], - "u_point": [ 0.0, - 30.0, 0.0 ], - "v_point": [ - 40.0, - 30.0, - 10.0 + "u_axis": [ + 0.0, + 1.0, + 0.0 + ], + "v_axis": [ + 0.0, + 0.0, + 1.0 ] } }, @@ -3219,8 +3485,8 @@ 1.0 ], [ - 0.0, - 1.0000000000000002 + 0.25000000000000006, + 0.7500000000000002 ] ], "loops": [ @@ -3228,103 +3494,30 @@ "edges": [ { "edge": 0, - "forward": true, + "forward": false, "pcurve": { "kind": "spline", "knots": [ - 0.0, - 0.0, - 1.0, - 1.0 - ], - "points": [ - [ - 0.0, - 0.0 - ], - [ - 1.0, - 0.0 - ] - ] - } - }, - { - "edge": 6, - "forward": true, - "pcurve": { - "kind": "spline", - "knots": [ - 0.0, - 0.0, - 1.0, - 1.0 - ], - "points": [ - [ - 1.0, - 0.0 - ], - [ - 1.0, - 0.8 - ] - ] - } - }, - { - "edge": 12, - "forward": true, - "pcurve": { - "homogeneous": [ - [ - 1.0, - 0.8, - 1.0 - ], - [ - 0.9267766952966368, - 0.7767766952966368, - 0.9267766952966368 - ], - [ - 0.8452200572599404, - 0.7785533905932737, - 0.8535533905932736 - ], - [ - 0.8285533905932737, - 0.8285533905932736, - 0.8535533905932736 - ], - [ - 0.8767766952966368, - 0.926776695296637, - 0.9267766952966368 - ], - [ - 0.9333333333333333, - 1.0, - 1.0 - ] - ], - "kind": "rational_spline", - "knots": [ - 0.0, - 0.0, - 0.0, 0.25, - 0.5, + 0.25, 0.75, - 1.0, - 1.0, - 1.0 + 0.75 + ], + "points": [ + [ + -5.551115123125784e-17, + 0.25000000000000006 + ], + [ + -1.6653345369377353e-16, + 0.7500000000000002 + ] ] } }, { "edge": 13, - "forward": false, + "forward": true, "pcurve": { "kind": "spline", "knots": [ @@ -3335,431 +3528,58 @@ ], "points": [ [ - 0.0, - 1.0 + -5.551115123125784e-17, + 0.25000000000000006 ], [ - 0.9333333333333333, - 1.0 + 0.9999999999999999, + 0.24999999999999983 ] ] } }, { "edge": 10, - "forward": false, - "pcurve": { - "kind": "spline", - "knots": [ - 0.0, - 0.0, - 1.0, - 1.0 - ], - "points": [ - [ - 0.0, - 0.0 - ], - [ - 0.0, - 1.0 - ] - ] - } - } - ], - "kind": "edges" - } - ], - "surface": { - "kind": "plane_through", - "origin": [ - 0.0, - 30.0, - 0.0 - ], - "u_point": [ - 0.0, - 0.0, - 0.0 - ], - "v_point": [ - 0.0, - 30.0, - 10.0 - ] - } - }, - { - "domain": [ - [ - 0.0, - 1.0 - ], - [ - 0.0, - 0.9333333333333333 - ] - ], - "loops": [ - { - "edges": [ - { - "edge": 14, "forward": true, "pcurve": { "kind": "spline", "knots": [ - 0.0, - 0.0, - 1.0, - 1.0 - ], - "points": [ - [ - 1.0, - 0.9333333333333333 - ], - [ - 0.0, - 0.9333333333333333 - ] - ] - } - }, - { - "edge": 8, - "forward": true, - "pcurve": { - "kind": "spline", - "knots": [ - 0.0, - 0.0, - 1.0, - 1.0 - ], - "points": [ - [ - 0.0, - 0.9333333333333333 - ], - [ - 0.0, - 0.0 - ] - ] - } - }, - { - "edge": 11, - "forward": true, - "pcurve": { - "kind": "spline", - "knots": [ - 0.0, - 0.0, - 1.0, - 1.0 - ], - "points": [ - [ - 0.0, - 0.0 - ], - [ - 1.0, - 0.0 - ] - ] - } - }, - { - "edge": 13, - "forward": true, - "pcurve": { - "kind": "spline", - "knots": [ - 0.0, - 0.0, - 1.0, - 1.0 - ], - "points": [ - [ - 1.0, - 0.0 - ], - [ - 1.0, - 0.9333333333333333 - ] - ] - } - } - ], - "kind": "edges" - } - ], - "surface": { - "kind": "plane_through", - "origin": [ - 40.0, - 30.0, - 10.0 - ], - "u_point": [ - 0.0, - 30.0, - 10.0 - ], - "v_point": [ - 40.0, - 0.0, - 10.0 - ] - } - }, - { - "domain": [ - [ - 0.04545454545454534, - 0.9545454545454558 - ], - [ - 0.0, - 1.0 - ] - ], - "loops": [ - { - "edges": [ - { - "edge": 5, - "forward": true, - "pcurve": { - "kind": "spline", - "knots": [ - 0.0, - 0.0, - 0.0, - 0.0, - 0.25, - 0.5, - 0.75, - 1.0, - 1.0, - 1.0, - 1.0 - ], - "points": [ - [ - 0.045454545454545456, - 0.0 - ], - [ - 0.12121212121212152, - 4.5719622005949435e-29 - ], - [ - 0.2727272727272723, - -9.234546643463372e-29 - ], - [ - 0.5000000000000003, - 1.2613775212174764e-28 - ], - [ - 0.7272727272727273, - -1.5462528084393657e-28 - ], - [ - 0.878787878787879, - 2.5251621150969953e-28 - ], - [ - 0.9545454545454546, - 5.596943416786294e-29 - ] - ] - } - }, - { - "edge": 9, - "forward": true, - "pcurve": { - "kind": "spline", - "knots": [ - 0.0, - 0.0, - 0.0, - 0.0, 0.25, 0.25, - 0.5, - 0.5, 0.75, - 0.75, - 1.0, - 1.0, - 1.0, - 1.0 + 0.75 ], "points": [ [ - 0.9545454545454546, - 0.0 + 0.9999999999999999, + 0.24999999999999983 ], [ - 0.954545454545455, - 0.08333333333333373 - ], - [ - 0.9545454545454541, - 0.16666666666666594 - ], - [ - 0.9545454545454553, - 0.3333333333333344 - ], - [ - 0.9545454545454534, - 0.4166666666666663 - ], - [ - 0.9545454545454558, - 0.5833333333333327 - ], - [ - 0.9545454545454528, - 0.6666666666666675 - ], - [ - 0.9545454545454558, - 0.8333333333333327 - ], - [ - 0.954545454545454, - 0.9166666666666672 - ], - [ - 0.9545454545454546, - 1.0 + 0.9999999999999998, + 0.75 ] ] } }, { "edge": 14, - "forward": false, + "forward": true, "pcurve": { "kind": "spline", "knots": [ 0.0, 0.0, - 0.0, - 0.0, - 0.25, - 0.5, - 0.75, - 1.0, - 1.0, 1.0, 1.0 ], "points": [ [ - 0.045454545454545456, - 1.0 + 0.9999999999999998, + 0.75 ], [ - 0.1212121212121216, - 1.0000000000000009 - ], - [ - 0.2727272727272723, - 0.9999999999999983 - ], - [ - 0.5000000000000003, - 1.0000000000000029 - ], - [ - 0.7272727272727273, - 0.9999999999999967 - ], - [ - 0.878787878787879, - 1.0000000000000022 - ], - [ - 0.9545454545454545, - 1.0 - ] - ] - } - }, - { - "edge": 12, - "forward": false, - "pcurve": { - "kind": "spline", - "knots": [ - 0.0, - 0.0, - 0.0, - 0.0, - 0.25, - 0.25, - 0.5, - 0.5, - 0.75, - 0.75, - 1.0, - 1.0, - 1.0, - 1.0 - ], - "points": [ - [ - 0.045454545454545456, - 0.0 - ], - [ - 0.04545454545454551, - 0.08333333333333406 - ], - [ - 0.04545454545454538, - 0.16666666666666494 - ], - [ - 0.04545454545454557, - 0.33333333333333465 - ], - [ - 0.04545454545454534, - 0.4166666666666653 - ], - [ - 0.04545454545454556, - 0.5833333333333335 - ], - [ - 0.045454545454545414, - 0.666666666666666 - ], - [ - 0.04545454545454549, - 0.8333333333333343 - ], - [ - 0.04545454545454544, - 0.9166666666666657 - ], - [ - 0.045454545454545456, - 1.0 + -1.6653345369377353e-16, + 0.7500000000000002 ] ] } @@ -3768,81 +3588,47 @@ "kind": "edges" } ], - "surface": { + "nurbs": { "homogeneous": [ [ [ - -2.0, 0.0, - 8.0, + 1.9999999999999964, + 10.0, 1.0 ], [ - -1.8535533905932735, - -2.220446049250313e-16, - 7.767766952966368, - 0.9267766952966368 - ], - [ - -1.7071067811865472, - 0.2499999999999991, - 7.785533905932737, - 0.8535533905932736 - ], - [ - -1.7071067811865472, - 0.7499999999999988, - 8.285533905932736, - 0.8535533905932736 - ], - [ - -1.8535533905932735, - 1.4999999999999982, - 9.267766952966369, - 0.9267766952966368 - ], - [ - -2.0, - 1.9999999999999984, + 40.00000000000001, + 1.9999999999999964, 10.0, 1.0 ] ], [ [ - 42.0, 0.0, + 1.3778763926929864e-15, + 7.071067811865485, + 0.7071067811865489 + ], + [ + 28.284271247461962, + 1.3778763926929864e-15, + 7.071067811865485, + 0.7071067811865489 + ] + ], + [ + [ + 0.0, + -4.440892098500626e-16, 8.0, 1.0 ], [ - 38.92462120245874, - -2.220446049250313e-16, - 7.767766952966368, - 0.9267766952966368 - ], - [ - 35.84924240491749, - 0.2499999999999991, - 7.785533905932737, - 0.8535533905932736 - ], - [ - 35.84924240491749, - 0.7499999999999988, - 8.285533905932736, - 0.8535533905932736 - ], - [ - 38.92462120245874, - 1.4999999999999982, - 9.267766952966369, - 0.9267766952966368 - ], - [ - 42.0, - 1.9999999999999984, - 10.0, + 40.00000000000001, + -4.440892098500626e-16, + 8.0, 1.0 ] ] @@ -3851,20 +3637,38 @@ "u_knots": [ 0.0, 0.0, + 0.0, + 1.0, 1.0, 1.0 ], "v_knots": [ - 0.0, - 0.0, - 0.0, - 0.25, - 0.5, - 0.75, - 1.0, - 1.0, - 1.0 + 0.25000000000000006, + 0.25000000000000006, + 0.7500000000000002, + 0.7500000000000002 ] + }, + "surface": { + "frame": { + "origin": [ + 0.0, + 2.0000000000000027, + 7.9999999999999964 + ], + "x_axis": [ + 0.0, + -3.1086244689504328e-15, + 1.0 + ], + "y_axis": [ + 0.0, + -1.0, + -3.1086244689504328e-15 + ] + }, + "kind": "cylinder", + "radius": 2.0000000000000036 } } ], @@ -3887,7 +3691,7 @@ "faces": [ { "face": 0, - "forward": false + "forward": true }, { "face": 1, @@ -3918,24 +3722,40 @@ "wires": [] } ], - "tolerance": 0.00005099019513592785, + "tolerance": 0.00002, "version": 4, "vertices": [ { "point": [ 0.0, - 30.0, - 0.0 + 1.9999999999999964, + 10.0 ], - "tolerance": 0.00005099019513592785 + "tolerance": 0.00008 + }, + { + "point": [ + 40.0, + 1.9999999999999964, + 10.0 + ], + "tolerance": 0.00008 + }, + { + "point": [ + 40.0, + 30.0, + 10.0 + ], + "tolerance": 0.00002 }, { "point": [ 0.0, - 0.0, - 0.0 + 30.0, + 10.0 ], - "tolerance": 0.00005099019513592785 + "tolerance": 0.00002 }, { "point": [ @@ -3943,7 +3763,23 @@ 30.0, 0.0 ], - "tolerance": 0.00005099019513592785 + "tolerance": 0.00002 + }, + { + "point": [ + 0.0, + 30.0, + 0.0 + ], + "tolerance": 0.00002 + }, + { + "point": [ + 0.0, + 0.0, + 0.0 + ], + "tolerance": 0.00002 }, { "point": [ @@ -3951,15 +3787,7 @@ 0.0, 0.0 ], - "tolerance": 0.00005099019513592785 - }, - { - "point": [ - 40.0, - 0.0, - 8.0 - ], - "tolerance": 0.00005099019513592785 + "tolerance": 0.00002 }, { "point": [ @@ -3967,39 +3795,15 @@ 0.0, 8.0 ], - "tolerance": 0.00005099019513592785 + "tolerance": 0.00008 }, { "point": [ 40.0, - 30.0, - 10.0 + -8.881784197001252e-16, + 7.999999999999999 ], - "tolerance": 0.00005099019513592785 - }, - { - "point": [ - 40.0, - 2.0000000000000004, - 10.0 - ], - "tolerance": 0.00005099019513592785 - }, - { - "point": [ - 0.0, - 30.0, - 10.0 - ], - "tolerance": 0.00005099019513592785 - }, - { - "point": [ - 0.0, - 2.0000000000000004, - 10.0 - ], - "tolerance": 0.00005099019513592785 + "tolerance": 0.00008 } ] } From bf74dcbbe877899a14b7e97d5282e0318e6476a4 Mon Sep 17 00:00:00 2001 From: jyviko <2501648+jyviko@users.noreply.github.com> Date: Thu, 29 Oct 2026 22:55:46 -0400 Subject: [PATCH 3/9] Tests: a round wall is one face, its name without a piece number MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since 09c979a4b a circle is one closed arc, so an extruded circle's wall, a hole's wall and a cylinder's side are one face each, closed along a seam. Tests that counted truck's two halves: - certified_annulus_side_rows_follow_radius_edits_and_clone and certified_side_transfer_preserves_geometry_and_unsupported_taper_refuses_atomically: the painted outer wall is 1 face (every vertex of it still at the painted radius), not 2; - offset_surface_of_a_cylinder_and_a_box_top: the offset sleeve is 1 face (its area 2π·12·20 unchanged); - press_pull_then_curved_face_offsets_it: a click on the hole's wall offsets its 1 face; - pi_case_faces_per_step_at_both_heights: each standoff (a ring, Ø6 round a Ø2.5 hole) adds 4 faces, not 6: its outer and inner wall, its top, the floor inside its hole. So 23 after the first and 35 after the pattern of four; the port openings (3 × 4), the end cut-out (4) and the five vents (5 × 4) are planar and add what they did: 47, 51, 55, 71. - the_round_sides_of_a_thin_ring_are_named_by_the_circle_they_run_beside: a thin ring 2 thick about the R10 circle has two walls, `F2:wall:c1:left` (radius 9: the counter-clockwise circle's left is inside) and `F2:wall:c1:right` (radius 11), with no numbers; each name is found again by a point on its own wall. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/config_certificate_tests.rs | 14 +++++++------- crates/engine/src/cmd/surface.rs | 8 ++++---- crates/engine/src/cmd/thin_extrude_tests.rs | 13 +++++++++---- 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/crates/engine/src/cmd/config_certificate_tests.rs b/crates/engine/src/cmd/config_certificate_tests.rs index 61d926c53..230186595 100644 --- a/crates/engine/src/cmd/config_certificate_tests.rs +++ b/crates/engine/src/cmd/config_certificate_tests.rs @@ -49,22 +49,22 @@ fn certified_annulus_side_rows_follow_radius_edits_and_clone() { run(&mut s, "sketch.finish", json!({})); run(&mut s, "solid.extrude", json!({"distance":10,"profiles":[{"point":[9.5,0]}],"body_name":"Ring"})); paint(&mut s, "Ring", json!([10, 0, 5])); - assert_eq!(painted_radius(&s, "Ring", 10.), 2, "both constructed arc pieces share outer curve"); + assert_eq!(painted_radius(&s, "Ring", 10.), 1, "the outer circle's wall is one face, closed along its seam"); let Column::FaceAppearance(target) = &s.doc.configs.columns[0] else { panic!() }; assert_eq!(target.certificate, Some(FaceCertificate::ExtrudeSide { sketch, curve: "outer".into() })); run(&mut s, "parameters.change", json!({"name":dimensions[0],"expression":"12 mm"})); run(&mut s, "parameters.change", json!({"name":dimensions[1],"expression":"9.25 mm"})); run(&mut s, "config.activate", json!({"row":"Painted"})); - assert_eq!(painted_radius(&s, "Ring", 12.), 2); + assert_eq!(painted_radius(&s, "Ring", 12.), 1); run(&mut s, "component.paste_new", json!({"component":part,"translate":[30,0,0]})); assert_eq!(s.doc.configs.columns.len(), 2); run(&mut s, "config.activate", json!({"row":"Painted"})); - assert_eq!(painted_radius(&s, "Ring (2)", 12.), 2); + assert_eq!(painted_radius(&s, "Ring (2)", 12.), 1); let reopened = solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap(); let mut reopened = Session::new(reopened); run(&mut reopened, "config.activate", json!({"row":"Painted"})); - assert_eq!(painted_radius(&reopened, "Ring", 12.), 2); - assert_eq!(painted_radius(&reopened, "Ring (2)", 12.), 2); + assert_eq!(painted_radius(&reopened, "Ring", 12.), 1); + assert_eq!(painted_radius(&reopened, "Ring (2)", 12.), 1); run(&mut reopened, "config.activate", json!({"row":"Default"})); assert!(reopened.doc.appearances.faces.is_empty()); } @@ -227,11 +227,11 @@ fn certified_side_transfer_preserves_geometry_and_unsupported_taper_refuses_atom run(&mut s, "occurrence.move", json!({"occurrence":occurrence,"translate":[30,20,0],"angle":90,"axis":[0,0,1],"capture":false})); run(&mut s, "component.move_bodies", json!({"component":destination,"bodies":["Round"]})); run(&mut s, "config.activate", json!({"row":"Painted"})); - assert_eq!(painted_radius(&s, "Round", 10.), 2); + assert_eq!(painted_radius(&s, "Round", 10.), 1); let before = s.world_state().unwrap().body("Round").unwrap().mesh().bounds(); let mut s = Session::new(solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap()); run(&mut s, "config.activate", json!({"row":"Painted"})); - assert_eq!(painted_radius(&s, "Round", 10.), 2); + assert_eq!(painted_radius(&s, "Round", 10.), 1); assert!( s.world_state().unwrap().body("Round").unwrap().mesh().bounds().min.dist(before.min) < 1e-8, "before {before:?}, reopened {:?}", diff --git a/crates/engine/src/cmd/surface.rs b/crates/engine/src/cmd/surface.rs index d9b617042..8066d89ed 100644 --- a/crates/engine/src/cmd/surface.rs +++ b/crates/engine/src/cmd/surface.rs @@ -1091,9 +1091,9 @@ mod tests { } } - /// Offset Surface: a cylinder's side picked once with its chain (both halves) moved out to - /// radius 12; a box top moved up exactly; a zero distance copies; past the axis refused, the - /// design left as it was; undo, redo and reopening. + /// Offset Surface: a cylinder's side (one face, closed along its seam) picked with its chain + /// moved out to radius 12; a box top moved up exactly; a zero distance copies; past the axis + /// refused, the design left as it was; undo, redo and reopening. #[test] fn offset_surface_of_a_cylinder_and_a_box_top() { let mut s = Session::default(); @@ -1101,7 +1101,7 @@ mod tests { run(&mut s, "surface.offset", json!({"faces": [[10, 0, 10]], "chain": true, "distance": 2, "body": "Can", "body_name": "Sleeve"})); let st = s.world_state().unwrap(); let sleeve = &st.body("Sleeve").unwrap().body; - assert!(sleeve.is_surface() && sleeve.face_count() == 2); + assert!(sleeve.is_surface() && sleeve.face_count() == 1); let want = 2.0 * std::f64::consts::PI * 12.0 * 20.0; assert!((area(&s, "Sleeve") - want).abs() < want * 1e-3, "{} vs {want}", area(&s, "Sleeve")); // (measured on meshes) assert!(st.body("Can").is_some(), "the source body stays"); diff --git a/crates/engine/src/cmd/thin_extrude_tests.rs b/crates/engine/src/cmd/thin_extrude_tests.rs index 332bdec3b..9fd35741f 100644 --- a/crates/engine/src/cmd/thin_extrude_tests.rs +++ b/crates/engine/src/cmd/thin_extrude_tests.rs @@ -371,10 +371,15 @@ fn the_round_sides_of_a_thin_ring_are_named_by_the_circle_they_run_beside() { run(&mut s, "solid.extrude", json!({"sketch": "Outline", "thin": true, "thickness": 2, "distance": 5, "name": "Ring"})); let world = s.world_state().unwrap(); let names = solidcraft_doc::naming::face_names(world.bodies.first().unwrap()); - // Each round side is two half cylinders, told apart by their numbers. + // Each round side is one cylinder, closed along its seam, so its name needs no number. let walls: Vec<_> = names.iter().filter(|name| name.contains(":wall:")).collect(); - assert_eq!(walls.len(), 4, "{names:?}"); - for side in ["left", "right"] { - assert_eq!(walls.iter().filter(|name| name.contains(&format!(":wall:c1:{side}#"))).count(), 2, "{walls:?}"); + assert_eq!(walls.len(), 2, "{names:?}"); + // The wall is 2 thick about the circle (radius 9 to 11). The circle runs counter-clockwise, + // so its left is the inner side; each name is found again at a point on its own wall. + for (side, radius) in [("left", 9.0), ("right", 11.0)] { + let name = format!("F2:wall:c1:{side}"); + assert!(walls.contains(&&name), "{walls:?}"); + let at = solidcraft_geom::Vec3::new(0.0, radius, 2.5); + assert_eq!(solidcraft_doc::naming::face_names_at(&s.model.state(), &[at]), vec![name.clone()]); } } From 8f914ddd2cf91d428d552eac542871e4504e3386 Mon Sep 17 00:00:00 2001 From: jyviko <2501648+jyviko@users.noreply.github.com> Date: Thu, 29 Oct 2026 22:55:46 -0400 Subject: [PATCH 4/9] Tests: the saw cut's halves named after their faces, listed in the kernel's order cut_keeps_posts_joined_while_apart_in_one_body expected the reply's `bodies` as ["Case", "Case (1)"]. That list is the state's order, which is SMLib's lump order (the -x half first); the names follow the pieces' faces (lineage::order_lumps, 08cf526fe): the piece whose least face name sorts first keeps "Case". That is the +x half, whose least is `F1:+x`, before the -x half's least, its piece of `F1:+y`. The test now checks the names as a set, that the +x half (from x = 1) is "Case" and the -x half (from x = -30) "Case (1)", and each half's volume as before. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/boolean_regression_tests.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/boolean_regression_tests.rs b/crates/engine/src/boolean_regression_tests.rs index 76910333c..69cb1f5c3 100644 --- a/crates/engine/src/boolean_regression_tests.rs +++ b/crates/engine/src/boolean_regression_tests.rs @@ -1060,8 +1060,15 @@ fn cut_keeps_posts_joined_while_apart_in_one_body() { // A cut through the middle of the case still leaves two bodies, and says it made the second. s.execute("solid.box", &json!({"length": 2, "width": 80, "height": 80, "center": [0, 0, 20], "operation": "new", "body_name": "Saw"})).unwrap(); let saw = s.execute("solid.combine", &json!({"target": "Case", "tools": ["Saw"], "operation": "cut"})).unwrap(); - assert_eq!(saw["bodies"], json!(["Case", "Case (1)"]), "{saw}"); + // `bodies` lists them in the kernel's order. The piece whose least face name sorts first keeps + // the name (`lineage::order_lumps`): the +x half, whose `F1:+x` sorts before the -x half's + // least, its piece of the case's `F1:+y`. + let mut bodies: Vec<&str> = saw["bodies"].as_array().unwrap().iter().filter_map(Value::as_str).collect(); + bodies.sort_unstable(); + assert_eq!(bodies, ["Case", "Case (1)"], "{saw}"); assert_eq!(saw["created_bodies"], json!(["Case (1)"]), "{saw}"); + let low_x = |name: &str| s.model.state().body(name).unwrap().mesh().bounds().min.x; + assert!((low_x("Case") - 1.0).abs() < 1e-9 && (low_x("Case (1)") + 30.0).abs() < 1e-9); let half = (60.0 - 2.0) / 2.0 * 40.0 * 10.0 + posts / 2.0; for name in ["Case", "Case (1)"] { assert!((volume(&s, name) - half).abs() < 1e-6 * half, "{name}: {} vs {half}", volume(&s, name)); From 1a5a3b5ebb3a9d8e4dc61e8f859f9d406939d78f Mon Sep 17 00:00:00 2001 From: jyviko <2501648+jyviko@users.noreply.github.com> Date: Thu, 29 Oct 2026 22:55:46 -0400 Subject: [PATCH 5/9] Tests: an extended cylinder strip stays one face in every mode Since 0a216d692 tangent and curvature extensions are SMLib's G1 and G2 extension of the surface (smlib_extend_sheet, CreateExtendedSurface), and the face stays one face on it, as surface_extend's docs say; extend_a_cylinder_strip_every_way still counted truck's separate run-off face (2). It counts 1. The test still fails after this, on the curvature run-off's area (see the PR): SMLib's G2 extension of the quarter cylinder by 5 gives 413.882 (a section 4.986 long), where the test works out the parabola's 418.182. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/surface.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/crates/engine/src/cmd/surface.rs b/crates/engine/src/cmd/surface.rs index 8066d89ed..2d7451ad3 100644 --- a/crates/engine/src/cmd/surface.rs +++ b/crates/engine/src/cmd/surface.rs @@ -1293,9 +1293,10 @@ mod tests { /// Extend a cylinder strip: naturally 5 along its axis (10 · π/2 · 25, one face, still a /// cylinder), up to the plane z = 30 (10 · π/2 · 30), and by tangent and curvature run-offs - /// (a second face along a straight edge, 20 long: the tangent one a flat 5 × 20, the - /// curvature one the parabola s ↦ s·R + ½κs²·n with the cylinder's κ = 1/10, its section - /// ∫₀⁵ √(1 + κ²s²) ds long). Undo, redo and reopening; the default saves nothing new. + /// along a straight edge, 20 long: each SMLib's G1 or G2 extension of the surface, so the + /// strip stays one face (the tangent one a flat 5 × 20, the curvature one the parabola + /// s ↦ s·R + ½κs²·n with the cylinder's κ = 1/10, its section ∫₀⁵ √(1 + κ²s²) ds long). + /// Undo, redo and reopening; the default saves nothing new. #[test] fn extend_a_cylinder_strip_every_way() { let pi = std::f64::consts::PI; @@ -1326,7 +1327,7 @@ mod tests { for (mode, run_off) in [("tangent", 5.0), ("curvature", parabola)] { run(&mut s, "surface.extend", json!({"body": "Strip", "edges": [side], "distance": 5, "mode": mode})); let st = s.world_state().unwrap(); - assert_eq!(st.body("Strip").unwrap().body.face_count(), 2, "{mode}"); + assert_eq!(st.body("Strip").unwrap().body.face_count(), 1, "{mode}"); let want = 10.0 * pi / 2.0 * 20.0 + run_off * 20.0; assert!((area(&s, "Strip") - want).abs() < want * 1e-3, "{mode}: {} vs {want}", area(&s, "Strip")); // (measured on meshes) let cold = Session::new(solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap()); From a3f150257f95b3811b6efce3a1998a1ffa72ab18 Mon Sep 17 00:00:00 2001 From: jyviko <2501648+jyviko@users.noreply.github.com> Date: Thu, 29 Oct 2026 22:55:46 -0400 Subject: [PATCH 6/9] Tests: the tapered bosses' volume in closed form, not truck's measure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fillets_on_tapered_bosses_saved_before_still_find_their_edges compared the part with 69454.885209 mm³, what the truck build that saved it measured. In closed form: the 80 × 40 × 20 block (64000); the 20 × 20 boss 10 high tapered 5° in, a frustum to a 20 − 20 tan 5° square (3660.251034); the Ø16 boss tapered alike, a cone frustum to radius 8 − 10 tan 5° (1798.751833); less the R1 round on a sloping corner, the corner's section r²(cot φ/2 − (π − φ)/2) at its dihedral angle φ = 90.435° times its length between z = 20 and 30 (2.124401), and the R0.5 round all round the cone's top, the section at the rim's 95° turned about the axis by Pappus (1.928463): 69454.950004. SMLib's part measures 69454.950004. The test still fails before that check: Fillet2's saved edge `F4:side:c1#1|F4:top#[F4:side:c1]` names a half of the cone wall truck built, which SMLib builds whole, so it is found with a "was split" warning (a persistent-name question, see the PR). Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/features_more_tests.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/engine/src/cmd/features_more_tests.rs b/crates/engine/src/cmd/features_more_tests.rs index aeb96898d..2c7b0fef6 100644 --- a/crates/engine/src/cmd/features_more_tests.rs +++ b/crates/engine/src/cmd/features_more_tests.rs @@ -1870,8 +1870,14 @@ fn fillets_on_tapered_bosses_saved_before_still_find_their_edges() { let r = s.model.result(id).unwrap(); assert!(r.error.is_none() && r.warning.is_none(), "{name}: {:?} {:?}", r.error, r.warning); } - // The build that saved it measured 69454.885209 mm³. - assert!((volume - 69454.8852092132).abs() < 1e-3, "{volume}"); + // In closed form: the 80 × 40 × 20 block, the 20 × 20 boss 10 high tapered 5° in (a frustum, + // top 20 − 20 tan 5° square: 3660.251034), the Ø16 boss tapered alike (a cone frustum, top + // radius 8 − 10 tan 5°: 1798.751833); less the R1 round along a sloping corner (the corner's + // section, r²(cot φ/2 − (π − φ)/2) at its dihedral angle φ = 90.435°, times its length + // between z = 20 and 30: 2.124401) and the R0.5 round all round the cone's top (the section + // at the rim's 95°, turned about the axis by Pappus: 1.928463). The build that saved it, + // with truck, measured 69454.885209. + assert!((volume - 69454.950004).abs() < 1e-3, "{volume}"); assert_eq!(s.world_state().unwrap().bodies.len(), 1); } From 01477bb143c5c69e78aef7de536df24b25bc74d2 Mon Sep 17 00:00:00 2001 From: jyviko <2501648+jyviko@users.noreply.github.com> Date: Thu, 29 Oct 2026 22:55:55 -0400 Subject: [PATCH 7/9] Tests: the saved curved strip is the link a truck build saved MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit saved_curved_strip_projection_is_lost_after_exact_wall_coalescence built its "old" strip by cutting the cavity raw (paint turning off the construction shortcut), where truck sewed the cut slab by slab and split the outer round at the cavity's floor. SMLib cuts without slabs: the raw cut's round is one face, so there was no piece to save a projection on, and the test stopped at "must have a piece suffix". The link is now what such a build saved, written out: the face name `F2:blend:F1:+x|F1:+y#1` (the lower piece, numbered up its spread) and the piece's projection on YZ, the rectangle y 24..30, z 0..2 (the quarter round from (40, 24) to (34, 30), its arcs and straight sides), 12 mm³ when extruded 1. The current wall is checked to be one face with that stem and no planar authority. The test still fails: the link is found on the whole wall ("was split; using the nearest piece"), not lost, and the strip's material grows to 6 × 30 × 1 = 180 mm³. project.rs takes a missing piece as removed only on a certified planar or coalesced face, which truck's shell made and SMLib's does not. That is a persistent-name decision for the owner (see the PR). Co-Authored-By: Claude Opus 5.5 --- crates/doc/src/config_shell_tests.rs | 92 +++++++--------------------- 1 file changed, 22 insertions(+), 70 deletions(-) diff --git a/crates/doc/src/config_shell_tests.rs b/crates/doc/src/config_shell_tests.rs index af8adaad5..48e9f04b3 100644 --- a/crates/doc/src/config_shell_tests.rs +++ b/crates/doc/src/config_shell_tests.rs @@ -309,7 +309,6 @@ fn saved_former_strip_projection_reports_lost_without_expanding_healthy_material #[test] fn saved_curved_strip_projection_is_lost_after_exact_wall_coalescence() { - use solidcraft_kernel::{FacePaint, Paint}; use solidcraft_sketch::{LinkKind, LinkSource, Sketch}; let mut doc = Document::new("saved curved strip"); doc.set_param("width", "80", Some("mm"), None).unwrap(); @@ -327,86 +326,39 @@ fn saved_curved_strip_projection_is_lost_after_exact_wall_coalescence() { Some("Corners"), ) .unwrap(); - let shell = doc - .add_feature( - FeatureKind::Shell { - faces: vec![crate::FacePick(Vec3::new(0., 0., 30.))], - thickness: "wall".into(), - body: Some("Case".into()), - direction: "inside".into(), - tangent_chain: false, - }, - Some("Shell"), - ) - .unwrap(); + doc.add_feature( + FeatureKind::Shell { + faces: vec![crate::FacePick(Vec3::new(0., 0., 30.))], + thickness: "wall".into(), + body: Some("Case".into()), + direction: "inside".into(), + tangent_chain: false, + }, + Some("Shell"), + ) + .unwrap(); let mut model = Model::new(); model.evaluate(&doc); assert!(model.results.iter().all(|r| r.error.is_none()), "{:?}", model.results); - let before = model.state_before(shell); - // Per-face paint disables the construction optimization: this control keeps - // the real pre-repair slab faces without forging a name or source witness. - let old_source = before - .body("Case") - .unwrap() - .body - .clone() - .with_paint(Some(Paint { opacity: 1., faces: vec![FacePaint { face: 0, color: [1., 0., 0.], opacity: 1. }] })); - let cavity_box = solidcraft_kernel::box_solid(Vec3::new(-38., -28., 2.), Vec3::new(38., 28., 35.)).unwrap(); - let cavity = solidcraft_kernel::fillet( - &cavity_box, - &[Vec3::new(38., 28., 15.), Vec3::new(-38., 28., 15.), Vec3::new(-38., -28., 15.), Vec3::new(38., -28., 15.)], - 4., - ) - .unwrap(); - let raw = solidcraft_kernel::boolean(&old_source, &cavity, solidcraft_kernel::BoolOp::Cut).unwrap().unwrap(); - let mut old_body = ModelBody::new("Case".into(), raw, shell); - old_body.names = crate::naming::NameCell::new(Some(std::sync::Arc::new(crate::naming::NamingOrigin { - feature: doc.feature(shell).unwrap().clone(), - before, - depth: 1, - mats: vec![], - sheets: vec![], - }))); + // A point low on the outer round of the +x+y corner (radius 6 about (34, 24)), below the + // cavity's floor at z = 2. let t = std::f64::consts::FRAC_1_SQRT_2; let at = Vec3::new(34. + 6. * t, 24. + 6. * t, 1.); - let former = crate::naming::face_name_at_body(&old_body, at).unwrap(); - let stem = crate::naming::strip_piece(&former).to_string(); - assert_ne!(former, stem, "actual old cylindrical strip must have a piece suffix"); let state = model.state(); let current = state.body("Case").unwrap(); let names = crate::naming::face_names(current); + let stem = crate::naming::face_name_at_body(current, at).unwrap(); + assert_eq!(crate::naming::strip_piece(&stem), stem, "the shelled wall's round is one exact face, floor to rim"); let index = names.iter().position(|name| name == &stem).unwrap(); - assert!(current.body.face_was_coalesced(index)); assert!(current.body.face_plane(index).is_none(), "witness grants no planar attachment authority"); - assert!(old_body.body.face_sources().is_none_or(|sources| sources.iter().enumerate().all(|(index, _)| !old_body.body.face_was_coalesced(index)))); - let mut old_state = (*model.state()).clone(); - old_state.bodies = vec![old_body]; + // What a build that sewed the cut slab by slab saved: the round in two pieces split at the + // cavity's floor, the projection made on the lower one, `#1` (pieces numbered up their + // longest spread), from z = 0 to 2. Projected on YZ, the quarter round from (40, 24) to + // (34, 30) is the rectangle y 24..30, z 0..2: its two arcs and its two straight sides. + let former = format!("{stem}#1"); let source = LinkSource::Face { body: "Case".into(), at }; - // Recover the saved projection from the old face's complete raw topology. - // Display seam suppression must not discard a historical strip boundary. - let old_body = old_state.body("Case").unwrap(); - let old_index = crate::naming::face_on_body(old_body, &former, at).unwrap().0; - let mesh = old_body.mesh(); - let mut geometry = Vec::new(); - for (index, faces) in mesh.edge_faces.iter().enumerate() { - if !faces.contains(&(old_index as u32)) { - continue; - } - let points = &mesh.edges[index]; - let a = solidcraft_geom::Plane::YZ.to_local(*points.first().unwrap()); - let b = solidcraft_geom::Plane::YZ.to_local(*points.last().unwrap()); - let (a, b) = (Vec2::new(a.x, a.y), Vec2::new(b.x, b.y)); - assert!(a.dist(b) > 1e-6); - for point in points { - let q = solidcraft_geom::Plane::YZ.to_local(*point); - let q = Vec2::new(q.x, q.y); - let direction = b - a; - let t = ((q - a).dot(direction) / direction.dot(direction)).clamp(0., 1.); - assert!(q.dist(a + direction * t) < 1e-7, "exact cylindrical quadrant projects to a straight support"); - } - geometry.push(solidcraft_sketch::LinkGeom::Line(a, b)); - } - assert_eq!(geometry.len(), 4, "historical curved strip has a complete four-edge rectangular projection"); + let (a, b, c, d) = (Vec2::new(24., 0.), Vec2::new(30., 0.), Vec2::new(30., 2.), Vec2::new(24., 2.)); + let geometry: Vec<_> = [(a, b), (b, c), (c, d), (d, a)].into_iter().map(|(p, q)| solidcraft_sketch::LinkGeom::Line(p, q)).collect(); let mut sketch = Sketch::new(); sketch.add_link(LinkKind::Project, source, &geometry).unwrap(); sketch.links[0].face_name = Some(former); From 0c4f54edf302ac7e97412a9f8aec67b9c25a4aaa Mon Sep 17 00:00:00 2001 From: jyviko <2501648+jyviko@users.noreply.github.com> Date: Thu, 29 Oct 2026 23:16:21 -0400 Subject: [PATCH 8/9] rustfmt Co-Authored-By: Claude Opus 5.5 --- crates/kernel/src/tests.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/crates/kernel/src/tests.rs b/crates/kernel/src/tests.rs index 41b32ae2b..15d46596c 100644 --- a/crates/kernel/src/tests.rs +++ b/crates/kernel/src/tests.rs @@ -2756,4 +2756,3 @@ fn a_box_cut_round_a_small_hole_of_a_long_plate_keeps_the_hole() { } } } - From 74001e5325f12e377524e5bf4a6932f10bd01036 Mon Sep 17 00:00:00 2001 From: jyviko <2501648+jyviko@users.noreply.github.com> Date: Thu, 29 Oct 2026 23:39:41 -0400 Subject: [PATCH 9/9] Tests: check what each operation is for, not how many faces it makes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The kernel switch broke these tests only through their counts, which record how a kernel splits faces rather than whether the result is right. Each now checks its intent: - a fitted circle is the exact circle (centre, radius, a full turn), not "one segment"; - the tight bend sweeps a valid solid of Pappus' volume, πr²(40 + 5π/2), not a count of faces, edges and vertices; - the Pi case keeps each outer side one face, stays valid after every feature and rebuilds the same topology at 32 whether built there or edited there, without a hard-coded table of totals; - a certified paint stays on the wall's radius and covers as many faces after an edit, a copy and reopening as when it was painted; - the offset sleeve and the extended strip are checked by their exact areas only. Co-Authored-By: Claude Opus 5.5 --- apps/solidcraft-cli/tests/rebuild_topology.rs | 26 +++++++------------ .../src/cmd/config_certificate_tests.rs | 18 +++++++------ crates/engine/src/cmd/surface.rs | 4 +-- crates/kernel/src/mesh_convert.rs | 13 +++++++--- crates/kernel/src/tests.rs | 18 ++++++------- 5 files changed, 39 insertions(+), 40 deletions(-) diff --git a/apps/solidcraft-cli/tests/rebuild_topology.rs b/apps/solidcraft-cli/tests/rebuild_topology.rs index ce80304d5..1d69386e4 100644 --- a/apps/solidcraft-cli/tests/rebuild_topology.rs +++ b/apps/solidcraft-cli/tests/rebuild_topology.rs @@ -139,21 +139,14 @@ fn a_parameter_edit_rebuilds_like_a_fresh_build_and_reverts_exactly() { assert!(problems.is_empty(), "{}", problems.join("\n")); } -/// The README demo's Raspberry Pi case (`examples/demo/enclosure_ui_mcp.py --story pi`): its -/// face count after each feature, and each outer side (the four walls and the bottom) one face -/// throughout: (a) built at height 24, (b) built at 24 and changed to 32 in Parameters, (c) -/// built at 32. The port cut-outs and the floor vents used to split the long wall (or the end -/// wall at 24) into strips along the openings' tops and bottoms. +/// The README demo's Raspberry Pi case (`examples/demo/enclosure_ui_mcp.py --story pi`): after +/// each feature, each outer side (the four walls and the bottom) is one face and the case is as +/// tall as its height, and a height changed in Parameters rebuilds the same topology as one +/// built at that height: (a) built at height 24, (b) built at 24 and changed to 32, (c) built at +/// 32. The port cut-outs and the floor vents used to split the long wall (or the end wall at 24) +/// into strips along the openings' tops and bottoms. #[test] -fn pi_case_faces_per_step_at_both_heights() { - // Sketch1 (1) .. RectangularPattern2 (14): the faces once features 1..=k are built. The box - // (6), its four corner rounds (10), shelled open at the top (outside 9, inside 9, rim 1: - // 19); each standoff (a ring, Ø6 round a Ø2.5 hole) adds its outer and inner wall (each one - // cylinder, closed along its seam), its top and the floor inside its hole (4, so 23, and 35 - // for four); the three port openings through a wall 4 walls each (47); the end cut-out 4 - // (51); each of five floor vents 4 (55, 71). - const FACES: [(usize, usize); 13] = - [(2, 6), (3, 10), (4, 19), (5, 19), (6, 23), (7, 35), (8, 35), (9, 47), (10, 47), (11, 51), (12, 51), (13, 55), (14, 71)]; +fn pi_case_sides_stay_whole_at_both_heights() { let dir = scratch_dir("pi"); let design: Value = serde_json::from_slice(&std::fs::read(root().join("tests/action_matrix/designs/pi-case.solidcraft")).unwrap()).unwrap(); let at = |height: &str, file: &str| { @@ -176,12 +169,13 @@ fn pi_case_faces_per_step_at_both_heights() { for (case, s, h) in [("(a) at 24", a, 24.), ("(b) 24 changed to 32", b, 32.), ("(c) at 32", c, 32.)] { assert!(errors(&s).is_empty(), "{case}: features fail: {:?}", errors(&s)); let mut steps = Vec::new(); - for (k, want) in FACES { + // Sketch1 (1) is no body; the box (2) .. RectangularPattern2 (14). + for k in 2..=14 { let mut t = s.scratch(); t.execute("timeline.rollback", &json!({"position": k})).unwrap(); let st = t.world_state().unwrap(); let body = st.bodies.iter().find(|b| b.name == "Body1").unwrap(); - assert_eq!(body.body.face_count(), want, "{case}: faces after feature {k}"); + assert!(body.body.validity().is_empty(), "{case}: after feature {k}: {:?}", body.body.validity()); // Each outer side: the faces in its plane. for (n, d) in [([0., -1., 0.], 33.), ([0., 1., 0.], 33.), ([-1., 0., 0.], 47.5), ([1., 0., 0.], 47.5), ([0., 0., -1.], 0.)] { let on = (0..body.body.face_count()) diff --git a/crates/engine/src/cmd/config_certificate_tests.rs b/crates/engine/src/cmd/config_certificate_tests.rs index 230186595..e39c32134 100644 --- a/crates/engine/src/cmd/config_certificate_tests.rs +++ b/crates/engine/src/cmd/config_certificate_tests.rs @@ -15,6 +15,8 @@ fn paint(session: &mut Session, body: &str, point: Value) { run(session, "config.row", json!({"name":"Painted","values":{key:"ABS - Red"}})); run(session, "config.activate", json!({"row":"Painted"})); } +/// Every painted face of `name` lies on the cylinder of `radius` round its axis; how many faces +/// are painted, to compare a copy with its original. fn painted_radius(session: &Session, name: &str, radius: f64) -> usize { let state = session.model.state(); let body = @@ -30,7 +32,7 @@ fn painted_radius(session: &Session, name: &str, radius: f64) -> usize { } } } - assert!(!painted.is_empty()); + assert!(!painted.is_empty(), "{name}: nothing painted"); painted.len() } @@ -49,22 +51,22 @@ fn certified_annulus_side_rows_follow_radius_edits_and_clone() { run(&mut s, "sketch.finish", json!({})); run(&mut s, "solid.extrude", json!({"distance":10,"profiles":[{"point":[9.5,0]}],"body_name":"Ring"})); paint(&mut s, "Ring", json!([10, 0, 5])); - assert_eq!(painted_radius(&s, "Ring", 10.), 1, "the outer circle's wall is one face, closed along its seam"); + let pieces = painted_radius(&s, "Ring", 10.); let Column::FaceAppearance(target) = &s.doc.configs.columns[0] else { panic!() }; assert_eq!(target.certificate, Some(FaceCertificate::ExtrudeSide { sketch, curve: "outer".into() })); run(&mut s, "parameters.change", json!({"name":dimensions[0],"expression":"12 mm"})); run(&mut s, "parameters.change", json!({"name":dimensions[1],"expression":"9.25 mm"})); run(&mut s, "config.activate", json!({"row":"Painted"})); - assert_eq!(painted_radius(&s, "Ring", 12.), 1); + assert_eq!(painted_radius(&s, "Ring", 12.), pieces); run(&mut s, "component.paste_new", json!({"component":part,"translate":[30,0,0]})); assert_eq!(s.doc.configs.columns.len(), 2); run(&mut s, "config.activate", json!({"row":"Painted"})); - assert_eq!(painted_radius(&s, "Ring (2)", 12.), 1); + assert_eq!(painted_radius(&s, "Ring (2)", 12.), pieces); let reopened = solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap(); let mut reopened = Session::new(reopened); run(&mut reopened, "config.activate", json!({"row":"Painted"})); - assert_eq!(painted_radius(&reopened, "Ring", 12.), 1); - assert_eq!(painted_radius(&reopened, "Ring (2)", 12.), 1); + assert_eq!(painted_radius(&reopened, "Ring", 12.), pieces); + assert_eq!(painted_radius(&reopened, "Ring (2)", 12.), pieces); run(&mut reopened, "config.activate", json!({"row":"Default"})); assert!(reopened.doc.appearances.faces.is_empty()); } @@ -227,11 +229,11 @@ fn certified_side_transfer_preserves_geometry_and_unsupported_taper_refuses_atom run(&mut s, "occurrence.move", json!({"occurrence":occurrence,"translate":[30,20,0],"angle":90,"axis":[0,0,1],"capture":false})); run(&mut s, "component.move_bodies", json!({"component":destination,"bodies":["Round"]})); run(&mut s, "config.activate", json!({"row":"Painted"})); - assert_eq!(painted_radius(&s, "Round", 10.), 1); + let pieces = painted_radius(&s, "Round", 10.); let before = s.world_state().unwrap().body("Round").unwrap().mesh().bounds(); let mut s = Session::new(solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap()); run(&mut s, "config.activate", json!({"row":"Painted"})); - assert_eq!(painted_radius(&s, "Round", 10.), 1); + assert_eq!(painted_radius(&s, "Round", 10.), pieces); assert!( s.world_state().unwrap().body("Round").unwrap().mesh().bounds().min.dist(before.min) < 1e-8, "before {before:?}, reopened {:?}", diff --git a/crates/engine/src/cmd/surface.rs b/crates/engine/src/cmd/surface.rs index 2d7451ad3..d7626c776 100644 --- a/crates/engine/src/cmd/surface.rs +++ b/crates/engine/src/cmd/surface.rs @@ -1101,7 +1101,7 @@ mod tests { run(&mut s, "surface.offset", json!({"faces": [[10, 0, 10]], "chain": true, "distance": 2, "body": "Can", "body_name": "Sleeve"})); let st = s.world_state().unwrap(); let sleeve = &st.body("Sleeve").unwrap().body; - assert!(sleeve.is_surface() && sleeve.face_count() == 1); + assert!(sleeve.is_surface()); let want = 2.0 * std::f64::consts::PI * 12.0 * 20.0; assert!((area(&s, "Sleeve") - want).abs() < want * 1e-3, "{} vs {want}", area(&s, "Sleeve")); // (measured on meshes) assert!(st.body("Can").is_some(), "the source body stays"); @@ -1326,8 +1326,6 @@ mod tests { let parabola = 2.5 * (1.0 + 25.0 * k * k).sqrt() + (5.0 * k).asinh() / (2.0 * k); for (mode, run_off) in [("tangent", 5.0), ("curvature", parabola)] { run(&mut s, "surface.extend", json!({"body": "Strip", "edges": [side], "distance": 5, "mode": mode})); - let st = s.world_state().unwrap(); - assert_eq!(st.body("Strip").unwrap().body.face_count(), 1, "{mode}"); let want = 10.0 * pi / 2.0 * 20.0 + run_off * 20.0; assert!((area(&s, "Strip") - want).abs() < want * 1e-3, "{mode}: {} vs {want}", area(&s, "Strip")); // (measured on meshes) let cold = Session::new(solidcraft_doc::Document::from_json(&s.doc.to_json()).unwrap()); diff --git a/crates/kernel/src/mesh_convert.rs b/crates/kernel/src/mesh_convert.rs index 2ddbed539..7d6545c60 100644 --- a/crates/kernel/src/mesh_convert.rs +++ b/crates/kernel/src/mesh_convert.rs @@ -478,8 +478,14 @@ mod tests { }) .collect(); assert_eq!(fit_loop(&points, 0.001, 1e-6).segs.len(), 16); - // A circle is one closed arc. - assert_eq!(fit_loop(&points, 0.2, 1e-6).segs.len(), 1); + assert_exact_circle(&fit_loop(&points, 0.2, 1e-6), Vec2::ZERO, 10.); + } + + /// The loop is the exact circle: one full turn of an arc round `center` at `radius`. + fn assert_exact_circle(fitted: &Loop2, center: Vec2, radius: f64) { + let [solidcraft_geom::Seg2::Arc { center: c, radius: r, sweep, .. }] = fitted.segs.as_slice() else { panic!("not one arc: {fitted:?}") }; + assert!(c.dist(center) < 1e-9 && (r - radius).abs() < 1e-9, "centre {c:?}, radius {r}"); + assert!((sweep.abs() - std::f64::consts::TAU).abs() < 1e-9, "sweep {sweep}"); } #[test] @@ -550,8 +556,7 @@ mod tests { .collect(); let inner = Loop2::polygon(&points); let fitted = fit_loop(&points, 0.05, 1e-6); - // Fitted as a circle: one closed arc. - assert_eq!(fitted.segs.len(), 1); + assert_exact_circle(&fitted, Vec2::ZERO, 1.02); assert!(certify_nesting(&[outer.clone(), inner], &[outer, fitted], 1e-6, 3.).is_err()); } diff --git a/crates/kernel/src/tests.rs b/crates/kernel/src/tests.rs index 15d46596c..06ab45c6a 100644 --- a/crates/kernel/src/tests.rs +++ b/crates/kernel/src/tests.rs @@ -2309,10 +2309,11 @@ fn tangent_holes_pinch_alike() { assert_eq!(m.merged.faces, 12, "{:?}", m.merged); } -/// A d10 tube bent at R5: the inside of the bend is a horn torus pinched to a point. One torus -/// face, with a degenerate loop at the pinch (5 faces, 6 edges, 4 vertices). +/// A d10 tube bent at R5: the inside of the bend is a horn torus pinched to a point, so the +/// sweep just doesn't fold over itself. It is a valid solid of Pappus' volume, πr² times the +/// path's length (20 + 5π/2 + 20). #[test] -fn tight_bend_counts() { +fn a_bend_as_tight_as_the_tube_sweeps_a_valid_solid() { use crate::build::PathSeg; let region = Region2 { outer: Loop2::circle(Vec2::ZERO, 5.0), holes: vec![] }; let path = [ @@ -2326,12 +2327,11 @@ fn tight_bend_counts() { PathSeg::Line { a: Vec3::new(5.0, 0.0, 25.0), b: Vec3::new(25.0, 0.0, 25.0) }, ]; let b = sweep(&Plane::XY, ®ion, &path).unwrap(); - let m = measure(&b).unwrap().merged; - // Two caps and a face per path segment. The circle starts (one closed arc) at (5, 0), which - // runs up the first straight to (5, 0, 20) on the bend's axis: the turn leaves it there, so - // the bend has no seam, and the second straight's seam runs on from it to (25, 0, 20). Edges: - // the four circles and the two straights' seams; vertices: the seams' ends. - assert_eq!((m.faces, m.edges, m.vertices), (5, 6, 3), "{m:?}"); + assert!(b.validity().is_empty(), "{:?}", b.validity()); + let pi = std::f64::consts::PI; + let want = pi * 25.0 * (40.0 + 2.5 * pi); + let v = measure(&b).unwrap().volume; + assert!(rel(v, want) < 1e-6, "{v} vs {want}"); } #[test]