Jump to content
  • Advertisement
Sign in to follow this  
Pibben

Fix bad mesh

This topic is 1329 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 an application where I need input meshes to be "clean" i.e. maximum 2 triangles per edge. However sometimes I get input where the mesh "meets itself" at an edge so I get 4 or even 6 triangles connected to an edge.

 

Is there a standard algorithm or some lib I can use to resolve these areas in the mesh?

 

Share this post


Link to post
Share on other sites
Advertisement


Is there a standard algorithm or some lib I can use to resolve these areas in the mesh?

I'm not aware of such an lib/algo because there's no correct solution.

 

Think of 3 quads, all three sharing a single edge.

Now try to calculate the normal of ... wait what ? You dont have a surface, even if you want to reduce it to only 2 quads, which quads would be the correct pair ? And if you selected both quads, are the normals pointing inside or outside ?

 

Whenever I encouter this issues, I clean up the models by hand. With time you know where to look for defect surfaces first.

Share this post


Link to post
Share on other sites

In 3ds max is a modifier called "STL check". It will highligh those issues besides others , it is up to you what you will pick to inspect (open edges, spikes, double faces...)

Share this post


Link to post
Share on other sites

 


Is there a standard algorithm or some lib I can use to resolve these areas in the mesh?

I'm not aware of such an lib/algo because there's no correct solution.

 

Think of 3 quads, all three sharing a single edge.

Now try to calculate the normal of ... wait what ? You dont have a surface, even if you want to reduce it to only 2 quads, which quads would be the correct pair ? And if you selected both quads, are the normals pointing inside or outside ?

 

Whenever I encouter this issues, I clean up the models by hand. With time you know where to look for defect surfaces first.

 

Thanks for your input!
 

In my case it's a little bit simpler, since I have an even number of triangles as the surface "continues" across the edge. It doesn't really matter how the triangles are paired up, as long as the output mesh is consistent. But it seems there is no readily available solution.

 

If you look at it more general; is there a lib to remesh the whole model, e.g. to get triangles of similar sizes?

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!