Sign in to follow this  
Mystery

Getting edges from large number of triangles

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
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

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