VTK (.vtk)
Background
|
|
Import and Export
- Import["file.vtk"] imports the polygon information from a VTK file and returns it as a Graphics3D object.
- Export["file.vtk",expr] exports a Graphics3D or GraphicsComplex expression to a VTK file.
- Import["file.vtk"] returns an expression of the form Graphics3D[ GraphicsComplex[…]].
- Import["file.vtk",elem] imports the specified element from a VTK file.
- Import["file.vtk",{elem,sub,…}] imports a subelement.
- Import["file.vtk",{{elem1,elem2,…}}] imports multiple elements.
- The import format can be specified with Import["file","VTK"] or Import["file",{"VTK",elem,…}].
- Export["file.vtk",expr,elem] creates a VTK file by treating expr as specifying element elem.
- Export["file.vtk",{expr1,expr2,…},{{elem1,elem2,…}}] treats each expri as specifying the corresponding elemi.
- Export["file.vtk",expr,opt1->val1,…] exports expr with the specified option elements taken to have the specified values.
- Export["file.vtk",{elem1->expr1,elem2->expr2,…},"Rules"] uses rules to specify the elements to be exported.
- See the reference pages for full general information on Import and Export.
- ImportString and ExportString support the VTK format.
Elements
- General Import elements:
-
"Elements" list of elements and options available in this file "Rules" full list of rules for each element and option "Options" list of rules for options, properties, and settings - Data representation elements:
-
"CuboidData" cuboid data in indexed form "CuboidObjects" list of Cuboid primitives given in absolute coordinates "Graphics3D" VTK file represented as a Graphics3D object "GraphicsComplex" VTK file as a GraphicsComplex object "LineData" the line elements of a VTK file in indexed form, with integer indices referencing the vertices as given by "VertexData" "LineObjects" list of Line primitives given in absolute coordinates "PolygonData" the polygon elements in indexed form "PolygonObjects" list of Polygon primitives given in absolute coordinates "VertexData" list of vertex coordinates "PointData" point data in indexed form "PointObjects" list of Point primitives given in absolute coordinates - Import and Export use the "Graphics3D" element by default for VTK files.
- The "VertexData" element corresponds to the first argument of GraphicsComplex.
Options
- General Import options:
-
Background Automatic what background color to use ImageSize Automatic overall size of the graphics to display Lighting Automatic what simulated lighting to use in coloring 3D surfaces - All options of Graphics3D can be given when importing from VTK.
- Export option:
-
"BinaryFormat" False whether to create a binary VTK file - Advanced option:
-
"VerticalAxis" {0,0,1} orientation to assume for the coordinate system used in the file - By default, the Wolfram Language assumes that in the coordinate system used by the VTK format, the vertical axis corresponds to the third coordinate.
- With the setting "VerticalAxis"->{0,1,0}, the Wolfram Language will apply the transformation {x,y,z}->{x,-z,y} to all graphics coordinates when importing from VTK, and the inverse transformation when exporting to VTK.
Examples
open allclose allSee Also
"3DS" "JVX" "LWO" "Maya" "OBJ" "OFF" "PLY" "POV" "RIB" "STL" "X3D"
Related Guides
Introduced in 2010
(8.0)