diff --git a/tests/kernel-cases/sheet-metal/cov-path-flange-one-line-down-at-45-degrees/expected.json b/tests/kernel-cases/sheet-metal/cov-path-flange-one-line-down-at-45-degrees/expected.json new file mode 100644 index 000000000..f0552828c --- /dev/null +++ b/tests/kernel-cases/sheet-metal/cov-path-flange-one-line-down-at-45-degrees/expected.json @@ -0,0 +1,22 @@ +{ + "sources": [], + "what": "sheet.path_flange along one line drawn 45 degrees down and out from the top edge of a 100 x 60 x 2 base, 20 long: a single bend down", + "source": "analytic", + "method": "T = 2, R = 2, K = 0.5. One line, one 45 degree bend, turning down (the path heads below the sheet): setback (R + T)tan(22.5 deg) = 1.656854 off the base and off the flange's 20 (to its outer face from the virtual sharp). V = 2*100*((60 - s) + (20 - s)) + (pi/4)((R+T)^2 - R^2)/2*100 = 15808.497198", + "body_count": 1, + "volume_mm3": 15808.497198241515, + "results": [ + { + "step": 10, + "json": { + "bends": [ + { + "angle_deg": 45.0, + "direction": "down", + "radius": 2.0 + } + ] + } + } + ] +} diff --git a/tests/kernel-cases/sheet-metal/cov-path-flange-one-line-down-at-45-degrees/recipe.json b/tests/kernel-cases/sheet-metal/cov-path-flange-one-line-down-at-45-degrees/recipe.json new file mode 100644 index 000000000..2c9c25722 --- /dev/null +++ b/tests/kernel-cases/sheet-metal/cov-path-flange-one-line-down-at-45-degrees/recipe.json @@ -0,0 +1,108 @@ +{ + "commands": [ + { + "command": "sheet.manage_rules", + "params": { + "name": "Steel 2", + "thickness": "2 mm", + "active": true, + "bend_radius": "2 mm", + "k_factor": 0.5 + } + }, + { + "command": "sketch.create", + "params": { + "plane": "XY", + "name": "Base" + } + }, + { + "command": "sketch.rectangle.two_point", + "params": { + "p0": [ + 0, + 0 + ], + "p1": [ + 100, + 60 + ] + } + }, + { + "command": "sketch.finish", + "params": {} + }, + { + "command": "sheet.flange", + "params": { + "type": "base", + "sketch": "Base" + } + }, + { + "command": "sketch.create", + "params": { + "plane": { + "origin": [ + 50, + 0, + 0 + ], + "x_dir": [ + 0, + -1, + 0 + ], + "y_dir": [ + 0, + 0, + 1 + ] + }, + "name": "Path" + } + }, + { + "command": "sketch.line", + "params": { + "points": [ + [ + 0, + 2 + ], + [ + 14.14213562373095, + -12.14213562373095 + ] + ], + "ids": [ + "p1" + ] + } + }, + { + "command": "sketch.finish", + "params": {} + }, + { + "command": "sheet.path_flange", + "params": { + "edge": [ + 50, + 0, + 2 + ], + "sketch": "Path", + "curves": [ + "p1" + ] + } + }, + { + "command": "sheet.flat_pattern", + "params": {} + } + ] +} diff --git a/tests/kernel-cases/sheet-metal/cov-path-flange-straight-on-from-the-sheet-refused/expected.json b/tests/kernel-cases/sheet-metal/cov-path-flange-straight-on-from-the-sheet-refused/expected.json new file mode 100644 index 000000000..2f54857fc --- /dev/null +++ b/tests/kernel-cases/sheet-metal/cov-path-flange-straight-on-from-the-sheet-refused/expected.json @@ -0,0 +1,8 @@ +{ + "sources": [], + "what": "sheet.path_flange along a line that runs straight on from the sheet (in its own plane): no bend to make", + "source": "invariants", + "method": "the first line's angle to the sheet makes the first bend; a line at 0 degrees to it makes none, so the path is refused with the line it is about", + "outcome": "refused", + "refusal": "line 1 of the path flange's path runs straight on from the sheet" +} diff --git a/tests/kernel-cases/sheet-metal/cov-path-flange-straight-on-from-the-sheet-refused/recipe.json b/tests/kernel-cases/sheet-metal/cov-path-flange-straight-on-from-the-sheet-refused/recipe.json new file mode 100644 index 000000000..5a73307a1 --- /dev/null +++ b/tests/kernel-cases/sheet-metal/cov-path-flange-straight-on-from-the-sheet-refused/recipe.json @@ -0,0 +1,104 @@ +{ + "commands": [ + { + "command": "sheet.manage_rules", + "params": { + "name": "Steel 2", + "thickness": "2 mm", + "active": true, + "bend_radius": "2 mm", + "k_factor": 0.5 + } + }, + { + "command": "sketch.create", + "params": { + "plane": "XY", + "name": "Base" + } + }, + { + "command": "sketch.rectangle.two_point", + "params": { + "p0": [ + 0, + 0 + ], + "p1": [ + 100, + 60 + ] + } + }, + { + "command": "sketch.finish", + "params": {} + }, + { + "command": "sheet.flange", + "params": { + "type": "base", + "sketch": "Base" + } + }, + { + "command": "sketch.create", + "params": { + "plane": { + "origin": [ + 50, + 0, + 0 + ], + "x_dir": [ + 0, + -1, + 0 + ], + "y_dir": [ + 0, + 0, + 1 + ] + }, + "name": "Path" + } + }, + { + "command": "sketch.line", + "params": { + "points": [ + [ + 0, + 2 + ], + [ + 20, + 2 + ] + ], + "ids": [ + "p1" + ] + } + }, + { + "command": "sketch.finish", + "params": {} + }, + { + "command": "sheet.path_flange", + "params": { + "edge": [ + 50, + 0, + 2 + ], + "sketch": "Path", + "curves": [ + "p1" + ] + } + } + ] +} diff --git a/tests/kernel-cases/sheet-metal/cov-path-flange-wall-and-an-outward-lip/expected.json b/tests/kernel-cases/sheet-metal/cov-path-flange-wall-and-an-outward-lip/expected.json new file mode 100644 index 000000000..6caf252b5 --- /dev/null +++ b/tests/kernel-cases/sheet-metal/cov-path-flange-wall-and-an-outward-lip/expected.json @@ -0,0 +1,39 @@ +{ + "sources": [], + "what": "sheet.path_flange along a two-line path across the y = 0 edge of a 100 x 60 x 2 base: 20 up, then 10 out away from the base (a Z section)", + "source": "analytic", + "method": "T = 2, R = 2, K = 0.5, setback R + T = 4 at each 90 degree bend. Line 1 (up, 20) is a wall 20 to its outer face (y = 0): straight 20 - 4 - 4 = 12; line 2 turns away from the sheet (a bend down), a lip 10 to its outer face from the virtual sharp at (y 2, z 20): straight 10 - 4 = 6, its far edge at y = 2 - 10 = -8, its top face at z 20. Base 100 x 56. V = 2*100*(56 + 12 + 6) + 2*(pi/2)((R+T)^2 - R^2)/2*100 = 16684.955592; the bends turn up, then down", + "body_count": 1, + "volume_mm3": 16684.955592153878, + "bbox": { + "min": [ + 0, + -8, + 0 + ], + "max": [ + 100, + 60, + 20 + ] + }, + "results": [ + { + "step": 10, + "json": { + "bends": [ + { + "angle_deg": 90.0, + "direction": "up", + "radius": 2.0 + }, + { + "angle_deg": 90.0, + "direction": "down", + "radius": 2.0 + } + ] + } + } + ] +} diff --git a/tests/kernel-cases/sheet-metal/cov-path-flange-wall-and-an-outward-lip/recipe.json b/tests/kernel-cases/sheet-metal/cov-path-flange-wall-and-an-outward-lip/recipe.json new file mode 100644 index 000000000..a81c006c6 --- /dev/null +++ b/tests/kernel-cases/sheet-metal/cov-path-flange-wall-and-an-outward-lip/recipe.json @@ -0,0 +1,114 @@ +{ + "commands": [ + { + "command": "sheet.manage_rules", + "params": { + "name": "Steel 2", + "thickness": "2 mm", + "active": true, + "bend_radius": "2 mm", + "k_factor": 0.5 + } + }, + { + "command": "sketch.create", + "params": { + "plane": "XY", + "name": "Base" + } + }, + { + "command": "sketch.rectangle.two_point", + "params": { + "p0": [ + 0, + 0 + ], + "p1": [ + 100, + 60 + ] + } + }, + { + "command": "sketch.finish", + "params": {} + }, + { + "command": "sheet.flange", + "params": { + "type": "base", + "sketch": "Base" + } + }, + { + "command": "sketch.create", + "params": { + "plane": { + "origin": [ + 50, + 0, + 0 + ], + "x_dir": [ + 0, + -1, + 0 + ], + "y_dir": [ + 0, + 0, + 1 + ] + }, + "name": "Path" + } + }, + { + "command": "sketch.line", + "params": { + "points": [ + [ + 0, + 2 + ], + [ + 0, + 22 + ], + [ + 10, + 22 + ] + ], + "ids": [ + "p1", + "p2" + ] + } + }, + { + "command": "sketch.finish", + "params": {} + }, + { + "command": "sheet.path_flange", + "params": { + "edge": [ + 50, + 0, + 2 + ], + "sketch": "Path", + "curves": [ + "p1", + "p2" + ] + } + }, + { + "command": "sheet.flat_pattern", + "params": {} + } + ] +}