diff --git a/tests/kernel-cases/solids/cov-align-bottom-face-onto-top-face/expected.json b/tests/kernel-cases/solids/cov-align-bottom-face-onto-top-face/expected.json new file mode 100644 index 000000000..78e72fc96 --- /dev/null +++ b/tests/kernel-cases/solids/cov-align-bottom-face-onto-top-face/expected.json @@ -0,0 +1,25 @@ +{ + "sources": [], + "what": "a cube's bottom face aligned onto a plate's top face (normals already opposite: a pure move)", + "source": "analytic", + "method": "the faces' normals are -Z and +Z: no turn; the picked point (105,5,0) goes to (20,20,10): the cube moves by (-85,15,10) to x 15..25, y 15..25, z 10..20. COM z = (16000*5 + 1000*15)/17000", + "body_count": 2, + "volume_mm3": 17000.0, + "center_of_mass": [ + 20, + 20, + 5.588235294117647 + ], + "bbox": { + "min": [ + 0, + 0, + 0 + ], + "max": [ + 40, + 40, + 20 + ] + } +} diff --git a/tests/kernel-cases/solids/cov-align-bottom-face-onto-top-face/recipe.json b/tests/kernel-cases/solids/cov-align-bottom-face-onto-top-face/recipe.json new file mode 100644 index 000000000..3666f0c26 --- /dev/null +++ b/tests/kernel-cases/solids/cov-align-bottom-face-onto-top-face/recipe.json @@ -0,0 +1,45 @@ +{ + "commands": [ + { + "command": "solid.box", + "params": { + "length": 40, + "width": 40, + "height": 10, + "body_name": "Base" + } + }, + { + "command": "solid.box", + "params": { + "length": 10, + "width": 10, + "height": 10, + "corner": [ + 100, + 0, + 0 + ], + "body_name": "Block" + } + }, + { + "command": "solid.align", + "params": { + "bodies": [ + "Block" + ], + "from_face": [ + 105, + 5, + 0 + ], + "to_face": [ + 20, + 20, + 10 + ] + } + } + ] +} diff --git a/tests/kernel-cases/solids/cov-align-face-onto-offset-plane/expected.json b/tests/kernel-cases/solids/cov-align-face-onto-offset-plane/expected.json new file mode 100644 index 000000000..b8885dd3f --- /dev/null +++ b/tests/kernel-cases/solids/cov-align-face-onto-offset-plane/expected.json @@ -0,0 +1,20 @@ +{ + "sources": [], + "what": "a post's bottom face aligned onto a plane z=50 away from the picked point in X and Y: it moves along the plane's normal only", + "source": "analytic", + "method": "onto a plane the point moves along its normal: (0,0,50); the bottom faces -Z, the plane +Z: no turn. The post goes to z 50..70, x and y unchanged", + "body_count": 1, + "volume_mm3": 2000.0, + "bbox": { + "min": [ + 100, + 0, + 50 + ], + "max": [ + 110, + 10, + 70 + ] + } +} diff --git a/tests/kernel-cases/solids/cov-align-face-onto-offset-plane/recipe.json b/tests/kernel-cases/solids/cov-align-face-onto-offset-plane/recipe.json new file mode 100644 index 000000000..44122140d --- /dev/null +++ b/tests/kernel-cases/solids/cov-align-face-onto-offset-plane/recipe.json @@ -0,0 +1,43 @@ +{ + "commands": [ + { + "command": "solid.box", + "params": { + "length": 10, + "width": 10, + "height": 20, + "corner": [ + 100, + 0, + 0 + ], + "body_name": "Post" + } + }, + { + "command": "solid.align", + "params": { + "bodies": [ + "Post" + ], + "from_face": [ + 105, + 5, + 0 + ], + "to_plane": { + "origin": [ + 0, + 0, + 50 + ], + "normal": [ + 0, + 0, + 1 + ] + } + } + } + ] +} diff --git a/tests/kernel-cases/solids/cov-align-side-face-turns-onto-top-face/expected.json b/tests/kernel-cases/solids/cov-align-side-face-turns-onto-top-face/expected.json new file mode 100644 index 000000000..6f3432214 --- /dev/null +++ b/tests/kernel-cases/solids/cov-align-side-face-turns-onto-top-face/expected.json @@ -0,0 +1,25 @@ +{ + "sources": [], + "what": "a 10x10x20 post's side face (+X) aligned onto a plate's top face: the post turns 90 deg to lie flat", + "source": "analytic", + "method": "+X turns onto -Z: 90 deg about +Y through (110,5,10), the post becomes 20 along X, 10 along Z (x 100..120, z 10..20); the point then moves to (20,20,10): x 10..30, y 15..25, z 10..20. Unturned it would reach z 30. COM z = (16000*5 + 2000*15)/18000", + "body_count": 2, + "volume_mm3": 18000.0, + "center_of_mass": [ + 20, + 20, + 6.111111111111111 + ], + "bbox": { + "min": [ + 0, + 0, + 0 + ], + "max": [ + 40, + 40, + 20 + ] + } +} diff --git a/tests/kernel-cases/solids/cov-align-side-face-turns-onto-top-face/recipe.json b/tests/kernel-cases/solids/cov-align-side-face-turns-onto-top-face/recipe.json new file mode 100644 index 000000000..3c182ec00 --- /dev/null +++ b/tests/kernel-cases/solids/cov-align-side-face-turns-onto-top-face/recipe.json @@ -0,0 +1,45 @@ +{ + "commands": [ + { + "command": "solid.box", + "params": { + "length": 40, + "width": 40, + "height": 10, + "body_name": "Base" + } + }, + { + "command": "solid.box", + "params": { + "length": 10, + "width": 10, + "height": 20, + "corner": [ + 100, + 0, + 0 + ], + "body_name": "Post" + } + }, + { + "command": "solid.align", + "params": { + "bodies": [ + "Post" + ], + "from_face": [ + 110, + 5, + 10 + ], + "to_face": [ + 20, + 20, + 10 + ] + } + } + ] +}