STL to Point cloud or Alpha shape

19 ビュー (過去 30 日間)
Alec York
Alec York 2017 年 12 月 29 日
コメント済み: Alec York 2018 年 8 月 23 日
Hello, I was wondering if there was a way to convert an imported STL file to a 3D point cloud or alpha shape. Thanks

採用された回答

Joe Murphy
Joe Murphy 2018 年 1 月 2 日
Hello Alec,
After importing an STL file to MATLAB (using any preferred method, such as the 'importGeometry' function), you can use the 'alphaShape' function to create a three-dimensional alpha shape using the geometric data imported from your STL:
shp = alphaShape(x,y,z)
where 'x', 'y' and 'z' correspond to the points of the shape in each dimension. In addition, if you have access to the Computer Vision System Toolbox, you can simply use the 'pointCloud' function to create a point cloud:
ptCloud = pointCloud(xyzPoints)
where 'xyzPoints' is a matrix with the x y and z point locations retrieved from your STL. You can read more about these functions and see some examples in the documentation below:
https://www.mathworks.com/help/matlab/ref/alphashape.html?s_tid=srchtitle
https://www.mathworks.com/help/vision/ref/pointcloud-class.html?s_tid=srchtitle
  2 件のコメント
Atia Najafi
Atia Najafi 2018 年 8 月 23 日
編集済み: Atia Najafi 2018 年 8 月 23 日
Hello Joe, can you please expand your answer? my problem is that after I imported stl file, do not know how create point cloud, how should define x, y ,z in following code, do not know what is wrong with it any help is appreciated
model = createpde(3);
>> importGeometry(model,'Part1.stl');
>> shp = alphaShape(x,y,z)
Undefined function or variable 'x'.
Alec York
Alec York 2018 年 8 月 23 日
The easiest way I found to do it was to save the STL file in ASCII format. Rename to a text document, import the points and finally remove all the duplicate points

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePoint Cloud Processing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by