You are here: Start » AVL.NET » AVL.SegmentPath(AvlNet.Path, float, float, AvlNet.PathSegmentationMode, float?, AvlNet.Path[], AvlNet.Path[], AvlNet.Segment2D[], AvlNet.Arc2D[])

AVL.SegmentPath(AvlNet.Path, float, float, AvlNet.PathSegmentationMode, float?, AvlNet.Path[], AvlNet.Path[], AvlNet.Segment2D[], AvlNet.Arc2D[])

Splits a path into parts that can be approximated as segments or arcs.

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax


public static void SegmentPath(
	AvlNet.Path inPath,
	float inSmoothingStdDev,
	float inMaxDeviation,
	AvlNet.PathSegmentationMode inSegmentationMode,
	float? inMaxArcRadius,
	out AvlNet.Path[] outStraight,
	out AvlNet.Path[] outArciform,
	out AvlNet.Segment2D[] outSegments,
	out AvlNet.Arc2D[] outArcs
)

Parameters

inPath
Type: AvlNet.Path
Path to be segmented
inSmoothingStdDev
Type: System.Single
Standard deviation used for initial gaussian smoothing of the segmented path
inMaxDeviation
Type: System.Single
Maximal distance between any point of a classified segment to the abstract shape
inSegmentationMode
Type: AvlNet.PathSegmentationMode
Whether to use arcs for segmentation
inMaxArcRadius
Type: System.Nullable<System.Single>
Maximal radius of an arc fitted to segment, or null.
outStraight
Type: AvlNet.Path
Parts classified as straight segments
outArciform
Type: AvlNet.Path
Parts classified as arciform segments
outSegments
Type: AvlNet.Segment2D
Segments corresponding to sections of path from outStraight
outArcs
Type: AvlNet.Arc2D
Arcs corresponding to sections of path from outArciform

Description

The operation segments the inPath into parts of preferably simple shape. Each of the resulting parts is classified as one of the following:

  • Straight section - in which case it is returned in outStraight output array
  • Arciform section - in which case it is returned in outArciform output array

The operation guarantees that the maximal distance from any of the resulting path section to the corresponding abstract shape (line segment or circular arc) is less than inMaxDeviation.

Examples

The resulting outStraight array (some of the paths in the picture have common ends but in fact each straight part is a separate path).

The resulting outArciform array.

Errors

Error type Description
DomainError Empty input path in SegmentPath

See also