Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project!

## [Algorithms] Potentially nearest set

 [Algorithms] Potentially nearest set From: Andreas.B - 2004-11-29 10:47:39 ```Hi, for a given point I want to determine which triangle in a mesh that is the nearest one. I'm thinking about solving it like this: 1. Divide the space that the mesh occupies into a grid. 2. For each cell in the grid calculate a 'potentially nearest set' of triangles, i.e. all the triangles that for at least one point inside the cell is the closest one. 3. To find the closest triangle for a point we find which cell the point is inside and test the 'potentially nearest set' of that cell. The part I'm having problem with is step 2. One solution would be to subdivide each cell into a large number of points and test all triangles for each one to see which belong to the 'pcs'. This will probably be extremely slow and it won't give an exact result. I'm thinking about calculating the max distance of each triangle to a cell and using the smallest of these values as a threshold value for which triangles can be closest, any thoughts on this? Am I correct in assuming that the furthest away point in a triangle will be one of the vertices? /A.B. ########################################### This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange. For more information, connect to http://www.F-Secure.com/ ```

 [Algorithms] Potentially nearest set From: Andreas.B - 2004-11-29 10:47:39 ```Hi, for a given point I want to determine which triangle in a mesh that is the nearest one. I'm thinking about solving it like this: 1. Divide the space that the mesh occupies into a grid. 2. For each cell in the grid calculate a 'potentially nearest set' of triangles, i.e. all the triangles that for at least one point inside the cell is the closest one. 3. To find the closest triangle for a point we find which cell the point is inside and test the 'potentially nearest set' of that cell. The part I'm having problem with is step 2. One solution would be to subdivide each cell into a large number of points and test all triangles for each one to see which belong to the 'pcs'. This will probably be extremely slow and it won't give an exact result. I'm thinking about calculating the max distance of each triangle to a cell and using the smallest of these values as a threshold value for which triangles can be closest, any thoughts on this? Am I correct in assuming that the furthest away point in a triangle will be one of the vertices? /A.B. ########################################### This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange. For more information, connect to http://www.F-Secure.com/ ```