mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 15:44:04 -06:00
Merge pull request #9577 from Ultimaker/fix_segfault_arranging_without_disallowed_areas
Fix segfault when arranging without any disallowed areas
This commit is contained in:
commit
db74bbda60
1 changed files with 2 additions and 2 deletions
|
@ -75,7 +75,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)
|
# Clip the disallowed areas so that they don't overlap the bounding box (The arranger chokes otherwise)
|
||||||
clipped_area = area.intersectionConvexHulls(build_plate_polygon)
|
clipped_area = area.intersectionConvexHulls(build_plate_polygon)
|
||||||
|
|
||||||
if clipped_area.getPoints() is not None: # numpy array has to be explicitly checked against None
|
if clipped_area.getPoints() is not None and len(clipped_area.getPoints()) > 2: # numpy array has to be explicitly checked against None
|
||||||
for point in clipped_area.getPoints():
|
for point in clipped_area.getPoints():
|
||||||
converted_points.append(Point(int(point[0] * factor), int(point[1] * factor)))
|
converted_points.append(Point(int(point[0] * factor), int(point[1] * factor)))
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ def findNodePlacement(nodes_to_arrange: List["SceneNode"], build_volume: "BuildV
|
||||||
converted_points = []
|
converted_points = []
|
||||||
hull_polygon = node.callDecoration("getConvexHull")
|
hull_polygon = node.callDecoration("getConvexHull")
|
||||||
|
|
||||||
if hull_polygon is not None and hull_polygon.getPoints() is not None: # numpy array has to be explicitly checked against None
|
if hull_polygon is not None and hull_polygon.getPoints() is not None and len(hull_polygon.getPoints()) > 2: # numpy array has to be explicitly checked against None
|
||||||
for point in hull_polygon.getPoints():
|
for point in hull_polygon.getPoints():
|
||||||
converted_points.append(Point(point[0] * factor, point[1] * factor))
|
converted_points.append(Point(point[0] * factor, point[1] * factor))
|
||||||
item = Item(converted_points)
|
item = Item(converted_points)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue