From 3e206875f14c6f08fa74b34460d07c185982ac99 Mon Sep 17 00:00:00 2001 From: "Onur R. Bingol" Date: Mon, 4 Sep 2017 20:11:36 -0500 Subject: [PATCH] Add curve and surface order properties --- nurbs/Curve.py | 16 ++++++++++++++++ nurbs/Surface.py | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/nurbs/Curve.py b/nurbs/Curve.py index e29b7893..5c8b2389 100644 --- a/nurbs/Curve.py +++ b/nurbs/Curve.py @@ -55,6 +55,22 @@ def __init__(self): self._mDelta = 0.01 self._mCurvePts = [] + @property + def order(self): + """ Curve order + + Follows the following equality: order = degree + 1 + + :getter: Gets the curve order + :setter: Sets the curve order + :type: integer + """ + return self._mDegree + 1 + + @order.setter + def order(self, value): + self.degree = value - 1 + @property def degree(self): """ Curve degree diff --git a/nurbs/Surface.py b/nurbs/Surface.py index 9652ccdd..485b2b78 100644 --- a/nurbs/Surface.py +++ b/nurbs/Surface.py @@ -64,6 +64,38 @@ def __init__(self): self._mDelta = 0.01 self._mSurfPts = [] + @property + def order_u(self): + """ Surface order for U direction + + Follows the following equality: order = degree + 1 + + :getter: Gets the surface order for U direction + :setter: Sets the surface order for U direction + :type: integer + """ + return self._mDegreeU + 1 + + @order_u.setter + def order_u(self, value): + self.degree_u = value - 1 + + @property + def order_v(self): + """ Surface order for V direction + + Follows the following equality: order = degree + 1 + + :getter: Gets the surface order for V direction + :setter: Sets the surface order for V direction + :type: integer + """ + return self._mDegreeV + 1 + + @order_v.setter + def order_v(self, value): + self.degree_v = value - 1 + @property def degree_u(self): """ Surface degree for U direction