stl to point cloud

조회 수: 36 (최근 30일)
shmulik e
shmulik e 2020년 4월 10일
댓글: Ameer Hamza 2020년 4월 10일
Hello
I have a STL file that i am tryongto convert to points clouid, or just the points cloud of the shell of the STL.
I tried differenf types of of STL reader function, but they all provide just the trigulation of the object wich includes faces and vertices, like the 'STL File Reader':
The STL file was saved from SolidWorks by me, so i can save it in adifferent format if nedded.
Thank you for the help.

답변 (1개)

Ameer Hamza
Ameer Hamza 2020년 4월 10일
Use the stlread: https://www.mathworks.com/help/releases/R2020a/matlab/ref/stlread.html function provided in MATLAB from R2018b. To get the point cloud
stlData = stlread('stl_filename');
points = stlData.Points;
  댓글 수: 2
shmulik e
shmulik e 2020년 4월 10일
편집: shmulik e 2020년 4월 10일
This gives me only the points of the triangles. If there is a big face than they are very few points on that face, only the triangles points.
I want to have a shell of voulme point cloud which represent the STL and a I can control the density of the points.
for exmaple if i have a stl file of a cube, the TOP figure is what i will get from:
points = stlData.Points;
and the bottom two is what is want to have (either one of them, they generated just for an example)
Ameer Hamza
Ameer Hamza 2020년 4월 10일
shmulik, This shows that the model saved in the STL file by SolidWorks just contains a few points. Is it possible to increase the use number of points in SolidWorks by using a finer mesh? Also run the following code to see if the points imported by MATLAB is same as the SolidWorks' model
stlData = stlread('filename.stl');
patchStruct.Vertices = stlData.Points;
patchStruct.Faces = stlData.ConnectivityList;
patchStruct.FaceColor = 'r';
patch(patchStruct)
view(3)

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Point Cloud Processing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by