SolidCraft: an open-source parametric 3D CAD application built in pure Rust. Desktop, web, and automation through MCP.
Wave 358/509: Kernel rig: hem cases, closed on a top and a bottom edge, open and flipped, on a flange, and one too short (and 1 more)
jyvikod64f60bf9384
diff --git a/tests/kernel-cases/sheet-metal/cov-hem-closed-on-a-bottom-edge/expected.json b/tests/kernel-cases/sheet-metal/cov-hem-closed-on-a-bottom-edge/expected.jsonnew file mode 100644index 0000000000..2592d6f46f--- /dev/null+++ b/tests/kernel-cases/sheet-metal/cov-hem-closed-on-a-bottom-edge/expected.json@@ -0,0 +1,21 @@+{+ "sources": [],+ "what": "sheet.hem on the bottom edge of a 100 x 60 x 2 base: the hem folds over the top face",+ "source": "analytic",+ "method": "as cov-hem-closed-on-a-top-edge, but a bottom-edge pick folds toward the top face: bend axis at (y 0, z T + g), the leg at z T + 2g .. 2T + 2g = 2.02 .. 4.02. V = 100*60*2 + (pi/2)(2.01^2 - 0.01^2)*100 + 5.99*100*2 = 13832.601716",+ "body_count": 1,+ "volume_mm3": 13832.601716025138,+ "faces": 10,+ "bbox": {+ "min": [+ 0,+ -2.01,+ 0+ ],+ "max": [+ 100,+ 60,+ 4.02+ ]+ }+}diff --git a/tests/kernel-cases/sheet-metal/cov-hem-closed-on-a-bottom-edge/recipe.json b/tests/kernel-cases/sheet-metal/cov-hem-closed-on-a-bottom-edge/recipe.jsonnew file mode 100644index 0000000000..46714048c2--- /dev/null+++ b/tests/kernel-cases/sheet-metal/cov-hem-closed-on-a-bottom-edge/recipe.json@@ -0,0 +1,58 @@+{+ "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": "sheet.hem",+ "params": {+ "edges": [+ [+ 50,+ 0,+ 0+ ]+ ],+ "length": 8+ }+ }+ ]+}diff --git a/tests/kernel-cases/sheet-metal/cov-hem-closed-on-a-top-edge/expected.json b/tests/kernel-cases/sheet-metal/cov-hem-closed-on-a-top-edge/expected.jsonnew file mode 100644index 0000000000..abb71c215d--- /dev/null+++ b/tests/kernel-cases/sheet-metal/cov-hem-closed-on-a-top-edge/expected.json@@ -0,0 +1,21 @@+{+ "sources": [],+ "what": "sheet.hem on the top edge of a 100 x 60 x 2 base, 8 long, the rule's hem gap (0.01 mm): a closed hem folded under the sheet",+ "source": "analytic",+ "method": "T = 2, hem gap g = 0.01 (the rule's default) is the inner radius of a 180 degree bend that starts at the edge (y = 0) and turns down (a top-edge pick folds toward the bottom face): bend axis at (y 0, z -g), outer radius g + T = 2.01, so the bend reaches y = -2.01; the leg, 8 - (g + T) = 5.99 long, lies under the base at z -2g - T .. -2g = -2.02 .. -0.02. V = 100*60*2 + (pi/2)((g+T)^2 - g^2)*100 + 5.99*100*2 = 13832.601716. Faces: the section's 8 sides (top, end, bottom, inner arc, leg inner, leg end, leg outer, outer arc) and its 2 end caps",+ "body_count": 1,+ "volume_mm3": 13832.601716025138,+ "faces": 10,+ "bbox": {+ "min": [+ 0,+ -2.01,+ -2.02+ ],+ "max": [+ 100,+ 60,+ 2+ ]+ }+}diff --git a/tests/kernel-cases/sheet-metal/cov-hem-closed-on-a-top-edge/recipe.json b/tests/kernel-cases/sheet-metal/cov-hem-closed-on-a-top-edge/recipe.jsonnew file mode 100644index 0000000000..c301bd1611--- /dev/null+++ b/tests/kernel-cases/sheet-metal/cov-hem-closed-on-a-top-edge/recipe.json@@ -0,0 +1,58 @@+{+ "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": "sheet.hem",+ "params": {+ "edges": [+ [+ 50,+ 0,+ 2+ ]+ ],+ "length": 8+ }+ }+ ]+}diff --git a/tests/kernel-cases/sheet-metal/cov-hem-on-a-flanges-far-edge/expected.json b/tests/kernel-cases/sheet-metal/cov-hem-on-a-flanges-far-edge/expected.jsonnew file mode 100644index 0000000000..9f76d7e571--- /dev/null+++ b/tests/kernel-cases/sheet-metal/cov-hem-on-a-flanges-far-edge/expected.json@@ -0,0 +1,20 @@+{+ "sources": [],+ "what": "sheet.hem on the far edge of a 20 mm edge flange (its outer face's edge), 8 long: the hem turns in over the flange's inner face",+ "source": "analytic",+ "method": "T = 2, R = 2, K = 0.5: the flange's 90 degree bend sets the base back R + T = 4 (100 x 56), its bend (pi/2)((R+T)^2 - R^2)/2*100 = 942.477796, its panel 20 - 4 = 16 high to z 20 (its outer face y = 0). The hem's 180 degree bend (inner radius 0.01) starts at z 20 and reaches z 20 + 2.01; its leg, 8 - 2.01 = 5.99, hangs inside the wall. V = 100*56*2 + 942.477796 + 16*100*2 + (pi/2)(2.01^2 - 0.01^2)*100 + 5.99*100*2 = 17175.079512",+ "body_count": 1,+ "volume_mm3": 17175.07951210208,+ "bbox": {+ "min": [+ 0,+ 0,+ 0+ ],+ "max": [+ 100,+ 60,+ 22.01+ ]+ }+}diff --git a/tests/kernel-cases/sheet-metal/cov-hem-on-a-flanges-far-edge/recipe.json b/tests/kernel-cases/sheet-metal/cov-hem-on-a-flanges-far-edge/recipe.jsonnew file mode 100644index 0000000000..dccaa19c55--- /dev/null+++ b/tests/kernel-cases/sheet-metal/cov-hem-on-a-flanges-far-edge/recipe.json@@ -0,0 +1,72 @@+{+ "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": "sheet.flange",+ "params": {+ "type": "edge",+ "edges": [+ [+ 50,+ 0,+ 2+ ]+ ],+ "height": 20+ }+ },+ {+ "command": "sheet.hem",+ "params": {+ "edges": [+ [+ 50,+ 0,+ 20+ ]+ ],+ "length": 8+ }+ }+ ]+}diff --git a/tests/kernel-cases/sheet-metal/cov-hem-open-with-a-gap-flipped/expected.json b/tests/kernel-cases/sheet-metal/cov-hem-open-with-a-gap-flipped/expected.jsonnew file mode 100644index 0000000000..b8f11e8b25--- /dev/null+++ b/tests/kernel-cases/sheet-metal/cov-hem-open-with-a-gap-flipped/expected.json@@ -0,0 +1,21 @@+{+ "sources": [],+ "what": "sheet.hem with its own gap of 1 mm (an open hem), flipped, on the top edge of a 100 x 60 x 2 base, 10 long",+ "source": "analytic",+ "method": "gap g = 1 is the inner radius; flip turns a top-edge hem over the top face: bend axis at (y 0, z T + g = 3), outer radius g + T = 3 (to y = -3), the leg 10 - 3 = 7 long at z T + 2g .. 2T + 2g = 4 .. 6. V = 100*60*2 + (pi/2)(3^2 - 1^2)*100 + 7*100*2 = 14656.637061",+ "body_count": 1,+ "volume_mm3": 14656.637061435917,+ "faces": 10,+ "bbox": {+ "min": [+ 0,+ -3,+ 0+ ],+ "max": [+ 100,+ 60,+ 6+ ]+ }+}diff --git a/tests/kernel-cases/sheet-metal/cov-hem-open-with-a-gap-flipped/recipe.json b/tests/kernel-cases/sheet-metal/cov-hem-open-with-a-gap-flipped/recipe.jsonnew file mode 100644index 0000000000..a213e05e86--- /dev/null+++ b/tests/kernel-cases/sheet-metal/cov-hem-open-with-a-gap-flipped/recipe.json@@ -0,0 +1,60 @@+{+ "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": "sheet.hem",+ "params": {+ "edges": [+ [+ 50,+ 0,+ 2+ ]+ ],+ "length": 10,+ "gap": 1,+ "flip": true+ }+ }+ ]+}diff --git a/tests/kernel-cases/sheet-metal/cov-hem-shorter-than-its-bend-refused/expected.json b/tests/kernel-cases/sheet-metal/cov-hem-shorter-than-its-bend-refused/expected.jsonnew file mode 100644index 0000000000..2971c4fd18--- /dev/null+++ b/tests/kernel-cases/sheet-metal/cov-hem-shorter-than-its-bend-refused/expected.json@@ -0,0 +1,8 @@+{+ "sources": [],+ "what": "sheet.hem 2 long on a 2 mm sheet: shorter than its own 180 degree bend (gap + T = 2.01)",+ "source": "invariants",+ "method": "the hem's length runs to its outer face, so it must be at least the bend's g + T = 2.01; a leg of 2 - 2.01 < 0 is no hem: a clean refusal",+ "outcome": "refused",+ "refusal": "the hem is shorter than its bend"+}diff --git a/tests/kernel-cases/sheet-metal/cov-hem-shorter-than-its-bend-refused/recipe.json b/tests/kernel-cases/sheet-metal/cov-hem-shorter-than-its-bend-refused/recipe.jsonnew file mode 100644index 0000000000..14022dd515--- /dev/null+++ b/tests/kernel-cases/sheet-metal/cov-hem-shorter-than-its-bend-refused/recipe.json@@ -0,0 +1,58 @@+{+ "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": "sheet.hem",+ "params": {+ "edges": [+ [+ 50,+ 0,+ 2+ ]+ ],+ "length": 2+ }+ }+ ]+}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.jsonnew file mode 100644index 0000000000..f0552828c3--- /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.jsonnew file mode 100644index 0000000000..2c9c257223--- /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.jsonnew file mode 100644index 0000000000..2f54857fcc--- /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.jsonnew file mode 100644index 0000000000..5a73307a1f--- /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.jsonnew file mode 100644index 0000000000..6caf252b5e--- /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.jsonnew file mode 100644index 0000000000..a81c006c60--- /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": {}+ }+ ]+}