Spline Curve <SplineCurve>

Synopsis

This design is used to create a general curve, who's shape is defined by the points it passes through and optionally points used to modify its curvature. The curve is always G1 continuous from start to end, and can be periodic, with either G0 or G1 continuity at the start.

Mixins

CurveMixin

InkStrokedMixin

Canonicals

Name Type Description
pointList list List of points that the curve must pass through.

Parameters

Name Type Description
periodic? boolean Determines whether the curve is closed or not and its continuity. If the first and last points are coincident and periodic? is False then a closed curve is created with G0 continuity at the start point. If the first and last points are not coincident and periodic? is False, then an open curve is created. If the first and last points are coincident and periodic? is True then a closed curve with G1 continuity will be created.
startTangent any Start direction of the curve. The input is ignored if periodic?: is True. By default the start direction is the vector from the first point in pointList to the second point in pointList. Can be either a Vector or Natural, which is the default.
endTangent any Direction at the end of the curve. The input is ignored if periodic?: is True. By default the end direction is the vector from the second to last point in pointList to the last point in pointList. Can be either a Vector or Natural, which is the default.
knots list This is a list of points used to control the curvature of the spline curve. If periodic?: is True, then this must be a list of length equal to the length of pointList: plus 1. The last knot point is discarded if the last point in pointList is coincident with the first point in pointList. If periodic?: is False, knots: must be a list of length equal to the length of pointList. If this parameter is not supplied, then knots: will be derived from the accumulated chord length along the spline.

Rules

Name Type Description
endPoint point End point of the spline. This is always the last point in the pointList parameter.
startPoint point Start point of the spline. This is always the first point in the pointList parameter.

Example 1

Name: splineCurve
Design: acDrawingDocument
Name Type Formula
pointList list

{point(0,0,0), point(1,4,0),

point(2,0,0), point(3,-4,0),

point(4,0,0)}

Child Name: curve
Child Design: splineCurve
Name Type Supplied
pointList list pointList
color string olive green"
Child Name: pt
Child Design: point
Child List?
Name Type Supplied
origin point nth(child:index:, pointList:)
color string "navy blue"
quantity integer length(pointList:)

Example 2

Name: splineCurve_Ex02
Design: acDrawingDocument
Name Type Formula
pointList list

{point(0,0,0), point(1,4,0),

point(2,0,0), point(3,-4,0),

point(4,0,0)}

Child Name: curve
Child Design: splineCurve
Name Type Supplied
pointList list pointList
startTangent vector vector(1, 0, 0)
endTangent vector vector(1, 0, 0)
color string olive green"
Child Name: pt
Child Design: point
Child List?
Name Type Supplied
origin point nth(child:index:, pointList:)
color string "navy blue"
quantity integer length(pointList:)

Example 3

Name: splineCurve_Ex03
Design: acDrawingDocument
Name Type Formula
pointList list

Dim j As Integer

Dim result As List = {}

For j = 0 To 23

Dim origin As Point = Point(0, 0, j/6)

Dim angle As Number = j * 360 / 6

Dim vect As RotateVector(Vector(1, 0, 0), angle, Vector(0, 0, 1)

result = result + {origin + vect * 1}

Next j

Return result

Child Name: curve
Child Design: splineCurve
Name Type Supplied
pointList list pointList
color string olive green"
Child Name: pt
Child Design: point
Child List?
Name Type Supplied
origin point nth(child:index:, pointList:)
color string "navy blue"
quantity integer length(pointList:)