| StrokedSegmentTParam, TPointFlatten Method |
Computes the points of a sequence of line segments which approximate the curve.
Namespace: DigitalRune.GraphicsAssembly: DigitalRune.Graphics (in DigitalRune.Graphics.dll) Version: 1.2.0.0 (1.2.1.14562)
Syntax public void Flatten(
ICollection<TPoint> points,
int maxNumberOfIterations,
TParam tolerance
)
Public Sub Flatten (
points As ICollection(Of TPoint),
maxNumberOfIterations As Integer,
tolerance As TParam
)
public:
virtual void Flatten(
ICollection<TPoint>^ points,
int maxNumberOfIterations,
TParam tolerance
) sealed
abstract Flatten :
points : ICollection<'TPoint> *
maxNumberOfIterations : int *
tolerance : 'TParam -> unit
override Flatten :
points : ICollection<'TPoint> *
maxNumberOfIterations : int *
tolerance : 'TParam -> unit
Parameters
- points
- Type: System.Collections.GenericICollectionTPoint
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: TParam
The tolerance value. The absolute error of the approximated polygon will be less than this
tolerance.
Implements
ICurveTParam, TPointFlatten(ICollectionTPoint, Int32, TParam)Exceptions 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