11 August 2021 at 20:56 #20155
I am quite new to SOFA and happy for any help;)
I use version v21.06.00 of SOFA in Ubuntu.
I tried to modify the liver.scn to Base.scn in order visualise my Base model and test my meshes.
Therefore, I used a Hexa mesh created in Gmsh as a Collision and Physical model which seem to look fine. However, my obj file that I used as a Visual model (or my implementation?) seems to be faulty. I used MeshLab to create the obj file and it looks fine when I open it in CAD.
Here are my files:
Thank you all in advance! I am happy for any advise!
Tori16 August 2021 at 15:49 #20170
I managed to get a well-looking visual model for my problem.
However, the visual model has an offset with regard to the physics and collision model that I am still trying to fix.
My idea is that it has something to do with the mapping?
If anyone is able to help me I am still very happy for any advice.
Tori18 August 2021 at 16:33 #20181
In your first question, the problem was that :
– your obj mesh was wayyyyy too much detailed (to many elements)
– your msh mesh seems to have some connectivity issues
Now regarding your second post, this means both meshes are generated in two different locations or with two different coordinate systems (obj file is not centered in 0,0,0). In SOFA, you can apply a translation on your loaded mesh using the data field
translation="tx ty tz"where tx, ty and tz are your 3d translations.
Looking at your obj mesh :
translation="-33.7 0 -24.9"should be the correct one.
Hugo20 August 2021 at 14:17 #20186
Many thanks for your answer!
I would have never thought of the fact that the obj file is not centered in (0,0,0)!
However, I am unsure about how to apply the translation.
I tried to edit the translation in the “MeshObjLoader LiverSurface” and also in the “OglModel VidualModel” (see pictures for clarification: https://we.tl/t-8fJB0WKdZc).
After that I reset the scene and the view, however it does not seem to change anything…
What am I doing wrong?
Also, I am wondering if that is the usual procedure to handle obj files?
Many thanks and best regards,
Tori23 August 2021 at 17:55 #20205
You should write this translation field into the scene file itself, not after the simulation is loaded.
Do not hesitate to share your updated version of it.
Hugo24 August 2021 at 14:10 #2023024 August 2021 at 14:52 #20231
You are welcome @toriwalnuss
I set the topic as solved.
I found the extract translation values by computing the size of the box bounding your mesh (dx, dy, dy) and by translating the object by (dx/2, dy/2, dy/2) you get it centered back in (0,0,0). For this I used the “Extract Cell by Region” filter from Paraview 😉
Hugo24 August 2021 at 17:43 #20242
- You must be logged in to reply to this topic.