5,286,006 members and growing! (20,286 online)
Email Password   helpLost your password?
General Programming » Algorithms & Recipes » Computational Geometry     Intermediate

Polygon Triangulation

By _qqq_

An article on sample code for triangulation of complex polygons.
VC6, VC7.1, C++, WindowsVS, VS.NET2003, VS6, Dev

Posted: 1 Sep 2004
Updated: 29 Jul 2005
Views: 86,273
Announcements
Want a new Job?



Search    
Advanced Search
Sitemap
26 votes for this Article.
Popularity: 5.71 Rating: 4.04 out of 5
5 votes, 19.2%
1
0 votes, 0.0%
2
0 votes, 0.0%
3
6 votes, 23.1%
4
15 votes, 57.7%
5

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

About the Author

_qqq_



Occupation: Researcher
Location: Poland Poland

Other popular Algorithms & Recipes articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 25 of 44 (Total in Forum: 44) (Refresh)FirstPrevNext
Subject  Author Date 
GeneralAnother uninitialized variablememberultimatenexus0:48 24 Apr '08  
GeneralIt doesent work "out of the box"?memberThrored4:41 29 Jan '08  
GeneralCompile Errors (GCC 4.1.1)memberpmacko13:31 25 Sep '07  
Generali am just a biginermemberpushn8:11 10 Jul '07  
QuestionCompile Errors VS2005 [modified]memberarkuhl18:43 23 Apr '07  
AnswerRe: Compile Errors VS2005member_qqq_22:28 24 Apr '07  
GeneralRe: Compile Errors VS2005 : A solutionmemberDevRX10:33 30 Jul '07  
AnswerRe: Compile Errors VS2005memberDevGisRX10:36 30 Jul '07  
General3d fragmentationmemberShokker123:32 11 Jan '07  
GeneralRe: 3d fragmentationmember_qqq_4:13 11 Jan '07  
Questionhow to insert one point ?membere_ilite17:09 19 Dec '06  
AnswerRe: how to insert one point ?member_qqq_4:10 11 Jan '07  
GeneralErrors in vect.hmemberaunghtet7:00 3 Aug '06  
GeneralCo-linear line segmentsmemberJon Evans23:48 27 Jul '05  
GeneralNice code :).. to bad it's GPL.sussAnonymous5:14 13 Jun '05  
GeneralRe: Nice code :).. to bad it's GPL.membertsohg11:43 15 Jun '05  
GeneralRe: Nice code :).. to bad it's GPL.member_qqq_0:09 4 Jul '05  
GeneralRe: Nice code :).. to bad it's GPL.sussDuduff7:44 27 Jul '05  
GeneralRe: Nice code :).. to bad it's GPL.memberArmel Asselin23:51 2 Aug '05  
GeneralRe: Nice code :).. to bad it's GPL.memberitouh21:26 4 Aug '05  
GeneralRe: Nice code :).. to bad it's GPL.memberandrzej.bol1:56 25 Mar '07  
GeneralRe: Nice code :).. to bad it's GPL.memberdoojoo17:27 13 Sep '07  
GeneralRe: Nice code :).. to bad it's GPL.memberLeonnik10:15 24 Oct '07  
GeneralRe: Nice code :).. to bad it's GPL.memberAlbertino8:29 12 May '08  
GeneralPractical usememberStas Desyatnikov2:52 12 May '05  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 29 Jul 2005
Editor: Smitha Vijayan
Copyright 2004 by _qqq_
Everything else Copyright © CodeProject, 1999-2008
Web15 | Advertise on the Code Project