From 305c36479bb187c2fba7ecc079620e2750ee33aa Mon Sep 17 00:00:00 2001 From: jyviko <2501648+jyviko@users.noreply.github.com> Date: Thu, 29 Oct 2026 17:10:20 -0400 Subject: [PATCH] Kernel rig: inspect cases, the gap between two spheres, their lens where they overlap, none past the clearance Co-Authored-By: Claude Opus 5.5 --- .../expected.json | 46 +++++++++++++++++++ .../recipe.json | 36 +++++++++++++++ .../expected.json | 22 +++++++++ .../recipe.json | 34 ++++++++++++++ .../expected.json | 18 ++++++++ .../recipe.json | 36 +++++++++++++++ 6 files changed, 192 insertions(+) create mode 100644 tests/kernel-cases/inspect/cov-clearance-gap-between-two-spheres/expected.json create mode 100644 tests/kernel-cases/inspect/cov-clearance-gap-between-two-spheres/recipe.json create mode 100644 tests/kernel-cases/inspect/cov-clearance-overlapping-spheres/expected.json create mode 100644 tests/kernel-cases/inspect/cov-clearance-overlapping-spheres/recipe.json create mode 100644 tests/kernel-cases/inspect/cov-clearance-spheres-farther-than-the-clearance/expected.json create mode 100644 tests/kernel-cases/inspect/cov-clearance-spheres-farther-than-the-clearance/recipe.json diff --git a/tests/kernel-cases/inspect/cov-clearance-gap-between-two-spheres/expected.json b/tests/kernel-cases/inspect/cov-clearance-gap-between-two-spheres/expected.json new file mode 100644 index 0000000000..af414d55bf --- /dev/null +++ b/tests/kernel-cases/inspect/cov-clearance-gap-between-two-spheres/expected.json @@ -0,0 +1,46 @@ +{ + "sources": [], + "what": "the gap between two spheres", + "source": "analytic", + "method": "spheres r 5 on (0,0,0) and (20,0,0): 20 - 5 - 5 = 10 apart, from (5,0,0) to (15,0,0)", + "results": [ + { + "command": 2, + "pointer": "/overlaps", + "value": [] + }, + { + "command": 2, + "pointer": "/near/0/a", + "value": "A" + }, + { + "command": 2, + "pointer": "/near/0/b", + "value": "B" + }, + { + "command": 2, + "pointer": "/near/0/distance_mm", + "value": 10.0 + }, + { + "command": 2, + "pointer": "/near/0/from", + "value": [ + 5, + 0, + 0 + ] + }, + { + "command": 2, + "pointer": "/near/0/to", + "value": [ + 15, + 0, + 0 + ] + } + ] +} diff --git a/tests/kernel-cases/inspect/cov-clearance-gap-between-two-spheres/recipe.json b/tests/kernel-cases/inspect/cov-clearance-gap-between-two-spheres/recipe.json new file mode 100644 index 0000000000..1461bdb5d3 --- /dev/null +++ b/tests/kernel-cases/inspect/cov-clearance-gap-between-two-spheres/recipe.json @@ -0,0 +1,36 @@ +{ + "commands": [ + { + "command": "solid.sphere", + "params": { + "center": [ + 0, + 0, + 0 + ], + "radius": 5, + "body_name": "A", + "operation": "new" + } + }, + { + "command": "solid.sphere", + "params": { + "center": [ + 20, + 0, + 0 + ], + "radius": 5, + "body_name": "B", + "operation": "new" + } + }, + { + "command": "inspect.clearance", + "params": { + "clearance": 15 + } + } + ] +} diff --git a/tests/kernel-cases/inspect/cov-clearance-overlapping-spheres/expected.json b/tests/kernel-cases/inspect/cov-clearance-overlapping-spheres/expected.json new file mode 100644 index 0000000000..07c05664d2 --- /dev/null +++ b/tests/kernel-cases/inspect/cov-clearance-overlapping-spheres/expected.json @@ -0,0 +1,22 @@ +{ + "sources": [], + "what": "the shared volume of two overlapping spheres", + "source": "analytic", + "method": "spheres r 5 on (0,0,0) and (8,0,0): the lens pi (4r + d)(2r - d)^2 / 12 = pi 28 4 / 12 = 29.3215, centred on (4,0,0)", + "results": [ + { + "command": 2, + "pointer": "/overlaps/0/volume_mm3", + "value": 29.321531433504735 + }, + { + "command": 2, + "pointer": "/overlaps/0/center", + "value": [ + 4, + 0, + 0 + ] + } + ] +} diff --git a/tests/kernel-cases/inspect/cov-clearance-overlapping-spheres/recipe.json b/tests/kernel-cases/inspect/cov-clearance-overlapping-spheres/recipe.json new file mode 100644 index 0000000000..d4886dc8f7 --- /dev/null +++ b/tests/kernel-cases/inspect/cov-clearance-overlapping-spheres/recipe.json @@ -0,0 +1,34 @@ +{ + "commands": [ + { + "command": "solid.sphere", + "params": { + "center": [ + 0, + 0, + 0 + ], + "radius": 5, + "body_name": "A", + "operation": "new" + } + }, + { + "command": "solid.sphere", + "params": { + "center": [ + 8, + 0, + 0 + ], + "radius": 5, + "body_name": "B", + "operation": "new" + } + }, + { + "command": "inspect.clearance", + "params": {} + } + ] +} diff --git a/tests/kernel-cases/inspect/cov-clearance-spheres-farther-than-the-clearance/expected.json b/tests/kernel-cases/inspect/cov-clearance-spheres-farther-than-the-clearance/expected.json new file mode 100644 index 0000000000..8f4b8e3afa --- /dev/null +++ b/tests/kernel-cases/inspect/cov-clearance-spheres-farther-than-the-clearance/expected.json @@ -0,0 +1,18 @@ +{ + "sources": [], + "what": "two spheres farther apart than the clearance asked", + "source": "analytic", + "method": "spheres r 5 on (0,0,0) and (20,0,0) are 10 apart; closer than 5 asked: none", + "results": [ + { + "command": 2, + "pointer": "/overlaps", + "value": [] + }, + { + "command": 2, + "pointer": "/near", + "value": [] + } + ] +} diff --git a/tests/kernel-cases/inspect/cov-clearance-spheres-farther-than-the-clearance/recipe.json b/tests/kernel-cases/inspect/cov-clearance-spheres-farther-than-the-clearance/recipe.json new file mode 100644 index 0000000000..ccf0012463 --- /dev/null +++ b/tests/kernel-cases/inspect/cov-clearance-spheres-farther-than-the-clearance/recipe.json @@ -0,0 +1,36 @@ +{ + "commands": [ + { + "command": "solid.sphere", + "params": { + "center": [ + 0, + 0, + 0 + ], + "radius": 5, + "body_name": "A", + "operation": "new" + } + }, + { + "command": "solid.sphere", + "params": { + "center": [ + 20, + 0, + 0 + ], + "radius": 5, + "body_name": "B", + "operation": "new" + } + }, + { + "command": "inspect.clearance", + "params": { + "clearance": 5 + } + } + ] +}