Skip to content

Commit

Permalink
Remove curve2d.full_circle2 #2
Browse files Browse the repository at this point in the history
  • Loading branch information
Onur Rauf Bingol committed Jan 17, 2020
1 parent 37a99a8 commit 8409b6f
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions geomdl/shapes/curve2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,41 +47,3 @@ def full_circle(radius=1):

# Return the generated curve
return curve


# Generates a NURBS circle from 7 control points
def full_circle2(radius=1):
""" Generates a full NURBS circle from 7 control points.
:param radius: radius of the circle
:type radius: int, float
:return: a NURBS curve
:rtype: NURBS.Curve
"""
if radius <= 0:
raise GeomdlException("Curve radius cannot be less than and equal to zero")

# Control points for a unit circle
control_points = [[1.0, 0.5, 1.0], [0.0, 1.0, 0.5], [-1.0, 0.5, 1.0],
[-1.0, -0.5, 0.5], [0.0, -1.0, 1.0], [1.0, -0.5, 0.5],
[1.0, 0.5, 1.0]]

# Set radius
ctrlpts = []
if radius != 1:
for point in control_points:
npt = [i * radius for i in point[0:2]]
npt.append(point[-1])
ctrlpts.append(npt)
else:
ctrlpts = control_points

# Generate the curve
curve = shortcuts.generate_curve(rational=True)
curve.name = "circle from 7 control points"
curve.degree = 2
curve.ctrlptsw = ctrlpts
curve.knotvector = [0, 0, 0, 0.33, 0.33, 0.66, 0.66, 1, 1, 1]

# Return the generated curve
return curve

0 comments on commit 8409b6f

Please sign in to comment.