How to find the difference in elevation of a point above a mesh?
Show older comments
Hi,
I have 2 datasets of x,y,z (Lidar and Total Station) and what am trying to do is produce a trimesh of the Total Station data and find the difference of elevation for each Lidar point above the surface.
Since the 2 data sets do not overlap in x or y, I was hoping this could be a simple way to compare elevation differences.
BUT...the output I get from the dalaunay gives me the vertices and I don't know how to subtract the lidar xyz from the trimesh.
Any suggestions would be greatly appreciated.
My code so far:
% generate random xyz
ts = rand(100,3);
% offset lidar data in x,y,z
lidar = [ts(:,1)*1.1,ts(:,2)*1.1,ts(:,3)*2];
% compute delaunay
dt = delaunay(ts(:,1:2));
% compute convexhull to look only at 'in' points
k = convhull(ts);
in = inpolygon(lidar(:,1),lidar(:,2),ts(k,1),ts(k,2));
% plot mesh
trimesh(dt,ts(:,1),ts(:,2),ts(:,3))
hold on
% plot lidar
plot3(lidar(in,1),lidar(in,2),lidar(in,3),'k*');
view(90,90)
xlabel('x')
ylabel('y')
zlabel('z')
Accepted Answer
More Answers (0)
Categories
Find more on Polygonal Shapes in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!