VTKExporter
Export a given mesh in a VTK file.
Target: Sofa.Component.IO.Mesh
namespace: sofa::component::vtkexporter
parents:
- BaseObject
Data
Name | Description | Default value |
---|---|---|
name | object name | unnamed |
printLog | if true, emits extra messages at runtime. | 0 |
tags | list of the subsets the object belongs to | |
bbox | this object bounding box | |
componentState | The state of the component among (Dirty, Valid, Undefined, Loading, Invalid). | Undefined |
listening | if true, handle the events, otherwise ignore the events | 0 |
filename | output VTK file name | |
XMLformat | Set to true to use XML format | 1 |
position | points position (will use points from topology or mechanical state if this is empty) | |
edges | write edge topology | 1 |
triangles | write triangle topology | 0 |
quads | write quad topology | 0 |
tetras | write tetra topology | 0 |
hexas | write hexa topology | 0 |
pointsDataFields | Data to visualize (on points) | |
cellsDataFields | Data to visualize (on cells) | |
exportEveryNumberOfSteps | export file only at specified number of steps (0=disable) | 0 |
exportAtBegin | export file at the initialization | 0 |
exportAtEnd | export file when the simulation is finished | 0 |
overwrite | overwrite the file, otherwise create a new file at each export, with suffix in the filename | 0 |
Links
Name | Description | Destination type name |
---|---|---|
context | Graph Node containing this object (or BaseContext::getDefault() if no graph is used) | BaseContext |
slaves | Sub-objects used internally by this object | BaseObject |
master | nullptr for regular objects, or master object for which this object is one sub-objects | BaseObject |
Examples
VTKExporter.scn
<Node name="root" dt="0.01" gravity="0 -9.81 0">
<RequiredPlugin name="Sofa.Component.IO.Mesh"/> <!-- Needed to use components [MeshOBJLoader VTKExporter] -->
<RequiredPlugin name="Sofa.Component.StateContainer"/> <!-- Needed to use components [MechanicalObject] -->
<RequiredPlugin name="Sofa.Component.Topology.Container.Constant"/> <!-- Needed to use components [MeshTopology] -->
<RequiredPlugin name="Sofa.Component.Topology.Container.Dynamic"/> <!-- Needed to use components [TetrahedronSetTopologyContainer] -->
<DefaultAnimationLoop/>
<MeshTopology name="mesh" filename="mesh/dragon.obj" />
<MeshOBJLoader name="loader" filename="mesh/dragon.obj" />
<MechanicalObject src="@loader" template="Vec3" name="mecha" showObject="1" />
<TetrahedronSetTopologyContainer src="@loader" name="topo" />
<VTKExporter filename="example.vtk" listening="true" edges="0" triangles="1" quads="0" tetras="0" pointsDataFields="mecha.position" exportAtBegin="1" />
</Node>
def createScene(root_node):
root = root_node.addChild('root', dt="0.01", gravity="0 -9.81 0")
root.addObject('RequiredPlugin', name="Sofa.Component.IO.Mesh")
root.addObject('RequiredPlugin', name="Sofa.Component.StateContainer")
root.addObject('RequiredPlugin', name="Sofa.Component.Topology.Container.Constant")
root.addObject('RequiredPlugin', name="Sofa.Component.Topology.Container.Dynamic")
root.addObject('DefaultAnimationLoop', )
root.addObject('MeshTopology', name="mesh", filename="mesh/dragon.obj")
root.addObject('MeshOBJLoader', name="loader", filename="mesh/dragon.obj")
root.addObject('MechanicalObject', src="@loader", template="Vec3", name="mecha", showObject="1")
root.addObject('TetrahedronSetTopologyContainer', src="@loader", name="topo")
root.addObject('VTKExporter', filename="example.vtk", listening="true", edges="0", triangles="1", quads="0", tetras="0", pointsDataFields="mecha.position", exportAtBegin="1")