日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Poly2Tri介绍

發布時間:2024/3/12 编程问答 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Poly2Tri介绍 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

這是Poly2Tri介紹的翻譯博文。
原文鏈接:http://sites-final.uclouvain.be/mema/Poly2Tri/poly2tri.html

引言

三角化算法一直是** 計算幾何(computational geometry)** 方向的研究熱點。
前人研究發展如下表所示:

圖片來源:http://www-cgrl.cs.mcgill.ca/~godfried/teaching/cg-projects/97/Thierry/thierry507webprj/complexity.html

前人對三角化算法總結鏈接:http://vterrain.org/Implementation/Libs/triangulate.html

計算幾何領域通常認定三種最常用的算法:
  • Recursive Ear Cutting algorithm,由ElGindy, Everett and Toussaint提供[1]
  • Sweep Line algorithm,由 Garey等提供[2]
  • Incremental Randomized Algorithm,由Sediel[3]和Amato[4]提供
  • 三種算法比較:
    • recursive ear cutting algorithm最容易實現,但是性能最糟,并且難以擴展到存在洞的多邊形情況
    • incremental randomized algorith性能可能是最好的,但是難以實現
    • sweep line algorithm相對來說,性能中和,使用更為廣泛

    Sweep Line Algorithm

    Mark de Berg, Marc van Kreveld, Mark Overmars, and Otfried Schwarzkopf and J. O’Rourke 等人總結了Sweep Line Algorithm,詳見引用[5] [6]

    Sweep Line Algorithm基本策略:
  • 將多變形分割成按照y方向單調排序(y-monotone)小多邊形,時間復雜度為O(nlog(n))
  • 再三角化這些頂點,時間復雜度是線性的
  • 為了將多變形單調化(monotone),需要將多變形頂點分成5種類型:開始頂點(start vertex)、結束頂點(end vertex)、分割頂點(split vertex)、合并頂點(merge vertex)、規則頂點(regular vertex)。原文作者為了容易實現這個算法,又將規則頂點分為規則向下的頂點(regular down)和規則向上的頂點(regular up),如下圖1.a所示。作者對此種分法的解釋如下:多變形頂點順時針組織,洞的方向也是順時針,內部的多變形肯定位于外部多邊形規則向上的點的左邊,而位于規則向下的點的右邊,這樣約定,在實現中對一些判斷不需要額外的計算和存儲。

    A polygon can be partitioned to monontone pieces by getting rid of its split or merge vertices (adding diagonals). When a diagonal is inserted, an auxliary diagonal is inserted at the same time on the opposite direction for monotone piece searching purpose (all monotone pieces can be easily constructed by these auxiliary diagonals since each diagonal is always shared by two adjacent monontone pieces), see Figure 1.b. Specificly, for each split vertex vi, a diagonal is inserted to the lowest vertex above it. On the contrary, for each merge vertex, a diagonal is inserted to the highest vertex below it. This lowest/highest vertex is often called helper of directly left edge of vi.

    Poly2Tri算法例子


    還有更多的例子,可點擊原文鏈接查看

    引用

  • G. Toussaint, Efficient triangulation of simeple polygons.
  • Garey, et al, Triangulating a simple polygon, Information Processing Letters, vol. 7 no. 4, 1978).
  • R. Seidel, A simple and fast incremental randomized algorithm for computing trapezoidal decompositions and for triangulating polygons. Comput. Geom. Theory Appl., 1(1):51-64, 1991.
  • Nancy M.A., Michael T.G., Edgar, A.R., Linear-time Triangulation of a simple Polygon Made easier Via Randomization, 2000.
  • Mark de Berg, Marc van Kreveld, Mark Overmars, and Otfried Schwarzkopf, Computational Geometry: Algorithms and Applications, 2nd Edition
  • J. O’Rourke, Computational in C, 2nd Edition.
  • 總結

    以上是生活随笔為你收集整理的Poly2Tri介绍的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。