Home › Forum › SOFA › Using SOFA › Model collapse with force of gravity
Tagged: 64_bits, collapse model, SOFA_1906, Windows_10
- This topic has 13 replies, 2 voices, and was last updated 5 years ago by Hugo.
-
AuthorPosts
-
20 October 2019 at 10:14 #14422lucaam86Blocked
Hi all,
I’m very new in Sofa.
I’m trying to set up a scene with some anatomical models (obj) inspired by the “liver” scene.
I have a problem: in runSofa my models collapse completely under the action of gravity, unlike the “liver” scene in which the liver remains fixed and immobile in the center of the scene after pressing “animate”.
Where do I have to act to control this situation?
Can someone help me?
This is the video of problem:
https://drive.google.com/file/d/1_1iWYYTdLpgIBGtvU9lVuJdKM9pn8RT3/view?usp=sharingThis is my scn file:
<?xml version="1.0" ?> <Node name="lroot" gravity="0 -9.81 0" dt="0.02"> <RequiredPlugin name="SofaOpenglVisual"/> <DefaultPipeline name="CollisionPipeline" verbose="0" /> <BruteForceDetection name="N2" /> <DefaultContactManager name="collision response" response="default" /> <DiscreteIntersection/> <MeshObjLoader name="aapp" filename="mesh/bio/aapp.obj" /> <Node name="Liver" gravity="0 10 0"> <EulerImplicitSolver name="cg_odesolver" rayleighStiffness="0.1" rayleighMass="0.1" /> <CGLinearSolver name="linear solver" iterations="25" tolerance="1e-09" threshold="1e-09" /> <MeshGmshLoader name="meshLoader" filename="mesh/bio/aapp.msh" /> <TetrahedronSetTopologyContainer name="topo" src="@meshLoader" /> <MechanicalObject name="dofs" src="@meshLoader" /> <TetrahedronSetGeometryAlgorithms template="Vec3d" name="GeomAlgo" /> <DiagonalMass name="computed using mass density" massDensity="1" /> <TetrahedralCorotationalFEMForceField template="Vec3d" name="FEM" method="large" poissonRatio="0.3" youngModulus="3000" computeGlobalMatrix="0" /> <FixedConstraint name="FixedConstraint" indices="3 39 64" /> <Node name="Visu" tags="Visual" gravity="0 -9.81 0"> <OglModel name="VisualModel" src="@../../aapp" /> <BarycentricMapping name="visual mapping" input="@../dofs" output="@VisualModel" /> </Node> <Node name="Surf" gravity="0 -9.81 0"> <SphereLoader filename="mesh/liver.sph" /> <MechanicalObject name="spheres" position="@[-1].position" /> <SphereCollisionModel name="CollisionModel" listRadius="@[-2].listRadius"/> <BarycentricMapping name="sphere mapping" input="@../dofs" output="@spheres" /> </Node> </Node> </Node>
22 October 2019 at 14:08 #14428HugoKeymasterHi @lucaam86 and welcome on the SOFA forum!
First of all, thank you very much for making the effort of generating a video and sharing your scene with us. It helps.
Could you also share the mesh with us? if not, could you at least send it to me only so that I can test it.I can already tell you that the issue might come from the numerical parameters that you set (dimensions, stiffness/mass, timestep)/
Best wishes,
Hugo
24 October 2019 at 18:57 #14465lucaam86BlockedHi Hugo and thank you very much for support.
Yes, I can share with you the .stl file of model.
You can download it here: https://drive.google.com/open?id=1bP-cm_E78lWIjNScUgSskMXFcP4Hyecq
I hope that you can help me to solve this problem.
Thank you
Luca25 October 2019 at 15:09 #14468lucaam86BlockedHow do you suggest me to modify these parameters?
25 October 2019 at 18:13 #14476HugoKeymasterHi @lucaam86
I would need the same *.obj and *.msh files to run the simulation. Can you share it?
It will allow me to answer your last question regarding parameter values.
BestHugo
25 October 2019 at 19:11 #14478lucaam86BlockedHi @Hugo,
sorry.
These are the file that you’ve requested me.
THank you. OBJ: https://drive.google.com/open?id=1-doZ16kr36uEH1xvX6IDxAcx0tVz55xr
.MSH: https://drive.google.com/open?id=18bxOBCNUIKGIll6P79pZMXCfBUKneEJa29 October 2019 at 19:21 #14488HugoKeymasterHi @lucaam86
I run your simulation, here is the video:
I identified several problems:
– your mechanical mesh (blue in the video) seems to have issues: non-manifoldness, single tetra separated from the rest of the mesh
– your fixedConstraint is only on the botton of your mesh, not on the top. Therefore everything fallsCould you explain again what your mesh is representing? What are you looking to simulate?
Best wishes,
Hugo
30 October 2019 at 06:29 #14490lucaam86BlockedHi @Hugo and thank you for support.
Can you explain me better what means that my mesh is non-manifoldness and single tetra separated from the rest of the mesh? How can fix these problems?For the “fixedConstraint” I know, but I don’t know how to set other constraints points.
This mesh represents Pulmonary Artery from radiological (CT) images. I wish I could manipulate this mesh exactly as I can manipulate “liver” with the mouse.
I want to be able to move this mesh with the mouse but I also want that when I finish moving, the mesh returns to its initial shape exactly like the liver.
Can you help me?
Thank you
Luca31 October 2019 at 14:41 #14503HugoKeymasterHi @lucaam86
You can have a look at this topic.
You can easily see in my above-posted image that you also have disconnected tetra: one tetrahedron is falling all alone. Basically, you should consider regenerating a new volumetric mesh.
You can have a look at the CGAL plugin in SOFA.Regarding the FixedConstraint, here are the steps to follow to change the IDs of the fixed nodes/degrees of freedom:
– you can open the MechanicalObject ruling the physics and activate the Visualization option “showIndices”
– choose the indices you want to fix
– add these indices in the field “indices” of the FixedConstraint.I just did a short video highlighting this:
Best,
Hugo
2 November 2019 at 14:02 #14515lucaam86BlockedHi @Hugo and thank you for useful reply to my previous message.
I’ve resolved the problem about disconnected tetra but I’ve another question for you.I link another video (https://drive.google.com/open?id=1LZ-t9s-z_gktl96hR-2SiTPHQoGz8fD_) in which you can see a semi-ball (my demo 3D model) in RunSOFA where I’m trying to customize “Liver.scn” file with my geometries. Inside the ball there are “orange sphere” with the liver’s shape. If I need to stretch my semi-ball I can do it only by drag these sphere and not directly my own semi-ball!
How can I transform these sphere set in semi-ball customized sphere set?
I think that I need to generate a *.sph semi-ball file (like as “mesh/liver.sph”) but i can not understand how can I do it.
Thank you again
Luca3 November 2019 at 17:05 #14520HugoKeymasterCiao @lucaam86
Thank you for all your videos!! you bringing life to this forum!
Do not hesitate your scene file when sharing such a video. It helps others to understand.
But in fact, you understood the problem. The fact is that your interaction with the mouse is done against the collision model (collision spheres inside your grey mesh). The forces due to your mouse actions are applied on these spheres and mapped back to the mechanical model. If you want to be able to “grasp” the grey with the mouse, you need to have the appropriate collision model: either with spheres (sph file) of using. the surface triangles of your current grey mesh.
Let us know if it helps.
BestHugo
3 November 2019 at 19:29 #14521lucaam86BlockedHi @Hugo,
If I can it’s a pleasure for me to share my video with community.
I think that I’ve resolved all problems that I’ve mentioned before.
Another question is: How can i cut a solid cilinder (for example) with mouse or with haptic controller?
I need to cut some blood vessels in Sofa. I’ve tried to set the properties of “Mouse Manager” to “Incise along a path” but seems that this it’s good only for the plane and not for solid geometries. Is it right?
Are there any solution to cut solid like a blood vessels or hepatic parenchima?
Thank you again
Luca3 November 2019 at 20:14 #14522HugoKeymasterHi @lucaam86
Cutting belongs to what is called “topological changes”.
The SOFA API permits it: you can have a look at the Carving plugin for instance.You can also take a look at the example scenes located in the folder TopologicalModifiers.
However, volumetric cutting is still work in progress. Indiedevs in the community are working on it, we should soon have impressive videos for this. Stay tuned.
Best,
Hugo
3 November 2019 at 20:16 #14523HugoKeymasterPS: other topics in the forum cover this “cutting” topic
PS2: when addressing a new topic, do not hesitate to close the previous topic and open a new one !Best wishes
Hugo
-
AuthorPosts
- You must be logged in to reply to this topic.