Skip to content

SolidCraft: an open-source parametric 3D CAD application built in pure Rust. Desktop, web, and automation through MCP.

Wave 370/509: Kernel rig: construction cases, the tangent plane to a cylinder and a sphere, and a point on the axis refused (and 3 more)

jyviko992b243cb69d
diff --git a/tests/kernel-cases/construction/cov-plane-midplane-between-parallel-planes/expected.json b/tests/kernel-cases/construction/cov-plane-midplane-between-parallel-planes/expected.json
new file mode 100644
index 0000000000..16ed5baa54
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-plane-midplane-between-parallel-planes/expected.json
@@ -0,0 +1,22 @@
+{
+ "sources": [],
+ "what": "the midplane of XY and a box's top",
+ "source": "analytic",
+ "method": "box 40 x 30 x 20 with a corner at the origin (x 0..40, y 0..30, z 0..20): halfway between z = 0 and z = 20: z = 10",
+ "construction": {
+ "M": {
+ "plane": {
+ "through": [
+ 5,
+ 5,
+ 10
+ ],
+ "normal": [
+ 0,
+ 0,
+ 1
+ ]
+ }
+ }
+ }
+}
diff --git a/tests/kernel-cases/construction/cov-plane-midplane-between-parallel-planes/recipe.json b/tests/kernel-cases/construction/cov-plane-midplane-between-parallel-planes/recipe.json
new file mode 100644
index 0000000000..9bf6739beb
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-plane-midplane-between-parallel-planes/recipe.json
@@ -0,0 +1,27 @@
+{
+ "commands": [
+ {
+ "command": "solid.box",
+ "params": {
+ "length": 40,
+ "width": 30,
+ "height": 20,
+ "body_name": "Box"
+ }
+ },
+ {
+ "command": "construct.plane.midplane",
+ "params": {
+ "a": "XY",
+ "b": {
+ "face": [
+ 20,
+ 15,
+ 20
+ ]
+ },
+ "name": "M"
+ }
+ }
+ ]
+}
diff --git a/tests/kernel-cases/construction/cov-plane-midplane-bisects-a-corner/expected.json b/tests/kernel-cases/construction/cov-plane-midplane-bisects-a-corner/expected.json
new file mode 100644
index 0000000000..a80bfa0f89
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-plane-midplane-bisects-a-corner/expected.json
@@ -0,0 +1,22 @@
+{
+ "sources": [],
+ "what": "the midplane of two box sides meeting 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): x = 40 and y = 30 meet on the vertical line through (40,30); the plane bisecting the box's 90 deg corner holds (1,1,0) and Z: normal (1,-1,0), through (40,30,0)",
+ "construction": {
+ "M": {
+ "plane": {
+ "through": [
+ 40,
+ 30,
+ 0
+ ],
+ "normal": [
+ 1,
+ -1,
+ 0
+ ]
+ }
+ }
+ }
+}
diff --git a/tests/kernel-cases/construction/cov-plane-midplane-bisects-a-corner/recipe.json b/tests/kernel-cases/construction/cov-plane-midplane-bisects-a-corner/recipe.json
new file mode 100644
index 0000000000..bc59c6462d
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-plane-midplane-bisects-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.midplane",
+ "params": {
+ "a": {
+ "face": [
+ 40,
+ 15,
+ 10
+ ]
+ },
+ "b": {
+ "face": [
+ 20,
+ 30,
+ 10
+ ]
+ },
+ "name": "M"
+ }
+ }
+ ]
+}
diff --git a/tests/kernel-cases/construction/cov-plane-midplane-of-a-plane-with-itself/expected.json b/tests/kernel-cases/construction/cov-plane-midplane-of-a-plane-with-itself/expected.json
new file mode 100644
index 0000000000..136a388f5d
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-plane-midplane-of-a-plane-with-itself/expected.json
@@ -0,0 +1,22 @@
+{
+ "sources": [],
+ "what": "the midplane of a plane and itself",
+ "source": "analytic",
+ "method": "halfway between XY and XY: XY",
+ "construction": {
+ "M": {
+ "plane": {
+ "through": [
+ 0,
+ 0,
+ 0
+ ],
+ "normal": [
+ 0,
+ 0,
+ 1
+ ]
+ }
+ }
+ }
+}
diff --git a/tests/kernel-cases/construction/cov-plane-midplane-of-a-plane-with-itself/recipe.json b/tests/kernel-cases/construction/cov-plane-midplane-of-a-plane-with-itself/recipe.json
new file mode 100644
index 0000000000..9a0ca7c1d5
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-plane-midplane-of-a-plane-with-itself/recipe.json
@@ -0,0 +1,12 @@
+{
+ "commands": [
+ {
+ "command": "construct.plane.midplane",
+ "params": {
+ "a": "XY",
+ "b": "XY",
+ "name": "M"
+ }
+ }
+ ]
+}
diff --git a/tests/kernel-cases/construction/cov-plane-perpendicular-refuses-a-line-square-to-the-plane/expected.json b/tests/kernel-cases/construction/cov-plane-perpendicular-refuses-a-line-square-to-the-plane/expected.json
new file mode 100644
index 0000000000..576899222e
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-plane-perpendicular-refuses-a-line-square-to-the-plane/expected.json
@@ -0,0 +1,8 @@
+{
+ "sources": [],
+ "what": "a perpendicular plane through the plane's normal",
+ "source": "analytic",
+ "method": "the Z axis is square to XY: every plane holding it is perpendicular, so none is the answer: refused",
+ "outcome": "refused",
+ "refusal": "the line is square to the plane"
+}
diff --git a/tests/kernel-cases/construction/cov-plane-perpendicular-refuses-a-line-square-to-the-plane/recipe.json b/tests/kernel-cases/construction/cov-plane-perpendicular-refuses-a-line-square-to-the-plane/recipe.json
new file mode 100644
index 0000000000..97dbc0bc72
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-plane-perpendicular-refuses-a-line-square-to-the-plane/recipe.json
@@ -0,0 +1,14 @@
+{
+ "commands": [
+ {
+ "command": "construct.plane.perpendicular",
+ "params": {
+ "plane": "XY",
+ "line": {
+ "axis": "Z"
+ },
+ "name": "P"
+ }
+ }
+ ]
+}
diff --git a/tests/kernel-cases/construction/cov-plane-perpendicular-through-a-box-edge/expected.json b/tests/kernel-cases/construction/cov-plane-perpendicular-through-a-box-edge/expected.json
new file mode 100644
index 0000000000..6cd781841b
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-plane-perpendicular-through-a-box-edge/expected.json
@@ -0,0 +1,22 @@
+{
+ "sources": [],
+ "what": "a plane through a box's bottom-front edge square to XY",
+ "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 runs along X; holding it and square to XY: normal X x Z = -Y: y = 0",
+ "construction": {
+ "P": {
+ "plane": {
+ "through": [
+ 7,
+ 0,
+ 3
+ ],
+ "normal": [
+ 0,
+ 1,
+ 0
+ ]
+ }
+ }
+ }
+}
diff --git a/tests/kernel-cases/construction/cov-plane-perpendicular-through-a-box-edge/recipe.json b/tests/kernel-cases/construction/cov-plane-perpendicular-through-a-box-edge/recipe.json
new file mode 100644
index 0000000000..0cb5468c3b
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-plane-perpendicular-through-a-box-edge/recipe.json
@@ -0,0 +1,27 @@
+{
+ "commands": [
+ {
+ "command": "solid.box",
+ "params": {
+ "length": 40,
+ "width": 30,
+ "height": 20,
+ "body_name": "Box"
+ }
+ },
+ {
+ "command": "construct.plane.perpendicular",
+ "params": {
+ "plane": "XY",
+ "line": {
+ "edge": [
+ 20,
+ 0,
+ 0
+ ]
+ },
+ "name": "P"
+ }
+ }
+ ]
+}
diff --git a/tests/kernel-cases/construction/cov-plane-perpendicular-through-a-diagonal-axis/expected.json b/tests/kernel-cases/construction/cov-plane-perpendicular-through-a-diagonal-axis/expected.json
new file mode 100644
index 0000000000..7e3423ab95
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-plane-perpendicular-through-a-diagonal-axis/expected.json
@@ -0,0 +1,22 @@
+{
+ "sources": [],
+ "what": "a plane through a diagonal axis in XY, square to XY",
+ "source": "analytic",
+ "method": "the axis from (0,0,0) to (10,10,0); square to XY and holding it: normal (1,1,0) x Z = (1,-1,0), through the origin",
+ "construction": {
+ "P": {
+ "plane": {
+ "through": [
+ 5,
+ 5,
+ 7
+ ],
+ "normal": [
+ 1,
+ -1,
+ 0
+ ]
+ }
+ }
+ }
+}
diff --git a/tests/kernel-cases/construction/cov-plane-perpendicular-through-a-diagonal-axis/recipe.json b/tests/kernel-cases/construction/cov-plane-perpendicular-through-a-diagonal-axis/recipe.json
new file mode 100644
index 0000000000..a42c360c02
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-plane-perpendicular-through-a-diagonal-axis/recipe.json
@@ -0,0 +1,34 @@
+{
+ "commands": [
+ {
+ "command": "construct.axis.two_points",
+ "params": {
+ "a": {
+ "point": [
+ 0,
+ 0,
+ 0
+ ]
+ },
+ "b": {
+ "point": [
+ 10,
+ 10,
+ 0
+ ]
+ },
+ "name": "D"
+ }
+ },
+ {
+ "command": "construct.plane.perpendicular",
+ "params": {
+ "plane": "XY",
+ "line": {
+ "axis": "D"
+ },
+ "name": "P"
+ }
+ }
+ ]
+}
diff --git a/tests/kernel-cases/construction/cov-plane-tangent-refuses-a-point-on-the-axis/expected.json b/tests/kernel-cases/construction/cov-plane-tangent-refuses-a-point-on-the-axis/expected.json
new file mode 100644
index 0000000000..1cc0669a6e
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-plane-tangent-refuses-a-point-on-the-axis/expected.json
@@ -0,0 +1,8 @@
+{
+ "sources": [],
+ "what": "a tangent plane to a cylinder at a point on its axis",
+ "source": "analytic",
+ "method": "cylinder r 5, h 10 on (60,0,0) along +Z: (60,0,5) is on the axis, equally far from every line of the side: refused",
+ "outcome": "refused",
+ "refusal": "the point is on the face's axis"
+}
diff --git a/tests/kernel-cases/construction/cov-plane-tangent-refuses-a-point-on-the-axis/recipe.json b/tests/kernel-cases/construction/cov-plane-tangent-refuses-a-point-on-the-axis/recipe.json
new file mode 100644
index 0000000000..b00fd54469
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-plane-tangent-refuses-a-point-on-the-axis/recipe.json
@@ -0,0 +1,36 @@
+{
+ "commands": [
+ {
+ "command": "solid.cylinder",
+ "params": {
+ "base": [
+ 60,
+ 0,
+ 0
+ ],
+ "radius": 5,
+ "height": 10,
+ "body_name": "Cyl",
+ "operation": "new"
+ }
+ },
+ {
+ "command": "construct.plane.tangent",
+ "params": {
+ "face": {
+ "face": [
+ 65,
+ 0,
+ 5
+ ]
+ },
+ "at": [
+ 60,
+ 0,
+ 5
+ ],
+ "name": "T"
+ }
+ }
+ ]
+}
diff --git a/tests/kernel-cases/construction/cov-plane-tangent-to-a-cylinder-at-a-point/expected.json b/tests/kernel-cases/construction/cov-plane-tangent-to-a-cylinder-at-a-point/expected.json
new file mode 100644
index 0000000000..b5815ebea3
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-plane-tangent-to-a-cylinder-at-a-point/expected.json
@@ -0,0 +1,22 @@
+{
+ "sources": [],
+ "what": "the tangent plane to a cylinder where a point projects on it",
+ "source": "analytic",
+ "method": "cylinder r 5, h 10 on (60,0,0) along +Z: (66,8,5) lies along (0.6,0.8,0) from the axis: it touches at (63,4,5) with normal (0.6,0.8,0)",
+ "construction": {
+ "T": {
+ "plane": {
+ "through": [
+ 63,
+ 4,
+ 5
+ ],
+ "normal": [
+ 3,
+ 4,
+ 0
+ ]
+ }
+ }
+ }
+}
diff --git a/tests/kernel-cases/construction/cov-plane-tangent-to-a-cylinder-at-a-point/recipe.json b/tests/kernel-cases/construction/cov-plane-tangent-to-a-cylinder-at-a-point/recipe.json
new file mode 100644
index 0000000000..b87038be54
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-plane-tangent-to-a-cylinder-at-a-point/recipe.json
@@ -0,0 +1,36 @@
+{
+ "commands": [
+ {
+ "command": "solid.cylinder",
+ "params": {
+ "base": [
+ 60,
+ 0,
+ 0
+ ],
+ "radius": 5,
+ "height": 10,
+ "body_name": "Cyl",
+ "operation": "new"
+ }
+ },
+ {
+ "command": "construct.plane.tangent",
+ "params": {
+ "face": {
+ "face": [
+ 65,
+ 0,
+ 5
+ ]
+ },
+ "at": [
+ 66,
+ 8,
+ 5
+ ],
+ "name": "T"
+ }
+ }
+ ]
+}
diff --git a/tests/kernel-cases/construction/cov-plane-tangent-to-a-sphere/expected.json b/tests/kernel-cases/construction/cov-plane-tangent-to-a-sphere/expected.json
new file mode 100644
index 0000000000..f2fc25418e
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-plane-tangent-to-a-sphere/expected.json
@@ -0,0 +1,22 @@
+{
+ "sources": [],
+ "what": "the tangent plane to a sphere",
+ "source": "analytic",
+ "method": "sphere r 5 on (0,0,60); towards (0,3,64), (0,0.6,0.8) from the centre: it touches at (0,3,64) with normal (0,3,4)",
+ "construction": {
+ "T": {
+ "plane": {
+ "through": [
+ 0,
+ 3,
+ 64
+ ],
+ "normal": [
+ 0,
+ 3,
+ 4
+ ]
+ }
+ }
+ }
+}
diff --git a/tests/kernel-cases/construction/cov-plane-tangent-to-a-sphere/recipe.json b/tests/kernel-cases/construction/cov-plane-tangent-to-a-sphere/recipe.json
new file mode 100644
index 0000000000..886b44f56e
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-plane-tangent-to-a-sphere/recipe.json
@@ -0,0 +1,35 @@
+{
+ "commands": [
+ {
+ "command": "solid.sphere",
+ "params": {
+ "center": [
+ 0,
+ 0,
+ 60
+ ],
+ "radius": 5,
+ "body_name": "Ball",
+ "operation": "new"
+ }
+ },
+ {
+ "command": "construct.plane.tangent",
+ "params": {
+ "face": {
+ "face": [
+ 0,
+ 0,
+ 65
+ ]
+ },
+ "at": [
+ 0,
+ 3,
+ 64
+ ],
+ "name": "T"
+ }
+ }
+ ]
+}
diff --git a/tests/kernel-cases/construction/cov-plane-three-points-on-vertices/expected.json b/tests/kernel-cases/construction/cov-plane-three-points-on-vertices/expected.json
new file mode 100644
index 0000000000..40867b98ab
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-plane-three-points-on-vertices/expected.json
@@ -0,0 +1,22 @@
+{
+ "sources": [],
+ "what": "the plane through three vertices of a box",
+ "source": "analytic",
+ "method": "box 40 x 30 x 20 with a corner at the origin (x 0..40, y 0..30, z 0..20): vertices (40,0,0), (0,30,0), (0,0,20): x/40 + y/30 + z/20 = 1, normal (3,4,6)",
+ "construction": {
+ "T": {
+ "plane": {
+ "through": [
+ 40,
+ 0,
+ 0
+ ],
+ "normal": [
+ 3,
+ 4,
+ 6
+ ]
+ }
+ }
+ }
+}
diff --git a/tests/kernel-cases/construction/cov-plane-three-points-on-vertices/recipe.json b/tests/kernel-cases/construction/cov-plane-three-points-on-vertices/recipe.json
new file mode 100644
index 0000000000..aba452d259
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-plane-three-points-on-vertices/recipe.json
@@ -0,0 +1,40 @@
+{
+ "commands": [
+ {
+ "command": "solid.box",
+ "params": {
+ "length": 40,
+ "width": 30,
+ "height": 20,
+ "body_name": "Box"
+ }
+ },
+ {
+ "command": "construct.plane.three_points",
+ "params": {
+ "a": {
+ "vertex": [
+ 40,
+ 0,
+ 0
+ ]
+ },
+ "b": {
+ "vertex": [
+ 0,
+ 30,
+ 0
+ ]
+ },
+ "c": {
+ "vertex": [
+ 0,
+ 0,
+ 20
+ ]
+ },
+ "name": "T"
+ }
+ }
+ ]
+}
diff --git a/tests/kernel-cases/construction/cov-plane-three-points-refuses-collinear-points/expected.json b/tests/kernel-cases/construction/cov-plane-three-points-refuses-collinear-points/expected.json
new file mode 100644
index 0000000000..4609948c3b
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-plane-three-points-refuses-collinear-points/expected.json
@@ -0,0 +1,8 @@
+{
+ "sources": [],
+ "what": "a plane through three points on one line",
+ "source": "analytic",
+ "method": "(0,0,0), (10,10,10), (20,20,20) are on one line: every plane through it holds them: refused",
+ "outcome": "refused",
+ "refusal": "the three points are on one line"
+}
diff --git a/tests/kernel-cases/construction/cov-plane-three-points-refuses-collinear-points/recipe.json b/tests/kernel-cases/construction/cov-plane-three-points-refuses-collinear-points/recipe.json
new file mode 100644
index 0000000000..45ee58fb73
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-plane-three-points-refuses-collinear-points/recipe.json
@@ -0,0 +1,31 @@
+{
+ "commands": [
+ {
+ "command": "construct.plane.three_points",
+ "params": {
+ "a": {
+ "point": [
+ 0,
+ 0,
+ 0
+ ]
+ },
+ "b": {
+ "point": [
+ 10,
+ 10,
+ 10
+ ]
+ },
+ "c": {
+ "point": [
+ 20,
+ 20,
+ 20
+ ]
+ },
+ "name": "T"
+ }
+ }
+ ]
+}
diff --git a/tests/kernel-cases/construction/cov-plane-three-points-slanted/expected.json b/tests/kernel-cases/construction/cov-plane-three-points-slanted/expected.json
new file mode 100644
index 0000000000..e729e6ae64
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-plane-three-points-slanted/expected.json
@@ -0,0 +1,22 @@
+{
+ "sources": [],
+ "what": "the plane through three box corners",
+ "source": "analytic",
+ "method": "(0,0,20), (40,0,20), (40,30,0): (40,0,0) x (40,30,-20) = (0,800,1200): normal (0,2,3) through (0,0,20)",
+ "construction": {
+ "T": {
+ "plane": {
+ "through": [
+ 0,
+ 30,
+ 0
+ ],
+ "normal": [
+ 0,
+ 2,
+ 3
+ ]
+ }
+ }
+ }
+}
diff --git a/tests/kernel-cases/construction/cov-plane-three-points-slanted/recipe.json b/tests/kernel-cases/construction/cov-plane-three-points-slanted/recipe.json
new file mode 100644
index 0000000000..125a6484ad
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-plane-three-points-slanted/recipe.json
@@ -0,0 +1,31 @@
+{
+ "commands": [
+ {
+ "command": "construct.plane.three_points",
+ "params": {
+ "a": {
+ "point": [
+ 0,
+ 0,
+ 20
+ ]
+ },
+ "b": {
+ "point": [
+ 40,
+ 0,
+ 20
+ ]
+ },
+ "c": {
+ "point": [
+ 40,
+ 30,
+ 0
+ ]
+ },
+ "name": "T"
+ }
+ }
+ ]
+}