Home › Forum › SOFA › Getting Started › [SOLVED] What is wrong with my visual model?
Tagged: Linux_other, obj, Other, SOFA_2106
- This topic has 7 replies, 2 voices, and was last updated 3 years, 2 months ago by Tori.
-
AuthorPosts
-
11 August 2021 at 20:56 #20155ToriBlocked
Hey there!
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:
https://we.tl/t-V509UfMGGtThank you all in advance! I am happy for any advise!
Best regards,
Tori
16 August 2021 at 15:49 #20170ToriBlockedUpdate:
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.Many thanks,
Tori
18 August 2021 at 16:33 #20181HugoKeymasterhi @toriwalnuss
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 issuesNow 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.Best wishes,
Hugo
20 August 2021 at 14:17 #20186ToriBlockedHi @Hugo!
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,Tori
23 August 2021 at 17:55 #20205HugoKeymasterhi @toriwalnuss
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.Best,
Hugo
24 August 2021 at 14:10 #20230ToriBlockedHi @Hugo,
many thanks, I managed to add the translation to the scene itself and it is looking good! π
https://we.tl/t-qcnyh8ILLYOne last question: How did you find the exact values for the translation?
Thank you so much for your patience!
Best regards,
Tori
24 August 2021 at 14:52 #20231HugoKeymasterYou 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 πBest
Hugo
24 August 2021 at 17:43 #20242 -
AuthorPosts
- You must be logged in to reply to this topic.