Export triangulation to Paraview

버전 1.1.0.0 (1.8 KB) 작성자: David Gingras
Function to export an unrestricted 2D triangulation to a VTK file which can be open with Paraview.
다운로드 수: 2.2K
업데이트 날짜: 2009/5/5

라이선스 보기

Trying to visualize a huge triangulation with trisurf or triplot is often very slow and frustrating. Solution : use Paraview, a very powerful and free 3D data viewer. But it could be complicated to generate the input file specially with binary format. The function proposed takes a 2.5D unrestricted triangulation and generates the ASCII VTK file for Paraview.

function exportTriangulation2VTK(file,XYZ,tri,dir)
Input :
"dir" is the path of the directory where the file is saved (string). (Optional)
"file" is the name without extension of the file (string).
"XYZ" is the coordinate of the vertex of the triangulation (nx3 matrix).
"tri" is the list of triangles which contain indexes of XYZ (mx3 matrix).

Simple example :
[X,Y,Z]=peaks(25);
X=reshape(X,[],1);
Y=reshape(Y,[],1);
Z=0.4*reshape(Z,[],1);
tri = delaunay(X,Y);
exportTriangulation2VTK('sampleExampleTri',[X Y Z],tri)

Note : If the triangulation doesn't have Z component (a plane), put the third column of XYZ with all zeros. Paraview only deals with 3D object.

인용 양식

David Gingras (2024). Export triangulation to Paraview (https://www.mathworks.com/matlabcentral/fileexchange/22602-export-triangulation-to-paraview), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2007a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Point Cloud Processing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.1.0.0

updated the description

1.0.0.0