From 34f1434a04c30214ebebf050ee496aca9b6b45c3 Mon Sep 17 00:00:00 2001 From: "Onur R. Bingol" Date: Sat, 24 Feb 2018 16:44:17 -0600 Subject: [PATCH] Remove get_ctrlpts option from eval functions --- geomdl/BSpline.py | 12 ------------ geomdl/NURBS.py | 12 ------------ 2 files changed, 24 deletions(-) diff --git a/geomdl/BSpline.py b/geomdl/BSpline.py index e8c72c8c..901f3595 100644 --- a/geomdl/BSpline.py +++ b/geomdl/BSpline.py @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/geomdl/NURBS.py b/geomdl/NURBS.py index 7c688078..73141543 100644 --- a/geomdl/NURBS.py +++ b/geomdl/NURBS.py @@ -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 @@ -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 @@ -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 @@ -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