diff --git a/tests/kernel-cases/surfaces/cov-untrim-cylinder-sheet-hole-in-place/expected.json b/tests/kernel-cases/surfaces/cov-untrim-cylinder-sheet-hole-in-place/expected.json new file mode 100644 index 0000000000..2c45cc4126 --- /dev/null +++ b/tests/kernel-cases/surfaces/cov-untrim-cylinder-sheet-hole-in-place/expected.json @@ -0,0 +1,26 @@ +{ + "sources": [], + "what": "a quarter-cylinder sheet r 10, 20 high, with a square window cut through it at 45 degrees, untrimmed in place: the cylinder face whole again", + "source": "analytic", + "method": "the window's loop is projected onto the cylinder along the sketch normal (1,1,0)/sqrt2 and cut out; untrimming every hole leaves the quarter cylinder: A = (pi/2) 10 20 = 314.16, one cylinder face with 4 free edges (two arcs, two rulings)", + "valid": false, + "body_count": 1, + "faces": 1, + "boundary_edges": 4, + "area_mm2": 314.1592653589793, + "surface_types": [ + "cylinder" + ], + "bbox": { + "min": [ + 0, + 0, + 0 + ], + "max": [ + 10, + 10, + 20 + ] + } +} diff --git a/tests/kernel-cases/surfaces/cov-untrim-cylinder-sheet-hole-in-place/recipe.json b/tests/kernel-cases/surfaces/cov-untrim-cylinder-sheet-hole-in-place/recipe.json new file mode 100644 index 0000000000..cae8c02a3c --- /dev/null +++ b/tests/kernel-cases/surfaces/cov-untrim-cylinder-sheet-hole-in-place/recipe.json @@ -0,0 +1,128 @@ +{ + "commands": [ + { + "command": "sketch.create", + "params": { + "plane": { + "origin": [ + 0, + 0, + 0 + ], + "x_dir": [ + 1, + 0, + 0 + ], + "y_dir": [ + 0, + 1, + 0 + ] + }, + "name": "Arc" + } + }, + { + "command": "sketch.arc.center_point", + "params": { + "center": [ + 0, + 0 + ], + "start": [ + 10, + 0 + ], + "end": [ + 0, + 10 + ] + } + }, + { + "command": "sketch.finish", + "params": {} + }, + { + "command": "surface.extrude", + "params": { + "sketch": "Arc", + "curves": [ + "a1" + ], + "distance": 20, + "body_name": "Quarter" + } + }, + { + "command": "sketch.create", + "params": { + "plane": { + "origin": [ + 0, + 0, + 0 + ], + "x_dir": [ + -0.7071067811865476, + 0.7071067811865476, + 0 + ], + "y_dir": [ + 0, + 0, + 1 + ] + }, + "name": "Window" + } + }, + { + "command": "sketch.rectangle.two_point", + "params": { + "p0": [ + -2, + 8 + ], + "p1": [ + 2, + 12 + ] + } + }, + { + "command": "sketch.finish", + "params": {} + }, + { + "command": "surface.trim", + "params": { + "body": "Quarter", + "curves": { + "sketch": "Window" + }, + "keep": [ + 9.84807753012208, + 1.7364817766693033, + 2 + ] + } + }, + { + "command": "surface.untrim", + "params": { + "face": { + "body": "Quarter", + "point": [ + 9.84807753012208, + 1.7364817766693033, + 2 + ] + }, + "holes": "all", + "in_place": true + } + } + ] +} diff --git a/tests/kernel-cases/surfaces/cov-untrim-face-without-holes-refused/expected.json b/tests/kernel-cases/surfaces/cov-untrim-face-without-holes-refused/expected.json new file mode 100644 index 0000000000..d0eb8a6e7f --- /dev/null +++ b/tests/kernel-cases/surfaces/cov-untrim-face-without-holes-refused/expected.json @@ -0,0 +1,8 @@ +{ + "sources": [], + "what": "untrim on a face with no holes and its outer boundary kept: nothing to do, refused", + "source": "invariants", + "method": "the face has no inner loop and outer is not asked: the command says so", + "outcome": "refused", + "refusal": "the face has no holes to remove" +} diff --git a/tests/kernel-cases/surfaces/cov-untrim-face-without-holes-refused/recipe.json b/tests/kernel-cases/surfaces/cov-untrim-face-without-holes-refused/recipe.json new file mode 100644 index 0000000000..981eb510c9 --- /dev/null +++ b/tests/kernel-cases/surfaces/cov-untrim-face-without-holes-refused/recipe.json @@ -0,0 +1,66 @@ +{ + "commands": [ + { + "command": "sketch.create", + "params": { + "plane": { + "origin": [ + 0, + 0, + 0 + ], + "x_dir": [ + 1, + 0, + 0 + ], + "y_dir": [ + 0, + 1, + 0 + ] + }, + "name": "Sheet sketch" + } + }, + { + "command": "sketch.rectangle.two_point", + "params": { + "p0": [ + 0, + 0 + ], + "p1": [ + 10, + 10 + ] + } + }, + { + "command": "sketch.finish", + "params": {} + }, + { + "command": "surface.patch", + "params": { + "sketch": "Sheet sketch", + "body_name": "Sheet" + } + }, + { + "command": "surface.untrim", + "params": { + "face": { + "body": "Sheet", + "point": [ + 5, + 5, + 0 + ] + }, + "holes": "all", + "in_place": true + } + } + ] +} diff --git a/tests/kernel-cases/surfaces/cov-untrim-sheet-hole-in-place/expected.json b/tests/kernel-cases/surfaces/cov-untrim-sheet-hole-in-place/expected.json new file mode 100644 index 0000000000..0668e50274 --- /dev/null +++ b/tests/kernel-cases/surfaces/cov-untrim-sheet-hole-in-place/expected.json @@ -0,0 +1,26 @@ +{ + "sources": [], + "what": "a square sheet 20 x 20 with a round hole r 4, untrimmed in place: the hole is gone", + "source": "analytic", + "method": "before: 400 - 16 pi = 349.73; untrimmed: the whole square, area 400, one plane face with its 4 outer edges free", + "valid": false, + "body_count": 1, + "faces": 1, + "boundary_edges": 4, + "area_mm2": 400.0, + "surface_types": [ + "plane" + ], + "bbox": { + "min": [ + 0, + 0, + 0 + ], + "max": [ + 20, + 20, + 0 + ] + } +} diff --git a/tests/kernel-cases/surfaces/cov-untrim-sheet-hole-in-place/recipe.json b/tests/kernel-cases/surfaces/cov-untrim-sheet-hole-in-place/recipe.json new file mode 100644 index 0000000000..425c84a6c2 --- /dev/null +++ b/tests/kernel-cases/surfaces/cov-untrim-sheet-hole-in-place/recipe.json @@ -0,0 +1,84 @@ +{ + "commands": [ + { + "command": "sketch.create", + "params": { + "plane": { + "origin": [ + 0, + 0, + 0 + ], + "x_dir": [ + 1, + 0, + 0 + ], + "y_dir": [ + 0, + 1, + 0 + ] + }, + "name": "Holed sketch" + } + }, + { + "command": "sketch.rectangle.two_point", + "params": { + "p0": [ + 0, + 0 + ], + "p1": [ + 20, + 20 + ] + } + }, + { + "command": "sketch.circle.center", + "params": { + "center": [ + 10, + 10 + ], + "radius": 4 + } + }, + { + "command": "sketch.finish", + "params": {} + }, + { + "command": "surface.patch", + "params": { + "sketch": "Holed sketch", + "profiles": [ + { + "point": [ + 2, + 2 + ] + } + ], + "body_name": "Holed" + } + }, + { + "command": "surface.untrim", + "params": { + "face": { + "body": "Holed", + "point": [ + 2, + 2, + 0 + ] + }, + "holes": "all", + "in_place": true + } + } + ] +} diff --git a/tests/kernel-cases/surfaces/cov-untrim-solid-top-face-copied-out/expected.json b/tests/kernel-cases/surfaces/cov-untrim-solid-top-face-copied-out/expected.json new file mode 100644 index 0000000000..c63f9aa8b5 --- /dev/null +++ b/tests/kernel-cases/surfaces/cov-untrim-solid-top-face-copied-out/expected.json @@ -0,0 +1,26 @@ +{ + "sources": [], + "what": "the top face of a block with a through hole, untrimmed: a solid's face is copied out, without the hole", + "source": "analytic", + "method": "block 20 x 20 x 10 cut by a cylinder r 4 through it; the top face (z = 10) untrimmed of its hole as a new surface body: the full 20 x 20 square, area 400; the block is removed so only the copy is graded", + "valid": false, + "body_count": 1, + "faces": 1, + "boundary_edges": 4, + "area_mm2": 400.0, + "surface_types": [ + "plane" + ], + "bbox": { + "min": [ + 0, + 0, + 10 + ], + "max": [ + 20, + 20, + 10 + ] + } +} diff --git a/tests/kernel-cases/surfaces/cov-untrim-solid-top-face-copied-out/recipe.json b/tests/kernel-cases/surfaces/cov-untrim-solid-top-face-copied-out/recipe.json new file mode 100644 index 0000000000..f4c7d551ca --- /dev/null +++ b/tests/kernel-cases/surfaces/cov-untrim-solid-top-face-copied-out/recipe.json @@ -0,0 +1,51 @@ +{ + "commands": [ + { + "command": "solid.box", + "params": { + "length": 20, + "width": 20, + "height": 10, + "body_name": "Block" + } + }, + { + "command": "solid.cylinder", + "params": { + "radius": 4, + "height": 10, + "base": [ + 10, + 10, + 0 + ], + "operation": "cut", + "targets": [ + "Block" + ] + } + }, + { + "command": "surface.untrim", + "params": { + "face": { + "body": "Block", + "point": [ + 2, + 2, + 10 + ] + }, + "body_name": "Lid" + } + }, + { + "command": "solid.remove", + "params": { + "bodies": [ + "Block" + ] + } + } + ] +}