From 8c1cf89d45413bfd8b1290be3cd29e1b68df275c Mon Sep 17 00:00:00 2001 From: Kostas Karmas Date: Fri, 16 Oct 2020 11:31:00 +0200 Subject: [PATCH] Skip arranging objects that have no convex hull CURA-7780 --- cura/Arranging/Nest2DArrange.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cura/Arranging/Nest2DArrange.py b/cura/Arranging/Nest2DArrange.py index 93d0788970..727504c9ff 100644 --- a/cura/Arranging/Nest2DArrange.py +++ b/cura/Arranging/Nest2DArrange.py @@ -3,6 +3,7 @@ from pynest2d import Point, Box, Item, NfpConfig, nest from typing import List, TYPE_CHECKING, Optional, Tuple from UM.Application import Application +from UM.Logger import Logger from UM.Math.Matrix import Matrix from UM.Math.Polygon import Polygon from UM.Math.Quaternion import Quaternion @@ -44,6 +45,9 @@ def findNodePlacement(nodes_to_arrange: List["SceneNode"], build_volume: "BuildV node_items = [] for node in nodes_to_arrange: hull_polygon = node.callDecoration("getConvexHull") + if not hull_polygon or hull_polygon.getPoints is None: + Logger.log("w", "Object {} cannot be arranged because it has no convex hull.".format(node.getName())) + continue converted_points = [] for point in hull_polygon.getPoints(): converted_points.append(Point(point[0] * factor, point[1] * factor))