NurbsCurve

class rhino3dm.NurbsCurve
NurbsCurve(degree, pointCount)

Constructs a new NURBS curve with a specific degree and control point count.

Parameters:
  • degree (int) – Degree of curve. Must be equal to or larger than 1 and smaller than or equal to 11.

  • pointCount (int) – Number of control-points.

NurbsCurve(dimension, rational, order, pointCount)

Constructs a new NURBS curve with knot and CV memory allocated.

Parameters:
  • dimension (int) – >=1.

  • rational (bool) – True to make a rational NURBS.

  • order (int) – (>= 2) The order=degree+1.

  • pointCount (int) – (>= order) number of control vertices.

Order

int: Gets the order of the curve. Order = Degree + 1.

IsRational

bool: Gets a value indicating whether or not the curve is rational. Rational curves have control-points with custom weights.

HasBezierSpans

bool: Returns True if the NURBS curve has Bezier spans (all distinct knots have multiplicity = degree)

Points

Collections.NurbsCurvePointList: Gets access to the control points of this NURBS curve.

Knots

Collections.NurbsCurveKnotList: Gets access to the knots (or “knot vector”) of this NURBS curve.

static CreateFromLine(line)

Gets a non-rational, degree 1 NURBS curve representation of the line.

Returns:

Curve on success, None on failure.

Return type:

rhino3dm.NurbsCurve

static 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.

Returns:

Curve on success, None on failure.

Return type:

rhino3dm.NurbsCurve

static 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.

Returns:

Curve on success, None on failure.

Return type:

rhino3dm.NurbsCurve

static 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.

Returns:

A NURBS curve representation of this ellipse or None if no such representation could be made.

Return type:

rhino3dm.NurbsCurve

static Create(periodic, degree, points)

Constructs a 3D NURBS curve from a list of control points.

Parameters:
  • periodic (bool) – If true, create a periodic uniform curve. If false, create a clamped uniform curve.

  • degree (int) – (>=1) degree=order-1.

  • points (System.Collections.Generic.IEnumerable<Point3d>) – control vertex locations.

Returns:

new NURBS curve on success None on error.

Return type:

rhino3dm.NurbsCurve

IncreaseDegree(desiredDegree)

Increase the degree of this curve.

Parameters:

desiredDegree (int) – The desired degree. Degrees should be number between and including 1 and 11.

Returns:

True on success, False on failure.

Return type:

bool

MakePiecewiseBezier(setEndWeightsToOne)

Clamps ends and adds knots so the NURBS curve has Bezier spans (all distinct knots have multiplicity = degree).

Parameters:

setEndWeightsToOne (bool) – 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.

Returns:

True on success, False on failure.

Return type:

bool

Reparameterize(c)

Use a linear fractional transformation to re-parameterize the NURBS curve. This does not change the curve’s domain.

Parameters:

c (float) – 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.

Returns:

True if successful.

Return type:

bool

GrevilleParameter(index)

Gets the greville (edit point) parameter that belongs to the control point at the specified index.

Parameters:

index (int) – Index of Greville (Edit) point.

Return type:

float

GrevillePoint(index)

Gets the Greville parameter that belongs to the control point at the specified index.

Parameters:

index (int) – Index of Greville point.

Return type:

rhino3dm.Point3d

ConvertSpanToBezier(index)

Converts a span of the NURBS curve into a Bezier.

Parameters:

spanIndex (int) – The span index, where (0 <= spanIndex <= Points.Count - Order).

Returns:

Bezier curve if successful, None otherwise.

Return type:

rhino3dm.BezierCurve