diff --git a/tests/kernel-cases/booleans/cov-boundary-fill-crescent-inside-one-tool/expected.json b/tests/kernel-cases/booleans/cov-boundary-fill-crescent-inside-one-tool/expected.json new file mode 100644 index 000000000..5e1c18404 --- /dev/null +++ b/tests/kernel-cases/booleans/cov-boundary-fill-crescent-inside-one-tool/expected.json @@ -0,0 +1,21 @@ +{ + "sources": [], + "what": "Boundary Fill of the cell inside one cylinder and outside the other: the crescent", + "source": "analytic", + "method": "A minus the lens: 1000 pi - 1228.370; faces: bottom, top, A's outer arc, B's inner arc = 4", + "body_count": 1, + "faces": 4, + "volume_mm3": 1913.222954981036, + "bbox": { + "min": [ + -10, + -10, + 0 + ], + "max": [ + 10, + 10, + 10 + ] + } +} diff --git a/tests/kernel-cases/booleans/cov-boundary-fill-crescent-inside-one-tool/recipe.json b/tests/kernel-cases/booleans/cov-boundary-fill-crescent-inside-one-tool/recipe.json new file mode 100644 index 000000000..d6256522f --- /dev/null +++ b/tests/kernel-cases/booleans/cov-boundary-fill-crescent-inside-one-tool/recipe.json @@ -0,0 +1,42 @@ +{ + "commands": [ + { + "command": "solid.cylinder", + "params": { + "radius": 10, + "height": 10, + "body_name": "A" + } + }, + { + "command": "solid.cylinder", + "params": { + "radius": 10, + "height": 10, + "base": [ + 10, + 0, + 0 + ], + "body_name": "B" + } + }, + { + "command": "solid.boundary_fill", + "params": { + "tools": [ + "A", + "B" + ], + "cells": [ + [ + -5, + 0, + 5 + ] + ], + "remove_tools": true + } + } + ] +} diff --git a/tests/kernel-cases/booleans/cov-boundary-fill-lens-of-two-cylinders/expected.json b/tests/kernel-cases/booleans/cov-boundary-fill-lens-of-two-cylinders/expected.json new file mode 100644 index 000000000..235cf5d6b --- /dev/null +++ b/tests/kernel-cases/booleans/cov-boundary-fill-lens-of-two-cylinders/expected.json @@ -0,0 +1,21 @@ +{ + "sources": [], + "what": "Boundary Fill of the cell inside both of two overlapping cylinders (r10, axes 10 apart): the lens", + "source": "analytic", + "method": "two circles r with centres d = r apart overlap in 2r^2 acos(d/2r) - (d/2) sqrt(4r^2-d^2) = 200 pi/3 - 5 sqrt 300 = 122.837; h 10. Faces: bottom, top, two cylinder arcs = 4", + "body_count": 1, + "faces": 4, + "volume_mm3": 1228.3696986087568, + "bbox": { + "min": [ + 0, + -8.660254037844387, + 0 + ], + "max": [ + 10, + 8.660254037844387, + 10 + ] + } +} diff --git a/tests/kernel-cases/booleans/cov-boundary-fill-lens-of-two-cylinders/recipe.json b/tests/kernel-cases/booleans/cov-boundary-fill-lens-of-two-cylinders/recipe.json new file mode 100644 index 000000000..0309db09c --- /dev/null +++ b/tests/kernel-cases/booleans/cov-boundary-fill-lens-of-two-cylinders/recipe.json @@ -0,0 +1,42 @@ +{ + "commands": [ + { + "command": "solid.cylinder", + "params": { + "radius": 10, + "height": 10, + "body_name": "A" + } + }, + { + "command": "solid.cylinder", + "params": { + "radius": 10, + "height": 10, + "base": [ + 10, + 0, + 0 + ], + "body_name": "B" + } + }, + { + "command": "solid.boundary_fill", + "params": { + "tools": [ + "A", + "B" + ], + "cells": [ + [ + 5, + 0, + 5 + ] + ], + "remove_tools": true + } + } + ] +} diff --git a/tests/kernel-cases/booleans/cov-boundary-fill-point-outside-every-tool-refused/expected.json b/tests/kernel-cases/booleans/cov-boundary-fill-point-outside-every-tool-refused/expected.json new file mode 100644 index 000000000..344fe9ebd --- /dev/null +++ b/tests/kernel-cases/booleans/cov-boundary-fill-point-outside-every-tool-refused/expected.json @@ -0,0 +1,8 @@ +{ + "sources": [], + "what": "a cell point outside every tool encloses nothing: refused", + "source": "analytic", + "method": "(50,50,5) is in neither cylinder: no cell there, a clean refusal", + "outcome": "refused", + "refusal": "outside every tool" +} diff --git a/tests/kernel-cases/booleans/cov-boundary-fill-point-outside-every-tool-refused/recipe.json b/tests/kernel-cases/booleans/cov-boundary-fill-point-outside-every-tool-refused/recipe.json new file mode 100644 index 000000000..400ceaf39 --- /dev/null +++ b/tests/kernel-cases/booleans/cov-boundary-fill-point-outside-every-tool-refused/recipe.json @@ -0,0 +1,41 @@ +{ + "commands": [ + { + "command": "solid.cylinder", + "params": { + "radius": 10, + "height": 10, + "body_name": "A" + } + }, + { + "command": "solid.cylinder", + "params": { + "radius": 10, + "height": 10, + "base": [ + 10, + 0, + 0 + ], + "body_name": "B" + } + }, + { + "command": "solid.boundary_fill", + "params": { + "tools": [ + "A", + "B" + ], + "cells": [ + [ + 50, + 50, + 5 + ] + ] + } + } + ] +} 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 + ] + } + } + ] +} diff --git a/tests/kernel-cases/sweeps/cov-web-normal-two-walls-reach-the-block/expected.json b/tests/kernel-cases/sweeps/cov-web-normal-two-walls-reach-the-block/expected.json new file mode 100644 index 000000000..99b57a6e8 --- /dev/null +++ b/tests/kernel-cases/sweeps/cov-web-normal-two-walls-reach-the-block/expected.json @@ -0,0 +1,20 @@ +{ + "sources": [], + "what": "a web along the sketch normal: two 10 mm lines on a plane 20 mm in front of a block, each a wall grown to the block", + "source": "analytic", + "method": "each wall runs along +Y from y=-20 to the block face y=0: 10 long, 2 thick in the plane, 20 deep: 400 each; V = 24000 + 800", + "body_count": 1, + "volume_mm3": 24800.0, + "bbox": { + "min": [ + 0, + -20, + 0 + ], + "max": [ + 60, + 40, + 10 + ] + } +} diff --git a/tests/kernel-cases/sweeps/cov-web-normal-two-walls-reach-the-block/recipe.json b/tests/kernel-cases/sweeps/cov-web-normal-two-walls-reach-the-block/recipe.json new file mode 100644 index 000000000..d6a39180f --- /dev/null +++ b/tests/kernel-cases/sweeps/cov-web-normal-two-walls-reach-the-block/recipe.json @@ -0,0 +1,97 @@ +{ + "commands": [ + { + "command": "solid.box", + "params": { + "length": 60, + "width": 40, + "height": 10, + "corner": [ + 0, + 0, + 0 + ], + "body_name": "Block" + } + }, + { + "command": "sketch.create", + "params": { + "plane": { + "origin": [ + 0.0, + -20.0, + 0.0 + ], + "x_dir": [ + 1, + 0, + 0 + ], + "y_dir": [ + 0, + 0, + 1 + ] + }, + "name": "WebS" + } + }, + { + "command": "sketch.line", + "params": { + "points": [ + [ + 10, + 5 + ], + [ + 20, + 5 + ] + ], + "ids": [ + "w1" + ], + "infer": false + } + }, + { + "command": "sketch.line", + "params": { + "points": [ + [ + 40, + 5 + ], + [ + 50, + 5 + ] + ], + "ids": [ + "w2" + ], + "infer": false + } + }, + { + "command": "sketch.finish", + "params": { + "sketch": "WebS" + } + }, + { + "command": "solid.web", + "params": { + "sketch": "WebS", + "curves": [ + "w1", + "w2" + ], + "thickness": 2, + "direction": "normal" + } + } + ] +} diff --git a/tests/kernel-cases/sweeps/cov-web-two-gussets-in-a-channel/expected.json b/tests/kernel-cases/sweeps/cov-web-two-gussets-in-a-channel/expected.json new file mode 100644 index 000000000..3d69f8bd6 --- /dev/null +++ b/tests/kernel-cases/sweeps/cov-web-two-gussets-in-a-channel/expected.json @@ -0,0 +1,20 @@ +{ + "sources": [], + "what": "a web of two lines, one wall each, across the two inside corners of a U channel", + "source": "analytic", + "method": "channel: base 60x40x5 + two walls 5x40x35 = 26000; each line closes a right triangle of legs 15 with its wall and the base: 2 * 112.5 * 2 thick = 450", + "body_count": 1, + "volume_mm3": 26450.0, + "bbox": { + "min": [ + 0, + 0, + 0 + ], + "max": [ + 60, + 40, + 40 + ] + } +} diff --git a/tests/kernel-cases/sweeps/cov-web-two-gussets-in-a-channel/recipe.json b/tests/kernel-cases/sweeps/cov-web-two-gussets-in-a-channel/recipe.json new file mode 100644 index 000000000..e90984050 --- /dev/null +++ b/tests/kernel-cases/sweeps/cov-web-two-gussets-in-a-channel/recipe.json @@ -0,0 +1,119 @@ +{ + "commands": [ + { + "command": "solid.box", + "params": { + "length": 60, + "width": 40, + "height": 5, + "body_name": "Bracket" + } + }, + { + "command": "solid.box", + "params": { + "length": 5, + "width": 40, + "height": 40, + "corner": [ + 0, + 0, + 0 + ], + "operation": "join" + } + }, + { + "command": "solid.box", + "params": { + "length": 5, + "width": 40, + "height": 40, + "corner": [ + 55, + 0, + 0 + ], + "operation": "join" + } + }, + { + "command": "sketch.create", + "params": { + "plane": { + "origin": [ + 0, + 20, + 0 + ], + "x_dir": [ + 1, + 0, + 0 + ], + "y_dir": [ + 0, + 0, + 1 + ] + }, + "name": "Gussets" + } + }, + { + "command": "sketch.line", + "params": { + "points": [ + [ + 5, + 20 + ], + [ + 20, + 5 + ] + ], + "ids": [ + "g1" + ], + "infer": false + } + }, + { + "command": "sketch.line", + "params": { + "points": [ + [ + 40, + 5 + ], + [ + 55, + 20 + ] + ], + "ids": [ + "g2" + ], + "infer": false + } + }, + { + "command": "sketch.finish", + "params": { + "sketch": "Gussets" + } + }, + { + "command": "solid.web", + "params": { + "sketch": "Gussets", + "curves": [ + "g1", + "g2" + ], + "thickness": 2 + } + } + ] +}