8 October 2019 at 16 h 38 min #14361
I am trying to visualize the VTK mesh of the bunny mesh.It gives the following error
[INFO] [SceneCheckerVisitor] Finished validating node "root". [INFO] [SofaViewer] QtViewer::keyPressEvent, CONTROL pressed [ERROR] [MeshVTKLoader] Error while parsing XML
The code for visualizing the VTK is
import Sofa import os path = os.path.dirname(os.path.abspath(__file__))+'/mesh/' def createScene(rootNode): rootNode.createObject('VisualStyle', displayFlags='showForceFields showBehaviorModels') rootNode.createObject('RequiredPlugin', pluginName='CGALPlugin') rootNode.createObject('RequiredPlugin', pluginName='SofaExporter') rootNode.findData('gravity').value='-9810 0 0'; node = rootNode.createChild('node') node.createObject('MeshVTKLoader',name='mesh',filename=path+'bunny0.vtu') node.createObject('MeshGenerationFromPolyhedron', name='gen',inputPointsemail@example.com', inputTrianglesfirstname.lastname@example.org', drawTetras='1') node.createObject('Mesh', email@example.comPoints', firstname.lastname@example.orgTetras') return rootNode
I dont know wether this is a bug,I just simply reproduced the same code of bunny example.11 October 2019 at 19 h 34 min #14394
Are you sure of your path?
could you also try doing filename=str(path)+’bunny0.vtu’ ?
[ERROR] [MeshVTKLoader] Error while parsing XML
this sounds like something wrong is passed as argument to the MeshVTKLoader and can not be parsed.
Hugo13 October 2019 at 22 h 48 min #14398
Thanks for the help. the error was due to the path in the tutorial page is missing https://project.inria.fr/softrobot/documentation/volumetric-mesh-generation-using-cgal-plugin/
Now the problem is the generated VTK mesh has a problem, I check my mesh and has no error, however, I don’t know why when I am exporting the generated VTK mesh using MeshVTKLoader it gives me the following error:
[ERROR] [TetrahedronFEMForceField(TetrahedronFEMForceField)] object must have a tetrahedric topology. The component is inactivated. To remove this error message please add a tetrahedric topology component to your scene.
What does that mean?in the scene example of soft robots plugin, they have this component included
I am attaching my OBJ file as I am concerned that I am not getting an accurate VTK mesh and maybe it would cause that error
https://gofile.io/?c=H65JiD18 October 2019 at 18 h 56 min #14415
Here the error is clear: the TetrahedronFEMForceField can not work properly without a tetrahedral topology on which to compute the integration of the linear elasticitic constitutive law.
Could you share the generated VTK mesh? I would guess that something went wrong with your meshing step.
Hugo19 October 2019 at 11 h 45 min #14419
Thanks! I think the problem from my mesh since it didn’t conform for FEM, I tried a new simple one
Here is the OBJ file:https://gofile.io/?c=X0Hm6U
Here the VTK file: https://gofile.io/?c=gFZfJ0
I tried to reconstruct the vtu mesh in ParaView, but the same issue.
Thanks so much for your help.22 October 2019 at 14 h 08 min #14427
Hi Marwa @ma1991
Indeed, your vtu mesh is only a surface and do not include any volumetric element (no tetrahedron). Have a look at the screenshot (crop in the volume of the mesh, only the surface appears):
Hugo22 October 2019 at 14 h 19 min #14434
This issue is solved, it was a mistake at the skin of the mesh and also because of the inverted normals I was trying to create faces manually.
Thanks for the help:)22 October 2019 at 14 h 22 min #14435
I still have a question when you convert from ObJ to vtk mesh, I am pressing ctr+E to export, the file I get is vtu and I have to reconstruct the mesh at Paraview as follows here:https://www.sofa-framework.org/community/doc/using-sofa/components/misc/vtkexport/
While I struggle to know whether I have to wait until simulations end to exports vtu file or just press ctr+E to export.22 October 2019 at 14 h 32 min #14437
You have two options: you can either export at begin (exportAtBegin=”1″) or at end (exportAtEnd=”1″)
Note that obj are surface-only format, while vtk is a format for both surface and volume meshed.
Hugo22 October 2019 at 14 h 36 min #14438
Thanks, it could be a dumb question, it would be a difference if we select at the begin or end. Yes, I know obj is surface-format, but I don’t know why SOFA doesn’t accept transforming from STL to vtk?22 October 2019 at 14 h 53 min #14439
No dumb question here.
When things are misunderstood, it means it can be better explained.
You can actually load or export both STL and VTK. So the transformation of one into the other should be not prob.
Hugo22 October 2019 at 14 h 55 min #14440
- You must be logged in to reply to this topic.