You are here: Start » AVL.NET » AVL.DetectPointSegments Method

AVL.DetectPointSegments Method

Detect points that lie along multiple segments.

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax

public static void DetectPointSegments(
	AvlNet.Point2D[] inPoints,
	float inMaxDistance,
	int inMaxRank,
	float? inMaxRelativeDistance,
	float inMaxTurnAngle,
	int inMinPointCount,
	out AvlNet.Segment2D[] outPointSegments,
	out AvlNet.Path[] outPaths
)

Parameters

Name Type Range Default Description
inPointsAvlNet.Point2DPoints to connect.
inMaxDistancefloat<0.0f, INF>10.0fMaximum distance between connected points. Default value: 10.0f.
inMaxRankint<1, INF>4Maximum number of neighbour candidates considered when joining points. Default value: 4.
inMaxRelativeDistancefloat?<1.0f, INF>2.0fMaximum distance in relation to the shortest distance for a point. Default value: 2.0f, or null.
inMaxTurnAnglefloat<0.0f, 90.0f>5.0fMaximum angle between consecutive path segments. Default value: 5.0f.
inMinPointCountint<2, INF>3Minimum number of points in one path. Default value: 3.
outPointSegmentsAvlNet.Segment2DSegments connecting first and last point of each path.
outPathsAvlNet.PathPaths of connected points.

Description

Use this filter to detect multiple segments or paths at the same time.

Set inMaxDistance to smaller value to avoid connecting distant points.
Set inMaxRank to larger value to allow detecting paths that lie close to each other.
Set inMaxTurnAngle to larger value when points do not lie precisely on a segment.
Set inMinPointCount to filter out too short paths (useful when some of the input points are noise).

Filter returns array of paths as well as segments connecting first and last point of each path.

Examples

Results for input parameters: inMaxDistance = 30, inMaxRank = 4, inMaxTurnAngle = 20, inMinPointCount = 4.

The resulting outPointSegments drawn with the input points.

The resulting outPaths drawn with the input points.

See also