- solved a ZeroDivisionError exception in the Geometry Editor -> Path Tool
This commit is contained in:
@@ -13,6 +13,7 @@ CHANGELOG for FlatCAM Evo beta
|
|||||||
- in Geometry Editor for the Path tool but only when using the 3D engine graphic mode, the mouse cursor is followed by position data
|
- in Geometry Editor for the Path tool but only when using the 3D engine graphic mode, the mouse cursor is followed by position data
|
||||||
- in Geometry Editor for the Path tool fixed an issue with path projection when changing the grid size while the Path tool is active
|
- in Geometry Editor for the Path tool fixed an issue with path projection when changing the grid size while the Path tool is active
|
||||||
- in Geometry Editor, for Path tool, added UI that close on end of the Path tool action; it displays the projected length which now is kept for as long as it is wanted, allowing for path automation in case of repetitive lengths
|
- in Geometry Editor, for Path tool, added UI that close on end of the Path tool action; it displays the projected length which now is kept for as long as it is wanted, allowing for path automation in case of repetitive lengths
|
||||||
|
- solved a ZeroDivisionError exception in the Geometry Editor -> Path Tool
|
||||||
|
|
||||||
13.04.2022
|
13.04.2022
|
||||||
|
|
||||||
|
|||||||
@@ -1086,13 +1086,15 @@ class FCPath(FCPolygon):
|
|||||||
last_pt = self.draw_app.app.mouse
|
last_pt = self.draw_app.app.mouse
|
||||||
|
|
||||||
seg_length = math.sqrt((last_pt[0] - first_pt[0])**2 + (last_pt[1] - first_pt[1])**2)
|
seg_length = math.sqrt((last_pt[0] - first_pt[0])**2 + (last_pt[1] - first_pt[1])**2)
|
||||||
|
if seg_length == 0.0:
|
||||||
|
return
|
||||||
try:
|
try:
|
||||||
new_x = first_pt[0] + (last_pt[0] - first_pt[0]) / seg_length * target_length
|
new_x = first_pt[0] + (last_pt[0] - first_pt[0]) / seg_length * target_length
|
||||||
new_y = first_pt[1] + (last_pt[1] - first_pt[1]) / seg_length * target_length
|
new_y = first_pt[1] + (last_pt[1] - first_pt[1]) / seg_length * target_length
|
||||||
except ZeroDivisionError as err:
|
except ZeroDivisionError as err:
|
||||||
self.points = []
|
self.points = []
|
||||||
self.clean_up()
|
self.clean_up()
|
||||||
return '%s %s' % (_("Failed."), str(err))
|
return '[ERROR_NOTCL] %s %s' % (_("Failed."), str(err).capitalize())
|
||||||
|
|
||||||
if self.points[-1] != (new_x, new_y):
|
if self.points[-1] != (new_x, new_y):
|
||||||
self.points.append((new_x, new_y))
|
self.points.append((new_x, new_y))
|
||||||
|
|||||||
Reference in New Issue
Block a user