From 680f2ee5cb1081fd7b6436a4905defc6962c5acf Mon Sep 17 00:00:00 2001 From: jyviko <2501648+jyviko@users.noreply.github.com> Date: Thu, 29 Oct 2026 17:03:27 -0400 Subject: [PATCH] Kernel rig: boundary surfaces through a square, a triangle and a network of four lines have their exact areas; five curves are refused Co-Authored-By: Claude Opus 5.5 --- .../expected.json | 8 + .../recipe.json | 76 +++++++ .../expected.json | 23 ++ .../recipe.json | 57 +++++ .../expected.json | 23 ++ .../recipe.json | 210 ++++++++++++++++++ .../expected.json | 26 +++ .../recipe.json | 67 ++++++ 8 files changed, 490 insertions(+) create mode 100644 tests/kernel-cases/surfaces/cov-boundary-five-curves-refused/expected.json create mode 100644 tests/kernel-cases/surfaces/cov-boundary-five-curves-refused/recipe.json create mode 100644 tests/kernel-cases/surfaces/cov-boundary-four-lines-flat-square/expected.json create mode 100644 tests/kernel-cases/surfaces/cov-boundary-four-lines-flat-square/recipe.json create mode 100644 tests/kernel-cases/surfaces/cov-boundary-network-of-four-lines-hyperbolic-paraboloid/expected.json create mode 100644 tests/kernel-cases/surfaces/cov-boundary-network-of-four-lines-hyperbolic-paraboloid/recipe.json create mode 100644 tests/kernel-cases/surfaces/cov-boundary-three-lines-triangle/expected.json create mode 100644 tests/kernel-cases/surfaces/cov-boundary-three-lines-triangle/recipe.json diff --git a/tests/kernel-cases/surfaces/cov-boundary-five-curves-refused/expected.json b/tests/kernel-cases/surfaces/cov-boundary-five-curves-refused/expected.json new file mode 100644 index 000000000..b094cf659 --- /dev/null +++ b/tests/kernel-cases/surfaces/cov-boundary-five-curves-refused/expected.json @@ -0,0 +1,8 @@ +{ + "sources": [], + "what": "a boundary loop of five curves: refused, a loop patch takes 2 to 4", + "source": "invariants", + "method": "the loop patch is a Coons patch of opposite pairs (or a bridge of two); five sides have no pairing", + "outcome": "refused", + "refusal": "`curves` must list 2 to 4 sketch curves in loop order" +} diff --git a/tests/kernel-cases/surfaces/cov-boundary-five-curves-refused/recipe.json b/tests/kernel-cases/surfaces/cov-boundary-five-curves-refused/recipe.json new file mode 100644 index 000000000..1ff190762 --- /dev/null +++ b/tests/kernel-cases/surfaces/cov-boundary-five-curves-refused/recipe.json @@ -0,0 +1,76 @@ +{ + "commands": [ + { + "command": "sketch.create", + "params": { + "plane": { + "origin": [ + 0, + 0, + 0 + ], + "x_dir": [ + 1, + 0, + 0 + ], + "y_dir": [ + 0, + 1, + 0 + ] + }, + "name": "Pent" + } + }, + { + "command": "sketch.line", + "params": { + "points": [ + [ + 0, + 0 + ], + [ + 10, + 0 + ], + [ + 14, + 8 + ], + [ + 5, + 14 + ], + [ + -4, + 8 + ], + [ + 0, + 0 + ] + ], + "infer": false + } + }, + { + "command": "sketch.finish", + "params": {} + }, + { + "command": "surface.boundary", + "params": { + "sketch": "Pent", + "curves": [ + "l1", + "l2", + "l3", + "l4", + "l5" + ] + } + } + ] +} diff --git a/tests/kernel-cases/surfaces/cov-boundary-four-lines-flat-square/expected.json b/tests/kernel-cases/surfaces/cov-boundary-four-lines-flat-square/expected.json new file mode 100644 index 000000000..3aa6f1fb5 --- /dev/null +++ b/tests/kernel-cases/surfaces/cov-boundary-four-lines-flat-square/expected.json @@ -0,0 +1,23 @@ +{ + "sources": [], + "what": "a boundary surface through the four sides of a 20 x 20 square: the flat square", + "source": "analytic", + "method": "the Coons patch of a planar loop of four lines is the bilinear patch of its corners, here the square itself: area 400 in z = 0, one face with 4 free edges", + "valid": false, + "body_count": 1, + "faces": 1, + "boundary_edges": 4, + "area_mm2": 400.0, + "bbox": { + "min": [ + 0, + 0, + 0 + ], + "max": [ + 20, + 20, + 0 + ] + } +} diff --git a/tests/kernel-cases/surfaces/cov-boundary-four-lines-flat-square/recipe.json b/tests/kernel-cases/surfaces/cov-boundary-four-lines-flat-square/recipe.json new file mode 100644 index 000000000..3adf94a64 --- /dev/null +++ b/tests/kernel-cases/surfaces/cov-boundary-four-lines-flat-square/recipe.json @@ -0,0 +1,57 @@ +{ + "commands": [ + { + "command": "sketch.create", + "params": { + "plane": { + "origin": [ + 0, + 0, + 0 + ], + "x_dir": [ + 1, + 0, + 0 + ], + "y_dir": [ + 0, + 1, + 0 + ] + }, + "name": "Square" + } + }, + { + "command": "sketch.rectangle.two_point", + "params": { + "p0": [ + 0, + 0 + ], + "p1": [ + 20, + 20 + ] + } + }, + { + "command": "sketch.finish", + "params": {} + }, + { + "command": "surface.boundary", + "params": { + "sketch": "Square", + "curves": [ + "l1", + "l2", + "l3", + "l4" + ], + "body_name": "Patch" + } + } + ] +} diff --git a/tests/kernel-cases/surfaces/cov-boundary-network-of-four-lines-hyperbolic-paraboloid/expected.json b/tests/kernel-cases/surfaces/cov-boundary-network-of-four-lines-hyperbolic-paraboloid/expected.json new file mode 100644 index 000000000..14e3db1c8 --- /dev/null +++ b/tests/kernel-cases/surfaces/cov-boundary-network-of-four-lines-hyperbolic-paraboloid/expected.json @@ -0,0 +1,23 @@ +{ + "sources": [], + "what": "a curve network of four straight lines in two directions, corners (0,0,0), (20,0,0), (20,20,0), (0,20,10): the Coons patch, a hyperbolic paraboloid", + "source": "analytic", + "method": "the Coons patch of four lines is bilinear: P(s,t) = (20s, 20t, 10(1-s)t); |Ps x Pt| = 200 sqrt(4 + t^2 + (1-s)^2); A = 200 * double integral over the unit square = 431.6148 (Gauss-Legendre 48 x 48); one face, 4 free edges", + "valid": false, + "body_count": 1, + "faces": 1, + "boundary_edges": 4, + "area_mm2": 431.6148065766132, + "bbox": { + "min": [ + 0, + 0, + 0 + ], + "max": [ + 20, + 20, + 10 + ] + } +} diff --git a/tests/kernel-cases/surfaces/cov-boundary-network-of-four-lines-hyperbolic-paraboloid/recipe.json b/tests/kernel-cases/surfaces/cov-boundary-network-of-four-lines-hyperbolic-paraboloid/recipe.json new file mode 100644 index 000000000..52cf8646e --- /dev/null +++ b/tests/kernel-cases/surfaces/cov-boundary-network-of-four-lines-hyperbolic-paraboloid/recipe.json @@ -0,0 +1,210 @@ +{ + "commands": [ + { + "command": "sketch.create", + "params": { + "plane": { + "origin": [ + 0, + 0, + 0 + ], + "x_dir": [ + 1, + 0, + 0 + ], + "y_dir": [ + 0, + 1, + 0 + ] + }, + "name": "U0" + } + }, + { + "command": "sketch.line", + "params": { + "points": [ + [ + 0, + 0 + ], + [ + 20, + 0 + ] + ], + "infer": false + } + }, + { + "command": "sketch.finish", + "params": {} + }, + { + "command": "sketch.create", + "params": { + "plane": { + "origin": [ + 0, + 20, + 0 + ], + "x_dir": [ + 1, + 0, + 0 + ], + "y_dir": [ + 0, + 0, + 1 + ] + }, + "name": "U1" + } + }, + { + "command": "sketch.line", + "params": { + "points": [ + [ + 0, + 10 + ], + [ + 20, + 0 + ] + ], + "infer": false + } + }, + { + "command": "sketch.finish", + "params": {} + }, + { + "command": "sketch.create", + "params": { + "plane": { + "origin": [ + 0, + 0, + 0 + ], + "x_dir": [ + 0, + 1, + 0 + ], + "y_dir": [ + 0, + 0, + 1 + ] + }, + "name": "V0" + } + }, + { + "command": "sketch.line", + "params": { + "points": [ + [ + 0, + 0 + ], + [ + 20, + 10 + ] + ], + "infer": false + } + }, + { + "command": "sketch.finish", + "params": {} + }, + { + "command": "sketch.create", + "params": { + "plane": { + "origin": [ + 0, + 0, + 0 + ], + "x_dir": [ + 1, + 0, + 0 + ], + "y_dir": [ + 0, + 1, + 0 + ] + }, + "name": "V1" + } + }, + { + "command": "sketch.line", + "params": { + "points": [ + [ + 20, + 0 + ], + [ + 20, + 20 + ] + ], + "infer": false + } + }, + { + "command": "sketch.finish", + "params": {} + }, + { + "command": "surface.boundary", + "params": { + "u": [ + { + "sketch": "U0", + "curves": [ + "l1" + ] + }, + { + "sketch": "U1", + "curves": [ + "l1" + ] + } + ], + "v": [ + { + "sketch": "V0", + "curves": [ + "l1" + ] + }, + { + "sketch": "V1", + "curves": [ + "l1" + ] + } + ], + "body_name": "Saddle" + } + } + ] +} diff --git a/tests/kernel-cases/surfaces/cov-boundary-three-lines-triangle/expected.json b/tests/kernel-cases/surfaces/cov-boundary-three-lines-triangle/expected.json new file mode 100644 index 000000000..4c9adf24a --- /dev/null +++ b/tests/kernel-cases/surfaces/cov-boundary-three-lines-triangle/expected.json @@ -0,0 +1,26 @@ +{ + "sources": [], + "what": "a boundary surface through three lines of a right triangle: the flat triangle", + "source": "analytic", + "method": "three curves: the side opposite the first collapses to the corner the other two share; the patch is the planar triangle (0,0), (20,0), (0,20): area 200; free edges the 3 sides (a collapsed side may stay as a degenerate edge: [3, 4])", + "valid": false, + "body_count": 1, + "faces": 1, + "boundary_edges": [ + 3, + 4 + ], + "area_mm2": 200.0, + "bbox": { + "min": [ + 0, + 0, + 0 + ], + "max": [ + 20, + 20, + 0 + ] + } +} diff --git a/tests/kernel-cases/surfaces/cov-boundary-three-lines-triangle/recipe.json b/tests/kernel-cases/surfaces/cov-boundary-three-lines-triangle/recipe.json new file mode 100644 index 000000000..bdb7f30d5 --- /dev/null +++ b/tests/kernel-cases/surfaces/cov-boundary-three-lines-triangle/recipe.json @@ -0,0 +1,67 @@ +{ + "commands": [ + { + "command": "sketch.create", + "params": { + "plane": { + "origin": [ + 0, + 0, + 0 + ], + "x_dir": [ + 1, + 0, + 0 + ], + "y_dir": [ + 0, + 1, + 0 + ] + }, + "name": "Tri" + } + }, + { + "command": "sketch.line", + "params": { + "points": [ + [ + 0, + 0 + ], + [ + 20, + 0 + ], + [ + 0, + 20 + ], + [ + 0, + 0 + ] + ], + "infer": false + } + }, + { + "command": "sketch.finish", + "params": {} + }, + { + "command": "surface.boundary", + "params": { + "sketch": "Tri", + "curves": [ + "l1", + "l2", + "l3" + ], + "body_name": "Patch" + } + } + ] +}