Table of Contents

Method Rebuild

Namespace
GeometryHelper.Dxf
Assembly
GeometryHelper.dll

Rebuild(int, int)

Gives the spline another degree and count of control points that run as near the curve as they can, as AutoCAD's Rebuild: the spline of least squares through points of the curve taken at even steps of its parameter (ten for each control point and at least 200), each fitted at its own parameter, so that the ends are where they were and the domain the same; not rational, its fit data taken out. A cubic 13 long of 5 points with an inner knot at 0.49, rebuilt as a cubic of 20 points, keeps within 0.003 of the old curve. The least squares are solved over the band of their equations, a point of the curve lying under degree + 1 control points: a spline of 1 000 spans is rebuilt of 5 000 points in 0.05 s.

public void Rebuild(int degree, int numCtrlPts)

Parameters

degree int

The degree, from 1 to 10.

numCtrlPts int

The count of control points, the degree and one at least.

Exceptions

ArgumentOutOfRangeException

Thrown when the degree is outside 1 to 10, or the count below the degree and one.

InvalidOperationException

Thrown when the spline has no data that make a spline, or is erased.