diff options
author | Ghostkeeper <rubend@tutanota.com> | 2017-12-28 16:30:47 +0300 |
---|---|---|
committer | Ghostkeeper <rubend@tutanota.com> | 2017-12-28 16:30:47 +0300 |
commit | a4d83331adb72eafc0c145a97a5797e0c8be39c5 (patch) | |
tree | 035dbfdcc071c136138cdba4ac1a73a2aa10047f /cura/PlatformPhysics.py | |
parent | 4b9ddc186a8ba870ea3cfb761c2d257ec3f9616d (diff) |
Code style: Space around binary operator
Contributes to issue CURA-4672.
Diffstat (limited to 'cura/PlatformPhysics.py')
-rwxr-xr-x | cura/PlatformPhysics.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/cura/PlatformPhysics.py b/cura/PlatformPhysics.py index d1871466d5..62338ce91f 100755 --- a/cura/PlatformPhysics.py +++ b/cura/PlatformPhysics.py @@ -117,33 +117,33 @@ class PlatformPhysics: overlap = node.callDecoration("getConvexHull").translate(move_vector.x, move_vector.z).intersectsPolygon(other_head_hull) if overlap: # Moving ensured that overlap was still there. Try anew! - move_vector = move_vector.set(x=move_vector.x + overlap[0] * self._move_factor, - z=move_vector.z + overlap[1] * self._move_factor) + move_vector = move_vector.set(x = move_vector.x + overlap[0] * self._move_factor, + z = move_vector.z + overlap[1] * self._move_factor) else: # Moving ensured that overlap was still there. Try anew! - move_vector = move_vector.set(x=move_vector.x + overlap[0] * self._move_factor, - z=move_vector.z + overlap[1] * self._move_factor) + move_vector = move_vector.set(x = move_vector.x + overlap[0] * self._move_factor, + z = move_vector.z + overlap[1] * self._move_factor) else: own_convex_hull = node.callDecoration("getConvexHull") other_convex_hull = other_node.callDecoration("getConvexHull") if own_convex_hull and other_convex_hull: overlap = own_convex_hull.translate(move_vector.x, move_vector.z).intersectsPolygon(other_convex_hull) if overlap: # Moving ensured that overlap was still there. Try anew! - temp_move_vector = move_vector.set(x=move_vector.x + overlap[0] * self._move_factor, - z=move_vector.z + overlap[1] * self._move_factor) + temp_move_vector = move_vector.set(x = move_vector.x + overlap[0] * self._move_factor, + z = move_vector.z + overlap[1] * self._move_factor) # if the distance between two models less than 2mm then try to find a new factor if abs(temp_move_vector.x - overlap[0]) < self._minimum_gap and abs(temp_move_vector.y - overlap[1]) < self._minimum_gap: temp_scale_factor = self._move_factor - temp_x_factor = (abs(overlap[0]) + self._minimum_gap) / overlap[0] if overlap[0] != 0 else 0# find x move_factor, like (3.4 + 2) / 3.4 = 1.58 + temp_x_factor = (abs(overlap[0]) + self._minimum_gap) / overlap[0] if overlap[0] != 0 else 0 # find x move_factor, like (3.4 + 2) / 3.4 = 1.58 temp_y_factor = (abs(overlap[1]) + self._minimum_gap) / overlap[1] if overlap[1] != 0 else 0 # find y move_factor if abs(temp_x_factor) > abs(temp_y_factor): temp_scale_factor = temp_x_factor else: temp_scale_factor = temp_y_factor - move_vector = move_vector.set(x=move_vector.x + overlap[0] * temp_scale_factor, - z=move_vector.z + overlap[1] * temp_scale_factor) + move_vector = move_vector.set(x = move_vector.x + overlap[0] * temp_scale_factor, + z = move_vector.z + overlap[1] * temp_scale_factor) else: move_vector = temp_move_vector else: @@ -151,7 +151,7 @@ class PlatformPhysics: # Simply waiting for the next tick seems to resolve this correctly. overlap = None - if not Vector.Null.equals(move_vector, epsilon=1e-5): + if not Vector.Null.equals(move_vector, epsilon = 1e-5): transformed_nodes.append(node) op = PlatformPhysicsOperation.PlatformPhysicsOperation(node, move_vector) op.push() |