Skip to content

Commit

Permalink
polygonWall: Add correct_corner parameter
Browse files Browse the repository at this point in the history
to allow disabling processing for fitting finger joints of the
perpendicular walls in the inner corners.
  • Loading branch information
florianfesti committed Apr 1, 2023
1 parent bdf1966 commit df4ae6d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion boxes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2754,13 +2754,15 @@ def _closePolygon(self, borders):
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
: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 = "")
Expand Down Expand Up @@ -2793,7 +2795,8 @@ def polygonWall(self, borders, edge="f", turtle=False,
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
Expand Down

0 comments on commit df4ae6d

Please sign in to comment.