Fix crash when arranging objects in one-at-a-time mode

Crashing was occuring because node.getPoints() can return None.

CURA-7440
This commit is contained in:
Kostas Karmas 2020-10-12 16:28:28 +02:00
parent 9f929298d7
commit 972e2f6716

View File

@ -64,6 +64,7 @@ def findNodePlacement(nodes_to_arrange: List["SceneNode"], build_volume: "BuildV
# Clip the disallowed areas so that they don't overlap the bounding box (The arranger chokes otherwise)
clipped_area = area.intersectionConvexHulls(build_plate_polygon)
if clipped_area.getPoints() is not None: # numpy array has to be explicitly checked against None
for point in clipped_area.getPoints():
converted_points.append(Point(point[0] * factor, point[1] * factor))
@ -76,6 +77,7 @@ def findNodePlacement(nodes_to_arrange: List["SceneNode"], build_volume: "BuildV
converted_points = []
hull_polygon = node.callDecoration("getConvexHull")
if hull_polygon.getPoints() is not None: # numpy array has to be explicitly checked against None
for point in hull_polygon.getPoints():
converted_points.append(Point(point[0] * factor, point[1] * factor))
item = Item(converted_points)