Skip to content

Commit 35dab59

Browse files
committed
Add new modes for the improved calculations, to avoid breaking existing projects.
1 parent 10b43a0 commit 35dab59

File tree

2 files changed

+31
-3
lines changed

2 files changed

+31
-3
lines changed

Resources/panels/FlangeParameters.ui

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1408,6 +1408,26 @@ min-width: 28px;</string>
14081408
</iconset>
14091409
</property>
14101410
</item>
1411+
<item>
1412+
<property name="text">
1413+
<string>Material Inside (90° legacy)</string>
1414+
</property>
1415+
<property name="icon">
1416+
<iconset>
1417+
<normalon>Icons:SheetMetal_WallPosMatIns.svg</normalon>
1418+
</iconset>
1419+
</property>
1420+
</item>
1421+
<item>
1422+
<property name="text">
1423+
<string>Thickness Outside (legacy)</string>
1424+
</property>
1425+
<property name="icon">
1426+
<iconset>
1427+
<normalon>Icons:SheetMetal_WallPosThkOut.svg</normalon>
1428+
</iconset>
1429+
</property>
1430+
</item>
14111431
</widget>
14121432
</item>
14131433
</layout>

SheetMetalCmd.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,10 +1263,16 @@ def smBend(
12631263
if BendType == "Material Outside":
12641264
offset = 0.0
12651265
inside = False
1266-
elif BendType == "Material Inside":
1266+
elif BendType == "Material Inside": # legacy mode for backwards compatibility
1267+
offset = -(thk + bendR)
1268+
inside = True
1269+
elif BendType == "Thickness Outside": # legacy mode for backwards compatibility
1270+
offset = -bendR
1271+
inside = True
1272+
elif BendType == "Material Inside V2":
12671273
offset = -(thk + bendR) * abs(math.tan(math.radians(bendA * 0.5)))
12681274
inside = True
1269-
elif BendType == "Thickness Outside":
1275+
elif BendType == "Thickness Outside V2":
12701276
offset = -bendR * abs(math.tan(math.radians(bendA * 0.5)))
12711277
inside = True
12721278
elif BendType == "Offset":
@@ -1781,7 +1787,9 @@ def addVerifyProperties(self, obj, refAngOffset=None, checkRefFace=False):
17811787
obj,
17821788
"BendType",
17831789
translate("App::Property", "Bend Type"),
1784-
["Material Outside", "Material Inside", "Thickness Outside", "Offset"],
1790+
["Material Outside", "Material Inside V2", "Thickness Outside V2", "Offset",
1791+
# legacy modes
1792+
"Material Inside", "Thickness Outside"],
17851793
)
17861794
SheetMetalTools.smAddEnumProperty(
17871795
obj,

0 commit comments

Comments
 (0)