saleone/pyfabrik

div by zero

Opened this issue · 0 comments

hello today i try some things and found this problem:

code:

initial_joint_positions = [Vector3(0, 0, 0), Vector3(10, 0, 0), Vector3(20, 0, 0), Vector3(30, 0, 0)]
tolerance = 0.01

# Initialize the Fabrik class (Fabrik, Fabrik2D or Fabrik3D)
fab = pyfabrik.Fabrik3D(initial_joint_positions, tolerance)
fab.move_to(Vector3(20, 0, 0))

error on iteration between Vector3(20, 0, 0), Vector3(30, 0, 0)

File "/home/fagh/IdeaProjects/LinearAnimation/main.py", line 47, in <module>
    fab.move_to(Vector3(20, 0, 0))
  File "/usr/lib/python3.9/site-packages/pyfabrik/__init__.py", line 131, in move_to
    return super().move_to(target, try_to_reach)
  File "/usr/lib/python3.9/site-packages/pyfabrik/__init__.py", line 85, in move_to
    return self._iterate(target)
  File "/usr/lib/python3.9/site-packages/pyfabrik/__init__.py", line 98, in _iterate
    len_share = self.lengths[i] / (next - current).length
ZeroDivisionError: float division by zero