NurbsCurve ========== .. py:module:: rhino3dm .. py:class:: NurbsCurve .. py:method:: NurbsCurve(degree, pointCount) Constructs a new NURBS curve with a specific degree and control point count. :param int degree: Degree of curve. Must be equal to or larger than 1 and smaller than or equal to 11. :param int pointCount: Number of control-points. .. py:method:: NurbsCurve(dimension, rational, order, pointCount) Constructs a new NURBS curve with knot and CV memory allocated. :param int dimension: >=1. :param bool rational: True to make a rational NURBS. :param int order: (>= 2) The order=degree+1. :param int pointCount: (>= order) number of control vertices. .. py:attribute:: Order int: Gets the order of the curve. Order = Degree + 1. .. py:attribute:: IsRational bool: Gets a value indicating whether or not the curve is rational. Rational curves have control-points with custom weights. .. py:attribute:: HasBezierSpans bool: Returns True if the NURBS curve has Bezier spans (all distinct knots have multiplicity = degree) .. py:attribute:: Points Collections.NurbsCurvePointList: Gets access to the control points of this NURBS curve. .. py:attribute:: Knots Collections.NurbsCurveKnotList: Gets access to the knots (or "knot vector") of this NURBS curve. .. py:staticmethod:: CreateFromLine(line) Gets a non-rational, degree 1 NURBS curve representation of the line. :return: Curve on success, None on failure. :rtype: rhino3dm.NurbsCurve .. py:staticmethod:: CreateFromArc(arc) Gets a rational degree 2 NURBS curve representation of the arc. Note that the parameterization of NURBS curve does not match arc's transcendental parameterization. :return: Curve on success, None on failure. :rtype: rhino3dm.NurbsCurve .. py:staticmethod:: CreateFromCircle(circle) Gets a rational degree 2 NURBS curve representation of the circle. Note that the parameterization of NURBS curve does not match circle's transcendental parameterization. Use GetRadianFromNurbFormParameter() and GetParameterFromRadian() to convert between the NURBS curve parameter and the transcendental parameter. :return: Curve on success, None on failure. :rtype: rhino3dm.NurbsCurve .. py:staticmethod:: CreateFromEllipse(ellipse) Gets a rational degree 2 NURBS curve representation of the ellipse. Note that the parameterization of the NURBS curve does not match with the transcendental parameterization of the ellipsis. :return: A NURBS curve representation of this ellipse or None if no such representation could be made. :rtype: rhino3dm.NurbsCurve .. py:staticmethod:: Create(periodic, degree, points) Constructs a 3D NURBS curve from a list of control points. :param bool periodic: If true, create a periodic uniform curve. If false, create a clamped uniform curve. :param int degree: (>=1) degree=order-1. :param System.Collections.Generic.IEnumerable points: control vertex locations. :return: new NURBS curve on success \ None on error. :rtype: rhino3dm.NurbsCurve .. py:method:: IncreaseDegree(desiredDegree) Increase the degree of this curve. :param int desiredDegree: The desired degree. \ Degrees should be number between and including 1 and 11. :return: True on success, False on failure. :rtype: bool .. py:method:: MakePiecewiseBezier(setEndWeightsToOne) Clamps ends and adds knots so the NURBS curve has Bezier spans (all distinct knots have multiplicity = degree). :param bool setEndWeightsToOne: If True and the first or last weight is not one, then the first and \ last spans are re-parameterized so that the end weights are one. :return: True on success, False on failure. :rtype: bool .. py:method:: Reparameterize(c) Use a linear fractional transformation to re-parameterize the NURBS curve. This does not change the curve's domain. :param float c: re-parameterization constant (generally speaking, c should be > 0). The \ control points and knots are adjusted so that \ output_nurbs(t) = input_nurbs(lambda(t)), where lambda(t) = c*t/( (c-1)*t + 1 ). \ Note that lambda(0) = 0, lambda(1) = 1, lambda'(t) > 0, \ lambda'(0) = c and lambda'(1) = 1/c. :return: True if successful. :rtype: bool .. py:method:: GrevilleParameter(index) Gets the greville (edit point) parameter that belongs to the control point at the specified index. :param int index: Index of Greville (Edit) point. :rtype: float .. py:method:: GrevillePoint(index) Gets the Greville parameter that belongs to the control point at the specified index. :param int index: Index of Greville point. :rtype: rhino3dm.Point3d .. py:method:: ConvertSpanToBezier(index) Converts a span of the NURBS curve into a Bezier. :param int spanIndex: The span index, where (0 <= spanIndex <= Points.Count - Order). :return: Bezier curve if successful, None otherwise. :rtype: rhino3dm.BezierCurve