Home › Forum › SOFA › Using SOFA › [SOLVED] deform the mesh data
Tagged: 64_bits, SOFA_16.12, win10
- This topic has 8 replies, 2 voices, and was last updated 7 years, 8 months ago by Lujain.
-
AuthorPosts
-
17 April 2017 at 13:53 #8923LujainBlocked
Hello everyone,
I generated FEM mesh using iso2mesh(a volumetric mesh generation tool from segmented map), and I can export the mesh data in off file. But i didn’t find the way to save the file in .obj format. Now I can load the off file which saves the node and triangle in the surface using thle MeshOffLoader. It looks like a liver that i want.
The problem is that I want to deform the liver. I studied the scene file of liver.scn and TutorialForceFieldLiverFEM.scn and TetrahedralCorotationalFEMForceField.scn and so on. But I still didnt get the key point of creating such a scene to achieve my simulation. Can anybody give me some advice?
Thanks in advance.17 April 2017 at 21:40 #8926HugoKeymasterHi Lujain,
If I understand well your process, you are generating a surface mesh from segment ted data. It means your mesh only includes points, edges et and triangles (surface). Right ?
To achieve a simulation like liver.scn or TutorialForceFieldLiverFEM.scn, you need a volumetric mesh, i.e. mesh made up of volumetric elements like tetra or hexahedra. The question coming nest is : how to generate one volumetric mesh from a surface mesh ?
This has already been discussed here : https://www.sofa-framework.org/community/forum/topic/obj-files-msh-files/
Best,
Hugo
18 April 2017 at 03:52 #8928LujainBlockedHi Hugo,
Thanks for ur reply!
The mesh that i got also contains nodes inside. I think it is already volumetric mesh now. The off file that i loaded in meshoffloader contains nodes both in surface and inside and also triangles(surface). The strange thing is if i only saved nodes in surface, it looks disorder in meshoffloader.
Now I dont know how to use or deal with these data in SOFA just using the volumtric elements that i have get, without using other components to generate again.
I am also confused with the convert between the format of these files, i.e.,.off,.obj,.msh,.stl,…
By the way, CGALPlugin cant be loaded in my work and i didn’t solve this problem, so i didnt use this plugin.
Best,
Lujain18 April 2017 at 12:34 #8930HugoKeymasterHey Lujain,
Could you share with us a preview of your volumetric mesh ? a clipping would help to see in the volume of your object.
Hugo
20 April 2017 at 04:03 #8966LujainBlockedHi Hugo,
Sorry for late reply.
I have sent my data file to your emali(I am sorry for that I dont know how to put it in the forum).
Thanks again!20 April 2017 at 09:13 #8967HugoKeymaster20 April 2017 at 09:27 #8968HugoKeymasterHi Lujain,
Your mesh is indeed a volumetric mesh.
Loading your *.mesh file with the MeshGmshLoader should work and then use the same structure as in the scene examples/Demos/liver.scnThis should definitely work.
Here are two pictures of your tetrahedral mesh:Hope this helps,
Hugo
20 April 2017 at 09:40 #8969HugoKeymasterI forgot to mention :
In the liver.scn scene you will find :
<EulerImplicitSolver name="cg_odesolver" /> <CGLinearSolver name="linear solver" iterations="25" tolerance="1e-09" threshold="1e-09" />
This means that the simulation is based on a Euler implicit integration scheme. This scheme builds a linear system Ax=b solved iteratively by a conjugate gradient.
You will also find:<DiagonalMass name="computed using mass density" massDensity="1" /> <TetrahedralCorotationalFEMForceField template="Vec3d" name="FEM" method="large" poissonRatio="0.3" youngModulus="3000" computeGlobalMatrix="0" />
This means that the liver has an homogeneous mass (with massDensity set to 1), integrated within the elements and lumped onto the vertices of the mesh. Finally, the mechanical constitutive law is a co-rotational FEM implementation of the linear elasticity, i.e. linear elastic model allowing for large displacement. The youngModulus is the elasticity parameter. For more, please refer to:
- a systematic approach to the element-independent corotational dynamics
- Efficient, physically plausible finite elements
Cheers,
Hugo
21 April 2017 at 02:42 #8970LujainBlockedHi Hugo,
Thanks very much. You helped me a lot and I can load my *.mesh file in SOFA now.
Then I will follow your advice to do next work.By the way, I also used CGALplugin to generate mesh using MeshGenerationFromImage.scn. But when I test the scene itself.It can generate mesh but can’t create vtu file. Ok,I will pull another topic.
Thanks again for your help.
Best Regrads.
Lujain -
AuthorPosts
- You must be logged in to reply to this topic.