polygonWall: Add correct_corner parameter

to allow disabling processing for fitting finger joints of the
perpendicular walls in the inner corners.
This commit is contained in:
Florian Festi 2023-04-01 16:58:06 +02:00
parent bdf196616d
commit df4ae6da3c
1 changed files with 4 additions and 1 deletions

View File

@ -2754,6 +2754,7 @@ class Boxes:
return borders
def polygonWall(self, borders, edge="f", turtle=False,
correct_corners=True,
callback=None, move=None, label=""):
"""
Polygon wall for all kind of multi-edged objects
@ -2761,6 +2762,7 @@ class Boxes:
:param borders: array of distance and angles to draw
:param edge: (Default value = "f") Edges to apply. If the array of borders contains more segments that edges, the edge will wrap. Only edge types without start and end width supported for now.
:param turtle: (Default value = False)
:param correct_corners: (Default value = True)
:param callback: (Default value = None)
:param move: (Default value = None)
:param label: rendered to identify parts, it is not ment to be cut or etched (Default value = "")
@ -2793,7 +2795,8 @@ class Boxes:
l = borders[i] - length_correction
next_angle = borders[i+1]
if isinstance(next_angle, (int, float)) and next_angle < 0:
if (correct_corners and
isinstance(next_angle, (int, float)) and next_angle < 0):
length_correction = t * math.tan(math.radians(-next_angle / 2))
else:
length_correction = 0.0