How to create mesh from coordinates

Hi,
I have a 3D object (as shown in figure) defined entirely by x,y,z coordinates. Below shows the plot using scatter3().
I do not have the triangulation information.
My ultimate goal is to convert it to an .*stl file. How do I mesh it? delaunay(x,y,z) is giving something like this which is not correct.
Do I need some kind of algorithm to mesh it ?
Or else can I convert the coordinates to a .ply file to use meshlab to mesh it ? I don't know how to convert. Since this is a closed figure meshgrid() etc. are not working.
Thank you for the help.

 採用された回答

Kaustubh Tiwarekar
Kaustubh Tiwarekar 2020 年 4 月 21 日

0 投票

1 件のコメント

Viraj Gandhi
Viraj Gandhi 2021 年 2 月 26 日
Thank you so much!! It saved a ton of my time!

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

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2016 年 12 月 28 日

0 投票

If you have R2014b or later consider using boundary() to generate an outside hull.

4 件のコメント

sumana
sumana 2016 年 12 月 28 日
Hi,
Thank you for the answer. But it does not work as I want it to. I got the below figure.
It is connecting many unnecessary points. Same with alphashape().
Could you suggest some algorithm or any other method ? How can I convert it to a pointcloud file ? Or could you provide an example with an arbitrary closed 3D shape, say a sphere?
Thank you
sumana
sumana 2016 年 12 月 28 日
This is what I got using alphashape (), which is close but there is a hole in the middle.
Note: This object was first generated in geodetic coordinates and then converted to spherical.
sumana
sumana 2016 年 12 月 28 日
Another view of it.
Walter Roberson
Walter Roberson 2016 年 12 月 28 日
編集済み: Walter Roberson 2016 年 12 月 28 日
pc = pointCloud( [x(:), y(:), z(:)] );
pcwrite(pc, 'OutputFileName.ply');
This requires the Computer Vision Toolbox.

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

カテゴリ

Community Treasure Hunt

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

Start Hunting!

Translated by