Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksei S <a.sasin@ultimaker.com>2017-12-22 15:04:25 +0300
committerAleksei S <a.sasin@ultimaker.com>2017-12-22 15:04:25 +0300
commit05acb2e00fc28c92c9851eb2dbe5c9637068e19c (patch)
treefb0e090d3cfb5b4d314865c65db45f42c534961a /cura/PlatformPhysics.py
parentb454b43ae04b553e3ed9f690e98eea10b1c00f96 (diff)
Prvent integer infinitive value after arranging all models
CURA-4672
Diffstat (limited to 'cura/PlatformPhysics.py')
-rwxr-xr-xcura/PlatformPhysics.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/cura/PlatformPhysics.py b/cura/PlatformPhysics.py
index 543eff0d4b..c4254ebd3f 100755
--- a/cura/PlatformPhysics.py
+++ b/cura/PlatformPhysics.py
@@ -135,9 +135,9 @@ 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] # find x move_factor, like (3.4 + 2) / 3.4 = 1.58
- temp_y_factor = (abs(overlap[1]) + self._minimum_gap) / overlap[1] # find y move_factor
- if temp_x_factor > temp_y_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