Jump to content
  • Advertisement
Sign in to follow this  
rajesh_nest

Determine Inner triangles given its Boundary triangle information

This topic is 2542 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

I have a mesh with triangle and vertex information. Now I need to extract a region (patch) of the mesh.
Using some algorithm I can find boundary triangles of the region.

Now How can I determine the inner triangles of the patch with boundary triangle information.

Share this post


Link to post
Share on other sites
Advertisement
Hi!

You need either one attribute that all triangles in the patch share or you need at least one vertex that is in the patch. On a closed mesh your boundary information divides your mesh into two patches (one inside, one outside). The question is: which one is the one you are looking for? You can resolve this ambiguity by specifying one vertex that is inside the patch (or perhaps find another measure like choosing the patch with the smaller area, but this won’t necessarily identify the correct patch…). If you have one vertex in the patch, you can do some sort of flood fill starting at that vertex until you hit the boundary. So, push all neighbors of that vertex on a stack (unless they are boundary vertices or have already been visited), then pop one vertex from the stack and start over again (pushing all its neighbors on the stack, etc) until your stack is empty. All vertices you visit are inside the patch. This will have a complexity linear in the number of vertices in the patch (in other words: pretty fast).

Share this post


Link to post
Share on other sites
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!