diff --git a/tests/kernel-cases/surfaces/cov-ruled-box-edge-along-the-top-normal/expected.json b/tests/kernel-cases/surfaces/cov-ruled-box-edge-along-the-top-normal/expected.json new file mode 100644 index 000000000..89906571f --- /dev/null +++ b/tests/kernel-cases/surfaces/cov-ruled-box-edge-along-the-top-normal/expected.json @@ -0,0 +1,26 @@ +{ + "sources": [], + "what": "a ruled strip 5 wide off the box's top front edge, along the top face's normal", + "source": "analytic", + "method": "edge (0..20, 0, 10), rulings +z (the top's normal), constant: the plane y = 0, x 0..20, z 10..15: area 100, one plane face with 4 free edges", + "valid": false, + "body_count": 1, + "faces": 1, + "boundary_edges": 4, + "area_mm2": 100.0, + "surface_types": [ + "plane" + ], + "bbox": { + "min": [ + 0, + 0, + 10 + ], + "max": [ + 20, + 0, + 15 + ] + } +} diff --git a/tests/kernel-cases/surfaces/cov-ruled-box-edge-along-the-top-normal/recipe.json b/tests/kernel-cases/surfaces/cov-ruled-box-edge-along-the-top-normal/recipe.json new file mode 100644 index 000000000..a2997bad5 --- /dev/null +++ b/tests/kernel-cases/surfaces/cov-ruled-box-edge-along-the-top-normal/recipe.json @@ -0,0 +1,41 @@ +{ + "commands": [ + { + "command": "solid.box", + "params": { + "length": 20, + "width": 10, + "height": 10, + "body_name": "Box" + } + }, + { + "command": "surface.ruled", + "params": { + "body": "Box", + "edges": [ + [ + 10, + 0, + 10 + ] + ], + "face": [ + 10, + 5, + 10 + ], + "distance": 5, + "body_name": "Strip" + } + }, + { + "command": "solid.remove", + "params": { + "bodies": [ + "Box" + ] + } + } + ] +} diff --git a/tests/kernel-cases/surfaces/cov-ruled-closed-top-chain-tangent-mitred-frame/expected.json b/tests/kernel-cases/surfaces/cov-ruled-closed-top-chain-tangent-mitred-frame/expected.json new file mode 100644 index 000000000..5e1ba4473 --- /dev/null +++ b/tests/kernel-cases/surfaces/cov-ruled-closed-top-chain-tangent-mitred-frame/expected.json @@ -0,0 +1,29 @@ +{ + "sources": [], + "what": "ruled strips 5 wide off all four top edges of a box, continuing the top: mitred at the corners into a flat frame", + "source": "analytic", + "method": "each strip continues the top (z = 10) outward 5; mitred corners close the frame 30 x 20 round the 20 x 10 top: area 600 - 200 = 400, all in z = 10; 4 strips (coplanar, counted [1, 4]), 8 free edges (4 inner, 4 outer)", + "valid": false, + "body_count": 1, + "faces": [ + 1, + 4 + ], + "boundary_edges": 8, + "area_mm2": 400.0, + "surface_types": [ + "plane" + ], + "bbox": { + "min": [ + -5, + -5, + 10 + ], + "max": [ + 25, + 15, + 10 + ] + } +} diff --git a/tests/kernel-cases/surfaces/cov-ruled-closed-top-chain-tangent-mitred-frame/recipe.json b/tests/kernel-cases/surfaces/cov-ruled-closed-top-chain-tangent-mitred-frame/recipe.json new file mode 100644 index 000000000..957bf77a0 --- /dev/null +++ b/tests/kernel-cases/surfaces/cov-ruled-closed-top-chain-tangent-mitred-frame/recipe.json @@ -0,0 +1,57 @@ +{ + "commands": [ + { + "command": "solid.box", + "params": { + "length": 20, + "width": 10, + "height": 10, + "body_name": "Box" + } + }, + { + "command": "surface.ruled", + "params": { + "body": "Box", + "edges": [ + [ + 10, + 0, + 10 + ], + [ + 20, + 5, + 10 + ], + [ + 10, + 10, + 10 + ], + [ + 0, + 5, + 10 + ] + ], + "face": [ + 10, + 5, + 10 + ], + "mode": "tangent", + "distance": 5, + "body_name": "Frame" + } + }, + { + "command": "solid.remove", + "params": { + "bodies": [ + "Box" + ] + } + } + ] +} diff --git a/tests/kernel-cases/surfaces/cov-ruled-cylinder-rim-at-45-degrees-is-a-cone/expected.json b/tests/kernel-cases/surfaces/cov-ruled-cylinder-rim-at-45-degrees-is-a-cone/expected.json new file mode 100644 index 000000000..f04789d90 --- /dev/null +++ b/tests/kernel-cases/surfaces/cov-ruled-cylinder-rim-at-45-degrees-is-a-cone/expected.json @@ -0,0 +1,26 @@ +{ + "sources": [], + "what": "a ruled strip off a cylinder's top rim at 45 degrees from the top face's normal, turned away from it: an exact cone frustum", + "source": "analytic", + "method": "rulings at 45 deg from +z, leaning out (away from the top face), keep their angle to the arc's axis: a cone. r 10 at z 10 to r 10 + 5/sqrt2 = 13.536 at z 10 + 5/sqrt2 = 13.536; lateral area pi (r1 + r2) slant = pi 23.536 5 = 369.69; one face, two free circles", + "valid": false, + "body_count": 1, + "faces": 1, + "boundary_edges": 2, + "area_mm2": 369.69530208595893, + "surface_types": [ + "cone" + ], + "bbox": { + "min": [ + -13.535533905932738, + -13.535533905932738, + 10 + ], + "max": [ + 13.535533905932738, + 13.535533905932738, + 13.535533905932738 + ] + } +} diff --git a/tests/kernel-cases/surfaces/cov-ruled-cylinder-rim-at-45-degrees-is-a-cone/recipe.json b/tests/kernel-cases/surfaces/cov-ruled-cylinder-rim-at-45-degrees-is-a-cone/recipe.json new file mode 100644 index 000000000..4de116f0a --- /dev/null +++ b/tests/kernel-cases/surfaces/cov-ruled-cylinder-rim-at-45-degrees-is-a-cone/recipe.json @@ -0,0 +1,42 @@ +{ + "commands": [ + { + "command": "solid.cylinder", + "params": { + "radius": 10, + "height": 10, + "body_name": "Post" + } + }, + { + "command": "surface.ruled", + "params": { + "body": "Post", + "edges": [ + [ + 10, + 0, + 10 + ] + ], + "face": [ + 0, + 0, + 10 + ], + "mode": "angle", + "angle": "45 deg", + "distance": 5, + "body_name": "Flare" + } + }, + { + "command": "solid.remove", + "params": { + "bodies": [ + "Post" + ] + } + } + ] +} diff --git a/tests/kernel-cases/surfaces/cov-ruled-cylinder-rim-tangent-to-the-top-is-a-flat-ring/expected.json b/tests/kernel-cases/surfaces/cov-ruled-cylinder-rim-tangent-to-the-top-is-a-flat-ring/expected.json new file mode 100644 index 000000000..9f4c1853e --- /dev/null +++ b/tests/kernel-cases/surfaces/cov-ruled-cylinder-rim-tangent-to-the-top-is-a-flat-ring/expected.json @@ -0,0 +1,26 @@ +{ + "sources": [], + "what": "a ruled strip off a cylinder's top rim continuing the top face: the flat ring r 10..15", + "source": "analytic", + "method": "tangent rulings continue the top (z = 10) square to the rim, outward: the plane annulus r 10..15, area pi (225 - 100) = 392.70; one plane face, two free circles", + "valid": false, + "body_count": 1, + "faces": 1, + "boundary_edges": 2, + "area_mm2": 392.6990816987241, + "surface_types": [ + "plane" + ], + "bbox": { + "min": [ + -15, + -15, + 10 + ], + "max": [ + 15, + 15, + 10 + ] + } +} diff --git a/tests/kernel-cases/surfaces/cov-ruled-cylinder-rim-tangent-to-the-top-is-a-flat-ring/recipe.json b/tests/kernel-cases/surfaces/cov-ruled-cylinder-rim-tangent-to-the-top-is-a-flat-ring/recipe.json new file mode 100644 index 000000000..6198c9219 --- /dev/null +++ b/tests/kernel-cases/surfaces/cov-ruled-cylinder-rim-tangent-to-the-top-is-a-flat-ring/recipe.json @@ -0,0 +1,41 @@ +{ + "commands": [ + { + "command": "solid.cylinder", + "params": { + "radius": 10, + "height": 10, + "body_name": "Post" + } + }, + { + "command": "surface.ruled", + "params": { + "body": "Post", + "edges": [ + [ + 10, + 0, + 10 + ] + ], + "face": [ + 0, + 0, + 10 + ], + "mode": "tangent", + "distance": 5, + "body_name": "Brim" + } + }, + { + "command": "solid.remove", + "params": { + "bodies": [ + "Post" + ] + } + } + ] +} diff --git a/tests/kernel-cases/surfaces/cov-ruled-zero-distance-refused/expected.json b/tests/kernel-cases/surfaces/cov-ruled-zero-distance-refused/expected.json new file mode 100644 index 000000000..d4e265a50 --- /dev/null +++ b/tests/kernel-cases/surfaces/cov-ruled-zero-distance-refused/expected.json @@ -0,0 +1,8 @@ +{ + "sources": [], + "what": "a ruled strip of width 0: refused, it would have no area", + "source": "invariants", + "method": "a strip needs a positive width", + "outcome": "refused", + "refusal": "the ruled surface distance must be positive and finite" +} diff --git a/tests/kernel-cases/surfaces/cov-ruled-zero-distance-refused/recipe.json b/tests/kernel-cases/surfaces/cov-ruled-zero-distance-refused/recipe.json new file mode 100644 index 000000000..fc19a936c --- /dev/null +++ b/tests/kernel-cases/surfaces/cov-ruled-zero-distance-refused/recipe.json @@ -0,0 +1,32 @@ +{ + "commands": [ + { + "command": "solid.box", + "params": { + "length": 20, + "width": 10, + "height": 10, + "body_name": "Box" + } + }, + { + "command": "surface.ruled", + "params": { + "body": "Box", + "edges": [ + [ + 10, + 0, + 10 + ] + ], + "face": [ + 10, + 5, + 10 + ], + "distance": 0 + } + } + ] +}