diff --git a/tests/kernel-cases/sheet-metal/416-round-hole-and-slanted-slot-across-a-bend/expected.json b/tests/kernel-cases/sheet-metal/416-round-hole-and-slanted-slot-across-a-bend/expected.json new file mode 100644 index 000000000..a60265e6c --- /dev/null +++ b/tests/kernel-cases/sheet-metal/416-round-hole-and-slanted-slot-across-a-bend/expected.json @@ -0,0 +1,13 @@ +{ + "sources": [ + "tangency-labs/solidcraft#416", + "tangency-labs/solidcraft#425", + "tangency-labs/solidcraft#1797", + "tangency-labs/solidcraft#1799" + ], + "what": "a 160 x 100 plate with a 90 degree flange, unfolded, a 20 mm round hole and a 10 x 24 slot turned 30 degrees cut across the bend zone, refolded: the cut-out walls fold to curves on the bend's cylinder", + "source": "analytic", + "method": "T = 2, R = 1, K = 0.5. Flat area: base 160 x (100 - 3) + bend 160*BA with BA = (pi/2)(1 + 1) = pi + flange straight 160*(30 - 3) = 160*(97 + pi + 27). The cut-outs lie wholly inside it: circle pi*10^2, slot 10*24. With K = 0.5 the neutral axis is the mid-surface, so a through cut of flat area A removes A*t of bent material exactly. V = 2*(160*(124 + pi) - 100*pi - 240)", + "body_count": 1, + "volume_mm3": 39576.99111843078 +} \ No newline at end of file diff --git a/tests/kernel-cases/sheet-metal/416-round-hole-and-slanted-slot-across-a-bend/recipe.json b/tests/kernel-cases/sheet-metal/416-round-hole-and-slanted-slot-across-a-bend/recipe.json new file mode 100644 index 000000000..27839dcea --- /dev/null +++ b/tests/kernel-cases/sheet-metal/416-round-hole-and-slanted-slot-across-a-bend/recipe.json @@ -0,0 +1,126 @@ +{ + "commands": [ + { + "command": "sheet.manage_rules", + "params": { + "name": "AL2", + "thickness": "2 mm", + "active": true, + "bend_radius": "1 mm", + "k_factor": 0.5 + } + }, + { + "command": "sketch.create", + "params": { + "plane": "XY", + "name": "Plate" + } + }, + { + "command": "sketch.rectangle.two_point", + "params": { + "p0": [ + 0, + 0 + ], + "p1": [ + 160, + 100 + ] + } + }, + { + "command": "sketch.finish", + "params": {} + }, + { + "command": "sheet.flange", + "params": { + "type": "base", + "sketch": "Plate" + } + }, + { + "command": "sheet.flange", + "params": { + "type": "edge", + "edges": [ + [ + 80, + 100, + 2 + ] + ], + "height": 30, + "angle": 90 + } + }, + { + "command": "sheet.unfold", + "params": {} + }, + { + "command": "sketch.create", + "params": { + "plane": "XY", + "name": "Cuts" + } + }, + { + "command": "sketch.circle.center", + "params": { + "center": [ + 50, + 98.570796 + ], + "diameter": 20 + } + }, + { + "command": "sketch.line", + "params": { + "points": [ + [ + 116.669873, + 85.678491 + ], + [ + 125.330127, + 90.678491 + ], + [ + 113.330127, + 111.463101 + ], + [ + 104.669873, + 106.463101 + ] + ], + "closed": true + } + }, + { + "command": "sketch.finish", + "params": {} + }, + { + "command": "solid.extrude", + "params": { + "sketch": "Cuts", + "through_all": true, + "direction": "symmetric", + "operation": "cut" + } + }, + { + "command": "sheet.refold", + "params": {} + }, + { + "command": "inspect.measure", + "params": {} + } + ] +} \ No newline at end of file diff --git a/tests/kernel-cases/sheet-metal/529-a-hundred-slots-and-four-folds/expected.json b/tests/kernel-cases/sheet-metal/529-a-hundred-slots-and-four-folds/expected.json new file mode 100644 index 000000000..8b11aff20 --- /dev/null +++ b/tests/kernel-cases/sheet-metal/529-a-hundred-slots-and-four-folds/expected.json @@ -0,0 +1,12 @@ +{ + "sources": [ + "tangency-labs/solidcraft#529", + "tangency-labs/solidcraft#430", + "tangency-labs/solidcraft#964" + ], + "what": "a 200 x 300 panel with a hundred 4.4 x 20 slots and four 90 degree folds (one per side tab): the flat geometry ran out of its processing budget above 77 slots", + "source": "analytic", + "method": "T = 2.5, R = 2.5, K = 0.44. Blank: 200*300 + 2*200*20 + 2*300*20 = 80000 mm2; a slot of overall length 20 and width 4.4 has area 4.4*(20 - 4.4) + pi*2.2^2 = 83.8453; flat volume (80000 - 100*slot)*2.5; the four folds of widths 200, 200, 300 and 300 add theta*w*t^2*(1/2 - K) each, in all (pi/2)*1000*6.25*0.06", + "body_count": 1, + "volume_mm3": 179627.72151170447 +} \ No newline at end of file diff --git a/tests/kernel-cases/sheet-metal/529-a-hundred-slots-and-four-folds/recipe.json b/tests/kernel-cases/sheet-metal/529-a-hundred-slots-and-four-folds/recipe.json new file mode 100644 index 000000000..71ad1feb0 --- /dev/null +++ b/tests/kernel-cases/sheet-metal/529-a-hundred-slots-and-four-folds/recipe.json @@ -0,0 +1,1600 @@ +{ + "commands": [ + { + "command": "sheet.manage_rules", + "params": { + "name": "Steel (mm)", + "thickness": "2.5 mm", + "active": true, + "bend_radius": "2.5 mm", + "k_factor": 0.44 + } + }, + { + "command": "sketch.create", + "params": { + "plane": "XY", + "name": "Blank" + } + }, + { + "command": "sketch.line", + "params": { + "points": [ + [ + 0, + -20 + ], + [ + 200, + -20 + ], + [ + 200, + 0 + ], + [ + 220, + 0 + ], + [ + 220, + 300 + ], + [ + 200, + 300 + ], + [ + 200, + 320 + ], + [ + 0, + 320 + ], + [ + 0, + 300 + ], + [ + -20, + 300 + ], + [ + -20, + 0 + ], + [ + 0, + 0 + ] + ], + "closed": true + } + }, + { + "command": "sketch.finish", + "params": {} + }, + { + "command": "sheet.flange", + "params": { + "type": "base", + "sketch": "Blank" + } + }, + { + "command": "sketch.create", + "params": { + "plane": "XY", + "name": "Slots" + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 10, + 15 + ], + "p1": [ + 10, + 35 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 10, + 42 + ], + "p1": [ + 10, + 62 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 10, + 69 + ], + "p1": [ + 10, + 89 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 10, + 96 + ], + "p1": [ + 10, + 116 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 10, + 123 + ], + "p1": [ + 10, + 143 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 10, + 150 + ], + "p1": [ + 10, + 170 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 10, + 177 + ], + "p1": [ + 10, + 197 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 10, + 204 + ], + "p1": [ + 10, + 224 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 10, + 231 + ], + "p1": [ + 10, + 251 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 10, + 258 + ], + "p1": [ + 10, + 278 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 29, + 15 + ], + "p1": [ + 29, + 35 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 29, + 42 + ], + "p1": [ + 29, + 62 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 29, + 69 + ], + "p1": [ + 29, + 89 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 29, + 96 + ], + "p1": [ + 29, + 116 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 29, + 123 + ], + "p1": [ + 29, + 143 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 29, + 150 + ], + "p1": [ + 29, + 170 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 29, + 177 + ], + "p1": [ + 29, + 197 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 29, + 204 + ], + "p1": [ + 29, + 224 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 29, + 231 + ], + "p1": [ + 29, + 251 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 29, + 258 + ], + "p1": [ + 29, + 278 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 48, + 15 + ], + "p1": [ + 48, + 35 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 48, + 42 + ], + "p1": [ + 48, + 62 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 48, + 69 + ], + "p1": [ + 48, + 89 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 48, + 96 + ], + "p1": [ + 48, + 116 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 48, + 123 + ], + "p1": [ + 48, + 143 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 48, + 150 + ], + "p1": [ + 48, + 170 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 48, + 177 + ], + "p1": [ + 48, + 197 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 48, + 204 + ], + "p1": [ + 48, + 224 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 48, + 231 + ], + "p1": [ + 48, + 251 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 48, + 258 + ], + "p1": [ + 48, + 278 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 67, + 15 + ], + "p1": [ + 67, + 35 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 67, + 42 + ], + "p1": [ + 67, + 62 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 67, + 69 + ], + "p1": [ + 67, + 89 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 67, + 96 + ], + "p1": [ + 67, + 116 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 67, + 123 + ], + "p1": [ + 67, + 143 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 67, + 150 + ], + "p1": [ + 67, + 170 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 67, + 177 + ], + "p1": [ + 67, + 197 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 67, + 204 + ], + "p1": [ + 67, + 224 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 67, + 231 + ], + "p1": [ + 67, + 251 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 67, + 258 + ], + "p1": [ + 67, + 278 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 86, + 15 + ], + "p1": [ + 86, + 35 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 86, + 42 + ], + "p1": [ + 86, + 62 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 86, + 69 + ], + "p1": [ + 86, + 89 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 86, + 96 + ], + "p1": [ + 86, + 116 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 86, + 123 + ], + "p1": [ + 86, + 143 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 86, + 150 + ], + "p1": [ + 86, + 170 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 86, + 177 + ], + "p1": [ + 86, + 197 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 86, + 204 + ], + "p1": [ + 86, + 224 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 86, + 231 + ], + "p1": [ + 86, + 251 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 86, + 258 + ], + "p1": [ + 86, + 278 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 105, + 15 + ], + "p1": [ + 105, + 35 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 105, + 42 + ], + "p1": [ + 105, + 62 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 105, + 69 + ], + "p1": [ + 105, + 89 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 105, + 96 + ], + "p1": [ + 105, + 116 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 105, + 123 + ], + "p1": [ + 105, + 143 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 105, + 150 + ], + "p1": [ + 105, + 170 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 105, + 177 + ], + "p1": [ + 105, + 197 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 105, + 204 + ], + "p1": [ + 105, + 224 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 105, + 231 + ], + "p1": [ + 105, + 251 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 105, + 258 + ], + "p1": [ + 105, + 278 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 124, + 15 + ], + "p1": [ + 124, + 35 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 124, + 42 + ], + "p1": [ + 124, + 62 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 124, + 69 + ], + "p1": [ + 124, + 89 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 124, + 96 + ], + "p1": [ + 124, + 116 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 124, + 123 + ], + "p1": [ + 124, + 143 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 124, + 150 + ], + "p1": [ + 124, + 170 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 124, + 177 + ], + "p1": [ + 124, + 197 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 124, + 204 + ], + "p1": [ + 124, + 224 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 124, + 231 + ], + "p1": [ + 124, + 251 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 124, + 258 + ], + "p1": [ + 124, + 278 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 143, + 15 + ], + "p1": [ + 143, + 35 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 143, + 42 + ], + "p1": [ + 143, + 62 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 143, + 69 + ], + "p1": [ + 143, + 89 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 143, + 96 + ], + "p1": [ + 143, + 116 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 143, + 123 + ], + "p1": [ + 143, + 143 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 143, + 150 + ], + "p1": [ + 143, + 170 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 143, + 177 + ], + "p1": [ + 143, + 197 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 143, + 204 + ], + "p1": [ + 143, + 224 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 143, + 231 + ], + "p1": [ + 143, + 251 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 143, + 258 + ], + "p1": [ + 143, + 278 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 162, + 15 + ], + "p1": [ + 162, + 35 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 162, + 42 + ], + "p1": [ + 162, + 62 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 162, + 69 + ], + "p1": [ + 162, + 89 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 162, + 96 + ], + "p1": [ + 162, + 116 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 162, + 123 + ], + "p1": [ + 162, + 143 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 162, + 150 + ], + "p1": [ + 162, + 170 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 162, + 177 + ], + "p1": [ + 162, + 197 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 162, + 204 + ], + "p1": [ + 162, + 224 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 162, + 231 + ], + "p1": [ + 162, + 251 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 162, + 258 + ], + "p1": [ + 162, + 278 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 181, + 15 + ], + "p1": [ + 181, + 35 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 181, + 42 + ], + "p1": [ + 181, + 62 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 181, + 69 + ], + "p1": [ + 181, + 89 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 181, + 96 + ], + "p1": [ + 181, + 116 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 181, + 123 + ], + "p1": [ + 181, + 143 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 181, + 150 + ], + "p1": [ + 181, + 170 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 181, + 177 + ], + "p1": [ + 181, + 197 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 181, + 204 + ], + "p1": [ + 181, + 224 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 181, + 231 + ], + "p1": [ + 181, + 251 + ], + "width": 4.4 + } + }, + { + "command": "sketch.slot.overall", + "params": { + "p0": [ + 181, + 258 + ], + "p1": [ + 181, + 278 + ], + "width": 4.4 + } + }, + { + "command": "sketch.finish", + "params": {} + }, + { + "command": "solid.extrude", + "params": { + "sketch": "Slots", + "through_all": true, + "direction": "symmetric", + "operation": "cut" + } + }, + { + "command": "sheet.fold", + "params": { + "points": [ + [ + 0, + -10, + 2.5 + ], + [ + 200, + -10, + 2.5 + ] + ], + "fixed": [ + 100, + 150, + 2.5 + ] + } + }, + { + "command": "sheet.fold", + "params": { + "points": [ + [ + 0, + 310, + 2.5 + ], + [ + 200, + 310, + 2.5 + ] + ], + "fixed": [ + 100, + 150, + 2.5 + ] + } + }, + { + "command": "sheet.fold", + "params": { + "points": [ + [ + -10, + 0, + 2.5 + ], + [ + -10, + 300, + 2.5 + ] + ], + "fixed": [ + 100, + 150, + 2.5 + ] + } + }, + { + "command": "sheet.fold", + "params": { + "points": [ + [ + 210, + 0, + 2.5 + ], + [ + 210, + 300, + 2.5 + ] + ], + "fixed": [ + 100, + 150, + 2.5 + ] + } + }, + { + "command": "inspect.measure", + "params": {} + } + ] +} \ No newline at end of file diff --git a/tests/kernel-cases/sheet-metal/570-flange-refuses-thickness-it-would-ignore/expected.json b/tests/kernel-cases/sheet-metal/570-flange-refuses-thickness-it-would-ignore/expected.json new file mode 100644 index 000000000..420cb13a9 --- /dev/null +++ b/tests/kernel-cases/sheet-metal/570-flange-refuses-thickness-it-would-ignore/expected.json @@ -0,0 +1,11 @@ +{ + "sources": [ + "tangency-labs/solidcraft#570", + "tangency-labs/solidcraft#594", + "tangency-labs/solidcraft#572" + ], + "what": "sheet.flange given thickness, k_factor and bend_radius, which the rule alone defines, used to ignore them silently and build the 2.5 mm default", + "source": "invariants", + "method": "a base flange asked for a 0.8 mm sheet must either build 0.8 mm (V = 100*60*0.8 = 4800) or refuse; it must never succeed with another thickness. The engine's documented behaviour is the refusal (the rule is the only source of thickness, k-factor and radius), so the right answer here is a clean refusal", + "outcome": "refused" +} \ No newline at end of file diff --git a/tests/kernel-cases/sheet-metal/570-flange-refuses-thickness-it-would-ignore/recipe.json b/tests/kernel-cases/sheet-metal/570-flange-refuses-thickness-it-would-ignore/recipe.json new file mode 100644 index 000000000..effafa79b --- /dev/null +++ b/tests/kernel-cases/sheet-metal/570-flange-refuses-thickness-it-would-ignore/recipe.json @@ -0,0 +1,37 @@ +{ + "commands": [ + { + "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": { + "sketch": "Base", + "thickness": 0.8, + "k_factor": 0.3, + "bend_radius": 0.8 + } + } + ] +} \ No newline at end of file diff --git a/tests/kernel-cases/sheet-metal/601-return-lip-on-a-flanges-far-edge/expected.json b/tests/kernel-cases/sheet-metal/601-return-lip-on-a-flanges-far-edge/expected.json new file mode 100644 index 000000000..77956d484 --- /dev/null +++ b/tests/kernel-cases/sheet-metal/601-return-lip-on-a-flanges-far-edge/expected.json @@ -0,0 +1,11 @@ +{ + "sources": [ + "tangency-labs/solidcraft#593", + "tangency-labs/solidcraft#601" + ], + "what": "an edge flange stands on the far edge of another edge flange (a lip turned in over the base), both 90 degrees", + "source": "analytic", + "method": "T = 2, R = 2, K = 0.5, setback R + T = 4 at each 90 degree bend. Base 100 x 60 trimmed to 100 x 56; wall 20 high to its outer face: straight 20 - 4 (its own bend) - 4 (the return's setback) = 12; return 10 high: straight 10 - 4 = 6; every panel 100 wide. Two 90 degree bends, each (pi/2)((R+T)^2 - R^2)*100/2 = 942.478. V = 2*100*(56 + 12 + 6) + 2*942.478", + "body_count": 1, + "volume_mm3": 16684.955592153878 +} \ No newline at end of file diff --git a/tests/kernel-cases/sheet-metal/601-return-lip-on-a-flanges-far-edge/recipe.json b/tests/kernel-cases/sheet-metal/601-return-lip-on-a-flanges-far-edge/recipe.json new file mode 100644 index 000000000..54e885314 --- /dev/null +++ b/tests/kernel-cases/sheet-metal/601-return-lip-on-a-flanges-far-edge/recipe.json @@ -0,0 +1,77 @@ +{ + "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.flange", + "params": { + "type": "edge", + "edges": [ + [ + 50, + 2, + 20 + ] + ], + "height": 10 + } + }, + { + "command": "inspect.measure", + "params": {} + } + ] +} \ No newline at end of file diff --git a/tests/kernel-cases/sheet-metal/634-flange-beside-the-leg-of-an-L-folded/expected.json b/tests/kernel-cases/sheet-metal/634-flange-beside-the-leg-of-an-L-folded/expected.json new file mode 100644 index 000000000..137ed2b2c --- /dev/null +++ b/tests/kernel-cases/sheet-metal/634-flange-beside-the-leg-of-an-L-folded/expected.json @@ -0,0 +1,21 @@ +{ + "sources": [ + "tangency-labs/solidcraft#634" + ], + "what": "the same bar with its leg and a 15 mm inside flange on the bar's top edge, folded", + "source": "analytic", + "method": "the leg stays: bbox y 0..60; the flange stands on the top face of the bar from the base's underside z = 0 to its height 15 (x 0..160 covers the bar and the leg)", + "body_count": 1, + "bbox": { + "min": [ + 0, + 0, + 0 + ], + "max": [ + 160, + 60, + 15 + ] + } +} \ No newline at end of file diff --git a/tests/kernel-cases/sheet-metal/634-flange-beside-the-leg-of-an-L-folded/recipe.json b/tests/kernel-cases/sheet-metal/634-flange-beside-the-leg-of-an-L-folded/recipe.json new file mode 100644 index 000000000..2f49a0e95 --- /dev/null +++ b/tests/kernel-cases/sheet-metal/634-flange-beside-the-leg-of-an-L-folded/recipe.json @@ -0,0 +1,83 @@ +{ + "commands": [ + { + "command": "sheet.manage_rules", + "params": { + "name": "Steel 2", + "thickness": "2 mm", + "active": true, + "bend_radius": "1 mm", + "k_factor": 0.5 + } + }, + { + "command": "sketch.create", + "params": { + "plane": "XY", + "name": "Blank" + } + }, + { + "command": "sketch.line", + "params": { + "points": [ + [ + 0, + 0 + ], + [ + 160, + 0 + ], + [ + 160, + 30 + ], + [ + 20, + 30 + ], + [ + 20, + 60 + ], + [ + 0, + 60 + ] + ], + "closed": true + } + }, + { + "command": "sketch.finish", + "params": {} + }, + { + "command": "sheet.flange", + "params": { + "type": "base", + "sketch": "Blank" + } + }, + { + "command": "sheet.flange", + "params": { + "edges": [ + [ + 90, + 30, + 2 + ] + ], + "height": 15, + "angle": 90, + "position": "inside" + } + }, + { + "command": "inspect.measure", + "params": {} + } + ] +} \ No newline at end of file diff --git a/tests/kernel-cases/sheet-metal/634-unfold-a-flange-beside-the-leg-of-an-L/expected.json b/tests/kernel-cases/sheet-metal/634-unfold-a-flange-beside-the-leg-of-an-L/expected.json new file mode 100644 index 000000000..5fdacabb4 --- /dev/null +++ b/tests/kernel-cases/sheet-metal/634-unfold-a-flange-beside-the-leg-of-an-L/expected.json @@ -0,0 +1,21 @@ +{ + "sources": [ + "tangency-labs/solidcraft#634" + ], + "what": "a 160 x 30 bar with a 20 x 30 leg past its top edge at the left end, and a 90 degree 15 mm inside flange on the bar's top edge (x 20..160), unfolded: the flange's trim cut the leg away", + "source": "analytic", + "method": "T = 2, R = 1, K = 0.5, BD(90) = 2*3 - pi = 2.8584. The setback strip is taken off the flange's own edge only, so the leg (y up to 60) stays and the flat reaches 15 - BD = 12.1416 past the bar's top edge, which is below the leg's top: bbox x 0..160, y 0..60, z 0..2", + "body_count": 1, + "bbox": { + "min": [ + 0, + 0, + 0 + ], + "max": [ + 160, + 60, + 2 + ] + } +} \ No newline at end of file diff --git a/tests/kernel-cases/sheet-metal/634-unfold-a-flange-beside-the-leg-of-an-L/recipe.json b/tests/kernel-cases/sheet-metal/634-unfold-a-flange-beside-the-leg-of-an-L/recipe.json new file mode 100644 index 000000000..73fe1378f --- /dev/null +++ b/tests/kernel-cases/sheet-metal/634-unfold-a-flange-beside-the-leg-of-an-L/recipe.json @@ -0,0 +1,87 @@ +{ + "commands": [ + { + "command": "sheet.manage_rules", + "params": { + "name": "Steel 2", + "thickness": "2 mm", + "active": true, + "bend_radius": "1 mm", + "k_factor": 0.5 + } + }, + { + "command": "sketch.create", + "params": { + "plane": "XY", + "name": "Blank" + } + }, + { + "command": "sketch.line", + "params": { + "points": [ + [ + 0, + 0 + ], + [ + 160, + 0 + ], + [ + 160, + 30 + ], + [ + 20, + 30 + ], + [ + 20, + 60 + ], + [ + 0, + 60 + ] + ], + "closed": true + } + }, + { + "command": "sketch.finish", + "params": {} + }, + { + "command": "sheet.flange", + "params": { + "type": "base", + "sketch": "Blank" + } + }, + { + "command": "sheet.flange", + "params": { + "edges": [ + [ + 90, + 30, + 2 + ] + ], + "height": 15, + "angle": 90, + "position": "inside" + } + }, + { + "command": "sheet.unfold", + "params": {} + }, + { + "command": "inspect.measure", + "params": {} + } + ] +} \ No newline at end of file diff --git a/tests/kernel-cases/sheet-metal/659-ellipse-cutout-across-a-bend/expected.json b/tests/kernel-cases/sheet-metal/659-ellipse-cutout-across-a-bend/expected.json new file mode 100644 index 000000000..deb5d8af6 --- /dev/null +++ b/tests/kernel-cases/sheet-metal/659-ellipse-cutout-across-a-bend/expected.json @@ -0,0 +1,11 @@ +{ + "sources": [ + "tangency-labs/solidcraft#659", + "tangency-labs/solidcraft#692" + ], + "what": "a 160 x 100 plate with a 90 degree flange, unfolded, a 24 x 12 ellipse cut across the bend zone and refolded: the cut's wall folds to a curve on the bend's cylinder", + "source": "analytic", + "method": "T = 2, R = 1, K = 0.5: flat area 160*(97 + pi + 27) as in the round-hole case; the ellipse (semi-axes 12 and 6, area 72*pi) lies inside the flat. With K = 0.5 a through cut of flat area A removes A*t of the folded part: V = 2*(160*(124 + pi) - 72*pi)", + "body_count": 1, + "volume_mm3": 40232.92030703181 +} \ No newline at end of file diff --git a/tests/kernel-cases/sheet-metal/659-ellipse-cutout-across-a-bend/recipe.json b/tests/kernel-cases/sheet-metal/659-ellipse-cutout-across-a-bend/recipe.json new file mode 100644 index 000000000..5d6c17eb2 --- /dev/null +++ b/tests/kernel-cases/sheet-metal/659-ellipse-cutout-across-a-bend/recipe.json @@ -0,0 +1,106 @@ +{ + "commands": [ + { + "command": "sheet.manage_rules", + "params": { + "name": "AL2", + "thickness": "2 mm", + "active": true, + "bend_radius": "1 mm", + "k_factor": 0.5 + } + }, + { + "command": "sketch.create", + "params": { + "plane": "XY", + "name": "Plate" + } + }, + { + "command": "sketch.rectangle.two_point", + "params": { + "p0": [ + 0, + 0 + ], + "p1": [ + 160, + 100 + ] + } + }, + { + "command": "sketch.finish", + "params": {} + }, + { + "command": "sheet.flange", + "params": { + "type": "base", + "sketch": "Plate" + } + }, + { + "command": "sheet.flange", + "params": { + "type": "edge", + "edges": [ + [ + 80, + 100, + 2 + ] + ], + "height": 30, + "angle": 90 + } + }, + { + "command": "sheet.unfold", + "params": {} + }, + { + "command": "sketch.create", + "params": { + "plane": "XY", + "name": "Ellipse" + } + }, + { + "command": "sketch.ellipse", + "params": { + "center": [ + 80, + 98.570796 + ], + "major": [ + 92, + 98.570796 + ], + "minor_radius": 6 + } + }, + { + "command": "sketch.finish", + "params": {} + }, + { + "command": "solid.extrude", + "params": { + "sketch": "Ellipse", + "through_all": true, + "direction": "symmetric", + "operation": "cut" + } + }, + { + "command": "sheet.refold", + "params": {} + }, + { + "command": "inspect.measure", + "params": {} + } + ] +} \ No newline at end of file diff --git a/tests/kernel-cases/sheet-metal/659-ellipse-cutout-in-a-flat-sheet/expected.json b/tests/kernel-cases/sheet-metal/659-ellipse-cutout-in-a-flat-sheet/expected.json new file mode 100644 index 000000000..eb56ed12e --- /dev/null +++ b/tests/kernel-cases/sheet-metal/659-ellipse-cutout-in-a-flat-sheet/expected.json @@ -0,0 +1,11 @@ +{ + "sources": [ + "tangency-labs/solidcraft#659", + "tangency-labs/solidcraft#692" + ], + "what": "a 20 x 12 ellipse cut through a 100 x 60 x 2.5 sheet: it became 0.001 mm chords, one face each", + "source": "analytic", + "method": "semi-axes 10 and 6: area pi*10*6 = 60*pi; V = 100*60*2.5 - 60*pi*2.5 = 15000 - 150*pi", + "body_count": 1, + "volume_mm3": 14528.76110196153 +} \ No newline at end of file diff --git a/tests/kernel-cases/sheet-metal/659-ellipse-cutout-in-a-flat-sheet/recipe.json b/tests/kernel-cases/sheet-metal/659-ellipse-cutout-in-a-flat-sheet/recipe.json new file mode 100644 index 000000000..584976533 --- /dev/null +++ b/tests/kernel-cases/sheet-metal/659-ellipse-cutout-in-a-flat-sheet/recipe.json @@ -0,0 +1,83 @@ +{ + "commands": [ + { + "command": "sheet.manage_rules", + "params": { + "name": "Steel (mm)", + "thickness": "2.5 mm", + "active": true, + "bend_radius": "2.5 mm", + "k_factor": 0.44 + } + }, + { + "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": "XY", + "name": "Ellipse" + } + }, + { + "command": "sketch.ellipse", + "params": { + "center": [ + 50, + 30 + ], + "major": [ + 60, + 30 + ], + "minor_radius": 6 + } + }, + { + "command": "sketch.finish", + "params": {} + }, + { + "command": "solid.extrude", + "params": { + "sketch": "Ellipse", + "through_all": true, + "direction": "symmetric", + "operation": "cut" + } + }, + { + "command": "inspect.measure", + "params": {} + } + ] +} \ No newline at end of file diff --git a/tests/kernel-cases/sheet-metal/702-flange-along-what-a-cutout-leaves/expected.json b/tests/kernel-cases/sheet-metal/702-flange-along-what-a-cutout-leaves/expected.json new file mode 100644 index 000000000..2ea3fd3b2 --- /dev/null +++ b/tests/kernel-cases/sheet-metal/702-flange-along-what-a-cutout-leaves/expected.json @@ -0,0 +1,10 @@ +{ + "sources": [ + "tangency-labs/solidcraft#702" + ], + "what": "a 200 x 100 plate whose bottom-left 100 x 60 is cut away, and a 90 degree 40 mm inside flange picked on what is left of the bottom edge (x 100..200)", + "source": "analytic", + "method": "T = 2, R = 1, K = 0.5. The flange runs only along the 100 mm the cut leaves of the edge. Plate 200*100 - 100*60 = 14000, less the 3 mm setback (R + T) strip along that stretch 100*3 = 300: 13700. Flange: bend flat BA = (pi/2)(R + K t) = pi, straight 40 - (R+T) = 37, both 100 wide: 100*(pi + 37). With K = 0.5 the neutral axis is the mid-surface, so the folded volume is the flat area times t: V = 2*(13700 + 100*(pi + 37))", + "body_count": 1, + "volume_mm3": 35428.31853071796 +} \ No newline at end of file diff --git a/tests/kernel-cases/sheet-metal/702-flange-along-what-a-cutout-leaves/recipe.json b/tests/kernel-cases/sheet-metal/702-flange-along-what-a-cutout-leaves/recipe.json new file mode 100644 index 000000000..92fac709d --- /dev/null +++ b/tests/kernel-cases/sheet-metal/702-flange-along-what-a-cutout-leaves/recipe.json @@ -0,0 +1,97 @@ +{ + "commands": [ + { + "command": "sheet.manage_rules", + "params": { + "name": "Steel 2", + "thickness": "2 mm", + "active": true, + "bend_radius": "1 mm", + "k_factor": 0.5 + } + }, + { + "command": "sketch.create", + "params": { + "plane": "XY", + "name": "Plate" + } + }, + { + "command": "sketch.rectangle.two_point", + "params": { + "p0": [ + 0, + 0 + ], + "p1": [ + 200, + 100 + ] + } + }, + { + "command": "sketch.finish", + "params": {} + }, + { + "command": "sheet.flange", + "params": { + "type": "base", + "sketch": "Plate" + } + }, + { + "command": "sketch.create", + "params": { + "plane": "XY", + "name": "Cut" + } + }, + { + "command": "sketch.rectangle.two_point", + "params": { + "p0": [ + -10, + -10 + ], + "p1": [ + 100, + 60 + ] + } + }, + { + "command": "sketch.finish", + "params": {} + }, + { + "command": "solid.extrude", + "params": { + "sketch": "Cut", + "through_all": true, + "direction": "symmetric", + "operation": "cut" + } + }, + { + "command": "sheet.flange", + "params": { + "edges": [ + [ + 150, + 0, + 2 + ] + ], + "height": 40, + "angle": 90, + "position": "inside" + } + }, + { + "command": "inspect.measure", + "params": {} + } + ] +} \ No newline at end of file diff --git a/tests/kernel-cases/sheet-metal/978-edge-flange-beside-a-ledge-as-tall-as-its-setback/expected.json b/tests/kernel-cases/sheet-metal/978-edge-flange-beside-a-ledge-as-tall-as-its-setback/expected.json new file mode 100644 index 000000000..b6d90092f --- /dev/null +++ b/tests/kernel-cases/sheet-metal/978-edge-flange-beside-a-ledge-as-tall-as-its-setback/expected.json @@ -0,0 +1,9 @@ +{ + "sources": [ + "tangency-labs/solidcraft#978" + ], + "what": "a 90 degree inside flange of radius 1 on an edge that has a ledge beside it exactly as tall as the flange's setback (3 mm): sew failed with a degenerate edge", + "source": "invariants", + "method": "T = 2, flange R = 1: setback R + T = 3 and the ledge (x 97..100, y 0..3) is exactly that tall, so the trim line runs along the ledge's top; the right answer is one valid closed body (the ledge goes with the setback strip), with no graded volume because the flange's extent along the ledge has no single reading", + "body_count": 1 +} \ No newline at end of file diff --git a/tests/kernel-cases/sheet-metal/978-edge-flange-beside-a-ledge-as-tall-as-its-setback/recipe.json b/tests/kernel-cases/sheet-metal/978-edge-flange-beside-a-ledge-as-tall-as-its-setback/recipe.json new file mode 100644 index 000000000..b49614654 --- /dev/null +++ b/tests/kernel-cases/sheet-metal/978-edge-flange-beside-a-ledge-as-tall-as-its-setback/recipe.json @@ -0,0 +1,84 @@ +{ + "commands": [ + { + "command": "sheet.manage_rules", + "params": { + "name": "Rule", + "thickness": "2 mm", + "active": true, + "bend_radius": "2 mm" + } + }, + { + "command": "sketch.create", + "params": { + "plane": "XY", + "name": "Outline" + } + }, + { + "command": "sketch.line", + "params": { + "points": [ + [ + 0, + 0 + ], + [ + 100, + 0 + ], + [ + 100, + 3 + ], + [ + 97, + 3 + ], + [ + 97, + 60 + ], + [ + 0, + 60 + ] + ], + "closed": true + } + }, + { + "command": "sketch.finish", + "params": {} + }, + { + "command": "sheet.flange", + "params": { + "type": "base", + "sketch": "Outline" + } + }, + { + "command": "sheet.flange", + "params": { + "type": "edge", + "edges": [ + [ + 50, + 0, + 2 + ] + ], + "height": 20, + "radius": 1, + "position": "inside", + "body": "Body1" + } + }, + { + "command": "inspect.measure", + "params": {} + } + ] +} \ No newline at end of file