Method GetInsertIndex
GetInsertIndex(List<Vector3>, Vector3)
Finds the insertion index that best preserves the current polygon order for a new anchor.
public static int GetInsertIndex(List<Vector3> anchors, Vector3 newAnchor)
Parameters
anchorsList<Vector3>Existing ordered anchor loop.
newAnchorVector3Anchor to insert.
Returns
- int
The index before which the new anchor should be inserted, or
-1when there are not enough anchors to define a segment.
Remarks
The method compares the new point against the midpoint of every polygon edge, including the closing edge from the last anchor back to the first.