How to make rectangular mesh from Points cloud

Does somebody know, how to simply and theoretically generate a rectangular mesh from a Points Cloud defined by 3D coordinates (x,y,z)?
Regards
Amine

回答 (1 件)

Katie
Katie 2019 年 12 月 19 日

1 投票

You can use a combination of meshgrid and griddata to do this. In the code below, I'm assuming that x is a column vector with the x coordinates of all of your points, y is a column vector with the y coordinates of all of your points, and z is a column vector with the z coordinates of all of your points.
dx=linspace(min(x),max(x),n);%n is the number of columns you want in your grid
dy=linspace(min(y),max(y),m);%m is the number of rows you want in your grid
[xq yq]=meshgrid(dx,dy);
grid=griddata(x, y z, xq, yq, 'linear');%linear is the type of interpolation used
The documentation for griddata also provides more examples: https://www.mathworks.com/help/matlab/ref/griddata.html

5 件のコメント

darova
darova 2019 年 12 月 19 日
It makes sense. I voted for your answer
Amine Bohi
Amine Bohi 2019 年 12 月 20 日
This is not exactly what I want to do. the rectangular mesh I want to make from my points cloud should be described by a FV structure (rectangular faces, vertices). Because when I do griddata it returns a nxn matrix and not a mesh structure. Thanks
darova
darova 2019 年 12 月 21 日
You can create faces manually. What is the problem?
Amine Bohi
Amine Bohi 2019 年 12 月 21 日
How can I do that ?
darova
darova 2019 年 12 月 21 日
Maybe such function exists already. Try fsurf2patch

サインインしてコメントする。

カテゴリ

質問済み:

2019 年 12 月 19 日

コメント済み:

2019 年 12 月 21 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by