SolidCraft: an open-source parametric 3D CAD application built in pure Rust. Desktop, web, and automation through MCP.
Wave 373/509: Kernel rig: inspect cases, the overlap volume of two boxes, none where they only touch, a box inside a box (and 3 more)
jyviko121439114cd8
diff --git a/tests/kernel-cases/inspect/cov-center-of-mass-box-and-cylinder/expected.json b/tests/kernel-cases/inspect/cov-center-of-mass-box-and-cylinder/expected.jsonnew file mode 100644index 0000000000..ba0e92e090--- /dev/null+++ b/tests/kernel-cases/inspect/cov-center-of-mass-box-and-cylinder/expected.json@@ -0,0 +1,36 @@+{+ "sources": [],+ "what": "the centre of mass of a box and a cylinder together",+ "source": "analytic",+ "method": "box 40 x 30 x 20 with a corner at the origin (V 24000 at (20,15,10)) and a cylinder r 5, h 10 on (60,0,0) (V 250 pi = 785.40 at (60,0,5)): the volume-weighted mean (21.2675, 14.5247, 9.8416), V = 24000 + 250 pi",+ "results": [+ {+ "command": 2,+ "pointer": "/center",+ "value": [+ 21.267517524987444,+ 14.524680928129708,+ 9.84156030937657+ ]+ },+ {+ "command": 2,+ "pointer": "/volume",+ "value": 24785.398163397447+ },+ {+ "command": 2,+ "pointer": "/bodies/1/center",+ "value": [+ 60,+ 0,+ 5+ ]+ },+ {+ "command": 2,+ "pointer": "/bodies/1/volume",+ "value": 785.3981633974482+ }+ ]+}diff --git a/tests/kernel-cases/inspect/cov-center-of-mass-box-and-cylinder/recipe.json b/tests/kernel-cases/inspect/cov-center-of-mass-box-and-cylinder/recipe.jsonnew file mode 100644index 0000000000..d5c90a5110--- /dev/null+++ b/tests/kernel-cases/inspect/cov-center-of-mass-box-and-cylinder/recipe.json@@ -0,0 +1,32 @@+{+ "commands": [+ {+ "command": "solid.box",+ "params": {+ "length": 40,+ "width": 30,+ "height": 20,+ "body_name": "Box",+ "operation": "new"+ }+ },+ {+ "command": "solid.cylinder",+ "params": {+ "base": [+ 60,+ 0,+ 0+ ],+ "radius": 5,+ "height": 10,+ "body_name": "Cyl",+ "operation": "new"+ }+ },+ {+ "command": "inspect.center_of_mass",+ "params": {}+ }+ ]+}diff --git a/tests/kernel-cases/inspect/cov-center-of-mass-box/expected.json b/tests/kernel-cases/inspect/cov-center-of-mass-box/expected.jsonnew file mode 100644index 0000000000..a40b16dd73--- /dev/null+++ b/tests/kernel-cases/inspect/cov-center-of-mass-box/expected.json@@ -0,0 +1,22 @@+{+ "sources": [],+ "what": "the centre of mass of a box",+ "source": "analytic",+ "method": "box 40 x 30 x 20 with a corner at the origin: the middle (20,15,10), V = 40 x 30 x 20 = 24000",+ "results": [+ {+ "command": 1,+ "pointer": "/center",+ "value": [+ 20,+ 15,+ 10+ ]+ },+ {+ "command": 1,+ "pointer": "/volume",+ "value": 24000.0+ }+ ]+}diff --git a/tests/kernel-cases/inspect/cov-center-of-mass-box/recipe.json b/tests/kernel-cases/inspect/cov-center-of-mass-box/recipe.jsonnew file mode 100644index 0000000000..5116cf00a1--- /dev/null+++ b/tests/kernel-cases/inspect/cov-center-of-mass-box/recipe.json@@ -0,0 +1,18 @@+{+ "commands": [+ {+ "command": "solid.box",+ "params": {+ "length": 40,+ "width": 30,+ "height": 20,+ "body_name": "Box",+ "operation": "new"+ }+ },+ {+ "command": "inspect.center_of_mass",+ "params": {}+ }+ ]+}diff --git a/tests/kernel-cases/inspect/cov-center-of-mass-refuses-an-unknown-body/expected.json b/tests/kernel-cases/inspect/cov-center-of-mass-refuses-an-unknown-body/expected.jsonnew file mode 100644index 0000000000..58a27d57a2--- /dev/null+++ b/tests/kernel-cases/inspect/cov-center-of-mass-refuses-an-unknown-body/expected.json@@ -0,0 +1,8 @@+{+ "sources": [],+ "what": "the centre of mass of a body that is not there",+ "source": "analytic",+ "method": "box 40 x 30 x 20 with a corner at the origin; no body `Nope`: refused",+ "outcome": "refused",+ "refusal": "no such bodies"+}diff --git a/tests/kernel-cases/inspect/cov-center-of-mass-refuses-an-unknown-body/recipe.json b/tests/kernel-cases/inspect/cov-center-of-mass-refuses-an-unknown-body/recipe.jsonnew file mode 100644index 0000000000..c05c6c794b--- /dev/null+++ b/tests/kernel-cases/inspect/cov-center-of-mass-refuses-an-unknown-body/recipe.json@@ -0,0 +1,22 @@+{+ "commands": [+ {+ "command": "solid.box",+ "params": {+ "length": 40,+ "width": 30,+ "height": 20,+ "body_name": "Box",+ "operation": "new"+ }+ },+ {+ "command": "inspect.center_of_mass",+ "params": {+ "bodies": [+ "Nope"+ ]+ }+ }+ ]+}diff --git a/tests/kernel-cases/inspect/cov-continuity-box-edge-is-sharp/expected.json b/tests/kernel-cases/inspect/cov-continuity-box-edge-is-sharp/expected.jsonnew file mode 100644index 0000000000..1468968e94--- /dev/null+++ b/tests/kernel-cases/inspect/cov-continuity-box-edge-is-sharp/expected.json@@ -0,0 +1,34 @@+{+ "sources": [],+ "what": "the order at a box's square edge",+ "source": "analytic",+ "method": "box 40 x 30 x 20 with a corner at the origin: the faces y = 0 and z = 0 meet at 90 deg along their edge: g0, sharp, normal angle 90",+ "results": [+ {+ "command": 1,+ "pointer": "/summary/edges",+ "value": 1+ },+ {+ "command": 1,+ "pointer": "/bodies/0/edges/0/order",+ "value": "g0"+ },+ {+ "command": 1,+ "pointer": "/bodies/0/edges/0/verdict",+ "value": "sharp"+ },+ {+ "command": 1,+ "pointer": "/bodies/0/edges/0/normal_angle_deg/value",+ "value": 90.0+ },+ {+ "command": 1,+ "pointer": "/bodies/0/edges/0/gap_mm/value",+ "value": 0.0,+ "rel": 1e-06+ }+ ]+}diff --git a/tests/kernel-cases/inspect/cov-continuity-box-edge-is-sharp/recipe.json b/tests/kernel-cases/inspect/cov-continuity-box-edge-is-sharp/recipe.jsonnew file mode 100644index 0000000000..6e23fd24ae--- /dev/null+++ b/tests/kernel-cases/inspect/cov-continuity-box-edge-is-sharp/recipe.json@@ -0,0 +1,27 @@+{+ "commands": [+ {+ "command": "solid.box",+ "params": {+ "length": 40,+ "width": 30,+ "height": 20,+ "body_name": "Box",+ "operation": "new"+ }+ },+ {+ "command": "inspect.continuity",+ "params": {+ "body": "Box",+ "edges": [+ [+ 20,+ 0,+ 0+ ]+ ]+ }+ }+ ]+}diff --git a/tests/kernel-cases/inspect/cov-continuity-fillet-seams-are-g1/expected.json b/tests/kernel-cases/inspect/cov-continuity-fillet-seams-are-g1/expected.jsonnew file mode 100644index 0000000000..9a93b77dcd--- /dev/null+++ b/tests/kernel-cases/inspect/cov-continuity-fillet-seams-are-g1/expected.json@@ -0,0 +1,43 @@+{+ "sources": [],+ "what": "the order where a round meets the faces either side",+ "source": "analytic",+ "method": "box 40 x 30 x 20 with a corner at the origin, its top-front edge (y 0, z 20) rounded r 3: the round meets the top (at y 3) and the front (at z 17) tangent, curvature jumping 0 to 1/3: g1, jump 1/3 per mm",+ "results": [+ {+ "command": 2,+ "pointer": "/summary/edges",+ "value": 2+ },+ {+ "command": 2,+ "pointer": "/bodies/0/edges/0/order",+ "value": "g1"+ },+ {+ "command": 2,+ "pointer": "/bodies/0/edges/1/order",+ "value": "g1"+ },+ {+ "command": 2,+ "pointer": "/bodies/0/edges/0/curvature_jump_per_mm/value",+ "value": 0.3333333333333333+ },+ {+ "command": 2,+ "pointer": "/bodies/0/edges/1/curvature_jump_per_mm/value",+ "value": 0.3333333333333333+ },+ {+ "command": 2,+ "pointer": "/bodies/0/edges/0/verdict",+ "value": "curvature_jump"+ },+ {+ "command": 2,+ "pointer": "/bodies/0/edges/1/verdict",+ "value": "curvature_jump"+ }+ ]+}diff --git a/tests/kernel-cases/inspect/cov-continuity-fillet-seams-are-g1/recipe.json b/tests/kernel-cases/inspect/cov-continuity-fillet-seams-are-g1/recipe.jsonnew file mode 100644index 0000000000..817d866484--- /dev/null+++ b/tests/kernel-cases/inspect/cov-continuity-fillet-seams-are-g1/recipe.json@@ -0,0 +1,45 @@+{+ "commands": [+ {+ "command": "solid.box",+ "params": {+ "length": 40,+ "width": 30,+ "height": 20,+ "body_name": "Box",+ "operation": "new"+ }+ },+ {+ "command": "solid.fillet",+ "params": {+ "edges": [+ [+ 20,+ 0,+ 20+ ]+ ],+ "radius": 3+ }+ },+ {+ "command": "inspect.continuity",+ "params": {+ "body": "Box",+ "edges": [+ [+ 20,+ 3,+ 20+ ],+ [+ 20,+ 0,+ 17+ ]+ ]+ }+ }+ ]+}diff --git a/tests/kernel-cases/inspect/cov-continuity-refuses-too-few-samples/expected.json b/tests/kernel-cases/inspect/cov-continuity-refuses-too-few-samples/expected.jsonnew file mode 100644index 0000000000..acb8d956e8--- /dev/null+++ b/tests/kernel-cases/inspect/cov-continuity-refuses-too-few-samples/expected.json@@ -0,0 +1,8 @@+{+ "sources": [],+ "what": "continuity with 2 stations a seam",+ "source": "analytic",+ "method": "box 40 x 30 x 20 with a corner at the origin: a seam needs its two ends and one station between: 2 is refused",+ "outcome": "refused",+ "refusal": "`samples` must be 3\u2026257 stations along each edge"+}diff --git a/tests/kernel-cases/inspect/cov-continuity-refuses-too-few-samples/recipe.json b/tests/kernel-cases/inspect/cov-continuity-refuses-too-few-samples/recipe.jsonnew file mode 100644index 0000000000..073ae40ea2--- /dev/null+++ b/tests/kernel-cases/inspect/cov-continuity-refuses-too-few-samples/recipe.json@@ -0,0 +1,21 @@+{+ "commands": [+ {+ "command": "solid.box",+ "params": {+ "length": 40,+ "width": 30,+ "height": 20,+ "body_name": "Box",+ "operation": "new"+ }+ },+ {+ "command": "inspect.continuity",+ "params": {+ "body": "Box",+ "samples": 2+ }+ }+ ]+}diff --git a/tests/kernel-cases/inspect/cov-interference-box-inside-a-box/expected.json b/tests/kernel-cases/inspect/cov-interference-box-inside-a-box/expected.jsonnew file mode 100644index 0000000000..c56e1ed3e7--- /dev/null+++ b/tests/kernel-cases/inspect/cov-interference-box-inside-a-box/expected.json@@ -0,0 +1,27 @@+{+ "sources": [],+ "what": "a box wholly inside another",+ "source": "analytic",+ "method": "box 40 x 30 x 20 with a corner at the origin and a box 10 x 10 x 10 from (5,5,5) inside it: the overlap is the small box: V 1000, centre (10,10,10)",+ "results": [+ {+ "command": 2,+ "pointer": "/count",+ "value": 1+ },+ {+ "command": 2,+ "pointer": "/interferences/0/volume_mm3",+ "value": 1000.0+ },+ {+ "command": 2,+ "pointer": "/interferences/0/center",+ "value": [+ 10,+ 10,+ 10+ ]+ }+ ]+}diff --git a/tests/kernel-cases/inspect/cov-interference-box-inside-a-box/recipe.json b/tests/kernel-cases/inspect/cov-interference-box-inside-a-box/recipe.jsonnew file mode 100644index 0000000000..800e73ec16--- /dev/null+++ b/tests/kernel-cases/inspect/cov-interference-box-inside-a-box/recipe.json@@ -0,0 +1,33 @@+{+ "commands": [+ {+ "command": "solid.box",+ "params": {+ "length": 40,+ "width": 30,+ "height": 20,+ "body_name": "A",+ "operation": "new"+ }+ },+ {+ "command": "solid.box",+ "params": {+ "length": 10,+ "width": 10,+ "height": 10,+ "body_name": "B",+ "operation": "new",+ "corner": [+ 5,+ 5,+ 5+ ]+ }+ },+ {+ "command": "inspect.interference",+ "params": {}+ }+ ]+}diff --git a/tests/kernel-cases/inspect/cov-interference-boxes-touching-face-to-face/expected.json b/tests/kernel-cases/inspect/cov-interference-boxes-touching-face-to-face/expected.jsonnew file mode 100644index 0000000000..07812ac632--- /dev/null+++ b/tests/kernel-cases/inspect/cov-interference-boxes-touching-face-to-face/expected.json@@ -0,0 +1,18 @@+{+ "sources": [],+ "what": "two boxes that only touch along a face",+ "source": "analytic",+ "method": "box 40 x 30 x 20 with a corner at the origin and a box 40 x 30 x 20 from (40,0,0): they share the face x = 40 and no volume: no interference",+ "results": [+ {+ "command": 2,+ "pointer": "/count",+ "value": 0+ },+ {+ "command": 2,+ "pointer": "/interferences",+ "value": []+ }+ ]+}diff --git a/tests/kernel-cases/inspect/cov-interference-boxes-touching-face-to-face/recipe.json b/tests/kernel-cases/inspect/cov-interference-boxes-touching-face-to-face/recipe.jsonnew file mode 100644index 0000000000..69744f365c--- /dev/null+++ b/tests/kernel-cases/inspect/cov-interference-boxes-touching-face-to-face/recipe.json@@ -0,0 +1,33 @@+{+ "commands": [+ {+ "command": "solid.box",+ "params": {+ "length": 40,+ "width": 30,+ "height": 20,+ "body_name": "A",+ "operation": "new"+ }+ },+ {+ "command": "solid.box",+ "params": {+ "length": 40,+ "width": 30,+ "height": 20,+ "body_name": "B",+ "operation": "new",+ "corner": [+ 40,+ 0,+ 0+ ]+ }+ },+ {+ "command": "inspect.interference",+ "params": {}+ }+ ]+}diff --git a/tests/kernel-cases/inspect/cov-interference-overlapping-boxes/expected.json b/tests/kernel-cases/inspect/cov-interference-overlapping-boxes/expected.jsonnew file mode 100644index 0000000000..f76118d01d--- /dev/null+++ b/tests/kernel-cases/inspect/cov-interference-overlapping-boxes/expected.json@@ -0,0 +1,50 @@+{+ "sources": [],+ "what": "the overlap of two boxes",+ "source": "analytic",+ "method": "box 40 x 30 x 20 with a corner at the origin and a box 40 x 30 x 20 from (30,20,10): they share the cube x 30..40, y 20..30, z 10..20: V 1000, A 600, centre (35,25,15)",+ "results": [+ {+ "command": 2,+ "pointer": "/count",+ "value": 1+ },+ {+ "command": 2,+ "pointer": "/interferences/0/volume_mm3",+ "value": 1000.0+ },+ {+ "command": 2,+ "pointer": "/interferences/0/area_mm2",+ "value": 600.0+ },+ {+ "command": 2,+ "pointer": "/interferences/0/center",+ "value": [+ 35,+ 25,+ 15+ ]+ },+ {+ "command": 2,+ "pointer": "/interferences/0/bbox/min",+ "value": [+ 30,+ 20,+ 10+ ]+ },+ {+ "command": 2,+ "pointer": "/interferences/0/bbox/max",+ "value": [+ 40,+ 30,+ 20+ ]+ }+ ]+}diff --git a/tests/kernel-cases/inspect/cov-interference-overlapping-boxes/recipe.json b/tests/kernel-cases/inspect/cov-interference-overlapping-boxes/recipe.jsonnew file mode 100644index 0000000000..4dfc1aeacb--- /dev/null+++ b/tests/kernel-cases/inspect/cov-interference-overlapping-boxes/recipe.json@@ -0,0 +1,33 @@+{+ "commands": [+ {+ "command": "solid.box",+ "params": {+ "length": 40,+ "width": 30,+ "height": 20,+ "body_name": "A",+ "operation": "new"+ }+ },+ {+ "command": "solid.box",+ "params": {+ "length": 40,+ "width": 30,+ "height": 20,+ "body_name": "B",+ "operation": "new",+ "corner": [+ 30,+ 20,+ 10+ ]+ }+ },+ {+ "command": "inspect.interference",+ "params": {}+ }+ ]+}diff --git a/tests/kernel-cases/inspect/cov-minimum-radius-of-a-box-is-none/expected.json b/tests/kernel-cases/inspect/cov-minimum-radius-of-a-box-is-none/expected.jsonnew file mode 100644index 0000000000..36d5b98c4f--- /dev/null+++ b/tests/kernel-cases/inspect/cov-minimum-radius-of-a-box-is-none/expected.json@@ -0,0 +1,13 @@+{+ "sources": [],+ "what": "the smallest radius of a box, which has no curved face",+ "source": "analytic",+ "method": "box 40 x 30 x 20 with a corner at the origin: every face is flat: no radius (null)",+ "results": [+ {+ "command": 1,+ "pointer": "/min_radius",+ "value": null+ }+ ]+}diff --git a/tests/kernel-cases/inspect/cov-minimum-radius-of-a-box-is-none/recipe.json b/tests/kernel-cases/inspect/cov-minimum-radius-of-a-box-is-none/recipe.jsonnew file mode 100644index 0000000000..144ba1eebc--- /dev/null+++ b/tests/kernel-cases/inspect/cov-minimum-radius-of-a-box-is-none/recipe.json@@ -0,0 +1,18 @@+{+ "commands": [+ {+ "command": "solid.box",+ "params": {+ "length": 40,+ "width": 30,+ "height": 20,+ "body_name": "Box",+ "operation": "new"+ }+ },+ {+ "command": "inspect.minimum_radius",+ "params": {}+ }+ ]+}diff --git a/tests/kernel-cases/inspect/cov-minimum-radius-of-a-circular-edge/expected.json b/tests/kernel-cases/inspect/cov-minimum-radius-of-a-circular-edge/expected.jsonnew file mode 100644index 0000000000..c3f5fc8efc--- /dev/null+++ b/tests/kernel-cases/inspect/cov-minimum-radius-of-a-circular-edge/expected.json@@ -0,0 +1,13 @@+{+ "sources": [],+ "what": "the radius of a cylinder's top edge",+ "source": "analytic",+ "method": "a cylinder r 5 on (60,0,0): its top edge is a circle of r 5",+ "results": [+ {+ "command": 1,+ "pointer": "/min_radius",+ "value": 5.0+ }+ ]+}diff --git a/tests/kernel-cases/inspect/cov-minimum-radius-of-a-circular-edge/recipe.json b/tests/kernel-cases/inspect/cov-minimum-radius-of-a-circular-edge/recipe.jsonnew file mode 100644index 0000000000..780d1f9037--- /dev/null+++ b/tests/kernel-cases/inspect/cov-minimum-radius-of-a-circular-edge/recipe.json@@ -0,0 +1,30 @@+{+ "commands": [+ {+ "command": "solid.cylinder",+ "params": {+ "base": [+ 60,+ 0,+ 0+ ],+ "radius": 5,+ "height": 10,+ "body_name": "Cyl",+ "operation": "new"+ }+ },+ {+ "command": "inspect.minimum_radius",+ "params": {+ "edges": [+ [+ 65,+ 0,+ 10+ ]+ ]+ }+ }+ ]+}diff --git a/tests/kernel-cases/inspect/cov-minimum-radius-of-a-fillet/expected.json b/tests/kernel-cases/inspect/cov-minimum-radius-of-a-fillet/expected.jsonnew file mode 100644index 0000000000..72f5a82088--- /dev/null+++ b/tests/kernel-cases/inspect/cov-minimum-radius-of-a-fillet/expected.json@@ -0,0 +1,13 @@+{+ "sources": [],+ "what": "the smallest radius over every face of a box with one rounded edge",+ "source": "analytic",+ "method": "box 40 x 30 x 20 with a corner at the origin, its top-front edge (y 0, z 20) rounded r 3: the flat faces have none, the round is a cylinder of r 3: the smallest radius is 3",+ "results": [+ {+ "command": 2,+ "pointer": "/min_radius",+ "value": 3.0+ }+ ]+}diff --git a/tests/kernel-cases/inspect/cov-minimum-radius-of-a-fillet/recipe.json b/tests/kernel-cases/inspect/cov-minimum-radius-of-a-fillet/recipe.jsonnew file mode 100644index 0000000000..3eef8050a8--- /dev/null+++ b/tests/kernel-cases/inspect/cov-minimum-radius-of-a-fillet/recipe.json@@ -0,0 +1,31 @@+{+ "commands": [+ {+ "command": "solid.box",+ "params": {+ "length": 40,+ "width": 30,+ "height": 20,+ "body_name": "Box",+ "operation": "new"+ }+ },+ {+ "command": "solid.fillet",+ "params": {+ "edges": [+ [+ 20,+ 0,+ 20+ ]+ ],+ "radius": 3+ }+ },+ {+ "command": "inspect.minimum_radius",+ "params": {}+ }+ ]+}diff --git a/tests/kernel-cases/inspect/cov-minimum-radius-of-an-ellipse/expected.json b/tests/kernel-cases/inspect/cov-minimum-radius-of-an-ellipse/expected.jsonnew file mode 100644index 0000000000..3c8dd17bfe--- /dev/null+++ b/tests/kernel-cases/inspect/cov-minimum-radius-of-an-ellipse/expected.json@@ -0,0 +1,13 @@+{+ "sources": [],+ "what": "the smallest radius of a sketch ellipse",+ "source": "analytic",+ "method": "ellipse a 10, b 4: tightest at the ends of the major axis, b^2 / a = 1.6, at (+-10, 0)",+ "results": [+ {+ "command": 3,+ "pointer": "/min_radius",+ "value": 1.6+ }+ ]+}diff --git a/tests/kernel-cases/inspect/cov-minimum-radius-of-an-ellipse/recipe.json b/tests/kernel-cases/inspect/cov-minimum-radius-of-an-ellipse/recipe.jsonnew file mode 100644index 0000000000..db95c86240--- /dev/null+++ b/tests/kernel-cases/inspect/cov-minimum-radius-of-an-ellipse/recipe.json@@ -0,0 +1,38 @@+{+ "commands": [+ {+ "command": "sketch.create",+ "params": {+ "plane": "XY",+ "name": "S"+ }+ },+ {+ "command": "sketch.ellipse",+ "params": {+ "center": [+ 0,+ 0+ ],+ "major": [+ 10,+ 0+ ],+ "minor_radius": 4+ }+ },+ {+ "command": "sketch.finish",+ "params": {}+ },+ {+ "command": "inspect.minimum_radius",+ "params": {+ "sketch": "S",+ "curves": [+ "e1"+ ]+ }+ }+ ]+}