Delaunay triangulating the 2d polygon with holes

前端 未结 2 1858
逝去的感伤
逝去的感伤 2021-02-13 06:18

I want to triangulate the complex (but not self-intersecting) polygon with holes, so that resulting triangles all lay inside the polygon, cover that polygon completely, and obey

2条回答
  •  旧时难觅i
    2021-02-13 06:32

    Here's one of the methods I came up with when doing navmesh for an RTS game. Note that it is homebrew, no third-party tools were used, it took me about 3 weeks to implement and bugfix:

    1. Feed all points into Delaunay triangulation (to get most uniform triangles)
    2. Check along holes outlines and flip polygon pairs produced by Delaunay to match outlines
    3. Clip holes innards

    Result (plz ignore purple outlines):

    enter image description here

提交回复
热议问题