mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-05 13:03:59 -06:00
More defensive coding to prevent division by zero
CURA-2443
This commit is contained in:
parent
4e3384e640
commit
10af3ee5ab
1 changed files with 1 additions and 1 deletions
|
@ -817,7 +817,7 @@ class CuraApplication(QtApplication):
|
|||
|
||||
# Compute the center of the objects when their origins are aligned.
|
||||
object_centers = [node.getMeshData().getCenterPosition().scale(node.getScale()) for node in group_node.getChildren() if node.getMeshData()]
|
||||
if object_centers:
|
||||
if object_centers and len(object_centers) > 0:
|
||||
middle_x = sum([v.x for v in object_centers]) / len(object_centers)
|
||||
middle_y = sum([v.y for v in object_centers]) / len(object_centers)
|
||||
middle_z = sum([v.z for v in object_centers]) / len(object_centers)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue