Sign in to follow this  

Using Triangle mesher

Recommended Posts

I am using Triangle ([url=""]http://www.cs.cmu.ed...e/triangle.html[/url]), and I ran into a problem that, even after reading and rereading the documentation, debug-stepping through the code, and trying different examples, I am unable solve. So if anyone has done this before, I would very much appreciate your advice.

I compiled Triangle as a dll, and I am using it from (but that is pretty much irrelevant). I have polygons defined as sets of vertices (clockwise oriented; I also tried counter-clockwise, I obviously get the same result). I want Triangle to triangulate these polygons. I am calling it with the following switches:
and I am passing in input.pointlist, input.segmentlist, input.edgelist, input.segmentmarkerlist, input.edgemarkerlist (segment, edge and marker lists are my attempt to fix the problem).

So basically I am calling it with a set of points defining the polygon. I only need the triangles and new points back (no markers, attributes, or any of that stuff).

What is happening is that for concave polygons, Triangle creates a convex hull and triangulates it (as if there were no boundaries defined even though I pass edges/segments). Is there a way to avoid this (I want the concave polygon to stay the way it is, just triangulated)? (I cannot create poly or any input files, I have to pass parameters in as variables, and I have to use Triangle as a library)
I am already considering splitting concave polygons into convex and then passing them to Triangle, but I would rather not have to do this.

Thank you.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this