Home › Forum › SOFA › Using SOFA › [SOLVED] Issue while exporting tetrahedron mesh generated from polyhedron
Tagged: 64_bits, Plugin_other, SOFA_2006, Windows_10
- This topic has 4 replies, 3 voices, and was last updated 4 years, 6 months ago by Singh.
-
AuthorPosts
-
31 May 2020 at 19:52 #16474SinghBlocked
Hello,
Following is my scene file.
<?xml version="1.0"?> <Node name="root" dt="0.05" showBoundingTree="0" gravity="0 -9 1"> <VisualStyle displayFlags="showVisual" /> <RequiredPlugin pluginName="CGALPlugin"/> <MeshObjLoader name="loader" filename="mesh/test.obj" /> <Node name="visu_surface"> <MechanicalObject name="dofs" position="@../loader.position"/> <TriangleSetTopologyContainer name="topo" triangles="@../loader.triangles"/> <TriangleSetTopologyModifier name="Modifier" /> <TriangleSetTopologyAlgorithms name="TopoAlgo" template="Vec3d" /> <TriangleSetGeometryAlgorithms template="Vec3d" name="GeomAlgo" drawTriangles="1" /> </Node> <Node name="tetra_mesh"> <MeshGenerationFromPolyhedron name="MeshGenerator" inputPoints="@../loader.position" inputTriangles="@../loader.triangles" inputQuads="@../loader.quads"/> <MechanicalObject name="dofs" position="@MeshGenerator.outputPoints"/> <TetrahedronSetTopologyContainer name="topo" tetrahedra="@MeshGenerator.outputTetras"/> <TetrahedronSetGeometryAlgorithms template="Vec3d" name="GeomAlgo" drawTetrahedra="1" drawScaleTetrahedra="0.8"/> </Node> <VTKExporter name="exporter" filename="mesh/test_out" XMLformat="1" edges="0" tetras="1" listening="true" exportAtBegin="true" cellsDataFields="MeshGenerator.outputCellData" overwrite="true"/> </Node>
I get following error: [ERROR] [VTKExporter(exporter)] Error creating file mesh/test_out.vtu
Is there some issue with my VTKExporter statement?
Am I correct in writing this: cellsDataFields=”MeshGenerator.outputCellData”31 May 2020 at 23:51 #16485HugoKeymasterHi @sukhraj
It seems the path is an issue. Could you try just with “test_out” ?
Regarding the MeshGenerator, it has only two outputs names:
MeshGenerator.outputPoints
andMeshGenerator.outputTetras
. Your writing is therefore incorrect, it should raise an error right?Best,
Hugo
1 June 2020 at 05:12 #16486SinghBlocked@hugo
Thanks for your inputs.
I am new to SOFA and that is my first attempt at creating a scene file 🙂Now I understand that:
MeshGenerator.outputPoints
gives me point/geometry information.
andMeshGenerator.outputTetras
gives me topological information. And I could see the same in the code:, f_newX0( initData (&f_newX0, "outputPoints", "New Rest position coordinates from the tetrahedral generation")) , f_tetrahedra(initData(&f_tetrahedra, "outputTetras", "List of tetrahedra"))
Then what should be the input to the cellDataFields?
<VTKExporter name="exporter" filename="test_out" XMLformat="1" edges="0" tetras="1" listening="true" exportAtBegin="true" cellsDataFields="MeshGenerator.outputTetras" overwrite="true"/>
I see an empty file test_out.vtk and the application never seems to finish writing.
I could not find an example scene that shows exporting a tetrahedral mesh generated from a surface mesh.Cheers,
Sukhraj1 June 2020 at 09:58 #16490jnbrunetModeratorHey Sukhraj,
Glad that you are trying out SOFA!
The
VTKExporter
works by looking in its context (the<Node></Node>
that contains it) in order to find a topology container ([.*]SetTopologyContainer
). It will then write the elements found in this topology.Looking quickly at your scene, you should probably move the
VTKExporter
to get something like this:<?xml version="1.0"?> <Node name="root" dt="0.05" showBoundingTree="0" gravity="0 -9 1"> <VisualStyle displayFlags="showVisual" /> <RequiredPlugin pluginName="CGALPlugin"/> <MeshObjLoader name="loader" filename="mesh/test.obj" /> <Node name="visu_surface"> <MechanicalObject name="dofs" position="@../loader.position"/> <TriangleSetTopologyContainer name="topo" triangles="@../loader.triangles"/> <TriangleSetTopologyModifier name="Modifier" /> <TriangleSetTopologyAlgorithms name="TopoAlgo" template="Vec3d" /> <TriangleSetGeometryAlgorithms template="Vec3d" name="GeomAlgo" drawTriangles="1" /> </Node> <Node name="tetra_mesh"> <MeshGenerationFromPolyhedron name="MeshGenerator" inputPoints="@../loader.position" inputTriangles="@../loader.triangles" inputQuads="@../loader.quads"/> <MechanicalObject name="dofs" position="@MeshGenerator.outputPoints"/> <TetrahedronSetTopologyContainer name="topo" tetrahedra="@MeshGenerator.outputTetras"/> <TetrahedronSetGeometryAlgorithms template="Vec3d" name="GeomAlgo" drawTetrahedra="1" drawScaleTetrahedra="0.8"/> <VTKExporter name="exporter" filename="test_out" XMLformat="1" edges="0" tetras="1" listening="true" exportAtBegin="true" overwrite="true"/> </Node> </Node>
Note that I removed the
cellsDataFields
attribute, as it isn’t used to stored the mesh topology, but rather some “field values” that you would like to store for each elements (cells).Hope that helps.
J-N1 June 2020 at 15:42 #16503 -
AuthorPosts
- You must be logged in to reply to this topic.