From 7f887413954152f2de7dbfd0f6e985dcd63875b8 Mon Sep 17 00:00:00 2001 From: "A.Sasin" Date: Tue, 10 Oct 2017 15:47:18 +0200 Subject: [PATCH] Fixed: Very small objects less then 0.1mm creates critical issues CURA-4431 --- cura/CuraApplication.py | 5 +++++ cura/ShapeArray.py | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index ab348ae471..c2517093bb 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -1359,6 +1359,11 @@ class CuraApplication(QtApplication): # Find node location offset_shape_arr, hull_shape_arr = ShapeArray.fromNode(node, min_offset = min_offset) + if offset_shape_arr is None and hull_shape_arr is None: + Message(self._i18n_catalog.i18nc("@info:status","Could not load a model"), + title=self._i18n_catalog.i18nc("@info:title", "Warning")).show() + return + # Step is for skipping tests to make it a lot faster. it also makes the outcome somewhat rougher node, _ = arranger.findNodePlacement(node, offset_shape_arr, hull_shape_arr, step = 10) diff --git a/cura/ShapeArray.py b/cura/ShapeArray.py index 95d0201c38..3594db2270 100755 --- a/cura/ShapeArray.py +++ b/cura/ShapeArray.py @@ -43,6 +43,10 @@ class ShapeArray: transform_x = transform._data[0][3] transform_y = transform._data[2][3] hull_verts = node.callDecoration("getConvexHull") + + if not hull_verts.getPoints().any(): # IF a model is to small then it will not contain any points + return None, None + # For one_at_a_time printing you need the convex hull head. hull_head_verts = node.callDecoration("getConvexHullHead") or hull_verts