Forum Replies Created
-
AuthorPosts
-
HugoKeymaster
hmm ok it’s not the problem I imagined then.
Test to add this option in the root node : bbox=”0 0 0 1 1 1″HugoKeymasterHi Eleonora,
That’s a good question : TetrahedralCorotationalFEMForceField implements a linear elastic constitutive law indeed. However, it is decomposing the actual element configuration into rotational and deformational components. Larger displacement (with small deformations) can therefore be handled still using a linear elastic material. More info here.
Other materials are available in SOFA. You can take a look at the TetrahedronHyperelasticityFEMForceField. This class implements hyperelastic materials.
Best regards,
Hugo
HugoKeymasterHi Quentin
The BoundingBox is a box covering the volume of all objects. In other words, the bounding box in a scene should therefore contain all objects.
If you have already a Mechanical Object in your scene, add the option “showObject”. This will force the computation of the BoundingBox (which is usually done by specific class/functions).
Let me know if this helps.
Cheers,Hugo
HugoKeymasterHey Baymin,
What is the scene you are trying to run ?
You should run it with ./bin/runSofa
The modeler is for long now deprecated, sorry about that.Best regards,
Hugo
HugoKeymasterDear @baymin,
Welcome to the SOFA forum.
Good thing to start with the tutorials, video and documentation.This scene seems to use an old feature of the API. Adding new point, or removing points in the MO is not that straightfoward and should not really be done through the GUI. I invite you to carry on the tutorials, and we will investigate this problem that relates to a deep part of the SOFA API.
Best,
Hugo
HugoKeymasterGood !
Don’t hesitate to “Mark the support topic as solved” when your issue is solved. (there is a dedicated checkbox, when a topic is open)Best,
Hugo
HugoKeymasterHi @montsediaz,
CGAL is a reference for meshing, that’s good to use it.
What function did you use? with which parameters?Can you share your stl mesh with us ?
It’s a tubular geometry, right? Your object might be too thin and needs smaller element size to be able to properly mesh it with tetras.Best,
Hugo
HugoKeymasterHi Quentin,
You can have a look at the example : examples/Components/visualmodel/recordedCamera.scn
Then just use the Qt QUI (“OpenGL” in the View tab).This should do the job.
Best,Hugo
HugoKeymasterHey Quentin !!
Thanks for the question. Animation loops rule the simulation and the order in which the computation is completed. As you noticed there is several animation loops.
There was a short documentation available, but following to your question I just updated it.
Let me know if you have further questions after reading the updated doc.
Best regards,Hugo
HugoKeymasterHi Eleonora,
What units did you use for the gravity (SI units are m/s²), since you use mm it should also be coherently set.
Best,
Hugo
HugoKeymasterHi Eleonora,
There is clearly a question of units.
What is the size of your breast mesh ? Is it in millimeter ?
What is the size of the probe ?Everything should use the same units. Moreover, if your meshes are in millimeter, your mass is in kg, then : the young modulus (~stiffness) should be give in MPa = N/mm2.
I will try to make your scene (breast+probe) work.
Best,Hugo
16 March 2018 at 14:53 in reply to: [SOLVED] Problems generating mesh with CGALPlugin and TetrahedronSetTopologyContainer #10667HugoKeymasterYou’re very welcome @montsediaz
16 March 2018 at 14:22 in reply to: [SOLVED] Problems generating mesh with CGALPlugin and TetrahedronSetTopologyContainer #10665HugoKeymasterHey,
I think I was not perfectly clear.
STL format is a format dedicated to surface (only) mesh. You can’t therefore have a volumetric mesh, in other words a STL file never defines tetrahedron or hexahedron information.From your STL file, you need to generate a volumetric mesh (VTK, gmsh …). CGAL does this step surface -> to volumetric mesh. The process that you describe with CGAL works.
Best regards,
Hugo
16 March 2018 at 10:42 in reply to: [SOLVED] Problems generating mesh with CGALPlugin and TetrahedronSetTopologyContainer #10655HugoKeymasterOK @montsediaz
I am looking at your first scene.
Several things are missing:- 5first of all your mesh is a surface mesh, therefore no tetrahedron are available and the FEM component cannot work properly. You need to create a 3D volumetric mesh (including triangles AND tetrahedra) from your surface mesh.
- moreover, you are missing a TetrahedronSetGeometryAlgorithms
Here is a fixed scene:
<?xml version="1.0"?> <Node name="Root" dt="0.02" > <VisualStyle name="visualStyle1" displayFlags="showVisualModel" /> <RequiredPlugin name="requiredPlugin8" printLog="1" pluginName="requiredPlugin8" /> <FreeMotionAnimationLoop name="freeMotionAnimationLoop9" /> <GenericConstraintSolver name="genericConstraintSolver10" maxIterations="1000" tolerance="0.001"/> <DefaultVisualManagerLoop name="defaultVisualManagerLoop11" /> <Node name="fromSurfaceToVolumetricMesh" > <MeshSTLLoader name="surface" filename="Kyma.stl" /> <MeshTetraStuffing name="stuffing" snapPoints="true" splitTetras="true" draw="false" size="3" alphaLong="0.25" alphaShort="0.4" inputPoints="@surface.position" inputTriangles="@surface.triangles" /> </Node> <Node name="objeto" > <EulerImplicitSolver name="eulerImplicitSolver12" /> <SparseLDLSolver template="CompressedRowSparseMatrix3f" name="sparseLDLSolver13" /> <TetrahedronSetTopologyContainer name="container" position="@../fromSurfaceToVolumetricMesh/stuffing.outputPoints" tetrahedra="@../fromSurfaceToVolumetricMesh/stuffing.outputTetras" /> <MechanicalObject template="Vec3d" name="tetras" position="0 0 0" velocity="0 0 0" force="0 0 0" externalForce="0 0 0" size="1" showObject="1" /> <TetrahedronSetGeometryAlgorithms template="Vec3d" name="GeomAlgo" /> <UniformMass template="Vec3d" name="uniformMass17" totalmass="1"/> <TetrahedronFEMForceField template="Vec3d" name="tetrahedronFEMFF18" poissonRatio="0.45" youngModulus="5000"/> <BoxROI template="Vec3d" name="ROI1" box="0 0 0 1 1 1" position="@tetras.rest_position" indices="0" drawBoxes="0" /> <RestShapeSpringsForceField template="Vec3d" name="restShapeSpringsFF20" points="@ROI1.indices" springColor="0 1 0 1" /> <LinearSolverConstraintCorrection template="Vec3d" name="linearSolverConstraintCorrection21" /> <Node name="NewMeshVisualization" > <OglModel template="ExtVec3f" name="oglModel22" color="green" /> <IdentityMapping template="Vec3d,ExtVec3f" name="barycentricMap23" input="@../" output="@./" /> </Node> </Node> <Node name="visuOriginalMesh" > <OglModel template="ExtVec3f" name="oglModel22" fileMesh="Kyma.stl" material="Default Diffuse 1 0.74902 0.74902 0.74902 1 Ambient 1 0.2 0.2 0.2 1 Specular 0 1 1 1 1 Emissive 0 0 0 0 0 Shininess 0 45 " primitiveType="DEFAULT" blendEquation="GL_FUNC_ADD" sfactor="GL_SRC_ALPHA" dfactor="GL_ONE_MINUS_SRC_ALPHA" /> </Node> </Node>
But you should really find a way to create your volumetric mesh in a proper meshing software (CGAL or other like MeshLab). The MeshTetraStuffing does only roughly the job.
I hope this helps
Hugo
HugoKeymasterDamned! that’s a shame for us sorry about it @secretdevil 🙁
Keep us updated, I want you to succeed in your work!Best
Hugo
16 March 2018 at 10:01 in reply to: [SOLVED] Problems generating mesh with CGALPlugin and TetrahedronSetTopologyContainer #10652HugoKeymasterHey @montsediaz !
Thank you for joining the SOFA forum!
Is there any way for you to share the mesh with us ? I always prefer to run the scenes locally.For the first scene case, try to change the Uniform mass with:
<UniformMass template="Vec3d" name="uniformMass17" totalmass="1" />
(set the value of total mass that you want instead of 1)
For the example using CGAL did you downloaded and installed CGAL and then compiled the CGAL SOFA plugin ?
Best
Hugo
HugoKeymasterHugoKeymasterHi @metheme !
Welcome to the SOFA community!
I am sorry but it seems you tried to updload an image but did not work. You can updload it on http://imgur.com (for instance) and link it in your post.Hmmm I guess @jnbrunet and @epernod this is the problem we already noticed on isolated vertices after a topological change right ?
We will try to get back to you on this @metheme.
If you carry investigating, you can join us on Gitter/GitHub to solve the problem together.Hugo
15 March 2018 at 16:08 in reply to: How to set up parameters for "realistic" behaviour of a liver #10646HugoKeymasterHallo @sebro,
To find the right parameters of your simulation, do not forget to pay specific attention to you units (dimension of the meshes, mechanical parameters, mass density). A previous forum discussion already focused on this topic. Moreover, numerical settings (time step, iterations for the CG etc.) must be carefully chosen to ensure stability and convergence.
I don’t know why but in my case, the BoxROI does not fit the liver (not fixed BC).
Moreover, in your scene you are coupling a volumetric mechanical model (FEM based) of the liver and a surface model. Those two models make your liver very stiff. Moreover, the 3D volumetric model (liver.msh) is very coarse and won’t allow you to capture a detailed dynamics.
Please find below a modified version:
<?xml version="1.0" ?> <Node name="root" dt="0.02" showBoundingTree="0" gravity="0 -9.8 0"> <VisualStyle displayFlags="showBehaviorModels showVisual" /> <RequiredPlugin name='SofaMiscCollision'/> <CollisionPipeline verbose="0" /> <BruteForceDetection name="N2" /> <CollisionResponse response="default" /> <MinProximityIntersection name="Proximity" alarmDistance="0.8" contactDistance="0.5" /> <CollisionGroup /> <!-- rotation="-40 150 80" translation="0 120 0" --> <Node name="FEM"> <EulerImplicit name="cg_odesolver" printLog="false" rayleighStiffness="0.1" rayleighMass="0.1" /> <CGLinearSolver iterations="200" name="linear solver" tolerance="1.0e-9" threshold="1.0e-9" /> <MeshGmshLoader name="loader" filename="/data/Softwares/sofa/src/master/share/mesh/liver.msh" /> <MechanicalObject src="@loader" name="Volume" scale3d="0.75 0.75 0.75" translation="0 1.8 0" rotation="140 90 0"/> <TetrahedronSetTopologyContainer name="Container" position="@Volume.position" src="@loader" tags=" "/> <TetrahedronSetTopologyModifier name="Modifier" /> <TetrahedronSetTopologyAlgorithms name="TopoAlgo" template="Vec3d" /> <TetrahedronSetGeometryAlgorithms name="GeomAlgo" template="Vec3d" /> <DiagonalMass massDensity="1.0" /> <FixedConstraint indices="1 30 50" /> <TetrahedralCorotationalFEMForceField name="FEM" youngModulus="12000" poissonRatio="0.3" method="large" /> <Node name="T"> <TriangleSetTopologyContainer name="Container" fileTopology="" tags=" " /> <TriangleSetTopologyModifier name="Modifier" /> <TriangleSetTopologyAlgorithms name="TopoAlgo" template="Vec3d" /> <TriangleSetGeometryAlgorithms name="GeomAlgo" template="Vec3d" /> <Tetra2TriangleTopologicalMapping input="@../Container" output="@Container" /> <TriangleSet /> <Node name="Surface"> <OglModel name="Visual" color="blue" /> <IdentityMapping input="@../../Volume" output="@Visual" /> </Node> </Node> </Node> </Node>
Note that training sessions are available to address this kind of issues.
I hope this helps,Hugo Talbot
HugoKeymasterHi Zahra,
Did you try the LinearVelocityConstraint component ?
Best,Hugo
HugoKeymasterHi Eleonora !
Thank you for your patience. I really think your project is promising.
I dug into your issue with your scenes and data. There is actually general remarks:- first, note that your mesh of the probe is not properly meshed (stretched, non-regular triangles), you need a good and regular mesh for collision.
- second, your breast mesh (Breast.msh) is in strange unit. You need to be careful with units, since if you use a breast in meters then you can use the usual SI unit (Pascal Pa) for the Young modulus. If not in meter, you need to adapt the Young modulus.
Note that in your case I think that :
- the contact stiffness was really high and to run your simulation without instabilities you needed to decrease the time step.
- moreover, you can simplify your simulation by considering the probe as rigid (with regards to the breast)
Here is a suggestion:
<Node name="root" dt="0.002" gravity="0 -9.8 0"> <VisualStyle displayFlags="hideCollisionModels showVisualModels" /> <DefaultAnimationLoop /> <CollisionPipeline verbose="0" draw="0"/> <BruteForceDetection name="N2"/> <NewProximityIntersection name="Proximity" alarmDistance="1" contactDistance="0.4"/> <CollisionResponse name="Response" response="default"/> <MeshGmshLoader name="meshLoader" filename="Data/emisphere.msh"/> <Node name="Hemisphere"> <EulerImplicitSolver rayleighStiffness="0"/> <CGLinearSolver iterations="200" tolerance="1e-09" threshold="1e-09"/> <TetrahedronSetTopologyContainer name="topo" src="@../meshLoader" /> <TetrahedronSetGeometryAlgorithms template="Vec3d" name="GeomAlgo" /> <MechanicalObject template="Vec3d" name="myLiver" showObject="1"/> <TetrahedronFEMForceField name="FEM" youngModulus="1681" poissonRatio="0.49" method="large" /> <DiagonalMass name="myDiagonalMass" massDensity="1" /> <UniformVelocityDampingForceField template="Vec3d" name="uniformVelocityDampingFF0" /> <BoxROI name="ROI" box="-10 -0.5 -10 10 0.5 10" drawBoxes="0" drawSize="0"/> <FixedConstraint name="Boundaries" indices="@ROI.indices"/> <Node name="Collision"> <MeshGmshLoader name="meshLoader" filename="Data/emisphere.msh" /> <Mesh src="@meshLoader"/> <MechanicalObject scale="1.0"/> <Triangle name="CollisionModel" contactStiffness="100"/> <BarycentricMapping name="CollisionMapping" /> <Node name="VisualNode"> <OglModel /> <IdentityMapping name="VisualMapHemiSphere" input="@../" output="@." /> </Node> </Node> </Node> <!-- Probe --> <Node name="Probe"> <EulerImplicitSolver rayleighStiffness="0"/> <CGLinearSolver iterations="200" tolerance="1e-09" threshold="1e-09"/> <MechanicalObject name="myParticle" template="Rigid" showObject="1" scale3d="0.1 0.1 0.1" position="0 0 0 0 0 0 0" translation="0 8 0" rotation="0 0 0" /> <UniformMass totalmass="2" /> <LinearMovementConstraint template="Rigid" keyTimes="0 0.05 0.2 10" movements=" 0 0 0 0 0 0 0 0 0 0 0 0 0 -1.3 0 0 0 0 0 -1.3 0 0 0 0" /> <Node name="CollisionNode"> <MeshObjLoader name="meshLoader2" filename="Data/probe.obj" /> <Mesh src="@meshLoader2"/> <MechanicalObject scale3d="0.1 0.1 0.1" name="CollModel" /> <Triangle name="ProbeCollision" contactStiffness="10"/> <LineModel name="Lines" contactStiffness="10" /> <PointModel name="Points" contactStiffness="10" /> <RigidMapping name="RigidMap" input="@../" output="@CollModel" /> <Node name="VisualNode"> <OglModel /> <IdentityMapping name="VisualMapProbe" input="@../" output="@." /> </Node> </Node> </Node> </Node>
I hope this helps
Hugo
HugoKeymasterDear SOFA developers,
The SOFA community is still actively recruiting!
You are a physics / simulation engineer, looking for advanced medical applications : check out the open position at IHU LIRYC and the Epione team about “Simulating RF ablations for cardiac arrhythmia”Check our job page or contact us to get all infos and tips!
Pass the woooord!
Best regards,Hugo Talbot
HugoKeymasterHi Tan-Nhu,
Welcome to the SOFA community and more especially welcome to our free forum!
I am always pretty happy to see forum topics already solved! Thanks for having this good habit to post user issue on the forum.Indeed you can either add the plugin library in the Plugin Manager or you can in any of your python/xml scene include the RequiredPlugin component. Both works.
Best regards,
Hugo
HugoKeymasterHi Eleonora,
Welcome to the SOFA forum and into the community!
I will shortly reply point by point but I am still investigating:1) to constraint a motion of your object, I would advise to use the LinearMovementConstraint : this class makes possible to impose displacements depending on the simulation steps/time. You will find an example in examples/Components/constraint/
2/3) I am currently investigating on this and get back to you as soon as I have info.
Best,
Hugo
1 March 2018 at 15:03 in reply to: Problem while opening the sensable example- SOFA crashes while opening example #10582HugoKeymasterHi Wendy!
Good to hear from you and Carlos again.
Thanks for your work and investigation, that’s a code I never used it myself.However, your console output clearly shows that the plugin is successfully loaded but the component fails to create. It therefore might miss an information (or an information is incorrect) for the NewOmniDriver to create.
Are you sure of the deviceName?
No additional warning/error is given?Best,
Hugo
-
AuthorPosts