diff options
author | Lipu Fei <lipu.fei815@gmail.com> | 2018-01-04 15:02:10 +0300 |
---|---|---|
committer | Lipu Fei <lipu.fei815@gmail.com> | 2018-01-04 15:02:10 +0300 |
commit | 7b8f951682322155e8fb5b332121d7bcbe6359a4 (patch) | |
tree | d912713a3a09fff0c02d27e6e359817f3f894dff /cura/PlatformPhysics.py | |
parent | 3a4445b656babc8d2271db97b9d805a270f2d9ea (diff) |
Simplify temp_scale_factor assignment
CURA-4672
Diffstat (limited to 'cura/PlatformPhysics.py')
-rwxr-xr-x | cura/PlatformPhysics.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/cura/PlatformPhysics.py b/cura/PlatformPhysics.py index ddc55302ee..0ad3cf1328 100755 --- a/cura/PlatformPhysics.py +++ b/cura/PlatformPhysics.py @@ -134,13 +134,10 @@ class PlatformPhysics: # 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_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 + + temp_scale_factor = temp_x_factor if abs(temp_x_factor) > abs(temp_y_factor) else 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) |