Skip to content

Commit

Permalink
Add deprecation message to Curve2D.convert3d
Browse files Browse the repository at this point in the history
  • Loading branch information
Onur R. Bingol committed Feb 24, 2018
1 parent f2de13d commit 48b2a97
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 28 deletions.
18 changes: 4 additions & 14 deletions geomdl/BSpline.py
Original file line number Diff line number Diff line change
Expand Up @@ -964,23 +964,13 @@ def __str__(self):
def convert3d(self):
""" Converts 2D curve to a 3D curve.
.. deprecated:: 3.5
Use :py:meth:`.add_dimension()`
:return: 3D curve
:rtype: BSpline.Curve
"""
# Modify control points
new_ctrlpts = []
for point in self._control_points:
temp = [point[0], point[1], 0.0]
new_ctrlpts.append(temp)

# Convert to 3D curve
ret_val = Curve()
ret_val.degree = self.degree
ret_val.ctrlpts = new_ctrlpts
ret_val.knotvector = self.knotvector
ret_val.delta = self.delta

return ret_val
return self.add_dimension()


class Surface(Abstract.Surface):
Expand Down
18 changes: 4 additions & 14 deletions geomdl/NURBS.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,23 +242,13 @@ def __str__(self):
def convert3d(self):
""" Converts 2D curve to a 3D curve.
.. deprecated:: 3.5
Use :py:meth:`.add_dimension()`
:return: 3D curve
:rtype: NURBS.Curve
"""
# Modify weighted control points
new_ctrlpts = []
for point in self._control_points:
temp = [point[0], point[1], 0.0, point[2]]
new_ctrlpts.append(temp)

# Convert to 3D curve
ret_val = Curve()
ret_val.degree = self.degree
ret_val.ctrlpts = new_ctrlpts
ret_val.knotvector = self.knotvector
ret_val.delta = self.delta

return ret_val
return self.add_dimension()


class Surface(BSpline.Surface):
Expand Down

0 comments on commit 48b2a97

Please sign in to comment.