Head size & settings for one at a time & all at once printing

This commit is contained in:
Jaime van Kessel 2015-07-21 11:13:38 +02:00
parent 5abb6c1635
commit a18f133e29
3 changed files with 264 additions and 190 deletions

View file

@ -41,10 +41,15 @@ class ConvexHullJob(Job):
# First, calculate the normal convex hull around the points
hull = hull.getConvexHull()
#print("hull: " , self._node.callDecoration("isGroup"), " " , hull.getPoints())
# Then, do a Minkowski hull with a simple 1x1 quad to outset and round the normal convex hull.
# This is done because of rounding errors.
hull = hull.getMinkowskiHull(Polygon(numpy.array([[-1, -1], [-1, 1], [1, 1], [1, -1]], numpy.float32)))
settings = Application.getInstance().getActiveMachine()
if settings.getSettingValueByKey("print_sequence") == "One at a time" and not self._node.getParent().callDecoration("isGroup"):
# Printing one at a time and it's not an object in a group
hull = hull.getMinkowskiHull(Polygon(numpy.array(settings.getSettingValueByKey("machine_head_polygon"),numpy.float32)))
hull_node = ConvexHullNode.ConvexHullNode(self._node, hull, Application.getInstance().getController().getScene().getRoot())
self._node.callDecoration("setConvexHullNode", hull_node)
self._node.callDecoration("setConvexHull", hull)