필터 지우기
필터 지우기

How can I save Matlab FEM mesh information to *.stl or *.ply

조회 수: 15 (최근 30일)
Bin
Bin 2024년 2월 15일
댓글: Bin 2024년 2월 23일
Hi omnipotent expert,
I encountered some issues after writing Matlab FEM mesh information into *.stl or *.ply then try to import it to some mesh handling software, such as Space Claim, Icem, etc. But these software can not correctly open *.stl or *.ply file from Matlab saved results. Did anybody have workful experience of transter these data to these mesh handling software or other software? Please share these experience, thank you.
Regards,
Bin

채택된 답변

Shubham
Shubham 2024년 2월 22일
Hi Bin,
There could be some compatibility issues when importing the mesh generated in MATLAB into other third-party software. Before exporting the mesh, try validating it first.
Remove duplicate points present in mesh. You can use the “unique” function to obtain unique rows in a matrix. Refer to the following code snippet:
% Find the unique vertices and their indices
[uniqueVertices, ~, indexn] = unique(V, 'rows', 'stable');
% Map the face indices to the new set of vertices
newFaces = indexn(F);
For more information on “unique” function, you can refer to the following documentation: https://www.mathworks.com/help/releases/R2020b/matlab/ref/double.unique.html
You can assess the quality of Mesh objects using the “meshQuality” function present in PDE toolbox documentation: https://www.mathworks.com/help/releases/R2020b/pde/ug/pde.femesh.meshquality.html?s_tid=doc_ta
Align mesh normal to point in a consistent direction using the unifyMeshNormalsFile Exchange submission: https://www.mathworks.com/matlabcentral/fileexchange/43013-unifymeshnormals
Finally, check the file format required for importing the mesh. You can write in ASCII and binary format. Refer to the following File Exchange function “stlwrite” which can be used to write in both file formats: https://www.mathworks.com/matlabcentral/fileexchange/20922-stlwrite-write-ascii-or-binary-stl-files
I hope this helps!
  댓글 수: 1
Bin
Bin 2024년 2월 23일
It really helps. Thank you very much Shubham, your answer solved my issue.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Geometry and Mesh에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by