How to Extracting Only Surface Coordinates from a 3D STL File in MATLAB?
23 次查看(过去 30 天)
显示 更早的评论
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!
0 个评论
回答(1 个)
Star Strider
2024-3-21
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';
.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!