Commit a39bba08 authored by Guillaume Seguin's avatar Guillaume Seguin

Hackily handle avg_norm == 0

parent 2f3f39c2
...@@ -335,6 +335,9 @@ class GcodeModel(Model): ...@@ -335,6 +335,9 @@ class GcodeModel(Model):
avg_move = move_normalized / 2 + prev_move / 2 avg_move = move_normalized / 2 + prev_move / 2
norm = numpy.linalg.norm(avg_move) norm = numpy.linalg.norm(avg_move)
# FIXME: handle norm == 0 or when paths go back (add an extra cap ?) # FIXME: handle norm == 0 or when paths go back (add an extra cap ?)
if norm == 0:
avg_move_normal = move_normal
else:
avg_move = avg_move / norm avg_move = avg_move / norm
avg_move_normal = numpy.array([- avg_move[1], avg_move[0]]) avg_move_normal = numpy.array([- avg_move[1], avg_move[0]])
# Compute vertices # Compute vertices
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment