Skip to content

SolidCraft: an open-source parametric 3D CAD application built in pure Rust. Desktop, web, and automation through MCP.

Wave 45/509: kernel-cases: sheet-metal convert and unfolded tray cases from #479, #488, #723, #725, #839, #1092, #1285, #1481

Brennen Herbruck771084982306
diff --git a/tests/kernel-cases/sheet-metal/1092-convert-an-L-with-a-modelled-bend-to-the-rules-radius/expected.json b/tests/kernel-cases/sheet-metal/1092-convert-an-L-with-a-modelled-bend-to-the-rules-radius/expected.json
new file mode 100644
index 0000000000..a3982963c3
--- /dev/null
+++ b/tests/kernel-cases/sheet-metal/1092-convert-an-L-with-a-modelled-bend-to-the-rules-radius/expected.json
@@ -0,0 +1,11 @@
+{
+ "sources": [
+ "tangency-labs/solidcraft#1092",
+ "tangency-labs/solidcraft#1314"
+ ],
+ "what": "an L section modelled with a bend of R2 inside and R4 outside, converted at that bend under a rule of R3: the bend becomes one bend of the rule's radius at the legs' virtual sharp",
+ "source": "analytic",
+ "method": "T = 2, R = 3, K = 0.5: BD(90) = 2*(R+T) - (pi/2)(R + K t) = 10 - 2*pi = 3.7168. The outer legs are 60 and 40 long (to the outer virtual sharp at the origin), so the flat length is 100 - BD = 96.2832, 50 wide, 2 thick; with K = 0.5 the folded volume is the flat area times t: V = 50*2*(100 - BD)",
+ "body_count": 1,
+ "volume_mm3": 9628.31853071796
+}
\ No newline at end of file
diff --git a/tests/kernel-cases/sheet-metal/1092-convert-an-L-with-a-modelled-bend-to-the-rules-radius/recipe.json b/tests/kernel-cases/sheet-metal/1092-convert-an-L-with-a-modelled-bend-to-the-rules-radius/recipe.json
new file mode 100644
index 0000000000..1fda196e8e
--- /dev/null
+++ b/tests/kernel-cases/sheet-metal/1092-convert-an-L-with-a-modelled-bend-to-the-rules-radius/recipe.json
@@ -0,0 +1,147 @@
+{
+ "commands": [
+ {
+ "command": "sheet.manage_rules",
+ "params": {
+ "name": "R3",
+ "thickness": "2 mm",
+ "active": true,
+ "bend_radius": "3 mm",
+ "k_factor": 0.5
+ }
+ },
+ {
+ "command": "sketch.create",
+ "params": {
+ "plane": "XY",
+ "name": "L"
+ }
+ },
+ {
+ "command": "sketch.line",
+ "params": {
+ "points": [
+ [
+ 0,
+ 40
+ ],
+ [
+ 0,
+ 4
+ ]
+ ]
+ }
+ },
+ {
+ "command": "sketch.arc.center_point",
+ "params": {
+ "center": [
+ 4,
+ 4
+ ],
+ "start": [
+ 0,
+ 4
+ ],
+ "end": [
+ 4,
+ 0
+ ]
+ }
+ },
+ {
+ "command": "sketch.line",
+ "params": {
+ "points": [
+ [
+ 4,
+ 0
+ ],
+ [
+ 60,
+ 0
+ ],
+ [
+ 60,
+ 2
+ ],
+ [
+ 4,
+ 2
+ ]
+ ]
+ }
+ },
+ {
+ "command": "sketch.arc.center_point",
+ "params": {
+ "center": [
+ 4,
+ 4
+ ],
+ "start": [
+ 4,
+ 2
+ ],
+ "end": [
+ 2,
+ 4
+ ]
+ }
+ },
+ {
+ "command": "sketch.line",
+ "params": {
+ "points": [
+ [
+ 2,
+ 4
+ ],
+ [
+ 2,
+ 40
+ ],
+ [
+ 0,
+ 40
+ ]
+ ]
+ }
+ },
+ {
+ "command": "sketch.finish",
+ "params": {}
+ },
+ {
+ "command": "solid.extrude",
+ "params": {
+ "sketch": "L",
+ "distance": 50,
+ "body_name": "Angle"
+ }
+ },
+ {
+ "command": "sheet.convert",
+ "params": {
+ "body": "Angle",
+ "face": [
+ 30,
+ 2,
+ 25
+ ],
+ "rule": "R3",
+ "bends": [
+ [
+ 1.1716,
+ 1.1716,
+ 25
+ ]
+ ]
+ }
+ },
+ {
+ "command": "inspect.measure",
+ "params": {}
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/kernel-cases/sheet-metal/1285-convert-a-bracket-whose-wall-covers-part-of-an-edge/expected.json b/tests/kernel-cases/sheet-metal/1285-convert-a-bracket-whose-wall-covers-part-of-an-edge/expected.json
new file mode 100644
index 0000000000..ec97e45858
--- /dev/null
+++ b/tests/kernel-cases/sheet-metal/1285-convert-a-bracket-whose-wall-covers-part-of-an-edge/expected.json
@@ -0,0 +1,22 @@
+{
+ "sources": [
+ "tangency-labs/solidcraft#1285",
+ "tangency-labs/solidcraft#1340"
+ ],
+ "what": "an 80 x 50 x 2 plate with a 40 wide, 30 high wall on part of its front edge, converted at the wall's outside bend edge: refused because the bend's setback used up an edge of a face",
+ "source": "analytic",
+ "method": "T = 2, R = 2, K = 0.44, BD(90) = 3.4761. One 90 degree bend 40 long; the plate is 50 deep and the wall 30 high to the outer sharp, so the flat is 50 + 30 - BD = 76.524 deep: unfolded it reaches 30 - BD = 26.5239 in front of the plate's edge y = 100 and spans x 0..80, z 0..2",
+ "body_count": 1,
+ "bbox": {
+ "min": [
+ 0,
+ 73.4761065788307,
+ 0
+ ],
+ "max": [
+ 80,
+ 150,
+ 2
+ ]
+ }
+}
\ No newline at end of file
diff --git a/tests/kernel-cases/sheet-metal/1285-convert-a-bracket-whose-wall-covers-part-of-an-edge/recipe.json b/tests/kernel-cases/sheet-metal/1285-convert-a-bracket-whose-wall-covers-part-of-an-edge/recipe.json
new file mode 100644
index 0000000000..277db6a48c
--- /dev/null
+++ b/tests/kernel-cases/sheet-metal/1285-convert-a-bracket-whose-wall-covers-part-of-an-edge/recipe.json
@@ -0,0 +1,72 @@
+{
+ "commands": [
+ {
+ "command": "sheet.manage_rules",
+ "params": {
+ "name": "Test",
+ "thickness": "2 mm",
+ "active": true,
+ "bend_radius": "2 mm",
+ "k_factor": 0.44,
+ "gap": "0.5 mm"
+ }
+ },
+ {
+ "command": "solid.box",
+ "params": {
+ "length": 80,
+ "width": 50,
+ "height": 2,
+ "corner": [
+ 0,
+ 100,
+ 0
+ ],
+ "body_name": "Bracket"
+ }
+ },
+ {
+ "command": "solid.box",
+ "params": {
+ "length": 40,
+ "width": 2,
+ "height": 30,
+ "corner": [
+ 20,
+ 100,
+ 0
+ ],
+ "operation": "join",
+ "targets": [
+ "Bracket"
+ ]
+ }
+ },
+ {
+ "command": "sheet.convert",
+ "params": {
+ "body": "Bracket",
+ "face": [
+ 40,
+ 125,
+ 0
+ ],
+ "bends": [
+ [
+ 40,
+ 100,
+ 0
+ ]
+ ]
+ }
+ },
+ {
+ "command": "sheet.unfold",
+ "params": {}
+ },
+ {
+ "command": "inspect.measure",
+ "params": {}
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/kernel-cases/sheet-metal/1481-unfold-a-tray-whose-features-choose-their-own-corner-relief/expected.json b/tests/kernel-cases/sheet-metal/1481-unfold-a-tray-whose-features-choose-their-own-corner-relief/expected.json
new file mode 100644
index 0000000000..444249853b
--- /dev/null
+++ b/tests/kernel-cases/sheet-metal/1481-unfold-a-tray-whose-features-choose-their-own-corner-relief/expected.json
@@ -0,0 +1,22 @@
+{
+ "sources": [
+ "tangency-labs/solidcraft#1232",
+ "tangency-labs/solidcraft#1481"
+ ],
+ "what": "a 120 x 90 base with two edge flange features (bottom and left edges with a round relief, top and right edges with a square one) over a rule whose relief is a notch, unfolded",
+ "source": "analytic",
+ "method": "T = 2, R = 1, K = 0.5, BD(90) = 2*3 - pi = 2.8584; each wall's flat reaches 20 - BD = 17.1416 past the base's edge, whatever corner relief a feature chooses (the relief cuts only the corner): bbox x -17.1416..137.1416, y -17.1416..107.1416, z 0..2",
+ "body_count": 1,
+ "bbox": {
+ "min": [
+ -17.141592653589793,
+ -17.141592653589793,
+ 0
+ ],
+ "max": [
+ 137.14159265358978,
+ 107.1415926535898,
+ 2
+ ]
+ }
+}
\ No newline at end of file
diff --git a/tests/kernel-cases/sheet-metal/1481-unfold-a-tray-whose-features-choose-their-own-corner-relief/recipe.json b/tests/kernel-cases/sheet-metal/1481-unfold-a-tray-whose-features-choose-their-own-corner-relief/recipe.json
new file mode 100644
index 0000000000..eece732516
--- /dev/null
+++ b/tests/kernel-cases/sheet-metal/1481-unfold-a-tray-whose-features-choose-their-own-corner-relief/recipe.json
@@ -0,0 +1,99 @@
+{
+ "commands": [
+ {
+ "command": "sheet.manage_rules",
+ "params": {
+ "name": "Sheet 2 mm",
+ "thickness": "2 mm",
+ "active": true,
+ "bend_radius": "1 mm",
+ "k_factor": 0.5,
+ "gap": "0.5 mm",
+ "corner_relief_shape": "notch"
+ }
+ },
+ {
+ "command": "sketch.create",
+ "params": {
+ "plane": "XY",
+ "name": "Base"
+ }
+ },
+ {
+ "command": "sketch.rectangle.two_point",
+ "params": {
+ "p0": [
+ 0,
+ 0
+ ],
+ "p1": [
+ 120,
+ 90
+ ]
+ }
+ },
+ {
+ "command": "sketch.finish",
+ "params": {}
+ },
+ {
+ "command": "sheet.flange",
+ "params": {
+ "type": "base",
+ "sketch": "Base"
+ }
+ },
+ {
+ "command": "sheet.flange",
+ "params": {
+ "type": "edge",
+ "height": 20,
+ "angle": "90 deg",
+ "edges": [
+ [
+ 60,
+ 0,
+ 2
+ ],
+ [
+ 0,
+ 45,
+ 2
+ ]
+ ],
+ "corner_relief_shape": "round",
+ "corner_relief": "8 mm"
+ }
+ },
+ {
+ "command": "sheet.flange",
+ "params": {
+ "type": "edge",
+ "height": 20,
+ "angle": "90 deg",
+ "edges": [
+ [
+ 60,
+ 90,
+ 2
+ ],
+ [
+ 120,
+ 45,
+ 2
+ ]
+ ],
+ "corner_relief_shape": "rectangular",
+ "corner_relief": "8 mm"
+ }
+ },
+ {
+ "command": "sheet.unfold",
+ "params": {}
+ },
+ {
+ "command": "inspect.measure",
+ "params": {}
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/kernel-cases/sheet-metal/479-unfold-a-tray-with-round-relieved-corners/expected.json b/tests/kernel-cases/sheet-metal/479-unfold-a-tray-with-round-relieved-corners/expected.json
new file mode 100644
index 0000000000..b4941f3a42
--- /dev/null
+++ b/tests/kernel-cases/sheet-metal/479-unfold-a-tray-with-round-relieved-corners/expected.json
@@ -0,0 +1,21 @@
+{
+ "sources": [
+ "tangency-labs/solidcraft#479"
+ ],
+ "what": "a 120 x 90 tray with four 20 mm 90 degree flanges and corner relief shape round, unfolded",
+ "source": "analytic",
+ "method": "a flange of angle th, outer leg length Hf (height, from the virtual sharp along the flange) bends with allowance BA = th(R+Kt) and bend deduction BD = 2(R+t)tan(th/2) - BA; unfolded it lies in the base's plane and reaches Hf - BD beyond the base's edge. T = 2, R = 1, K = 0.5. BD(90) = 2*3 - pi = 2.8584, so the flat reaches 20 - BD = 17.1416 past each edge of the base: bbox x from -17.1416 to 137.1416, y from -17.1416 to 107.1416, z 0..2 (the base keeps its place); the corner relief changes the outline only inside the corners",
+ "body_count": 1,
+ "bbox": {
+ "min": [
+ -17.141592653589793,
+ -17.141592653589793,
+ 0
+ ],
+ "max": [
+ 137.14159265358978,
+ 107.1415926535898,
+ 2
+ ]
+ }
+}
\ No newline at end of file
diff --git a/tests/kernel-cases/sheet-metal/479-unfold-a-tray-with-round-relieved-corners/recipe.json b/tests/kernel-cases/sheet-metal/479-unfold-a-tray-with-round-relieved-corners/recipe.json
new file mode 100644
index 0000000000..a5512ce731
--- /dev/null
+++ b/tests/kernel-cases/sheet-metal/479-unfold-a-tray-with-round-relieved-corners/recipe.json
@@ -0,0 +1,86 @@
+{
+ "commands": [
+ {
+ "command": "sheet.manage_rules",
+ "params": {
+ "name": "Sheet 2 mm",
+ "thickness": "2 mm",
+ "active": true,
+ "bend_radius": "1 mm",
+ "k_factor": 0.5,
+ "gap": "0.5 mm",
+ "corner_relief_shape": "round",
+ "corner_relief": "8 mm"
+ }
+ },
+ {
+ "command": "sketch.create",
+ "params": {
+ "plane": "XY",
+ "name": "Base"
+ }
+ },
+ {
+ "command": "sketch.rectangle.two_point",
+ "params": {
+ "p0": [
+ 0,
+ 0
+ ],
+ "p1": [
+ 120,
+ 90
+ ]
+ }
+ },
+ {
+ "command": "sketch.finish",
+ "params": {}
+ },
+ {
+ "command": "sheet.flange",
+ "params": {
+ "type": "base",
+ "sketch": "Base"
+ }
+ },
+ {
+ "command": "sheet.flange",
+ "params": {
+ "type": "edge",
+ "height": 20,
+ "angle": 90,
+ "edges": [
+ [
+ 60.0,
+ 0,
+ 2
+ ],
+ [
+ 120,
+ 45.0,
+ 2
+ ],
+ [
+ 60.0,
+ 90,
+ 2
+ ],
+ [
+ 0,
+ 45.0,
+ 2
+ ]
+ ]
+ }
+ },
+ {
+ "command": "sheet.unfold",
+ "params": {}
+ },
+ {
+ "command": "inspect.measure",
+ "params": {}
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/kernel-cases/sheet-metal/488-unfold-a-tray-with-square-relieved-corners/expected.json b/tests/kernel-cases/sheet-metal/488-unfold-a-tray-with-square-relieved-corners/expected.json
new file mode 100644
index 0000000000..7d21f6f912
--- /dev/null
+++ b/tests/kernel-cases/sheet-metal/488-unfold-a-tray-with-square-relieved-corners/expected.json
@@ -0,0 +1,21 @@
+{
+ "sources": [
+ "tangency-labs/solidcraft#488"
+ ],
+ "what": "a 120 x 90 tray with four 20 mm 90 degree flanges and corner relief shape rectangular, unfolded",
+ "source": "analytic",
+ "method": "a flange of angle th, outer leg length Hf (height, from the virtual sharp along the flange) bends with allowance BA = th(R+Kt) and bend deduction BD = 2(R+t)tan(th/2) - BA; unfolded it lies in the base's plane and reaches Hf - BD beyond the base's edge. T = 2, R = 1, K = 0.5. BD(90) = 2*3 - pi = 2.8584, so the flat reaches 20 - BD = 17.1416 past each edge of the base: bbox x from -17.1416 to 137.1416, y from -17.1416 to 107.1416, z 0..2 (the base keeps its place); the corner relief changes the outline only inside the corners",
+ "body_count": 1,
+ "bbox": {
+ "min": [
+ -17.141592653589793,
+ -17.141592653589793,
+ 0
+ ],
+ "max": [
+ 137.14159265358978,
+ 107.1415926535898,
+ 2
+ ]
+ }
+}
\ No newline at end of file
diff --git a/tests/kernel-cases/sheet-metal/488-unfold-a-tray-with-square-relieved-corners/recipe.json b/tests/kernel-cases/sheet-metal/488-unfold-a-tray-with-square-relieved-corners/recipe.json
new file mode 100644
index 0000000000..5c00345c02
--- /dev/null
+++ b/tests/kernel-cases/sheet-metal/488-unfold-a-tray-with-square-relieved-corners/recipe.json
@@ -0,0 +1,86 @@
+{
+ "commands": [
+ {
+ "command": "sheet.manage_rules",
+ "params": {
+ "name": "Sheet 2 mm",
+ "thickness": "2 mm",
+ "active": true,
+ "bend_radius": "1 mm",
+ "k_factor": 0.5,
+ "gap": "0.5 mm",
+ "corner_relief_shape": "rectangular",
+ "corner_relief": "8 mm"
+ }
+ },
+ {
+ "command": "sketch.create",
+ "params": {
+ "plane": "XY",
+ "name": "Base"
+ }
+ },
+ {
+ "command": "sketch.rectangle.two_point",
+ "params": {
+ "p0": [
+ 0,
+ 0
+ ],
+ "p1": [
+ 120,
+ 90
+ ]
+ }
+ },
+ {
+ "command": "sketch.finish",
+ "params": {}
+ },
+ {
+ "command": "sheet.flange",
+ "params": {
+ "type": "base",
+ "sketch": "Base"
+ }
+ },
+ {
+ "command": "sheet.flange",
+ "params": {
+ "type": "edge",
+ "height": 20,
+ "angle": 90,
+ "edges": [
+ [
+ 60.0,
+ 0,
+ 2
+ ],
+ [
+ 120,
+ 45.0,
+ 2
+ ],
+ [
+ 60.0,
+ 90,
+ 2
+ ],
+ [
+ 0,
+ 45.0,
+ 2
+ ]
+ ]
+ }
+ },
+ {
+ "command": "sheet.unfold",
+ "params": {}
+ },
+ {
+ "command": "inspect.measure",
+ "params": {}
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/kernel-cases/sheet-metal/723-unfold-a-tray-with-torn-corners/expected.json b/tests/kernel-cases/sheet-metal/723-unfold-a-tray-with-torn-corners/expected.json
new file mode 100644
index 0000000000..4c3fed6419
--- /dev/null
+++ b/tests/kernel-cases/sheet-metal/723-unfold-a-tray-with-torn-corners/expected.json
@@ -0,0 +1,24 @@
+{
+ "sources": [
+ "tangency-labs/solidcraft#723",
+ "tangency-labs/solidcraft#809",
+ "tangency-labs/solidcraft#1797",
+ "tangency-labs/solidcraft#1799"
+ ],
+ "what": "a 120 x 90 tray with four 20 mm 90 degree flanges and corner relief shape tear, unfolded",
+ "source": "analytic",
+ "method": "a flange of angle th, outer leg length Hf (height, from the virtual sharp along the flange) bends with allowance BA = th(R+Kt) and bend deduction BD = 2(R+t)tan(th/2) - BA; unfolded it lies in the base's plane and reaches Hf - BD beyond the base's edge. T = 2, R = 1, K = 0.5. BD(90) = 2*3 - pi = 2.8584, so the flat reaches 20 - BD = 17.1416 past each edge of the base: bbox x from -17.1416 to 137.1416, y from -17.1416 to 107.1416, z 0..2 (the base keeps its place); the corner relief changes the outline only inside the corners",
+ "body_count": 1,
+ "bbox": {
+ "min": [
+ -17.141592653589793,
+ -17.141592653589793,
+ 0
+ ],
+ "max": [
+ 137.14159265358978,
+ 107.1415926535898,
+ 2
+ ]
+ }
+}
\ No newline at end of file
diff --git a/tests/kernel-cases/sheet-metal/723-unfold-a-tray-with-torn-corners/recipe.json b/tests/kernel-cases/sheet-metal/723-unfold-a-tray-with-torn-corners/recipe.json
new file mode 100644
index 0000000000..fe3f005084
--- /dev/null
+++ b/tests/kernel-cases/sheet-metal/723-unfold-a-tray-with-torn-corners/recipe.json
@@ -0,0 +1,85 @@
+{
+ "commands": [
+ {
+ "command": "sheet.manage_rules",
+ "params": {
+ "name": "Sheet 2 mm",
+ "thickness": "2 mm",
+ "active": true,
+ "bend_radius": "1 mm",
+ "k_factor": 0.5,
+ "gap": "0.5 mm",
+ "corner_relief_shape": "tear"
+ }
+ },
+ {
+ "command": "sketch.create",
+ "params": {
+ "plane": "XY",
+ "name": "Base"
+ }
+ },
+ {
+ "command": "sketch.rectangle.two_point",
+ "params": {
+ "p0": [
+ 0,
+ 0
+ ],
+ "p1": [
+ 120,
+ 90
+ ]
+ }
+ },
+ {
+ "command": "sketch.finish",
+ "params": {}
+ },
+ {
+ "command": "sheet.flange",
+ "params": {
+ "type": "base",
+ "sketch": "Base"
+ }
+ },
+ {
+ "command": "sheet.flange",
+ "params": {
+ "type": "edge",
+ "height": 20,
+ "angle": 90,
+ "edges": [
+ [
+ 60.0,
+ 0,
+ 2
+ ],
+ [
+ 120,
+ 45.0,
+ 2
+ ],
+ [
+ 60.0,
+ 90,
+ 2
+ ],
+ [
+ 0,
+ 45.0,
+ 2
+ ]
+ ]
+ }
+ },
+ {
+ "command": "sheet.unfold",
+ "params": {}
+ },
+ {
+ "command": "inspect.measure",
+ "params": {}
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/kernel-cases/sheet-metal/725-convert-a-shelled-tray-and-unfold-it/expected.json b/tests/kernel-cases/sheet-metal/725-convert-a-shelled-tray-and-unfold-it/expected.json
new file mode 100644
index 0000000000..2278ee401a
--- /dev/null
+++ b/tests/kernel-cases/sheet-metal/725-convert-a-shelled-tray-and-unfold-it/expected.json
@@ -0,0 +1,24 @@
+{
+ "sources": [
+ "tangency-labs/solidcraft#647",
+ "tangency-labs/solidcraft#725",
+ "tangency-labs/solidcraft#1285",
+ "tangency-labs/solidcraft#1340"
+ ],
+ "what": "a 100 x 60 x 30 box shelled to 2 mm, converted to sheet metal by its four bottom edges and unfolded",
+ "source": "analytic",
+ "method": "T = 2, R = 2, K = 0.44: BD(90) = 2*4 - (pi/2)(2 + 0.88) = 3.4761. The walls' outer legs are 30 long, so the flat reaches 30 - BD = 26.5239 past each edge of the 100 x 60 base (flat 160 - 2*BD = 153.048 by 113.048); the base keeps its place z 0..2",
+ "body_count": 1,
+ "bbox": {
+ "min": [
+ -26.523893421169305,
+ -26.523893421169305,
+ 0
+ ],
+ "max": [
+ 126.5238934211693,
+ 86.5238934211693,
+ 2
+ ]
+ }
+}
\ No newline at end of file
diff --git a/tests/kernel-cases/sheet-metal/725-convert-a-shelled-tray-and-unfold-it/recipe.json b/tests/kernel-cases/sheet-metal/725-convert-a-shelled-tray-and-unfold-it/recipe.json
new file mode 100644
index 0000000000..9d15158bb8
--- /dev/null
+++ b/tests/kernel-cases/sheet-metal/725-convert-a-shelled-tray-and-unfold-it/recipe.json
@@ -0,0 +1,77 @@
+{
+ "commands": [
+ {
+ "command": "sheet.manage_rules",
+ "params": {
+ "name": "Rule",
+ "thickness": "2 mm",
+ "active": true,
+ "bend_radius": "2 mm",
+ "k_factor": 0.44
+ }
+ },
+ {
+ "command": "solid.box",
+ "params": {
+ "length": 100,
+ "width": 60,
+ "height": 30,
+ "body_name": "Tray"
+ }
+ },
+ {
+ "command": "solid.shell",
+ "params": {
+ "faces": [
+ [
+ 50,
+ 30,
+ 30
+ ]
+ ],
+ "thickness": 2
+ }
+ },
+ {
+ "command": "sheet.convert",
+ "params": {
+ "body": "Tray",
+ "face": [
+ 50,
+ 30,
+ 0
+ ],
+ "bends": [
+ [
+ 50,
+ 0,
+ 0
+ ],
+ [
+ 100,
+ 30,
+ 0
+ ],
+ [
+ 50,
+ 60,
+ 0
+ ],
+ [
+ 0,
+ 30,
+ 0
+ ]
+ ]
+ }
+ },
+ {
+ "command": "sheet.unfold",
+ "params": {}
+ },
+ {
+ "command": "inspect.measure",
+ "params": {}
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/kernel-cases/sheet-metal/839-flange-on-a-plate-with-rounded-corners-unfolded/expected.json b/tests/kernel-cases/sheet-metal/839-flange-on-a-plate-with-rounded-corners-unfolded/expected.json
new file mode 100644
index 0000000000..60ba07fc3b
--- /dev/null
+++ b/tests/kernel-cases/sheet-metal/839-flange-on-a-plate-with-rounded-corners-unfolded/expected.json
@@ -0,0 +1,21 @@
+{
+ "sources": [
+ "tangency-labs/solidcraft#839"
+ ],
+ "what": "a 200 x 100 plate with its corners rounded 8 and one 40 mm inside flange on its bottom edge, unfolded: the trim made the outline's arcs chords",
+ "source": "analytic",
+ "method": "T = 2, R = 1, K = 0.5, BD(90) = 2.8584: the flat reaches 40 - BD = 37.1416 below the plate's bottom edge; the plate itself spans x 0..200 up to y = 100 (its top corners are the rounded ones); z 0..2",
+ "body_count": 1,
+ "bbox": {
+ "min": [
+ 0,
+ -37.1415926535898,
+ 0
+ ],
+ "max": [
+ 200,
+ 100,
+ 2
+ ]
+ }
+}
\ No newline at end of file
diff --git a/tests/kernel-cases/sheet-metal/839-flange-on-a-plate-with-rounded-corners-unfolded/recipe.json b/tests/kernel-cases/sheet-metal/839-flange-on-a-plate-with-rounded-corners-unfolded/recipe.json
new file mode 100644
index 0000000000..c6f6871e57
--- /dev/null
+++ b/tests/kernel-cases/sheet-metal/839-flange-on-a-plate-with-rounded-corners-unfolded/recipe.json
@@ -0,0 +1,183 @@
+{
+ "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.line",
+ "params": {
+ "points": [
+ [
+ 8,
+ 0
+ ],
+ [
+ 192,
+ 0
+ ]
+ ]
+ }
+ },
+ {
+ "command": "sketch.arc.three_point",
+ "params": {
+ "start": [
+ 192,
+ 0
+ ],
+ "end": [
+ 200,
+ 8
+ ],
+ "through": [
+ 197.6568542495,
+ 2.3431457505
+ ]
+ }
+ },
+ {
+ "command": "sketch.line",
+ "params": {
+ "points": [
+ [
+ 200,
+ 8
+ ],
+ [
+ 200,
+ 92
+ ]
+ ]
+ }
+ },
+ {
+ "command": "sketch.arc.three_point",
+ "params": {
+ "start": [
+ 200,
+ 92
+ ],
+ "end": [
+ 192,
+ 100
+ ],
+ "through": [
+ 197.6568542495,
+ 97.6568542495
+ ]
+ }
+ },
+ {
+ "command": "sketch.line",
+ "params": {
+ "points": [
+ [
+ 192,
+ 100
+ ],
+ [
+ 8,
+ 100
+ ]
+ ]
+ }
+ },
+ {
+ "command": "sketch.arc.three_point",
+ "params": {
+ "start": [
+ 8,
+ 100
+ ],
+ "end": [
+ 0,
+ 92
+ ],
+ "through": [
+ 2.3431457505,
+ 97.6568542495
+ ]
+ }
+ },
+ {
+ "command": "sketch.line",
+ "params": {
+ "points": [
+ [
+ 0,
+ 92
+ ],
+ [
+ 0,
+ 8
+ ]
+ ]
+ }
+ },
+ {
+ "command": "sketch.arc.three_point",
+ "params": {
+ "start": [
+ 0,
+ 8
+ ],
+ "end": [
+ 8,
+ 0
+ ],
+ "through": [
+ 2.3431457505,
+ 2.3431457505
+ ]
+ }
+ },
+ {
+ "command": "sketch.finish",
+ "params": {}
+ },
+ {
+ "command": "sheet.flange",
+ "params": {
+ "type": "base",
+ "sketch": "Plate"
+ }
+ },
+ {
+ "command": "sheet.flange",
+ "params": {
+ "edges": [
+ [
+ 100,
+ 0,
+ 2
+ ]
+ ],
+ "height": 40,
+ "angle": 90,
+ "position": "inside"
+ }
+ },
+ {
+ "command": "sheet.unfold",
+ "params": {}
+ },
+ {
+ "command": "inspect.measure",
+ "params": {}
+ }
+ ]
+}
\ No newline at end of file