Skip to content

Commit 7241d8e

Browse files
committed
check bounds before sending paths to execute
pyclipper fails on empty paths
1 parent 945c6f3 commit 7241d8e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Lib/booleanOperations/booleanOperationManager.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ def clipExecute(subjectContours, clipContours, operation, subjectFillType="nonZe
5959
for j, clipContour in enumerate(clipContours):
6060
_addContour(clipperPath=pc, contour=clipContour, fillType=pyclipper.PT_CLIP, contourCount=i)
6161

62+
bounds = pc.GetBounds()
63+
if (bounds.bottom, bounds.left, bounds.top, bounds.right) == (0, 0, 0, 0):
64+
# do nothing if there are no paths
65+
return []
66+
6267
try:
6368
solution = pc.Execute(_operationMap[operation],
6469
_fillTypeMap[subjectFillType],

0 commit comments

Comments
 (0)