Skip to content

Commit

Permalink
Remove get_ctrlpts option from eval functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Onur R. Bingol committed Feb 24, 2018
1 parent 48b2a97 commit 34f1434
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 24 deletions.
12 changes: 0 additions & 12 deletions geomdl/BSpline.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,6 @@ def curvept(self, u=-1, **kwargs):
:rtype: list
"""
check_vars = kwargs.get('check_vars', True)
get_ctrlpts = kwargs.get('get_ctrlpts', False)

if check_vars:
# Check all parameters are set before the curve evaluation
Expand All @@ -433,12 +432,7 @@ def curvept(self, u=-1, **kwargs):
for i in range(0, self._degree + 1):
cpt[:] = [curve_pt + (basis[i] * ctrl_pt) for curve_pt, ctrl_pt in
zip(cpt, self._control_points[span - self._degree + i])]
if get_ctrlpts:
ctrlpts.append(self._control_points[span - self._degree + i])

# Return associated control points
if get_ctrlpts:
return cpt, ctrlpts
return cpt

# Evaluates the B-Spline curve
Expand Down Expand Up @@ -1710,7 +1704,6 @@ def surfpt(self, u=-1, v=-1, **kwargs):
:rtype: list
"""
check_vars = kwargs.get('check_vars', True)
get_ctrlpts = kwargs.get('get_ctrlpts', False)

if check_vars:
# Check all parameters are set before the surface evaluation
Expand All @@ -1735,13 +1728,8 @@ def surfpt(self, u=-1, v=-1, **kwargs):
idx_v = span_v - self._degree_v + l
for k in range(0, self._degree_u + 1):
temp[:] = [tmp + (basis_u[k] * cp) for tmp, cp in zip(temp, self._control_points2D[idx_u + k][idx_v])]
if get_ctrlpts:
ctrlpts.append(self._control_points2D[idx_u + k][idx_v])
spt[:] = [pt + (basis_v[l] * tmp) for pt, tmp in zip(spt, temp)]

# Return associated control points
if get_ctrlpts:
return spt, ctrlpts
return spt

# Evaluates the B-Spline surface
Expand Down
12 changes: 0 additions & 12 deletions geomdl/NURBS.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ def curvept(self, u=-1, **kwargs):
:rtype: list
"""
check_vars = kwargs.get('check_vars', True)
get_ctrlpts = kwargs.get('get_ctrlpts', False)

if check_vars:
# Check all parameters are set before the curve evaluation
Expand All @@ -140,17 +139,12 @@ def curvept(self, u=-1, **kwargs):
for i in range(0, self._degree + 1):
cptw[:] = [elem1 + (basis[i] * elem2) for elem1, elem2 in
zip(cptw, self._control_points[span - self._degree + i])]
if get_ctrlpts:
ctrlpts.append(self._control_points[span - self._degree + i])

# Divide by weight
cpt = []
for idx in range(self._dimension - 1):
cpt.append(float(cptw[idx] / cptw[-1]))

# Return associated control points
if get_ctrlpts:
return cpt, ctrlpts
return cpt

# Evaluates the rational curve derivative
Expand Down Expand Up @@ -370,7 +364,6 @@ def surfpt(self, u=-1, v=-1, **kwargs):
:rtype: list
"""
check_vars = kwargs.get('check_vars', True)
get_ctrlpts = kwargs.get('get_ctrlpts', False)

if check_vars:
# Check all parameters are set before the surface evaluation
Expand All @@ -394,16 +387,11 @@ def surfpt(self, u=-1, v=-1, **kwargs):
idx_v = span_v - self._degree_v + l
for k in range(0, self._degree_u + 1):
temp[:] = [tmp + (basis_u[k] * cp) for tmp, cp in zip(temp, self._control_points2D[idx_u + k][idx_v])]
if get_ctrlpts:
ctrlpts.append(self._control_points2D[idx_u + k][idx_v])
sptw[:] = [ptw + (basis_v[l] * tmp) for ptw, tmp in zip(sptw, temp)]

# Divide by weight
spt = [float(c / sptw[-1]) for c in sptw[0:(self._dimension - 1)]]

# Return associated control points
if get_ctrlpts:
return spt, ctrlpts
return spt

# Evaluates n-th order rational surface derivatives at the given (u, v) parameter
Expand Down

0 comments on commit 34f1434

Please sign in to comment.