Skip to content

Commit 458989f

Browse files
committed
Fixed bug in degree elevation algorithm
1 parent 759cd47 commit 458989f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

aerocaps/geom/curves.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,12 +324,11 @@ class Bezier2D(PCurve2D):
324324

325325
def __init__(self, control_points: typing.List[Point2D]):
326326
self.control_points = control_points
327-
self._degree = None
328327
self.curve_connections = []
329328

330329
@property
331330
def degree(self):
332-
return self._degree
331+
return len(self.control_points) - 1
333332

334333
@degree.setter
335334
def degree(self, value):
@@ -606,12 +605,11 @@ class Bezier3D(PCurve3D):
606605

607606
def __init__(self, control_points: typing.List[Point3D]):
608607
self.control_points = control_points
609-
self._degree = None
610608
self.curve_connections = []
611609

612610
@property
613611
def degree(self):
614-
return self._degree
612+
return len(self.control_points) - 1
615613

616614
@degree.setter
617615
def degree(self, value):

0 commit comments

Comments
 (0)