Skip to content

Commit

Permalink
Fixed a bug in NURBS curve derivatives method
Browse files Browse the repository at this point in the history
Thanks to Federico Muretti for pointing out the error.
  • Loading branch information
Onur R. Bingol committed Mar 27, 2018
1 parent f460070 commit 1bde474
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions geomdl/NURBS.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,8 @@ def derivatives(self, u=-1, order=0):
# Algorithm A4.2
CK = [[None for _ in range(self._dimension - 1)] for _ in range(order + 1)]
for k in range(0, order + 1):
v = []
for idx in range(self._dimension - 1):
v.append(CKw[idx])

for i in range(1, order + 1):
v = [val for val in CKw[k][0:self._dimension-1]]
for i in range(1, k + 1):
v[:] = [tmp - (utils.binomial_coefficient(k, i) * CKw[i][-1] * drv) for tmp, drv in zip(v, CK[k - i])]
CK[k][:] = [tmp / CKw[0][-1] for tmp in v]

Expand Down

0 comments on commit 1bde474

Please sign in to comment.