PolyData can be used for any polygonal data.UnstructuredGrid is a not regular and not uniform points data, like the StructuredGrid, but can handle all cell types (see VTK file formats documentation for cell types available).You have to specify the coordinates for all mesh nodes. StructuredGrid is a not regular and not uniform points data.Thus, you have to specify the nodes coordinates along the three axes, Ox, Oy & Oz. RectilinearGrid is also a regularly spaced points data but spacing can be not uniform.Thus, points data are regularly and uniformly spaced. StructuredPoints is the "simplest" format: you only have to set the mesh dimensions (nx, ny, nz), mesh origin (x0, y0, z0) and cell dimensions (dx, dy, dz).StructuredPoints (aka ImageData, see later).These pages show how one can easily write snipped code to create theses datasets, usingĪnd believe me, this is far easier to write them using TVTK than "pure" VTK -)īut if one of you, wikiers, think that this link is irrelevant (not "pure" VTK), no problem,Īs you should already be aware if you have read the VTK file formats documentation, VTK can handle several kinds of datasets, for points data and cells data. Meanwhile, Gaël wrote a really cool doc on VTK Data Structures, in the Mayavi Users Guide. Note: Well, I have initiated this wiki and never found time to write some materials to it :-( Although it is easier to write than the XML kind (understand: with low-level instructions like "printf" in C or "print" in python), this wiki will focus on the last kind, the XML format. The first kind is quite obsolete now, but still widely used. Please browse to get more information if needed.īefore writing VTK files, you have to know that there are two kinds of VTK files: "legacy" VTK files and "XML" VTK files. In the following, the data you want to write to a VTK file are supposed to arise from scipy/numpy arrays. Why using python ? Because it's beautiful & powerful, of course ! -) Obviously, you can use your favourite programming language to write such files. The purpose of this wiki is to show how one can write VTK files using python.
0 Comments
Leave a Reply. |