Click or drag to resize
DigitalRuneBSplineSegment2FFlatten Method
Computes the points of a sequence of line segments which approximate the curve.

Namespace: DigitalRune.Mathematics.Interpolation
Assembly: DigitalRune.Mathematics (in DigitalRune.Mathematics.dll) Version: 1.14.0.0 (1.14.0.14427)
Syntax
public void Flatten(
	ICollection<Vector2F> points,
	int maxNumberOfIterations,
	float tolerance
)

Parameters

points
Type: System.Collections.GenericICollectionVector2F
A collection to which all points of the line segments are added. See remarks.
maxNumberOfIterations
Type: SystemInt32
The maximum number of iterations which are taken to compute the approximation.
tolerance
Type: SystemSingle
The tolerance value. The absolute error of the approximated polygon will be less than this tolerance.

Implements

ICurveTParam, TPointFlatten(ICollectionTPoint, Int32, TParam)
Exceptions
ExceptionCondition
ArgumentOutOfRangeExceptiontolerance is 0 or less than 0.
Remarks

This method computes a sequence of line segments which approximates the curve. For each line segment, the start and end point are added to points. For example, if a curve is approximated with two line segments (A, B) and (B, C) where A, B, C are three key points, then following points will be added to collection: A, B, B, C. This means, that duplicate points are added to the collection. The advantage of this is that the approximation can represent "gaps" in the curve. And it is easy to flatten several curves into the same points collection.

For some curves the approximation is computed with an iterative algorithm. The iterations end when the maxNumberOfIterations were performed, or when the tolerance criterion is met - whichever comes first.

See Also