Starting file type is .obj 3D file. This is a point cloud of x,y,z coordinates. The files lists the points as:
v x-coordinate y-coordinate z-coordinate
When I run the m file it should prompt me to choose the .obj file. This file will contain a point cloud of a concave surface.
The point cloud will be similar to flat land with ONE concave section in it. Imagine a flat yard and a hole dug into the ground. This is what the point cloud will look like. (**NOTE** Attached is a sample of the point cloud cropped out of the surrounding flat surface)
This hole will not model a perfect cylinder or a semicircle, it may have an odd shaped surrounding edge, and may have bumps in the base of the hole.
NOTE: There will always be only one hole.
*What Matlab Needs to do:
Matlab needs to fit a plane perpendicular to the hole on the outer edge of the hole, calculate the distance from each point to this plane, and sum the distances. Then Matlab needs to calculate the average distance between neighboring points, square this averaged distance to get area. Multiply this area by the summed distances, from the points to the fitted plane, to calculate the volume.
If the dense point cloud has an area where points seem to be missing like a cluster of point are not present this area should be interpolated and filled in with points if needed for the measurement.
After it should display the resulting volume calculation, and plot the 3D data that it used to calculate the volume -> This is a check to be sure that what was calculated was what the user wanted calculated in a visual manner.
That's it! In a nut shell: Calculate volume, display the data that was used for the volume calculation.
I will send samples to help build the program.
Attached is an example of a .obj file that has a concave form with all other data edited away. But usually the concave section would have a flat plane surrounding it, but the file format (v x y z) will remain the same.