MeshExporter
Export topology and positions into file.
Supported format are:
- vtkxml
- vtk
- netgen
- teten
- gmsh
- obj
Target: Sofa.Component.IO.Mesh
namespace: sofa::component::meshexporter
parents:
- BaseSimulationExporter
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 | Path or filename where to export the data. If missing the name of the component is used. | |
exportEveryNumberOfSteps | export file only at specified number of steps (0=disable, default=0) | 0 |
exportAtBegin | export file before the simulation starts, once the simulation is initialized (default=false) | 0 |
exportAtEnd | export file when the simulation is over and cleanup is called, i.e. just before deleting the simulation (default=false) | 0 |
enable | Enable or disable the component. (default=true) | 1 |
format | File format to use | ALL |
position | points position (will use points from topology or mechanical state if this is empty) | |
edges | write edge topology | 1 |
triangles | write triangle topology | 1 |
quads | write quad topology | 1 |
tetras | write tetra topology | 1 |
hexas | write hexa topology | 1 |
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
MeshExporter.scn
<?xml version='1.0'?>
<Node name='Root' gravity='0 0 0' time='0' animate='0' bbox="0 0 0 1 1 1" >
<RequiredPlugin name="Sofa.Component.IO.Mesh"/>
<RequiredPlugin name="Sofa.Component.StateContainer"/>
<RequiredPlugin name="Sofa.Component.Topology.Container.Grid"/>
<DefaultAnimationLoop/>
<RegularGridTopology name='grid' n='6 6 6' min='-10 -10 -10' max='10 10 10' p0='-30 -10 -10' computeHexaList='0'/>
<MechanicalObject name="MechaObj"/>
<MeshExporter name='exporterA' format='vtk' printLog='true' filename='outFile' exportEveryNumberOfSteps='5' position="@MechaObj.position" hexas="@grid.computeHexaList" />
</Node>
def createScene(root_node):
root = root_node.addChild('Root', gravity="0 0 0", time="0", animate="0", bbox="0 0 0 1 1 1")
root.addObject('RequiredPlugin', name="Sofa.Component.IO.Mesh")
root.addObject('RequiredPlugin', name="Sofa.Component.StateContainer")
root.addObject('RequiredPlugin', name="Sofa.Component.Topology.Container.Grid")
root.addObject('DefaultAnimationLoop', )
root.addObject('RegularGridTopology', name="grid", n="6 6 6", min="-10 -10 -10", max="10 10 10", p0="-30 -10 -10", computeHexaList="0")
root.addObject('MechanicalObject', name="MechaObj")
root.addObject('MeshExporter', name="exporterA", format="vtk", printLog="true", filename="outFile", exportEveryNumberOfSteps="5", position="@MechaObj.position", hexas="@grid.computeHexaList")