Skip to content

Commit

Permalink
FEM: result task panel, avoid zero float division
Browse files Browse the repository at this point in the history
  • Loading branch information
berndhahnebach committed Apr 19, 2020
1 parent a020dc2 commit 9dc688f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Mod/Fem/femguiobjects/_ViewProviderFemResultMechanical.py
Expand Up @@ -703,6 +703,8 @@ def get_displacement_scale_factor(res_obj):
z_span = abs(p_z_max - p_z_min)
span = max(x_span, y_span, z_span)
max_disp = max(x_max, y_max, z_max)
if max_disp == 0.0:
return 0.0 # avoid float division by zero
# FIXME - add max_allowed_disp to Preferences
max_allowed_disp = 0.01 * span
scale = max_allowed_disp / max_disp
Expand Down

0 comments on commit 9dc688f

Please sign in to comment.