AddInterpCurve

Adds an interpolated curve object to  the document.  Options exist to make a periodic curve or to specify the tangent at the endpoints.  The resulting curve is a non-rational NURBS curve of the specified degree.

Syntax

rhinoscriptsyntax.AddInterpCurve(points, degree=3, knotstyle=0, start_tangent=None, end_tangent=None)

rhinoscript.curve.AddInterpCurve(points, degree=3, knotstyle=0, start_tangent=None, end_tangent=None)

Parameters

points

Required.  A list containing 3-D points to interpolate.  For periodic curves, if the final point is a duplicate of the initial point, it is ignored. Note, the number of control points must be >= (intDegree+1).

degree

Optional.  Number.  The degree of the curve.  If omitted, degree = 3 is used.  The degree of the curve must be >=1.  Periodic curves must have a degree >= 2.  For intKnotStyle = 1 or 2, the degree must be 3.  For intKnotStyle = 4 or 5, the degree must be odd.

knotstyle

Optional.  Number. The knot style to use, and whether the curve should be periodic.  If omitted, uniform knots (0) are created.

Value

Description

0

Uniform knots.  Parameter spacing between consecutive knots is 1.0.

1

Chord length spacing.  Requires dblDegree = 3 with arrCV1 and arrCVn1 specified.

2

Sqrt (chord length).  Requires dblDegree = 3 with arrCV1 and arrCVn1 specified.

3

Periodic with uniform spacing.

4

Periodic with chord length spacing.  Requires an odd degree value.

5

Periodic with sqrt (chord length) spacing.  Requires an odd degree value.

start_tangent, end_tangent

Optional.  3D Vectors that specify tangency conditions at the ends of the curve.

Returns

Guid

The identifier of the new object if successful.

None

If not successful, or on error.

Example

import rhinoscriptsyntax as rs

points = (0,0,0), (1,1,0), (2,0,0), (3,1,0), (4,0,0), (5,1,0)

rs.AddInterpCurve(points)

Also See

AddCurve

CurvePointCount

IsCurve