Removed logging, improved spot for left-over object. CURA-3239

This commit is contained in:
Jack Ha 2017-04-03 11:47:04 +02:00
parent e866c03b50
commit d6cd37626b
2 changed files with 2 additions and 8 deletions

View File

@ -134,13 +134,10 @@ class Arrange:
fixed_nodes.append(node_)
# place all objects fixed nodes
for fixed_node in fixed_nodes:
Logger.log("d", " # Placing [%s]" % str(fixed_node))
vertices = fixed_node.callDecoration("getConvexHull")
points = copy.deepcopy(vertices._points)
shape_arr = ShapeArray.fromPolygon(points, scale = scale)
arranger.place(0, 0, shape_arr)
Logger.log("d", "Current buildplate: \n%s" % str(arranger._occupied[::10, ::10]))
return arranger
## Find placement for a node (using offset shape) and place it (using hull shape)
@ -152,20 +149,17 @@ class Arrange:
for i in range(count):
new_node = copy.deepcopy(node)
Logger.log("d", " # Finding spot for %s" % new_node)
x, y, penalty_points, start_prio = self.bestSpot(
offset_shape_arr, start_prio = start_prio, step = step)
transformation = new_node._transformation
if x is not None: # We could find a place
transformation._data[0][3] = x
transformation._data[2][3] = y
Logger.log("d", "Best place is: %s %s (points = %s)" % (x, y, penalty_points))
self.place(x, y, hull_shape_arr) # take place before the next one
Logger.log("d", "New buildplate: \n%s" % str(self._occupied[::10, ::10]))
else:
Logger.log("d", "Could not find spot!")
transformation._data[0][3] = 200
transformation._data[2][3] = -100 + i * 20
transformation._data[2][3] = 100 + i * 20
nodes.append(new_node)
return nodes

View File

@ -856,8 +856,8 @@ class CuraApplication(QtApplication):
if not node and object_id != 0: # Workaround for tool handles overlapping the selected object
node = Selection.getSelectedObject(0)
# If object is part of a group, multiply group
current_node = node
# Find the topmost group
while current_node.getParent() and current_node.getParent().callDecoration("isGroup"):
current_node = current_node.getParent()