20 October 2019 at 10 h 14 min #14422
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:
This 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 h 08 min #14428
Hi @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)/
Hugo24 October 2019 at 18 h 57 min #14465
Hi 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.
Luca25 October 2019 at 15 h 09 min #14468
How do you suggest me to modify these parameters?25 October 2019 at 18 h 13 min #14476
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.
Hugo25 October 2019 at 19 h 11 min #14478
These are the file that you’ve requested me.
THank you29 October 2019 at 19 h 21 min #14488
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 falls
Could you explain again what your mesh is representing? What are you looking to simulate?
Hugo30 October 2019 at 6 h 29 min #14490
Hi @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?
Luca31 October 2019 at 14 h 41 min #14503
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:
Hugo2 November 2019 at 14 h 02 min #14515
Hi @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 h 05 min #14520
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.
Hugo3 November 2019 at 19 h 29 min #14521
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 h 14 min #14522
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.
Hugo3 November 2019 at 20 h 16 min #14523
PS: 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 !
You must be logged in to reply to this topic.