Forum Replies Created
-
AuthorPosts
-
MABlocked
Many thanks, Hugo! I think I should more elaborate on my questions, the purple and blue parts have it is own displacement stored since I mapped two different volumetric mesh, and now I have a displacement of each volumetric mesh, should be the net their summation?
Also, the results do sound not realistic, I made sure the units are unified, should I use this part “TetrahedronHyperelasticityFEMForceField”?
Thanks
MABlockedIt worked, I think the problem is the vtu file generated from paraview is different from the one at SOFA, although I made sure the data mode is ascii. Anyway, I used VTK format which can be generated from freecad and GMSH
1- Import STL file in Freecad
2- Then go to part, select: create shape from mesh
3- then click on the new generated shape and select: convert to solid
4-Select the new generated shape, and the export in STEP format.
5- Open Gmsh, merge, and then go to mesh, select 3D, that should give volumetric mesh
6- To refine mesh, go down in gmsh list, refine mesh by spliting, that would make it finer.For those who maybe interested in generating vtu, simply in Paraview, save data as vtu and select data mode ASCII.
In SOFA scenes, sometimes it doesnot work for vtu, but you can import VTK and visualize using two commands below”
`bunnyVisu = finger.createChild(‘visu’)
bunnyVisu.createObject(‘OglModel’, color=[0.3, 0.2, 0.2, 0.6])
bunnyVisu.createObject(‘IdentityMapping’)”`I hope there will be more documentation on these steps as it sometimes not easy to figure things out 😉
Thanks
MABlockedimport meshio mesh = meshio.read('dogbone.vtk') mesh.write("dogbone.vtu")
I really dont know what to do else to get a vtu file working in SOFA like vtu file example, after getting multiple files in VTU all of them crash… I am really confused.
MABlockedBTW, I tried meshio and also in vain, the vtu generated by meshio leads the scene crashing, all the examples files in SOFA in vtu works except the ones I generate from meshio for example,I dont know what I am missing to create a vtu file
MABlockedHere is the code
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='SofaExporter') rootNode.createObject('RequiredPlugin', pluginName='SoftRobots') rootNode.createObject('RequiredPlugin', name='SofaPython') rootNode.createObject('RequiredPlugin', pluginName='CGALPlugin') rootNode.createObject('RequiredPlugin', pluginName='SofaExporter') rootNode.createObject('RequiredPlugin', name='SofaSparseSolver') rootNode.createObject('RequiredPlugin', name='SofaBoundaryCondition') rootNode.findData('gravity').value='-9810 0 0'; rootNode.createObject('BackgroundSetting', color=[0, 0.168627, 0.211765, 1]); rootNode.createObject('OglSceneFrame', style="Arrows", alignment="TopRight"); ############################### ## MECHANICAL MODEL ############################### node = rootNode.createChild('node') node.createObject('MeshObjLoader',name='mesh',filename=path+'Hollow_Bunny_Body_Cavity.obj') node.createObject('MeshGenerationFromPolyhedron', inputPoints='@mesh.position', inputTriangles='@mesh.triangles', drawTetras='1', facetSize='0.35', facetApproximation='0.1', cellRatio='2', cellSize='0.5' ) node.createObject('Mesh', position='@gen.outputPoints', tetrahedra='@gen.outputTetras') node.createObject('VTKExporter', filename=path+'bunny.vtu', edges='0', tetras='1', exportAtBegin='1', listening='true') return rootNode
I press ctrl+E to export at the beginning, and the result is exporting VTU files that is empty, I am confused.
[INFO] [VTKExporter(VTKExporter)] ### VTKExporter[VTKExporter] ### Nb points: 0 Nb edges: 0 Nb triangles: 0 Nb quads: 0 Nb tetras: 0 Nb hexas: 0 ### ### Total nb cells: 0
I tried different meshes and I dont know what is missing, I cannot view it in paraview
MABlockedHi,
Thanks! Yes, I am using python scene, my questions precisely how I can export Obj file to VTU files? I know how to get VTK files, but in some examples it gives error and it requires vtu format, which I am not able to get or it give error, for example I use paraviw for conversion vtk to vtu, but still in SOFA doesnot work it seems I guess vtu files obtained by paraview isnot okay, I tried other vtu files examples in SOFA and works perfectly and thats make me wonder how I can get vtu files “export vtk/obj to vtu?”
MABlockedHi Hugo,
I am quite afraid whether the SOFA would be the right tool for my problem, simply I am going to do a benchmark to see whether the response could suffice. In the following scene, I am having a single s-yarn where I apply a force. The only thing I can add the young modulus and Poisson ratio. Most software for textiles is commercial and my institute does not have access to that software.
I am sharing the video, could you please tell me whether this could be worthwhile to continue with SOFA to model fabric, basically the analytical model is a set of springs( different stiffness), I am confused how would be the answer, I am expecting strain rate 1 up to 4 %.
MABlockedHi @Hugo,
I understand now where is the error was I misplaced the indices place
However, I don’t know how to set the right dimensions of the box correctly.
Thanks so much Hugo 🙂
MABlockedHi @Hugo,
Thanks, I agree 😉 However, I dont know what I am missing, I pressed ‘s’ to select and then ‘v’ to have the table here the first column of pointID exist, I took the first column for each box, in SOFA, it seems the same error happens, I dont know what I misunderstood. I am attaching pictures
Thanks!
MABlockedHi Hugo,
Thanks for advising using Paraview selection tool since it easier, however, I still have a question:
concerning the points of the indices for fixed constraints. I managed to extract using find data, however, I don’t know which points to select there are many, I selected the region graphically (attached photo and ascii vtk file). Actually, the tutorial of paraview is outdated. The question which points to select from the file or I has to reduce my selection in purple( see attached photo).The file of ascii vtk
https://gofile.io/?c=xXERbIThanks,
MABlockedThanks, 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?
MABlockedI 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.
MABlockedHi Hugo,
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:)
MABlockedThanks Hugo,I solved this issue.
MABlockedHi Hugo,
Thanks! No, in my example the box doesn’t show fixed to the mesh
When I add the box and I tried different locations
I don’t know how these numbers are selected, I just looked at VTK ascii file, I could not find a solution for attaching the box to my mesh.
Best
MABlocked@sescaida, the code I am using for generating the volumetric mesh, doesn’t work, the mesh in exported indeed in vtu when I am trying to visualize it gives me an error: there is no tetrahedric topology.
I used the same mesh you fixed earlier, I am baffled what mistake I did, I have other OBJ and I am not able to have a proper vtu mesh.
MABlockedHi @hugo,
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.
MABlockedHi @Hugo,
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
the. file:
https://gofile.io/?c=H65JiDMABlockedI solved it,in the following page:https://project.inria.fr/softrobot/documentation/volumetric-mesh-generation-using-cgal-plugin/
In line 6 of the code
node.createObject(‘VTKExporter’, filename=‘bunny’, edges=‘0’, tetras=‘1’, exportAtBegin=‘1’)
It missing path+
node.createObject(‘VTKExporter’, filename=path+‘bunny’, edges=‘0’, tetras=‘1’, exportAtBegin=‘1’)
MABlockedHi Hugo,
Yes, I mean actuating or pulling. Actually, I was able to do that on Linux, but now I have Mac, so I don’t know whether it is a hotkey issue. In other examples, I can pull objects perfectly.
MABlocked@Hugo, Thanks for your reply! Yes, I do agree that modeling Fabric is complex and still have to add actuation, actually my research is concerned about modeling.
Yes, I want to create a volumetric mesh from the STL file: https://gofile.io/?c=vn4wFJ
I know meshing is a separate domain, but I didn’t help in other communities about meshing, few who working on fabric meshing, I asked them and they don’t want to share or help.
Thanks for your time!
MABlockedHi @Hugo,
The ultimate goal in modeling is generating internal forces that can actuate the yarn, firstly, I am expecting to import this mesh in SOFA and apply external forces to measure the strain, stress, friction among stitches and sliding as well.
This would help me in testing different geometrical shapes for making sure that there is force cancellation among stitches that could help in actuating the yarn by using pneumatic actuators.
The bottom line is: testing the mechanical properties of different geometrical shapes woven/knitted yarns that could be best to be actuated and also be used for the haptic interface.
Best,
MABlockedHi Hugo,
Are there updates concerning the mesh, I still cannot solve the error?
Best,
-
AuthorPosts