Closed pan3rock closed 3 months ago
There is a private method in Triangulation
called edgeTriangles
you could make it public and see if it is fast enough for your needs. If you want the absolutely fastest lookup possible and are willing to sacrifice some preprocessing time and some memory, the fastest way would be to generate an unordered_map
that maps edges to triangles. It can be created with a single pass over all the triangles.
Thanks for your suggestion. I used the way of unordered_map
and reduced percentage of elapsed time to 12%. Thanks again for CDT, it helped me a lot!
My project involves an operation of find all triangles containing a certain edge, similar to MATLAB function
edgeAttachments
. Through the profile analysis, this operation accounted for more than 80% of the total runtime in my project. Could anyone provide some suggestions to make it faster? My Implements with a simple example is provided below. Any advice is welcome.