From 58b384d7d99e46f75914c85c8a0c54341056d3e8 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 overlap volume of two boxes, none where they only touch, a box inside a box Co-Authored-By: Claude Opus 5.5 --- .../expected.json | 27 ++++++++++ .../recipe.json | 33 ++++++++++++ .../expected.json | 18 +++++++ .../recipe.json | 33 ++++++++++++ .../expected.json | 50 +++++++++++++++++++ .../recipe.json | 33 ++++++++++++ 6 files changed, 194 insertions(+) create mode 100644 tests/kernel-cases/inspect/cov-interference-box-inside-a-box/expected.json create mode 100644 tests/kernel-cases/inspect/cov-interference-box-inside-a-box/recipe.json create mode 100644 tests/kernel-cases/inspect/cov-interference-boxes-touching-face-to-face/expected.json create mode 100644 tests/kernel-cases/inspect/cov-interference-boxes-touching-face-to-face/recipe.json create mode 100644 tests/kernel-cases/inspect/cov-interference-overlapping-boxes/expected.json create mode 100644 tests/kernel-cases/inspect/cov-interference-overlapping-boxes/recipe.json 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.json new file mode 100644 index 000000000..c56e1ed3e --- /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.json new file mode 100644 index 000000000..800e73ec1 --- /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.json new file mode 100644 index 000000000..07812ac63 --- /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.json new file mode 100644 index 000000000..69744f365 --- /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.json new file mode 100644 index 000000000..f76118d01 --- /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.json new file mode 100644 index 000000000..4dfc1aeac --- /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": {} + } + ] +}