Jump to content
  • Advertisement
Sign in to follow this  
Krohm

Using the 'triangle' library

This topic is 2518 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Can someone explain to me how to use the triangle library?
http://www.cs.cmu.edu/~quake/triangle.html

I've spent about 4 hours now trying to specify the boundary for a mesh I have to triangulate with no success. The library just triangolates all the points ignoring the specified segments.
On a later thought, it looks like segments are just required to be there but don't really restrict the triangulation.
I am definitely missing something.
I'm going to try edges now, but I don't have much hope, from documentation, it looks like they are not used as input parameters (?).

Suggestions are welcome.

Share this post


Link to post
Share on other sites
Advertisement
Replying for future reference.

Triangle's documentation could have some rewording. It appears the "-p" option is not just related to parsing of .poly files but also works in the library by enabling segment processing for PSLG.

Share this post


Link to post
Share on other sites
Hidden
Replying for future reference. Triangle's documentation could have some rewording. It appears the "-p" option is not just related to parsing of .poly files but also works in the library by enabling segment processing for PSLG.


Krohm.... you are my favorite person on the entire internet :D after several days of messing with this and pulling my hair out, I finally got it working (after reading your post). thank you * 42 :D *hug*

Additional things I learned:
If you are using z switch, make sure your segments are numbered from 0, not from 1.
If you are triangulating pieces of an existing mesh, state segments in terms of the nodes relevant for the piece you are triangulating (nodes are numbered in order in which you are passing the relevant nodes to Triangle, starting with 0) (extremely stupid bug)

Share this post


Link to post
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!