Skip to content

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

Wave 372/509: Kernel rig: construction cases, where three planes meet, and parallel planes or planes through one line refused (and 3 more)

jyvikob10cd4b8e002
diff --git a/tests/kernel-cases/construction/cov-point-three-planes-box-corner/expected.json b/tests/kernel-cases/construction/cov-point-three-planes-box-corner/expected.json
new file mode 100644
index 0000000000..9d4a2d4850
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-point-three-planes-box-corner/expected.json
@@ -0,0 +1,15 @@
+{
+ "sources": [],
+ "what": "the corner where three box faces meet",
+ "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, y = 30, z = 20 meet at (40,30,20)",
+ "construction": {
+ "P": {
+ "point": [
+ 40,
+ 30,
+ 20
+ ]
+ }
+ }
+}
diff --git a/tests/kernel-cases/construction/cov-point-three-planes-box-corner/recipe.json b/tests/kernel-cases/construction/cov-point-three-planes-box-corner/recipe.json
new file mode 100644
index 0000000000..c68c37c7e2
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-point-three-planes-box-corner/recipe.json
@@ -0,0 +1,40 @@
+{
+ "commands": [
+ {
+ "command": "solid.box",
+ "params": {
+ "length": 40,
+ "width": 30,
+ "height": 20,
+ "body_name": "Box"
+ }
+ },
+ {
+ "command": "construct.point.three_planes",
+ "params": {
+ "a": {
+ "face": [
+ 40,
+ 15,
+ 10
+ ]
+ },
+ "b": {
+ "face": [
+ 20,
+ 30,
+ 10
+ ]
+ },
+ "c": {
+ "face": [
+ 20,
+ 15,
+ 20
+ ]
+ },
+ "name": "P"
+ }
+ }
+ ]
+}
diff --git a/tests/kernel-cases/construction/cov-point-three-planes-refuses-planes-through-one-line/expected.json b/tests/kernel-cases/construction/cov-point-three-planes-refuses-planes-through-one-line/expected.json
new file mode 100644
index 0000000000..0a91a58fb7
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-point-three-planes-refuses-planes-through-one-line/expected.json
@@ -0,0 +1,8 @@
+{
+ "sources": [],
+ "what": "three planes sharing one line",
+ "source": "analytic",
+ "method": "XZ, YZ and x = y all hold the Z axis: they meet in a line, not a point: refused",
+ "outcome": "refused",
+ "refusal": "the planes don't meet in a point"
+}
diff --git a/tests/kernel-cases/construction/cov-point-three-planes-refuses-planes-through-one-line/recipe.json b/tests/kernel-cases/construction/cov-point-three-planes-refuses-planes-through-one-line/recipe.json
new file mode 100644
index 0000000000..4a292904da
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-point-three-planes-refuses-planes-through-one-line/recipe.json
@@ -0,0 +1,26 @@
+{
+ "commands": [
+ {
+ "command": "construct.point.three_planes",
+ "params": {
+ "a": "XZ",
+ "b": "YZ",
+ "c": {
+ "plane": {
+ "origin": [
+ 0,
+ 0,
+ 0
+ ],
+ "normal": [
+ 1,
+ -1,
+ 0
+ ]
+ }
+ },
+ "name": "P"
+ }
+ }
+ ]
+}
diff --git a/tests/kernel-cases/construction/cov-point-three-planes-refuses-two-parallel/expected.json b/tests/kernel-cases/construction/cov-point-three-planes-refuses-two-parallel/expected.json
new file mode 100644
index 0000000000..08cbc8b1df
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-point-three-planes-refuses-two-parallel/expected.json
@@ -0,0 +1,8 @@
+{
+ "sources": [],
+ "what": "three planes, two of them parallel",
+ "source": "analytic",
+ "method": "XY and z = 5 are parallel: refused",
+ "outcome": "refused",
+ "refusal": "two of the planes are parallel"
+}
diff --git a/tests/kernel-cases/construction/cov-point-three-planes-refuses-two-parallel/recipe.json b/tests/kernel-cases/construction/cov-point-three-planes-refuses-two-parallel/recipe.json
new file mode 100644
index 0000000000..e940988a64
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-point-three-planes-refuses-two-parallel/recipe.json
@@ -0,0 +1,26 @@
+{
+ "commands": [
+ {
+ "command": "construct.point.three_planes",
+ "params": {
+ "a": "XY",
+ "b": {
+ "plane": {
+ "origin": [
+ 0,
+ 0,
+ 5
+ ],
+ "normal": [
+ 0,
+ 0,
+ 1
+ ]
+ }
+ },
+ "c": "YZ",
+ "name": "P"
+ }
+ }
+ ]
+}
diff --git a/tests/kernel-cases/construction/cov-point-three-planes-slanted/expected.json b/tests/kernel-cases/construction/cov-point-three-planes-slanted/expected.json
new file mode 100644
index 0000000000..6310b62e2a
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-point-three-planes-slanted/expected.json
@@ -0,0 +1,15 @@
+{
+ "sources": [],
+ "what": "the point where three slanted planes meet",
+ "source": "analytic",
+ "method": "x + y = 10, y + z = 6, x + z = 8: adding, x + y + z = 12, so (6,4,2)",
+ "construction": {
+ "P": {
+ "point": [
+ 6,
+ 4,
+ 2
+ ]
+ }
+ }
+}
diff --git a/tests/kernel-cases/construction/cov-point-three-planes-slanted/recipe.json b/tests/kernel-cases/construction/cov-point-three-planes-slanted/recipe.json
new file mode 100644
index 0000000000..341c35bdc5
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-point-three-planes-slanted/recipe.json
@@ -0,0 +1,52 @@
+{
+ "commands": [
+ {
+ "command": "construct.point.three_planes",
+ "params": {
+ "a": {
+ "plane": {
+ "origin": [
+ 10,
+ 0,
+ 0
+ ],
+ "normal": [
+ 1,
+ 1,
+ 0
+ ]
+ }
+ },
+ "b": {
+ "plane": {
+ "origin": [
+ 0,
+ 0,
+ 6
+ ],
+ "normal": [
+ 0,
+ 1,
+ 1
+ ]
+ }
+ },
+ "c": {
+ "plane": {
+ "origin": [
+ 0,
+ 0,
+ 8
+ ],
+ "normal": [
+ 1,
+ 0,
+ 1
+ ]
+ }
+ },
+ "name": "P"
+ }
+ }
+ ]
+}
diff --git a/tests/kernel-cases/construction/cov-point-two-edges-meeting/expected.json b/tests/kernel-cases/construction/cov-point-two-edges-meeting/expected.json
new file mode 100644
index 0000000000..05654a3f5a
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-point-two-edges-meeting/expected.json
@@ -0,0 +1,15 @@
+{
+ "sources": [],
+ "what": "where two box edges meet",
+ "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 0 along Y meet at (40,0,0)",
+ "construction": {
+ "P": {
+ "point": [
+ 40,
+ 0,
+ 0
+ ]
+ }
+ }
+}
diff --git a/tests/kernel-cases/construction/cov-point-two-edges-meeting/recipe.json b/tests/kernel-cases/construction/cov-point-two-edges-meeting/recipe.json
new file mode 100644
index 0000000000..f20ad54c89
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-point-two-edges-meeting/recipe.json
@@ -0,0 +1,33 @@
+{
+ "commands": [
+ {
+ "command": "solid.box",
+ "params": {
+ "length": 40,
+ "width": 30,
+ "height": 20,
+ "body_name": "Box"
+ }
+ },
+ {
+ "command": "construct.point.two_edges",
+ "params": {
+ "a": {
+ "edge": [
+ 20,
+ 0,
+ 0
+ ]
+ },
+ "b": {
+ "edge": [
+ 40,
+ 15,
+ 0
+ ]
+ },
+ "name": "P"
+ }
+ }
+ ]
+}
diff --git a/tests/kernel-cases/construction/cov-point-two-edges-refuses-parallel-edges/expected.json b/tests/kernel-cases/construction/cov-point-two-edges-refuses-parallel-edges/expected.json
new file mode 100644
index 0000000000..c24f3e9dc6
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-point-two-edges-refuses-parallel-edges/expected.json
@@ -0,0 +1,8 @@
+{
+ "sources": [],
+ "what": "two parallel 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): the edges y 0, z 0 and y 30, z 0 both run along X: they never meet nor have one closest point: refused",
+ "outcome": "refused",
+ "refusal": "the edges are parallel"
+}
diff --git a/tests/kernel-cases/construction/cov-point-two-edges-refuses-parallel-edges/recipe.json b/tests/kernel-cases/construction/cov-point-two-edges-refuses-parallel-edges/recipe.json
new file mode 100644
index 0000000000..bae734072b
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-point-two-edges-refuses-parallel-edges/recipe.json
@@ -0,0 +1,33 @@
+{
+ "commands": [
+ {
+ "command": "solid.box",
+ "params": {
+ "length": 40,
+ "width": 30,
+ "height": 20,
+ "body_name": "Box"
+ }
+ },
+ {
+ "command": "construct.point.two_edges",
+ "params": {
+ "a": {
+ "edge": [
+ 20,
+ 0,
+ 0
+ ]
+ },
+ "b": {
+ "edge": [
+ 20,
+ 30,
+ 0
+ ]
+ },
+ "name": "P"
+ }
+ }
+ ]
+}
diff --git a/tests/kernel-cases/construction/cov-point-two-edges-skew/expected.json b/tests/kernel-cases/construction/cov-point-two-edges-skew/expected.json
new file mode 100644
index 0000000000..a093eabec5
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-point-two-edges-skew/expected.json
@@ -0,0 +1,15 @@
+{
+ "sources": [],
+ "what": "where two skew box edges come closest",
+ "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 come closest at (40,0,0) and (40,0,20): the point halfway between, (40,0,10)",
+ "construction": {
+ "P": {
+ "point": [
+ 40,
+ 0,
+ 10
+ ]
+ }
+ }
+}
diff --git a/tests/kernel-cases/construction/cov-point-two-edges-skew/recipe.json b/tests/kernel-cases/construction/cov-point-two-edges-skew/recipe.json
new file mode 100644
index 0000000000..a49a060e73
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-point-two-edges-skew/recipe.json
@@ -0,0 +1,33 @@
+{
+ "commands": [
+ {
+ "command": "solid.box",
+ "params": {
+ "length": 40,
+ "width": 30,
+ "height": 20,
+ "body_name": "Box"
+ }
+ },
+ {
+ "command": "construct.point.two_edges",
+ "params": {
+ "a": {
+ "edge": [
+ 20,
+ 0,
+ 0
+ ]
+ },
+ "b": {
+ "edge": [
+ 40,
+ 15,
+ 20
+ ]
+ },
+ "name": "P"
+ }
+ }
+ ]
+}
diff --git a/tests/kernel-cases/construction/cov-point-vertex-box-corner/expected.json b/tests/kernel-cases/construction/cov-point-vertex-box-corner/expected.json
new file mode 100644
index 0000000000..56d1000feb
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-point-vertex-box-corner/expected.json
@@ -0,0 +1,15 @@
+{
+ "sources": [],
+ "what": "a point on a box's far 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 vertex nearest (39,29,19) is (40,30,20)",
+ "construction": {
+ "P": {
+ "point": [
+ 40,
+ 30,
+ 20
+ ]
+ }
+ }
+}
diff --git a/tests/kernel-cases/construction/cov-point-vertex-box-corner/recipe.json b/tests/kernel-cases/construction/cov-point-vertex-box-corner/recipe.json
new file mode 100644
index 0000000000..7a209b200a
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-point-vertex-box-corner/recipe.json
@@ -0,0 +1,26 @@
+{
+ "commands": [
+ {
+ "command": "solid.box",
+ "params": {
+ "length": 40,
+ "width": 30,
+ "height": 20,
+ "body_name": "Box"
+ }
+ },
+ {
+ "command": "construct.point.vertex",
+ "params": {
+ "point": {
+ "vertex": [
+ 39,
+ 29,
+ 19
+ ]
+ },
+ "name": "P"
+ }
+ }
+ ]
+}
diff --git a/tests/kernel-cases/construction/cov-point-vertex-of-a-construction-point/expected.json b/tests/kernel-cases/construction/cov-point-vertex-of-a-construction-point/expected.json
new file mode 100644
index 0000000000..3c4d9bacc9
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-point-vertex-of-a-construction-point/expected.json
@@ -0,0 +1,15 @@
+{
+ "sources": [],
+ "what": "a point on another construction point",
+ "source": "analytic",
+ "method": "the point where XY, XZ and YZ meet is the origin; a point on it is too",
+ "construction": {
+ "P": {
+ "point": [
+ 0,
+ 0,
+ 0
+ ]
+ }
+ }
+}
diff --git a/tests/kernel-cases/construction/cov-point-vertex-of-a-construction-point/recipe.json b/tests/kernel-cases/construction/cov-point-vertex-of-a-construction-point/recipe.json
new file mode 100644
index 0000000000..717ca22239
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-point-vertex-of-a-construction-point/recipe.json
@@ -0,0 +1,22 @@
+{
+ "commands": [
+ {
+ "command": "construct.point.three_planes",
+ "params": {
+ "a": "XY",
+ "b": "XZ",
+ "c": "YZ",
+ "name": "Pin"
+ }
+ },
+ {
+ "command": "construct.point.vertex",
+ "params": {
+ "point": {
+ "construct_point": "Pin"
+ },
+ "name": "P"
+ }
+ }
+ ]
+}
diff --git a/tests/kernel-cases/construction/cov-point-vertex-refuses-with-no-body/expected.json b/tests/kernel-cases/construction/cov-point-vertex-refuses-with-no-body/expected.json
new file mode 100644
index 0000000000..17daa15213
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-point-vertex-refuses-with-no-body/expected.json
@@ -0,0 +1,8 @@
+{
+ "sources": [],
+ "what": "a point on a vertex where there is no body",
+ "source": "analytic",
+ "method": "no body, so no vertex to put it on: refused",
+ "outcome": "refused",
+ "refusal": "there is no vertex"
+}
diff --git a/tests/kernel-cases/construction/cov-point-vertex-refuses-with-no-body/recipe.json b/tests/kernel-cases/construction/cov-point-vertex-refuses-with-no-body/recipe.json
new file mode 100644
index 0000000000..ee8d56f7e4
--- /dev/null
+++ b/tests/kernel-cases/construction/cov-point-vertex-refuses-with-no-body/recipe.json
@@ -0,0 +1,17 @@
+{
+ "commands": [
+ {
+ "command": "construct.point.vertex",
+ "params": {
+ "point": {
+ "vertex": [
+ 1,
+ 2,
+ 3
+ ]
+ },
+ "name": "P"
+ }
+ }
+ ]
+}
diff --git a/tests/kernel-cases/inspect/KNOWN_FAILING b/tests/kernel-cases/inspect/KNOWN_FAILING
new file mode 100644
index 0000000000..4584f2f891
--- /dev/null
+++ b/tests/kernel-cases/inspect/KNOWN_FAILING
@@ -0,0 +1,6 @@
+# The inspect cases that fail today, one a line: `<case> <why it fails today>`. Sorted. A run
+# with --known-failing fails on a case that fails and is not listed here, and on a listed case
+# that passes: a fix removes its line in the same pull request.
+# Baseline: rig-cases-construction-inspect 45f69c0e5 with SMLib 60b1c6a, aarch64 Linux.
+cov-center-of-mass-box-and-cylinder inspect.center_of_mass measures each body's display mesh (b.mesh().measure()), not its exact faces: the cylinder's volume is its chords' 784.13, not 250 pi = 785.40 (1.6e-3 short)
+cov-compare-taller-box inspect.compare integrates a region's volume along sampling lines: the 40 x 30 x 5 slab only B has comes out 5976.49, not 6000 (0.4% short)
diff --git a/tests/kernel-cases/inspect/PATHS b/tests/kernel-cases/inspect/PATHS
new file mode 100644
index 0000000000..faec9db6b0
--- /dev/null
+++ b/tests/kernel-cases/inspect/PATHS
@@ -0,0 +1,20 @@
+# Source files whose change must rerun the inspect area: one git pathspec glob a line.
+# The commands: center of mass, minimum radius, curvature comb and isocurve; continuity and the
+# draw-only analyses; interference (registered in joints.rs), clearance and compare.
+crates/engine/src/cmd/sketch_inspect.rs
+crates/engine/src/cmd/surface_analysis.rs
+crates/engine/src/cmd/interference.rs
+crates/engine/src/cmd/joints.rs
+crates/engine/src/cmd/clearance.rs
+crates/engine/src/cmd/compare.rs
+crates/engine/src/cmd/inspect.rs
+# What they measure with: the comparison of two surfaces, a face's isocurves, seam continuity,
+# body distance and mass properties.
+crates/geom/src/compare.rs
+crates/doc/src/eval.rs
+crates/kernel/src/iso.rs
+crates/kernel/src/continuity.rs
+crates/kernel/src/continuity_order.rs
+crates/kernel/src/distance.rs
+crates/kernel/src/measure.rs
+tests/kernel-cases/inspect/**
diff --git a/tests/kernel-cases/inspect/skipped.json b/tests/kernel-cases/inspect/skipped.json
new file mode 100644
index 0000000000..5c5ef00d3b
--- /dev/null
+++ b/tests/kernel-cases/inspect/skipped.json
@@ -0,0 +1,26 @@
+[
+ {
+ "source": "inspect.accessibility",
+ "why": "draws only: shades the faces a tool from one direction can reach; returns the analysis it set, no numbers"
+ },
+ {
+ "source": "inspect.curvature_map",
+ "why": "draws only: shades the faces by curvature; returns the analysis it set (its radius), no measurement"
+ },
+ {
+ "source": "inspect.draft",
+ "why": "draws only: shades the faces by draft against the pull direction; returns the pull and angle it was given, no face's draft angle"
+ },
+ {
+ "source": "inspect.environment_map",
+ "why": "draws only: a reflection shading; returns the analysis it set"
+ },
+ {
+ "source": "inspect.section",
+ "why": "draws only: shows the cut on a plane; returns the plane it was given (origin, normal, axis, at), no section area or outline"
+ },
+ {
+ "source": "inspect.zebra",
+ "why": "draws only: zebra stripes; returns the analysis it set (its stripe count)"
+ }
+]