SolidCraft: an open-source parametric 3D CAD application built in pure Rust. Desktop, web, and automation through MCP.
Wave 371/509: Kernel rig: construction cases, the centre of a circular edge, sphere, torus and sketch arc, and a flat face refused (and 3 more)
jyviko2aec67534963
diff --git a/tests/kernel-cases/construction/cov-plane-two-edges-meeting-at-a-corner/expected.json b/tests/kernel-cases/construction/cov-plane-two-edges-meeting-at-a-corner/expected.jsonnew file mode 100644index 0000000000..3893d49b6d--- /dev/null+++ b/tests/kernel-cases/construction/cov-plane-two-edges-meeting-at-a-corner/expected.json@@ -0,0 +1,22 @@+{+ "sources": [],+ "what": "the plane through two box edges that meet at a corner",+ "source": "analytic",+ "method": "box 40 x 30 x 20 with a corner at the origin (x 0..40, y 0..30, z 0..20): the top edges y 0, z 20 (along X) and x 40, z 20 (along Y) meet at (40,0,20): the top, z = 20",+ "construction": {+ "E": {+ "plane": {+ "through": [+ 1,+ 1,+ 20+ ],+ "normal": [+ 0,+ 0,+ 1+ ]+ }+ }+ }+}diff --git a/tests/kernel-cases/construction/cov-plane-two-edges-meeting-at-a-corner/recipe.json b/tests/kernel-cases/construction/cov-plane-two-edges-meeting-at-a-corner/recipe.jsonnew file mode 100644index 0000000000..d8df250e43--- /dev/null+++ b/tests/kernel-cases/construction/cov-plane-two-edges-meeting-at-a-corner/recipe.json@@ -0,0 +1,33 @@+{+ "commands": [+ {+ "command": "solid.box",+ "params": {+ "length": 40,+ "width": 30,+ "height": 20,+ "body_name": "Box"+ }+ },+ {+ "command": "construct.plane.two_edges",+ "params": {+ "a": {+ "edge": [+ 20,+ 0,+ 20+ ]+ },+ "b": {+ "edge": [+ 40,+ 15,+ 20+ ]+ },+ "name": "E"+ }+ }+ ]+}diff --git a/tests/kernel-cases/construction/cov-plane-two-edges-opposite-box-edges/expected.json b/tests/kernel-cases/construction/cov-plane-two-edges-opposite-box-edges/expected.jsonnew file mode 100644index 0000000000..1390d905ce--- /dev/null+++ b/tests/kernel-cases/construction/cov-plane-two-edges-opposite-box-edges/expected.json@@ -0,0 +1,22 @@+{+ "sources": [],+ "what": "the plane through a box's bottom-front and top-back edges",+ "source": "analytic",+ "method": "box 40 x 30 x 20 with a corner at the origin (x 0..40, y 0..30, z 0..20): both run along X, through (0,0,0) and (0,30,20): normal X x (0,30,20) = (0,-20,30): the plane 3z = 2y, normal (0,-2,3)",+ "construction": {+ "E": {+ "plane": {+ "through": [+ 5,+ 30,+ 20+ ],+ "normal": [+ 0,+ -2,+ 3+ ]+ }+ }+ }+}diff --git a/tests/kernel-cases/construction/cov-plane-two-edges-opposite-box-edges/recipe.json b/tests/kernel-cases/construction/cov-plane-two-edges-opposite-box-edges/recipe.jsonnew file mode 100644index 0000000000..835d05243e--- /dev/null+++ b/tests/kernel-cases/construction/cov-plane-two-edges-opposite-box-edges/recipe.json@@ -0,0 +1,33 @@+{+ "commands": [+ {+ "command": "solid.box",+ "params": {+ "length": 40,+ "width": 30,+ "height": 20,+ "body_name": "Box"+ }+ },+ {+ "command": "construct.plane.two_edges",+ "params": {+ "a": {+ "edge": [+ 20,+ 0,+ 0+ ]+ },+ "b": {+ "edge": [+ 20,+ 30,+ 20+ ]+ },+ "name": "E"+ }+ }+ ]+}diff --git a/tests/kernel-cases/construction/cov-plane-two-edges-refuses-skew-edges/expected.json b/tests/kernel-cases/construction/cov-plane-two-edges-refuses-skew-edges/expected.jsonnew file mode 100644index 0000000000..f061ab2497--- /dev/null+++ b/tests/kernel-cases/construction/cov-plane-two-edges-refuses-skew-edges/expected.json@@ -0,0 +1,8 @@+{+ "sources": [],+ "what": "a plane through two skew box edges",+ "source": "analytic",+ "method": "box 40 x 30 x 20 with a corner at the origin (x 0..40, y 0..30, z 0..20): y 0, z 0 along X and x 40, z 20 along Y never meet and are not parallel: no plane holds both: refused",+ "outcome": "refused",+ "refusal": "the edges are not in one plane"+}diff --git a/tests/kernel-cases/construction/cov-plane-two-edges-refuses-skew-edges/recipe.json b/tests/kernel-cases/construction/cov-plane-two-edges-refuses-skew-edges/recipe.jsonnew file mode 100644index 0000000000..ef250537b5--- /dev/null+++ b/tests/kernel-cases/construction/cov-plane-two-edges-refuses-skew-edges/recipe.json@@ -0,0 +1,33 @@+{+ "commands": [+ {+ "command": "solid.box",+ "params": {+ "length": 40,+ "width": 30,+ "height": 20,+ "body_name": "Box"+ }+ },+ {+ "command": "construct.plane.two_edges",+ "params": {+ "a": {+ "edge": [+ 20,+ 0,+ 0+ ]+ },+ "b": {+ "edge": [+ 40,+ 15,+ 20+ ]+ },+ "name": "E"+ }+ }+ ]+}diff --git a/tests/kernel-cases/construction/cov-point-along-path-a-third-of-an-arc/expected.json b/tests/kernel-cases/construction/cov-point-along-path-a-third-of-an-arc/expected.jsonnew file mode 100644index 0000000000..22389d2aa6--- /dev/null+++ b/tests/kernel-cases/construction/cov-point-along-path-a-third-of-an-arc/expected.json@@ -0,0 +1,15 @@+{+ "sources": [],+ "what": "a point a third along a quarter-circle arc",+ "source": "analytic",+ "method": "the arc r 10 about the origin from (10,0) to (0,10) counter-clockwise: a third of its length is 30 deg round: (10 cos 30, 10 sin 30, 0) = (8.6603, 5, 0)",+ "construction": {+ "P": {+ "point": [+ 8.660254037844386,+ 5,+ 0+ ]+ }+ }+}diff --git a/tests/kernel-cases/construction/cov-point-along-path-a-third-of-an-arc/recipe.json b/tests/kernel-cases/construction/cov-point-along-path-a-third-of-an-arc/recipe.jsonnew file mode 100644index 0000000000..9da9dd038f--- /dev/null+++ b/tests/kernel-cases/construction/cov-point-along-path-a-third-of-an-arc/recipe.json@@ -0,0 +1,43 @@+{+ "commands": [+ {+ "command": "sketch.create",+ "params": {+ "plane": "XY",+ "name": "Path"+ }+ },+ {+ "command": "sketch.arc.center_point",+ "params": {+ "center": [+ 0,+ 0+ ],+ "start": [+ 10,+ 0+ ],+ "end": [+ 0,+ 10+ ]+ }+ },+ {+ "command": "sketch.finish",+ "params": {}+ },+ {+ "command": "construct.point.along_path",+ "params": {+ "path": {+ "sketch": "Path",+ "curve": "a1"+ },+ "t": "1/3",+ "name": "P"+ }+ }+ ]+}diff --git a/tests/kernel-cases/construction/cov-point-along-path-past-the-end/expected.json b/tests/kernel-cases/construction/cov-point-along-path-past-the-end/expected.jsonnew file mode 100644index 0000000000..bc40d5224f--- /dev/null+++ b/tests/kernel-cases/construction/cov-point-along-path-past-the-end/expected.json@@ -0,0 +1,15 @@+{+ "sources": [],+ "what": "a point at t 1.5, past the end of a sketch line",+ "source": "analytic",+ "method": "t runs 0..1 along the path; a point along it can go no further than its end: (40,0,0)",+ "construction": {+ "P": {+ "point": [+ 40,+ 0,+ 0+ ]+ }+ }+}diff --git a/tests/kernel-cases/construction/cov-point-along-path-past-the-end/recipe.json b/tests/kernel-cases/construction/cov-point-along-path-past-the-end/recipe.jsonnew file mode 100644index 0000000000..d306d3ddb9--- /dev/null+++ b/tests/kernel-cases/construction/cov-point-along-path-past-the-end/recipe.json@@ -0,0 +1,41 @@+{+ "commands": [+ {+ "command": "sketch.create",+ "params": {+ "plane": "XY",+ "name": "Path"+ }+ },+ {+ "command": "sketch.line",+ "params": {+ "points": [+ [+ 0,+ 0+ ],+ [+ 40,+ 0+ ]+ ]+ }+ },+ {+ "command": "sketch.finish",+ "params": {}+ },+ {+ "command": "construct.point.along_path",+ "params": {+ "path": {+ "sketch": "Path",+ "curve": "l1"+ },+ "t": 1.5,+ "name": "P"+ }+ }+ ]+}diff --git a/tests/kernel-cases/construction/cov-point-along-path-quarter-of-a-line/expected.json b/tests/kernel-cases/construction/cov-point-along-path-quarter-of-a-line/expected.jsonnew file mode 100644index 0000000000..6d5d351439--- /dev/null+++ b/tests/kernel-cases/construction/cov-point-along-path-quarter-of-a-line/expected.json@@ -0,0 +1,15 @@+{+ "sources": [],+ "what": "a point a quarter along a sketch line",+ "source": "analytic",+ "method": "the line l1 from (0,0,0) to (40,0,0): t 0.25 is (10,0,0)",+ "construction": {+ "P": {+ "point": [+ 10,+ 0,+ 0+ ]+ }+ }+}diff --git a/tests/kernel-cases/construction/cov-point-along-path-quarter-of-a-line/recipe.json b/tests/kernel-cases/construction/cov-point-along-path-quarter-of-a-line/recipe.jsonnew file mode 100644index 0000000000..8485a9ee41--- /dev/null+++ b/tests/kernel-cases/construction/cov-point-along-path-quarter-of-a-line/recipe.json@@ -0,0 +1,41 @@+{+ "commands": [+ {+ "command": "sketch.create",+ "params": {+ "plane": "XY",+ "name": "Path"+ }+ },+ {+ "command": "sketch.line",+ "params": {+ "points": [+ [+ 0,+ 0+ ],+ [+ 40,+ 0+ ]+ ]+ }+ },+ {+ "command": "sketch.finish",+ "params": {}+ },+ {+ "command": "construct.point.along_path",+ "params": {+ "path": {+ "sketch": "Path",+ "curve": "l1"+ },+ "t": 0.25,+ "name": "P"+ }+ }+ ]+}diff --git a/tests/kernel-cases/construction/cov-point-center-of-a-circular-edge/expected.json b/tests/kernel-cases/construction/cov-point-center-of-a-circular-edge/expected.jsonnew file mode 100644index 0000000000..bbf8b272b2--- /dev/null+++ b/tests/kernel-cases/construction/cov-point-center-of-a-circular-edge/expected.json@@ -0,0 +1,15 @@+{+ "sources": [],+ "what": "the centre of a cylinder's top edge",+ "source": "analytic",+ "method": "cylinder r 5, h 10 on (60,0,0) along +Z: its top edge is the circle about (60,0,10)",+ "construction": {+ "C": {+ "point": [+ 60,+ 0,+ 10+ ]+ }+ }+}diff --git a/tests/kernel-cases/construction/cov-point-center-of-a-circular-edge/recipe.json b/tests/kernel-cases/construction/cov-point-center-of-a-circular-edge/recipe.jsonnew file mode 100644index 0000000000..e1be1b86ec--- /dev/null+++ b/tests/kernel-cases/construction/cov-point-center-of-a-circular-edge/recipe.json@@ -0,0 +1,31 @@+{+ "commands": [+ {+ "command": "solid.cylinder",+ "params": {+ "base": [+ 60,+ 0,+ 0+ ],+ "radius": 5,+ "height": 10,+ "body_name": "Cyl",+ "operation": "new"+ }+ },+ {+ "command": "construct.point.center",+ "params": {+ "of": {+ "edge": [+ 65,+ 0,+ 10+ ]+ },+ "name": "C"+ }+ }+ ]+}diff --git a/tests/kernel-cases/construction/cov-point-center-of-a-sketch-arc/expected.json b/tests/kernel-cases/construction/cov-point-center-of-a-sketch-arc/expected.jsonnew file mode 100644index 0000000000..1f8fb40385--- /dev/null+++ b/tests/kernel-cases/construction/cov-point-center-of-a-sketch-arc/expected.json@@ -0,0 +1,15 @@+{+ "sources": [],+ "what": "the centre of a sketch arc",+ "source": "analytic",+ "method": "the arc r 10 about the sketch origin on XY",+ "construction": {+ "C": {+ "point": [+ 0,+ 0,+ 0+ ]+ }+ }+}diff --git a/tests/kernel-cases/construction/cov-point-center-of-a-sketch-arc/recipe.json b/tests/kernel-cases/construction/cov-point-center-of-a-sketch-arc/recipe.jsonnew file mode 100644index 0000000000..fa61edc8e4--- /dev/null+++ b/tests/kernel-cases/construction/cov-point-center-of-a-sketch-arc/recipe.json@@ -0,0 +1,42 @@+{+ "commands": [+ {+ "command": "sketch.create",+ "params": {+ "plane": "XY",+ "name": "Path"+ }+ },+ {+ "command": "sketch.arc.center_point",+ "params": {+ "center": [+ 0,+ 0+ ],+ "start": [+ 10,+ 0+ ],+ "end": [+ 0,+ 10+ ]+ }+ },+ {+ "command": "sketch.finish",+ "params": {}+ },+ {+ "command": "construct.point.center",+ "params": {+ "of": {+ "sketch": "Path",+ "curve": "a1"+ },+ "name": "C"+ }+ }+ ]+}diff --git a/tests/kernel-cases/construction/cov-point-center-of-a-sphere/expected.json b/tests/kernel-cases/construction/cov-point-center-of-a-sphere/expected.jsonnew file mode 100644index 0000000000..f218862ca9--- /dev/null+++ b/tests/kernel-cases/construction/cov-point-center-of-a-sphere/expected.json@@ -0,0 +1,15 @@+{+ "sources": [],+ "what": "the centre of a sphere",+ "source": "analytic",+ "method": "sphere r 5 on (0,0,60)",+ "construction": {+ "C": {+ "point": [+ 0,+ 0,+ 60+ ]+ }+ }+}diff --git a/tests/kernel-cases/construction/cov-point-center-of-a-sphere/recipe.json b/tests/kernel-cases/construction/cov-point-center-of-a-sphere/recipe.jsonnew file mode 100644index 0000000000..4e4fff0eb2--- /dev/null+++ b/tests/kernel-cases/construction/cov-point-center-of-a-sphere/recipe.json@@ -0,0 +1,30 @@+{+ "commands": [+ {+ "command": "solid.sphere",+ "params": {+ "center": [+ 0,+ 0,+ 60+ ],+ "radius": 5,+ "body_name": "Ball",+ "operation": "new"+ }+ },+ {+ "command": "construct.point.center",+ "params": {+ "of": {+ "face": [+ 5,+ 0,+ 60+ ]+ },+ "name": "C"+ }+ }+ ]+}diff --git a/tests/kernel-cases/construction/cov-point-center-of-a-torus/expected.json b/tests/kernel-cases/construction/cov-point-center-of-a-torus/expected.jsonnew file mode 100644index 0000000000..52b8edc912--- /dev/null+++ b/tests/kernel-cases/construction/cov-point-center-of-a-torus/expected.json@@ -0,0 +1,15 @@+{+ "sources": [],+ "what": "the centre of a torus",+ "source": "analytic",+ "method": "torus major 10, minor 2 on (0,60,0)",+ "construction": {+ "C": {+ "point": [+ 0,+ 60,+ 0+ ]+ }+ }+}diff --git a/tests/kernel-cases/construction/cov-point-center-of-a-torus/recipe.json b/tests/kernel-cases/construction/cov-point-center-of-a-torus/recipe.jsonnew file mode 100644index 0000000000..038b06c31f--- /dev/null+++ b/tests/kernel-cases/construction/cov-point-center-of-a-torus/recipe.json@@ -0,0 +1,31 @@+{+ "commands": [+ {+ "command": "solid.torus",+ "params": {+ "center": [+ 0,+ 60,+ 0+ ],+ "major": 10,+ "minor": 2,+ "body_name": "Ring",+ "operation": "new"+ }+ },+ {+ "command": "construct.point.center",+ "params": {+ "of": {+ "face": [+ 12,+ 60,+ 0+ ]+ },+ "name": "C"+ }+ }+ ]+}diff --git a/tests/kernel-cases/construction/cov-point-center-refuses-a-flat-face/expected.json b/tests/kernel-cases/construction/cov-point-center-refuses-a-flat-face/expected.jsonnew file mode 100644index 0000000000..8540d8fc9d--- /dev/null+++ b/tests/kernel-cases/construction/cov-point-center-refuses-a-flat-face/expected.json@@ -0,0 +1,8 @@+{+ "sources": [],+ "what": "the centre of a flat face",+ "source": "analytic",+ "method": "box 40 x 30 x 20 with a corner at the origin (x 0..40, y 0..30, z 0..20): the top is a plane, not a sphere or torus: refused",+ "outcome": "refused",+ "refusal": "the face is not a sphere or torus"+}diff --git a/tests/kernel-cases/construction/cov-point-center-refuses-a-flat-face/recipe.json b/tests/kernel-cases/construction/cov-point-center-refuses-a-flat-face/recipe.jsonnew file mode 100644index 0000000000..5a67ef9547--- /dev/null+++ b/tests/kernel-cases/construction/cov-point-center-refuses-a-flat-face/recipe.json@@ -0,0 +1,26 @@+{+ "commands": [+ {+ "command": "solid.box",+ "params": {+ "length": 40,+ "width": 30,+ "height": 20,+ "body_name": "Box"+ }+ },+ {+ "command": "construct.point.center",+ "params": {+ "of": {+ "face": [+ 20,+ 15,+ 20+ ]+ },+ "name": "C"+ }+ }+ ]+}diff --git a/tests/kernel-cases/construction/cov-point-edge-plane-refuses-a-parallel-edge/expected.json b/tests/kernel-cases/construction/cov-point-edge-plane-refuses-a-parallel-edge/expected.jsonnew file mode 100644index 0000000000..3e1637162f--- /dev/null+++ b/tests/kernel-cases/construction/cov-point-edge-plane-refuses-a-parallel-edge/expected.json@@ -0,0 +1,8 @@+{+ "sources": [],+ "what": "a box edge parallel to the plane",+ "source": "analytic",+ "method": "box 40 x 30 x 20 with a corner at the origin (x 0..40, y 0..30, z 0..20): the edge y 0, z 0 along X never crosses y = 10: refused",+ "outcome": "refused",+ "refusal": "the edge is parallel to the plane"+}diff --git a/tests/kernel-cases/construction/cov-point-edge-plane-refuses-a-parallel-edge/recipe.json b/tests/kernel-cases/construction/cov-point-edge-plane-refuses-a-parallel-edge/recipe.jsonnew file mode 100644index 0000000000..583e098eed--- /dev/null+++ b/tests/kernel-cases/construction/cov-point-edge-plane-refuses-a-parallel-edge/recipe.json@@ -0,0 +1,40 @@+{+ "commands": [+ {+ "command": "solid.box",+ "params": {+ "length": 40,+ "width": 30,+ "height": 20,+ "body_name": "Box"+ }+ },+ {+ "command": "construct.point.edge_plane",+ "params": {+ "edge": {+ "edge": [+ 20,+ 0,+ 0+ ]+ },+ "plane": {+ "plane": {+ "origin": [+ 0,+ 10,+ 0+ ],+ "normal": [+ 0,+ 1,+ 0+ ]+ }+ },+ "name": "P"+ }+ }+ ]+}diff --git a/tests/kernel-cases/construction/cov-point-edge-plane-slanted-plane/expected.json b/tests/kernel-cases/construction/cov-point-edge-plane-slanted-plane/expected.jsonnew file mode 100644index 0000000000..a59f3ba132--- /dev/null+++ b/tests/kernel-cases/construction/cov-point-edge-plane-slanted-plane/expected.json@@ -0,0 +1,15 @@+{+ "sources": [],+ "what": "where a box's vertical edge crosses a slanted plane",+ "source": "analytic",+ "method": "box 40 x 30 x 20 with a corner at the origin (x 0..40, y 0..30, z 0..20): the edge x 0, y 0 along Z meets x + z = 15 at (0,0,15)",+ "construction": {+ "P": {+ "point": [+ 0,+ 0,+ 15+ ]+ }+ }+}diff --git a/tests/kernel-cases/construction/cov-point-edge-plane-slanted-plane/recipe.json b/tests/kernel-cases/construction/cov-point-edge-plane-slanted-plane/recipe.jsonnew file mode 100644index 0000000000..86187bdc9a--- /dev/null+++ b/tests/kernel-cases/construction/cov-point-edge-plane-slanted-plane/recipe.json@@ -0,0 +1,40 @@+{+ "commands": [+ {+ "command": "solid.box",+ "params": {+ "length": 40,+ "width": 30,+ "height": 20,+ "body_name": "Box"+ }+ },+ {+ "command": "construct.point.edge_plane",+ "params": {+ "edge": {+ "edge": [+ 0,+ 0,+ 10+ ]+ },+ "plane": {+ "plane": {+ "origin": [+ 0,+ 0,+ 15+ ],+ "normal": [+ 1,+ 0,+ 1+ ]+ }+ },+ "name": "P"+ }+ }+ ]+}diff --git a/tests/kernel-cases/construction/cov-point-edge-plane-square-cut/expected.json b/tests/kernel-cases/construction/cov-point-edge-plane-square-cut/expected.jsonnew file mode 100644index 0000000000..73dc505673--- /dev/null+++ b/tests/kernel-cases/construction/cov-point-edge-plane-square-cut/expected.json@@ -0,0 +1,15 @@+{+ "sources": [],+ "what": "where a box edge crosses a plane square to it",+ "source": "analytic",+ "method": "box 40 x 30 x 20 with a corner at the origin (x 0..40, y 0..30, z 0..20): the edge y 0, z 0 along X meets x = 12 at (12,0,0)",+ "construction": {+ "P": {+ "point": [+ 12,+ 0,+ 0+ ]+ }+ }+}diff --git a/tests/kernel-cases/construction/cov-point-edge-plane-square-cut/recipe.json b/tests/kernel-cases/construction/cov-point-edge-plane-square-cut/recipe.jsonnew file mode 100644index 0000000000..bff7913afc--- /dev/null+++ b/tests/kernel-cases/construction/cov-point-edge-plane-square-cut/recipe.json@@ -0,0 +1,40 @@+{+ "commands": [+ {+ "command": "solid.box",+ "params": {+ "length": 40,+ "width": 30,+ "height": 20,+ "body_name": "Box"+ }+ },+ {+ "command": "construct.point.edge_plane",+ "params": {+ "edge": {+ "edge": [+ 20,+ 0,+ 0+ ]+ },+ "plane": {+ "plane": {+ "origin": [+ 12,+ 0,+ 0+ ],+ "normal": [+ 1,+ 0,+ 0+ ]+ }+ },+ "name": "P"+ }+ }+ ]+}