Quote:
Originally Posted by hunter Where would i denote in the code to have the new files be cut down?? Maybe i need to be a bit clearer in what the code needs to do.
I import a file which contains about 15000 x y z coordinates for a point cloud. I then use this file and run my code to fit a plane to these points and tell me the distance of each point from teh plane. On the second run I take the points and delete any point that is over 128mm from the plane surface, fit a new plane to the new set of points, get the distances, and save the new point cloud file. I then run the program again with the new point cloud file and fit a newer plane to the new points, delete any points over 64mm from the surface of the plane, get distances of newer points, and save the file. I repeat this process untill i get down to deleting points .25mm away. Following is the points in my code where i delete points. Highlighted in red is the spot where the number is changed each time to tell where the cut off point for the points should be:
m_12=1;
for n_12=1 : size(plane2point_12,1);
if abs(plane2point_12(n_12))< 64
cull1_12(m_12,  =[x_12(n_12) y_12(n_12) z_12(n_12)];
m_12=m_12+1;
end |
If you look at the snippet you will see that each time around the loop a different file is read and written.
The first file read from is your initial file, subsequently the file read is that written on the previous loop trip.
The names of the files written are dynamically constructed to have a numeric at the end that increases by 1 each time around the loop.
So the files written are:
'C:\MATLAB701\work\Point_Clouds11'
'C:\MATLAB701\work\Point_Clouds12'
'C:\MATLAB701\work\Point_Clouds13'
:
:
'C:\MATLAB701\work\Point_Clouds30'
RonL