- fixed a division by zero error: fixed #377

This commit is contained in:
Marius Stanciu
2020-02-01 06:59:15 +02:00
committed by Marius
parent 6eb96264f1
commit 7aea33914c
4 changed files with 15 additions and 4 deletions

View File

@@ -4756,7 +4756,11 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
return
tooldia = float(tool_dia_item.text())
new_cutz = (tooldia - vdia) / (2 * math.tan(math.radians(half_vangle)))
try:
new_cutz = (tooldia - vdia) / (2 * math.tan(math.radians(half_vangle)))
except ZeroDivisionError:
new_cutz = self.old_cutz
new_cutz = float('%.*f' % (self.decimals, new_cutz)) * -1.0 # this value has to be negative
self.ui.cutz_entry.set_value(new_cutz)