Finding the envelope to a cloud of points; Method known and programmed, problem with creating the right output from loops.
- November 15, 2012
- 2 replies
- 2504 views
Hello,
I'm currently working on extracting the envelope from a cloud of points which is part of my diploma-thesis.This cloud of points has been created through the simulation of motion of a gear-flank. For extracting the envelope I thought out the following approach:
1) Create a mesh of points that will be projected onto the surface of the cloud. For now this mesh is a plain of rectangular shape. Later I will probably use a numerical approach for bending this plain, but the indices and everything except the commands for creating this mesh will remain the same.
2) For every point of the mesh the distance to every point of the simulation needs to be calculated.
3) Find the points with the minimal distance between the mesh and the cloud.
These points of the cloud have to be on the surface of my cloud and have to be part of the envelope.
So far so good. I got the simulation, the mesh and I know how to calculate the distances. For one point out of the mesh it is quite easy to find the closest point out of the cloud with a triple-for-loop. But I fail at writing this for all points of the mesh. Since the mesh itself has two dimensions I end up with a quintuple for-loop. But the way I set it up, I always get the coordinates of the very last combination checked instead of the points with the minimal distance...
I cannot upload the original file and the data is far to complex for writing it out in this text-editor. So I created a sample file with data in the exact structure (this is only a sample. This data is compiled through about 40 pages of code...) as the original data is. I also put in the for-loops I thought would work. But apparently they do not work completely.
Could someone please take a look at this and tell me how I can get this to work?
Thanks in advance,
Jonathan

