From 95120300601c5a8391a3909c7291f95248d35052 Mon Sep 17 00:00:00 2001 From: Nino van Hooff Date: Wed, 2 Oct 2019 13:07:11 +0200 Subject: Check for adhesion area collisions in one-at-a-time ordering CURA-6785 --- cura/OneAtATimeIterator.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'cura/OneAtATimeIterator.py') diff --git a/cura/OneAtATimeIterator.py b/cura/OneAtATimeIterator.py index a61ce492a9..4d420f6d05 100644 --- a/cura/OneAtATimeIterator.py +++ b/cura/OneAtATimeIterator.py @@ -92,12 +92,24 @@ class OneAtATimeIterator(Iterator.Iterator): score_b = sum(self._hit_map[self._original_node_list.index(b)]) return score_a - score_b - # Checks if A can be printed before B + ## Checks if A can be printed before B def _checkHit(self, a: SceneNode, b: SceneNode) -> bool: if a == b: return False - overlap = a.callDecoration("getConvexHullBoundary").intersectsPolygon(b.callDecoration("getConvexHullHeadFull")) + a_hit_hull = a.callDecoration("getConvexHullBoundary") + b_hit_hull = b.callDecoration("getConvexHullHeadFull") + overlap = a_hit_hull.intersectsPolygon(b_hit_hull) + + if overlap: + return True + + # Adhesion areas must never overlap, regardless of printing order + # This would cause over-extrusion + a_hit_hull = a.callDecoration("getAdhesionArea") + b_hit_hull = b.callDecoration("getAdhesionArea") + overlap = a_hit_hull.intersectsPolygon(b_hit_hull) + if overlap: return True else: -- cgit v1.2.3