Bowyer-Watson algorithm: how to fill “holes” left by removing triangles with super triangle vertices

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-30 14:14:39
Macinho

I encountered the same problem when i was implementing Bowyer-Watson algorithm described here: http://paulbourke.net/papers/triangulate/. I couldn't find anything helpful on internet and even asked at my university, but with no result. After a while I came up with a solution. I started with discovery that for the problem to disappear, the vertices of bounding triangle should ideally lie at infinity, which is not practical. So what does triangles circumcircle look like if triangle has one or two vertices at infinity? It is just line going through the other points. So testing if point lies in triangles circumcircle changes to testing if point lies left or right of line.

Algorithm then looks like this:

  1. Check if any of triangles vertices lies at infinity. In other words: check if triangle is sharing some vertices with bounding triangle.

  2. If it's sharing all three vertices: trivial.

  3. If it's sharing zero vertices: classical approach - check if distance from point to circumcenter is shorter than circumradius.

  4. If it's sharing one vertex: check if point lies to the left/right of line defined by the other two vertices. one vertex in infinity

  5. If it's sharing two vertices: check if point lies to the left/right of line defined by these two vertices but shifted to the third point. In other words: you take only the slope vector from line between these shared vertices and shift it so that the line passes through the third point. two vertices in infinity

Testing whether point lies to the left or right of line depends on your triangles winding order.

It seems you have a solution for your problem but it's also possible to check if the circumcenter of the triangle is outside the supertriangle. You can use a point-in-polygon test. Maybe it can guarantee that there are not missing triangles.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!