From cf7e1af99d179aed977361b8defb069da1d5725b Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 17 Jun 2021 14:56:49 +0200 Subject: [PATCH] Don't create disallowed areas for areas without any points It seems people edit definitions to remove all vertices. This causes Cura to crash because of the calculation of disallowed areas. Fixes Sentry issue CURA-2FY. --- cura/BuildVolume.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index fd953a838a..0c78be7547 100755 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020 Ultimaker B.V. +# Copyright (c) 2021 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. import numpy @@ -916,6 +916,8 @@ class BuildVolume(SceneNode): return {} for area in self._global_container_stack.getProperty("machine_disallowed_areas", "value"): + if len(area) == 0: + continue # Numpy doesn't deal well with 0-length arrays, since it can't determine the dimensionality of them. polygon = Polygon(numpy.array(area, numpy.float32)) polygon = polygon.getMinkowskiHull(Polygon.approximatedCircle(border_size)) machine_disallowed_polygons.append(polygon)