Matlab and 3D volumes

241 views Asked by At

I want to create a 3D volume from the following set of data. Is there a function in Matlab that helps or do I need to construct more data vertices? Tried fill3() but that only creates the top and bottom surface, not the sides.

latitude    longitude   lowerAltitude   upperAltitude
-73.8124    40.6422        100             200 
-73.8119    40.6485        100             200 
-73.8377    40.6597        100             1500 
-73.86      40.6671        100             1600 
-73.8849    40.6377        100             1800 
-73.875     40.6302        100             1800 
-73.8525    40.6518        100             1600 
-73.8401    40.6539        100             1500 
-73.8124    40.6422        100             200 

Regards. BSL

2

There are 2 answers

2
MosGeo On

You can create a convex hull of the points that you have and visualize that surface. Note that you will need to rearrange your data to create two points for each line that you currently have. For example the first line in your example, need to be split in two points as follows. The three columns will be your X, Y, and Z.

latitude longitude Altitude -73.8124 40.6422 100 -73.8124 40.6422 200
0
Benjamin Levy On

Postscript. After due consideration of my goal of detecting a point (x,y,z) inside a 3d volume (X,Y,Z), I decided on a simple two-step approach. 1) detect the presence of the point in the X,Y perimeter with inpolygon. 2) If the x,y point is inside the bottom perimeter of the region as (X,Y, Z=Z0), then test for min(Z) <= z <= max(Z), where Z = f( X,Y) as contoured with X,Y points. Unless someone else has a more elegant solution, this will have to do. BTW, not really crazy about the contour() fxn in Matlab. But, using scattered interpolation for my upper boundary altitude (with lat, lon) would not work with Delaunay fxn (invalid TRI output).