Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Edwards <s.edwards@ultimaker.com>2016-05-26 15:39:22 +0300
committerSimon Edwards <s.edwards@ultimaker.com>2016-05-26 15:39:22 +0300
commit5f638f6e69b85d64d1904bac8c4c25417294e209 (patch)
treeca69b73234cf6b0db593bb79fda782b515a5941d /cura/ConvexHullNode.py
parent7e3dd3d443dfbda122bd14f0c2b73ba6f6831e13 (diff)
Better handling of degenerate convex hull cases.
Contributes to CURA-1504
Diffstat (limited to 'cura/ConvexHullNode.py')
-rw-r--r--cura/ConvexHullNode.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/cura/ConvexHullNode.py b/cura/ConvexHullNode.py
index 3d00edd288..2d88604b6e 100644
--- a/cura/ConvexHullNode.py
+++ b/cura/ConvexHullNode.py
@@ -39,9 +39,10 @@ class ConvexHullNode(SceneNode):
self._convex_hull_head_mesh = None
self._hull = hull
- hull_mesh = self.createHullMesh(self._hull.getPoints())
- if hull_mesh:
- self.setMeshData(hull_mesh)
+ if self._hull:
+ hull_mesh = self.createHullMesh(self._hull.getPoints())
+ if hull_mesh:
+ self.setMeshData(hull_mesh)
convex_hull_head = self._node.callDecoration("getConvexHullHead")
if convex_hull_head:
self._convex_hull_head_mesh = self.createHullMesh(convex_hull_head.getPoints())
@@ -76,9 +77,10 @@ class ConvexHullNode(SceneNode):
self._shader.setUniformValue("u_color", self._color)
if self.getParent():
- renderer.queueNode(self, transparent = True, shader = self._shader, backface_cull = True, sort = -8)
- if self._convex_hull_head_mesh:
- renderer.queueNode(self, shader = self._shader, transparent = True, mesh = self._convex_hull_head_mesh, backface_cull = True, sort = -8)
+ if self.getMeshData():
+ renderer.queueNode(self, transparent = True, shader = self._shader, backface_cull = True, sort = -8)
+ if self._convex_hull_head_mesh:
+ renderer.queueNode(self, shader = self._shader, transparent = True, mesh = self._convex_hull_head_mesh, backface_cull = True, sort = -8)
return True