Click here to Skip to main content
6,633,937 members and growing! (20,248 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, WindowsVS.NET2003, Dev
Posted:1 Sep 2004
Updated:29 Jul 2005
Views:112,172
Bookmarked:65 times
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
27 votes for this article.
Popularity: 5.70 Rating: 3.98 out of 5
6 votes, 22.2%
1

2

3
6 votes, 22.2%
4
15 votes, 55.6%
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_


Member

Occupation: Researcher
Location: Poland Poland

Other popular Algorithms & Recipes articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 25 of 46 (Total in Forum: 46) (Refresh)FirstPrevNext
GeneralVC2008 Compiler Errors PinmemberMeriInssi1:17 17 Aug '09  
GeneralAnother uninitialized variable Pinmemberultimatenexus0:48 24 Apr '08  
GeneralIt doesent work "out of the box"? PinmemberThrored4:41 29 Jan '08  
GeneralCompile Errors (GCC 4.1.1) Pinmemberpmacko13:31 25 Sep '07  
GeneralRe: Compile Errors (GCC 4.1.1) Pinmembercodecack5:56 7 Nov '09  
Generali am just a biginer Pinmemberpushn8:11 10 Jul '07  
QuestionCompile Errors VS2005 [modified] Pinmemberarkuhl18:43 23 Apr '07  
AnswerRe: Compile Errors VS2005 Pinmember_qqq_22:28 24 Apr '07  
GeneralRe: Compile Errors VS2005 : A solution PinmemberDevRX10:33 30 Jul '07  
AnswerRe: Compile Errors VS2005 PinmemberDevGisRX10:36 30 Jul '07  
General3d fragmentation PinmemberShokker123:32 11 Jan '07  
GeneralRe: 3d fragmentation Pinmember_qqq_4:13 11 Jan '07  
Questionhow to insert one point ? Pinmembere_ilite17:09 19 Dec '06  
AnswerRe: how to insert one point ? Pinmember_qqq_4:10 11 Jan '07  
GeneralErrors in vect.h Pinmemberaunghtet7:00 3 Aug '06  
GeneralCo-linear line segments PinmemberJon Evans23:48 27 Jul '05  
GeneralNice code :).. to bad it's GPL. PinsussAnonymous5:14 13 Jun '05  
GeneralRe: Nice code :).. to bad it's GPL. Pinmembertsohg11:43 15 Jun '05  
GeneralRe: Nice code :).. to bad it's GPL. Pinmember_qqq_0:09 4 Jul '05  
GeneralRe: Nice code :).. to bad it's GPL. PinsussDuduff7:44 27 Jul '05  
GeneralRe: Nice code :).. to bad it's GPL. PinmemberArmel Asselin23:51 2 Aug '05  
GeneralRe: Nice code :).. to bad it's GPL. Pinmemberitouh21:26 4 Aug '05  
GeneralRe: Nice code :).. to bad it's GPL. Pinmemberandrzej.bol1:56 25 Mar '07  
GeneralRe: Nice code :).. to bad it's GPL. Pinmemberdoojoo17:27 13 Sep '07  
GeneralRe: Nice code :).. to bad it's GPL. PinmemberLeonnik10:15 24 Oct '07  

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-2009
Web22 | Advertise on the Code Project