How to Extracting Only Surface Coordinates from a 3D STL File in MATLAB?

조회 수: 22 (최근 30일)
Zihan Wang
Zihan Wang 2024년 3월 21일
답변: Star Strider 2024년 3월 21일
Hello MATLAB Community,
I've created a 3D model in SolidWorks and I'm currently trying to import it into MATLAB to extract the coordinates of points that lie only on the model's surface.
I've been utilizing the generateMesh function from the Partial Differential Equation Toolbox. However, this method seems to be including points from the interior of the model as well.
I have attached the STL file of my model. Could anyone guide me on how to modify my approach so that I only obtain the coordinates of the surface points?
Thanks!

답변 (1개)

Star Strider
Star Strider 2024년 3월 21일
See if the trisurf function does what you want —
Uz = unzip('22G teardrop COMSOL.zip');
filename = Uz{:};
[TR,fileformat,attributes,solidID] = stlread(filename);
P = TR.Points;
T = TR.ConnectivityList;
Q = [P(1:10,:) T(1:10,:)];
figure
trisurf(T, P(:,1), P(:,2), P(:,3), 'EdgeColor','none')
colormap(turbo)
axis('equal')
view(120,45)
Ax = gca;
Ax.Visible = 'off';
.

카테고리

Help CenterFile Exchange에서 Display Point Clouds에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by