Polarith AI
1.8

◆ GetNearestEdge() [2/2]

static int GetNearestEdge ( IList< Vector3 >  polygon,
Vector3  point,
int  startEdgeIndex = 0 
)
static

Computes the edge of the given polygon which is nearest to the given point .

The edges are obtained by the collection of points called polygon . It is assumed that the path points are sorted.

Parameters
polygonSorted list of polygon points.
pointPoint relative to the path
startEdgeIndexDetermines the edge index where to start the algorithm (optional).
Returns
Index of the edge nearest to the given point .
Imprint