Forum Replies Created
-
AuthorPosts
-
HugoKeymaster
Hi @xiaojuan,
Did you find out the source of the problem ?
What version of SOFA are you using? sources or binaries ?
What is the output error ?Cheers,
Hugo
13 September 2017 at 17:10 in reply to: [SOLVED] How to generate one specific deformation in two different mesh resolutions? #9982HugoKeymasterHi Zahra
For the BarycentricMapping, you can see many scenes are using it. Or simply in the examples (examples/Components/mapping). What kind of template are you using in your scene (Rigid, Vec3 ..) ?
Using Vec3, the standard usage is:
... <Node name="Liver"> <!-- ... your solvers , loaders .. --> <!-- Master object --> <MechanicalObject template="Vec3d" name="myObject1" /> <!-- ... your physics (mass etc) --> <Node name="Subnode" > <!-- Slave object --> <MechanicalObject template="Vec3d" name="myObject2" /> <BarycentricMapping name="Mapping" input="@myObject1" output="@myObject2" /> </Node> ...
HTH
Hugo
13 September 2017 at 17:02 in reply to: [SOLVED] Translating mechanical objects (not working c++) #9981HugoKeymasterHi @omarehaly,
If you access the MechanicalObject of your scene, you should be able to do (before the init() ):
your_mechanicalObj->setTranslation(dx, dy, dz);
This should work. HTH,
Hugo
HugoKeymasterHey Wendy,
The .inr format is proper to CGAL. It corresponds to a medical image format.
There is different constraints in SOFA (Fixed, Partial, Attach, Bilateral, AffineMovement…). To better answer you, I would need to better understand what you want to do. But to change the physics during the simulation (“break the constraint”), you will need to code a bit (using Python it would be pretty straightforward).
Best regards,
Hugo
12 September 2017 at 11:23 in reply to: [SOLVED] Track a target point/node on a volumetric mesh #9970HugoKeymasterHey Siming,
To my knowledge, there is no direct way. However, using python it can be pretty easy!
All you need to do is to add this in your XML scene:<Node name="root" /> <RequiredPlugin name="SofaPython" pluginName="SofaPython" /> <PythonScriptController filename="trackingScript.py" classname="trackingScript"/> ... </Node>
and create your tracking script using python:
import Sofa import sys #your python class class trackingScript(Sofa.PythonScriptController): # after creation of the graph, then initialization comes # you need to retrieve the MechanicalObject associated to your object def initGraph(self,rootnode): self.yourNode = rootnode.getChild("YourNode") self.yourMO = self.yourNode.getObject("name_of_your_MechanicalObject") return 0 # called on each animation step def onBeginAnimationStep(self,dt): # here access the node you want .. vector_of_position = self.yourMO.findData('position').value print vector_of_position[10][0] return 0
Hope this helps,
Hugo
HugoKeymasterDear Sen,
You already have many threads open on this topic:
- https://www.sofa-framework.org/community/forum/topic/carving-algorithm/
- https://www.sofa-framework.org/community/forum/topic/problem-with-carving-on-rigid-tissues/
- https://www.sofa-framework.org/community/forum/topic/how-to-carving-by-phantom-device/
Please stop opening new threads on this topic. We already gave you guidance on the plugin. On top of this, examples of the plugin and of topological changes are available in the SOFA repository. If you want a tailored support, please buy a support service.
Best regards,
Hugo
6 September 2017 at 22:51 in reply to: [SOLVED] Export/Save displacement field of a simulation #9963HugoKeymasterHey @germanunkol,
What you want is to access (and export) at ever time step the displacement field with regards to the rest position (u(t)=x(t)-x_0). I am afraid the simplest way to do it is to use the work around you describe, the displacement information is not directly available in SOFA at my best knowledge. Is this crucial for you to have it in SOFA ?
Best,
Hugo
5 September 2017 at 22:28 in reply to: [SOLVED] How should i use damping in HexahedronFEMForceField #9960HugoKeymasterVery nice to hear !!!
Indeed, damping is dedicated to this purpose: damping a system that oscillates.
Thank you for explaining the whole story !
Keep us updated !Cheers
Hugo
HugoKeymasterYou can either share them on wetransfer (temporary), but I guess updloaing a picture of it (http://imgur.com/) would be good as well. Especially if you can provide a cropped view.
Keep us updated 😉
Best,
Hugo
4 September 2017 at 10:54 in reply to: [SOLVED] How should i use damping in HexahedronFEMForceField #9957HugoKeymasterHey Ruilang,
Not sure to understand, when you cut there’s still a point attached?
About damping, Rayleigh damping is a numerical damping, usually used to stabilize or ease convergence of the simulation. But it has to be used with caution since it can strongly affect the solution of your system. You can also add your own damping or using the DiagonalVelocityDampingForceField (I never used it myself).
But more generally, I am not sure that damping would help in your problem.A video illustrating your issue would help the understanding.
Best,Hugo
HugoKeymasterDear SOFA community,
Today is the last day for early-bird registration for the ISMAR 2017 conference in Nantes where SOFA workshop session takes place (09th Oct 2017, full day)!
Contact us for any further information or question you may have.
The SOFA Consortium
HugoKeymasterAs I said, I would model the tumor and the ovary as two regions of one single object.
The CGAL library allows you to mesh different regions with different sizes: https://www.sofa-framework.org/community/doc/using-sofa/optional-features/cgal-library/Each region can be meshed with a different level of refinement.
Each region would have each own physical/mechanical properties.HTH,
Hugo
HugoKeymasterContact me using the form: https://www.sofa-framework.org/consortium/contact/
Thanks.HugoKeymasterLet’s pursue the discussion in PM.
HugoKeymasterHey Yannie,
This paper is based on a collision-detection method called LDI, standing for Layered Depth Images. This algorithm is patented and available in a private plugin for licensing / research. Let me know if you are interested.
Best wishes,
Hugo
HugoKeymasterHi Wendy,
Since the tumor and the ovary are the same organ (ovary), just with different properties, an easy way to go is to run a simulation with heterogeneous properties of your object. A topic talks about it: https://www.sofa-framework.org/community/forum/topic/composite_objects/
To do so, you can use mesher (like CGAL) to take into account the two regions while meshing (create a clear frontier). Then, give specific parameter to each element/region.
Is it clear? Does it help?
Cheers,Hugo
HugoKeymasterHey @beejay ,
alright then, if the explicit simulation gives you the right behaviour/result (are your sure about it?), then the
addForce
function is well implemented.About the implicit simulation:
– are you sure the object is not moving (even small value in thevelocity
field of theMechanicalObject
) ?
– If so, are you sure to have both the integration scheme (ODESolver, e.g. EulerImplicitSolver) AND a linear solver (e.g. CGLinearSolver) ?
– what are the value of iterations / threshold / tolerance in the CG (if you are using one) ?
– finally, the problem could also come from your mappingCould you share us the explicit and implicit scene ?
Hugo
HugoKeymasterHey @xiaojuan
Have you tried to replace the bottom node :
<Node name="Collision"> <CylinderGridTopology name="coli" nx="5" ny="5" nz="115" length="21" radius="0.05" axis="1 0 0" /> <MechanicalObject /> <BeamLinearMapping isMechanical="true" /> <Triangle /> </Node>
with
<Line name="BeamCollisionModel"/>
If it’s working, could you share with us your meshes so that everyone can try your scene?
Best,Hugo
11 August 2017 at 17:57 in reply to: [SOLVED] TetrahedralCorotationalFEMForcefeild used with SurfaceRegistration #9915HugoKeymasterHey Lujain
You have a MechanicalObject that shouldn’t exist:
<Node name="Scene" gravity="0 0 0" dt="0.05" > <RequiredPlugin name="Registration" pluginName="Registration" /> <VisualStyle displayFlags="showForceFields showVisual" /> <EulerImplicitSolver rayleighStiffness="0.5" rayleighMass="0.5" /> <CGLinearSolver template="GraphScattered" iterations="25" threshold="1e-008" /> <Node name="target"> <OglModel name="Liver" fileMesh="output_liver_1_deformation.obj" material="Default Diffuse 1 0 0 1 1 Ambient 1 0 0 0.2 1 Specular 0 0 0 1 1 Emissive 0 0 0 1 1 Shininess 0 45" /> </Node> <Node name="PassiveVolumetricMesh"> <MeshVTKLoader name="meshLoader" filename="output_liver_1.vtu"/> <Mesh src="@meshLoader" /> <MechanicalObject src="@meshLoader" dx="2.5" /> <TetrahedronSetTopologyContainer name="topo" src="@meshLoader"/> <TetrahedronSetTopologyModifier name="Modifier" /> <TetrahedronSetGeometryAlgorithms name="GeomAlgo" template="Vec3d" /> <UniformMass totalmass="5" /> <TetrahedronFEMForceField name="FEM" youngModulus="1000" poissonRatio="0.4" computeGlobalMatrix="false" method="large" /> <Node name="RegisteredTriangleSurface"> <TriangleSetTopologyContainer name="Container"/> <TriangleSetTopologyModifier name="Modifier" /> <TriangleSetTopologyAlgorithms name="TopoAlgo" template="Vec3d" /> <TriangleSetGeometryAlgorithms name="GeomAlgo" template="Vec3d" /> <Tetra2TriangleTopologicalMapping input="@../topo" output="@Container" /> <UniformMass mass="10"/> <ClusteringEngine template="Vec3d" name="clustering" radius='0.01' number='100' position="@meshLoader.position"/> <PositionBasedDynamicsConstraint template="Vec3d" stiffness ='0.1' position="@shapeMatching.targetPosition"/> --> <ClosestPointRegistrationForceField template="Vec3d" sourceTriangles="@../meshLoader.triangles" sourceNormals="@NormalsFromPoints.normals" position="@../../target/Liver.position" triangles="@../../target/Liver.triangles" normals="@../../target/Liver.normal" cacheSize="4" stiffness="200" damping="0" theCloserTheStiffer="1" /> <Node name="Visu"> <OglModel template="ExtVec3f" name="VisualModel" fileMesh="output_liver_1.obj" material="Default Diffuse 1 1 0 0 1 Ambient 1 0 0 0.2 1 Specular 0 1 0 0 1 Emissive 0 1 0 0 1 Shininess 0 45" primitiveType="DEFAULT" blendEquation="GL_FUNC_ADD" sfactor="GL_SRC_ALPHA" dfactor="GL_ONE_MINUS_SRC_ALPHA"/> <BarycentricMapping input="@.." output="@VisualModel" /> </Node> </Node> </Node> </Node>
On top of this, you can increase the stiffness in ClosestPointRegistrationForceField during the simulation. Here is what I get:
Please, do not forget to cite the plugin & SOFA in your work.
Best regards,Hugo
HugoKeymasterDid you take a look at the example : examples/Components/forcefield/BeamFEMForceField.scn ?
Hugo
HugoKeymasterDear Vincent !
I hope you have a good start with SOFA.
Point by point:– dimensions: in SOFA, no unit is specified. This means that your 3D models (ex liver) and the physics parameters (ex: Young’s modulus) must be consistent. For instance, if your mesh is in millimeter, your Young’s modulus must be in MegaPascal. Is that clear?
Do not consider the dimensions of other objects in SOFA examples.– collision detection: in the same way, the numerical settings of the simulation and the collision detection, will depend on your dimensions. Could you show us your scene ? But as first guess, I would shorten the time step, and define larger alarm and contact distances.
– gravitational acceleration : again, seeing your scene would help to give you hints. Here, you should make sure there is not default rayleigh damping in your ODE solver. Until pull-request #350 default Rayleigh values were non-zero.
I hope this helps.
Best,Hugo
HugoKeymasterHi @vmenon,
To represent blood vessels:
- triangular surfaces are usually used when modeling endovascular catheter navigation, see this paper
- or beams when modeling the vessels as a mechanical structure, see this paper
For the first point, the centerline of vessels can be semi-automatically extracted from medical images, and the triangular mesh can be generated. A plugin will soon be available for licensing or research collaboration on the SOFA marketplace.
Hope this helps,Hugo
HugoKeymasterHugoKeymasterHey @outtt,
This work should soon be available for licensing on the marketplace, stay tuned.
Best,Hugo
7 August 2017 at 15:45 in reply to: [SOLVED] TetrahedralCorotationalFEMForcefeild used with SurfaceRegistration #9904HugoKeymasterYour transfer is no longer available Lujain, could you resend it, please?
-
AuthorPosts