Forum Replies Created
-
AuthorPosts
-
HugoKeymaster
Hi Zahra,
shall we close the topic?
HugoKeymasterOk Lujain, keep us updated.
However, it’s hard for us to help since it concerns Paraview and without your mesh.Hugo
HugoKeymasterHey Zahra,
The scene TutorialForceFieldLiverTriangleFEM.scn highlights a FEM implemented on triangles, i.e. surface elements. The external force you notice is the gravity itself. If you open the XML scene, you will note :
<Node name="root" gravity="0 -9.81 0" dt="0.02">
showing that the gravity is set in the y-direction. With FixedConstraint, the liver is therefore under gravity. Defining external forces to deform the object is the correct formulation.
Best,
Hugo
2 May 2017 at 18:35 in reply to: [SOLVED] Issue of error simulating catheter using CatmullRomSplineMapping etc components #9036HugoKeymasterHey Xiaojuan,
By comparing your scene with the CatmullRomSplineMapping.scn, I noted that you were using a Rigid template for the MechanicalObject, whereas the CatmullRomSplineMapping does only handle Vec3d/Vec3f types.
Hugo
HugoKeymasterTo answer your other question : how to define manually the vector of positions of the Mechanical Object.
At my best knowledge, this is not feasible as you described in XML using
<MechanicalObject position[i] = ".." />
Three solutions are available (taking the case of a Rigid-templated MechanicalObject):
- give the position manually in the scene:
<MechanicalObject template="Rigid" position="0 0 0 0 0 0 1 1 0 0 0 0 0 1 2 0 0 0 0 0 1 3 0 0 0 0 0 1" />
- you can describe your position vector in an obj (e.g. “mesh.obj”) file like
v 0 0 0 0 0 0 1 v 1 0 0 0 0 0 1 v 2 0 0 0 0 0 1 v 3 0 0 0 0 0 1
and load this obj in SOFA, and assign these loaded positions:
<MeshObjLoader name="loadingFile" filename="mesh.obj" /> ... <MechanicalObject position="@loadingFile.position" />
- or do it in Python using a PythonScriptController, see examples in the Python plugin.
Does this help ?
Cheers,Hugo
HugoKeymasterHi Xiaojuan,
The data positionDevice of the class GeomagicDriver is not a vector of positions, but just a single Rigid coordinate. So all you can do is to manually define the data positionDevice with one rigid, for instance:
<GeomagicDriver positionDevice="0 0 0 0 0 0 1" />
Cheers,
Hugo
2 May 2017 at 18:24 in reply to: [SOLVED] How to figure out the available options of xml tags? #9032HugoKeymasterHey Vincent,
The possible attributes (called also data) are available in the API documentation.
We are currently working on a more accurate overview of all available attributes in SOFA (work led by @guillaumeparan).
Do not hesitate to improve (edit and pull-request) also the online documentation.
Thank you for sharing this post. Since it works, I will set the topic as resolved, alright?Cheers,
Hugo
HugoKeymasterHey @boland3,
Indeed, you have compiled the Geomagic plugin successfully. Note that you compiled SOFA in debug mode. Is this on purpose? I would advise to run in release mode, it would obviously run faster.
Moreover, you need to install your Geomagic haptic device. But this has nothing to do with SOFA. This should be described in the documentation of the plugin (README.txt).
What is your error now? is it still the one you described above ?
The exception unknown software exception (0xe0434352) occured in the application at location 0x76510f22
Because as I said, it is a Windows error regarding the message. Not directly related to SOFA.
Cheers,Hugo
HugoKeymasterDear Lujain,
If you want to select edges, there is, for now, no selector in SOFA. But a new GUI is in progress (see here to learn more, especially the last comment of damienmarchal). To select ids, you should be able do it in your mesh editor (e.g. Paraview, Blender).
In the scene liver.scn, the indices 3, 39 and 64 were selected before the simulation and defined as fixed constraint.
Does this help?
Best,Hugo
27 April 2017 at 10:40 in reply to: [SOLVED] Issue of error simulating catheter using CatmullRomSplineMapping etc components #9012HugoKeymasterHi @xiaojuan,
I fixed the layout for you. You need to set the code marker at the beginning, jump a line and at the end set another code marker.
It looks like a pretty old component. At least, I did not know it!
The scene examples/Components/mapping/CatmullRomSplineMapping.scn is working fine for me. I am using the master branch on Linux. Are you using SOFA v16.08 ?Otherwise, you can look at the BeamFEMForceField example (examples/Components/forcefield/BeamFEMForceField.scn). Hope this helps
Hugo
HugoKeymasterHi Siming,
Yes, it is highly possible, that’s why I wrote above: Dicom images include the orientation of the image. When exporting a mesh, depending on the extension, this orientation is saved or not.
I remember there is a way to extract the orientation matrix of the Dicom image. Can you find it ?
With this orientation, you can align both .obj and .stl meshes. To do so in SOFA, you need to use the translation and rotation data of the loader (i.e. MeshObjLoader and MeshSTLLoader) you are using.
Best,
Hugo
27 April 2017 at 00:14 in reply to: [SOLVED] How to import volume mesh from Matlab iso2mesh toolkit? #9008HugoKeymasterWahoo, nice work Vincent!
Thank you so much for sharing!HugoKeymasterHi Salman,
Did you try to use two visual models, like :
<Node name="PhysicalObject" > ... <MechanicalObject/> ... <Node name="visuTexture" activate ="1"> <OglModel texturename="mytexture.jpg" /> <IdentityMapping/> </Node> <Node name="visuUnifiedColor" activate ="1"> <OglModel color="red" /> <IdentityMapping/> </Node> </Node>
And still using Python, you could then activate or de-activate the visualization nodes as you want (using the activate data in Node).
Let me know if it fixes your problem,Hugo
HugoKeymasterHi Siming,
If I understand it correctly, you have one .obj model for the visualization and one .stl used for the FEM model, right ?
First of all, why would your two models be not in the same configuration ?
If it comes from Dicom data, you can use the projection matrix saved in the header to register both meshes..Hugo
HugoKeymasterDear Pedro,
Thank you for your interest in SOFA and welcome into the SOFA community!
Could you tell us more your configuration (which version of SOFA, version of python) ? what is the error you get ?
Cheers,Hugo
HugoKeymasterDear Salman,
Thank you for your interest in SOFA and welcome into our open-source community!
About exporting the position of your object(s) during the simulation, you can use:- an mesh exporter (like the VTKExporter): with this exporter in the scene, you will be able to save a vtk file at each step of your simulation and replay it in paraview. Please find an example in : examples/Components/misc/VTKExporter.scn
- a State exporter : this is a SOFA export format saving the position as you do it
About saving screenshots more efficiently in SOFA, I do not have experience in this. Let’s see if anyone in the community has done this before.
Finally, this recently-published paper focuses on a similar challenge and could be of interest for you :
Segmentation and Labelling of Intra-operative Laparoscopic Images using Structure from Point CloudHope this helps,
Hugo
HugoKeymasterHi Lujain,
Unfortunately, there is no example scene for the MeshExporter.
Looking at the MeshExporter.cpp might help you with all data names etc. If you write your own example scene, do not hesitate to pull-request it / share it !Another way would be to export as VTK, then in Gmesh read the VTK file and resave it as gmsh. Let me know if this helps.
Hugo
23 April 2017 at 13:43 in reply to: [SOLVED] CGALplugin(MeshGenerationFromImage):Error in creating file data/output.vtu #8988HugoKeymasterThank you for the feedback Lujain !
Good work ! Keep us updatedHugoKeymasterHi @boland3,
Sorry for your compilation failure. This error is not related to SOFA.
See the following forum discussion:
https://answers.microsoft.com/en-us/windows/forum/windows8_1-performance/the-exception-unknown-software-exception/f1404ce4-cdbe-4758-aa19-bad55fcc099cThe CMake must only be run for SOFA. If the plugin Geomagic is activated in CMake, it will be compiled. Nothing more to do (as explained in the doc).
Cheers,
Hugo
21 April 2017 at 22:04 in reply to: [SOLVED] How to generate one specific deformation in two different mesh resolutions? #8976HugoKeymasterHey Zahra,
Any news ? any progress ?
Cheers,Hugo
21 April 2017 at 22:00 in reply to: [SOLVED] Queries about tetrahedralization with the CGAL Plugin. #8975HugoKeymasterSo, 4.7 is working for you Lujain, right?
Shall we close the topic?HugoKeymasterHi Lujain
The CGAL plugins is indeed not compatible with the latest 4.9 version of CGAL.
Since you opened a new issue for the output problem, I will close this topic. Alright?
In the future, the CGAL SOFA plugin should be made compatible with the 4.9 version.Cheers,
Hugo
HugoKeymasterI forgot to mention :
In the liver.scn scene you will find :
<EulerImplicitSolver name="cg_odesolver" /> <CGLinearSolver name="linear solver" iterations="25" tolerance="1e-09" threshold="1e-09" />
This means that the simulation is based on a Euler implicit integration scheme. This scheme builds a linear system Ax=b solved iteratively by a conjugate gradient.
You will also find:<DiagonalMass name="computed using mass density" massDensity="1" /> <TetrahedralCorotationalFEMForceField template="Vec3d" name="FEM" method="large" poissonRatio="0.3" youngModulus="3000" computeGlobalMatrix="0" />
This means that the liver has an homogeneous mass (with massDensity set to 1), integrated within the elements and lumped onto the vertices of the mesh. Finally, the mechanical constitutive law is a co-rotational FEM implementation of the linear elasticity, i.e. linear elastic model allowing for large displacement. The youngModulus is the elasticity parameter. For more, please refer to:
- a systematic approach to the element-independent corotational dynamics
- Efficient, physically plausible finite elements
Cheers,
Hugo
HugoKeymasterHi Lujain,
Your mesh is indeed a volumetric mesh.
Loading your *.mesh file with the MeshGmshLoader should work and then use the same structure as in the scene examples/Demos/liver.scnThis should definitely work.
Here are two pictures of your tetrahedral mesh:Hope this helps,
Hugo
HugoKeymaster - give the position manually in the scene:
-
AuthorPosts