You are here: Start » AVL.NET » AVL.JoinAdjacentPaths

AVL.JoinAdjacentPaths

Joins those paths of an array which endpoints lie near enough.

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax

C++
C#
 
public static void JoinAdjacentPaths
(
	IList<AvlNet.Path> inPaths,
	float inMaxJoiningDistance,
	float inMaxJoiningAngle,
	float inJoiningDistanceBalance,
	float? inJoiningEndingLength,
	float inMinPathLength,
	IList<AvlNet.Path> outPaths
)

Parameters

Name Type Range Default Description
inPathsSystem.Collections.Generic.IList<AvlNet.Path>
inMaxJoiningDistancefloat<0.0f, INF>10.0fMaximal distance between edges that can be joined. Default value: 10.0f.
inMaxJoiningAnglefloat<0.0f, 180.0f>30.0fMaximal allowed angle between edges being joined. Default value: 30.0f.
inJoiningDistanceBalancefloat<0.0f, 1.0f>1.0fDetermines how important distance between paths is according to their angle difference. Default value: 1.0f.
inJoiningEndingLengthfloat?<0.0f, INF>0.0fDetermines the length of the path end used for path angle computing. Default value: 0.0f.
inMinPathLengthfloat<0.0f, INF>0.0fMinimal length of a path. Default value: 0.0f.
outPathsSystem.Collections.Generic.IList<AvlNet.Path>

Description

The operation repeatedly connects the least distant pair of endpoints of open paths of an array until no such pair can be connected. An endpoint can be joined with another one in its vicinity only if the distance between them is not greater than inMaxJoiningDistance and neither of them forms an angle greater than inMaxJoiningAngle with the segment connecting them. The inJoiningEndingLength parameter determines what part of the path ending is used to determine above mentioned turn angle. If it is set to Nil, the whole path is decisive. Sometimes two or more path endings can be joined with an ending. Because only one of them can be, each of the candidates is evaluated based on the distance from the fixed path's ending and the turn angle associated with their connection. The greater inJoiningDistanceBalance is, the less influence on the evaluation score the latter value has. After the joining phase, paths that are shorter than inMinPathLength are removed from the final results.

Examples

JoinAdjacentPaths run on the sample path array with inMaxJoiningDistance = 25.

JoinAdjacentPaths run on the sample path array with inMaxJoiningDistance = 1000.

Function Overrides

See also