Detecting Valid Partitions
Two algorithms are used to determine whether a group of three vertices can form a valid internal triangle. The first algorithm is fast and can quickly cull partitions that lie entirely outside of the polygon. If the partition is inside the polygon a more expensive algorithm is used to make sure it doesn't intersect any existing polygon edges.
两个算法用来实现这一点:
第一个算法简单,并且可以很快地排除掉完全在多边形外边的分割。
第二个算法是用来确保在多边形内部的分割不会与其它已经存在的多边形的边相交。
The Internal Angle Algorithm
如图:AB是要检测的潜在分割
Cast two rays out along the edges connected to vertex A. The interior angle is the angle in the direction of the polygon. If the partition endpoint (vertex B) is within the interior angle, then it is a potential valid partition.
找到点A所连