• Advertisement
Sign in to follow this  

Getting edges from large number of triangles

This topic is 4942 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 am looking for a more efficient way to do this. Currently I have a thousand of different points which form triangles with one another. I need to extract out all the unique edges for these triangles(>10000 of them). My current solution is to check the 3 edges of each triangle against a vector which contains all the unique edges I have extracted so far. If it is not in there, I will add it to the vector else just abandon it. However program seems to run out of memory just doing that. :) Any bright ideas?

Share this post


Link to post
Share on other sites
Advertisement
if you use indexes for the points, and you should if you dont want to waste memory. you can store each edge in a list, with the smaller index first, do a quicksort on it, and remove all entry's that are present more than once (because they are sorted you can check if your edge and the next edge in the list are identical...) this costs some memory but its the fastest way i know.


T2k

Share this post


Link to post
Share on other sites
Is there a limit the number of elements a vector can hold? I think the number of edges from the triangles can come about to more than 20000.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement