From be4f15db63e11784f78a439f4e5a867f6759d085 Mon Sep 17 00:00:00 2001 From: jyviko <2501648+jyviko@users.noreply.github.com> Date: Thu, 29 Oct 2026 16:50:20 -0400 Subject: [PATCH] Kernel rig: bounding solid cases, two boxes with a margin and a sphere's exact box Co-Authored-By: Claude Opus 5.5 --- .../expected.json | 21 ++++++++++++ .../recipe.json | 25 ++++++++++++++ .../expected.json | 20 +++++++++++ .../recipe.json | 34 +++++++++++++++++++ 4 files changed, 100 insertions(+) create mode 100644 tests/kernel-cases/solids/cov-bounding-solid-of-a-sphere/expected.json create mode 100644 tests/kernel-cases/solids/cov-bounding-solid-of-a-sphere/recipe.json create mode 100644 tests/kernel-cases/solids/cov-bounding-solid-two-boxes-with-margin/expected.json create mode 100644 tests/kernel-cases/solids/cov-bounding-solid-two-boxes-with-margin/recipe.json diff --git a/tests/kernel-cases/solids/cov-bounding-solid-of-a-sphere/expected.json b/tests/kernel-cases/solids/cov-bounding-solid-of-a-sphere/expected.json new file mode 100644 index 0000000000..a326179ed7 --- /dev/null +++ b/tests/kernel-cases/solids/cov-bounding-solid-of-a-sphere/expected.json @@ -0,0 +1,21 @@ +{ + "sources": [], + "what": "the bounding box of a sphere r10 at (5,5,5): a curved body's exact extremes, not its mesh's", + "source": "analytic", + "method": "the sphere spans 5 +- 10 on each axis: the box (-5,-5,-5)-(15,15,15) = 20^3 = 8000; with the sphere kept: V = 8000 + 4/3 pi 1000; faces 6 + 1", + "body_count": 2, + "faces": 7, + "volume_mm3": 12188.79020478639, + "bbox": { + "min": [ + -5, + -5, + -5 + ], + "max": [ + 15, + 15, + 15 + ] + } +} diff --git a/tests/kernel-cases/solids/cov-bounding-solid-of-a-sphere/recipe.json b/tests/kernel-cases/solids/cov-bounding-solid-of-a-sphere/recipe.json new file mode 100644 index 0000000000..686f78767b --- /dev/null +++ b/tests/kernel-cases/solids/cov-bounding-solid-of-a-sphere/recipe.json @@ -0,0 +1,25 @@ +{ + "commands": [ + { + "command": "solid.sphere", + "params": { + "radius": 10, + "center": [ + 5, + 5, + 5 + ], + "body_name": "Ball" + } + }, + { + "command": "solid.bounding_solid", + "params": { + "bodies": [ + "Ball" + ], + "body_name": "Bound" + } + } + ] +} diff --git a/tests/kernel-cases/solids/cov-bounding-solid-two-boxes-with-margin/expected.json b/tests/kernel-cases/solids/cov-bounding-solid-two-boxes-with-margin/expected.json new file mode 100644 index 0000000000..c2cdffc6d0 --- /dev/null +++ b/tests/kernel-cases/solids/cov-bounding-solid-two-boxes-with-margin/expected.json @@ -0,0 +1,20 @@ +{ + "sources": [], + "what": "the bounding box of two boxes (0..10 cube, 20..25 x 0..5 x 0..5) with a 2 mm margin", + "source": "analytic", + "method": "the boxes span (0,0,0)-(25,10,10); with 2 mm: (-2,-2,-2)-(27,12,12) = 29x14x14 = 5684; with both boxes kept: V = 1000 + 125 + 5684", + "body_count": 3, + "volume_mm3": 6809, + "bbox": { + "min": [ + -2, + -2, + -2 + ], + "max": [ + 27, + 12, + 12 + ] + } +} diff --git a/tests/kernel-cases/solids/cov-bounding-solid-two-boxes-with-margin/recipe.json b/tests/kernel-cases/solids/cov-bounding-solid-two-boxes-with-margin/recipe.json new file mode 100644 index 0000000000..54f3a63d89 --- /dev/null +++ b/tests/kernel-cases/solids/cov-bounding-solid-two-boxes-with-margin/recipe.json @@ -0,0 +1,34 @@ +{ + "commands": [ + { + "command": "solid.box", + "params": { + "length": 10, + "width": 10, + "height": 10, + "body_name": "A" + } + }, + { + "command": "solid.box", + "params": { + "length": 5, + "width": 5, + "height": 5, + "corner": [ + 20, + 0, + 0 + ], + "body_name": "B" + } + }, + { + "command": "solid.bounding_solid", + "params": { + "margin": 2, + "body_name": "Bound" + } + } + ] +}