如何计算Bowyer-Watson算法中的超三角形环绕点集?

时间:2016-09-07 11:39:07

标签: algorithm triangulation

首先,抱歉我的英语不好。按照我的问题,在Bowyer-Watson算法中,我们必须找到一个超三角形环绕所有点。但是我们如何计算超三角形的3个顶点的协调器(x,y)?任何人都有这个问题吗?非常感谢。

1 个答案:

答案 0 :(得分:0)

我没有这方面的证据,但首先想到的是获得convex hull点数的enter image description here

1. Get the convex hull of the group of points.
2. Initialize the variable smallest = infinity.
3. For each point P in convex hull do the following:
       Find the point farthest away from P call it Q.
       Set N1 = point to the left of P (counter-clockwise along convex hull).  
           N2 = point to the right of P (clockwise along convex hull).
           L1 = line that intersects Q and is perpendicular to the line PQ.
           L2 = line that intersects P and N1.
           L3 = line that intersects P and N2.
           A = area of the triangle thats formed by the intersections of L1,L2,L3.
       If A < smallest, then set smallest = A.
4. Return smallest

这当然会返回一个不太有用的数字,所以你可以做一些像创建三角形类的东西

class Triangle{
    Point p1;
    Point p2;
    Point p3;
    double Area;
    //etc...
}

并将smallest改为喜欢triangle.area或类似内容,以便最终跟踪这些点。