views:

244

answers:

1

Hey, I'm looking for a library that will triangulate planar polygons with openings.

I've seen a couple other questions that ask about triangulation (see http://stackoverflow.com/questions/406301/polygon-triangulation-with-holes and http://stackoverflow.com/questions/974791/polygon-triangulation), but I'm looking for something that I can use from .NET without having to write a managed wrapper.

Anyone know of a good .NET geometry calculation library? Or is there some way I can do this in DirectX without getting up to my elbows in unmanaged API calls?

+1  A: 

XNA Framework maybe?

Or you can search in CodeProject and find some small libs like this one

Sorantis
Thanks for the help. I just investigated that CodeProject link, and it looks like it doesn't support openings. Also, part of the reason I don't want to write this myself is to avoid bugs at obscure edge cases, so someone's unmaintained pet project is not ideal.Your XNA idea of using is interesting, although I can't immediately find a way to get it to triangulate polygons. Are you familiar with how this works?
Henry Jackson
http://xnawiki.com/index.php?title=Polygon_Triangulation perhaps this might help.
Sorantis
Thanks again for looking into this! Unfortunately that link doesn't look promising either... it doesn't account for openings, and the bugs listed on the discussion page make it unsuitable for general use. Maybe I'll just have to sit down with a computational geometry algorithm and do my best..
Henry Jackson
yep, my advice would be to go through the algorithm, and implement it. Very useful thing to do. These are the things that form the basis of understanding of computational geometry. Sooner or later you have to write this kind of things by yourself. So yes, go for it! :)
Sorantis