Table of Contents

Method FromControlPoints

Namespace
GeometryHelper.Geometry
Assembly
GeometryHelper.dll

FromControlPoints(int, IEnumerable<GeoPoint2>)

Builds the clamped spline of a degree whose control points are given, with its knots as evenly spaced as they can be over [0, 1].

public static GeoSpline2 FromControlPoints(int degree, IEnumerable<GeoPoint2> controlPoints)

Parameters

degree int

The degree, from 1 to 25.

controlPoints IEnumerable<GeoPoint2>

The control points, at least degree + 1 and not all one point.

Returns

GeoSpline2

The spline, not rational.

Remarks

Seven control points of degree 3 have the knots 0, 0, 0, 0, 1/4, 1/2, 3/4, 1, 1, 1, 1: the four spans of the curve take a quarter each of the parameter. With degree + 1 points it is the Bézier curve of the points.

Exceptions

ArgumentNullException

Thrown when the control points are null.

ArgumentOutOfRangeException

Thrown when the degree is outside 1 to 25.

ArgumentException

Thrown when there are too few control points, or they are all one point.