任意多边形三角化

                 任意多边形三角化

                            -----by  wangsh

 

 

     

转载自:

http://www.codeproject.com/Articles/8160/Polygon-Triangulation

Polygon Triangulation

By _qqq_ | 29 Jul 2005

 

 

 

Introduction

HGRD is a code for triangulation of a polygon with or without holes. It can triangulate and also deal with many disconnected polygons treated as a single one (see figure with the triangulation of Norway border line). The algorithm is based on Delaunay triangulation. One of the main problems was to keep complexity order as low as possible (N log N) so tree structures (i.e., STL map) are used in critical parts. Thanks to this, it was possible to triangulate a complex polygon with around 40000 nodes within 6s (Athlon 1.4GHz DDR 266).

 

Using the code

The class HPolygon encapsulates functionality of a class HGrd which is responsible for triangulation.HPolygon provides also simple import and output of data (the syntax of input and output files are described inside 'readme' attached to the zip file with the code). Hopefully, this should make usage of the triangulator quite easily especially if you want to build the code into your application.

The demo is a console application which takes as arguments the names of input and output files. The output file can be used in Amtec Tecplot visualization software (not so readily available) but can be easily transformed to other formats.

Any feedback will be highly appreciated.

History

  • July 28, 2005: I have decided to release the hgrd under GNU Lesser General Public License.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

 

 

 

 

 

 

 

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值