Forum Replies Created
-
AuthorPosts
-
Alex BilgerBlocked
Hi Ben,
It is obviously confusing. The names are probably not the best ones…
The Bounding Volume Hierarchy algorithm works with a tree of collision models. In SOFA, we use a tree of bounding boxes. Each bounding box has children bounding boxes until the bounding boxes at the deepest level of the tree contain the true collision elements (probably the triangles of your surface mesh). Depending on the depth of the tree, there are not many triangles in a bounding box. Probably only one in your case. So it makes sense that you iterate over only one element in your deepest collision models (the bounding boxes).
However, I don’t understand where the 30 you mentioned comes from. What data are you referring to?
Alex BilgerBlockedGood to know that your simulation is working.
What mesh did you re-export? The FEM mesh or the one used in the MeshROI?Please let us know if you find what caused your problem.
Cheers
Alex BilgerBlockedOk, I think I get it.
Check that the mesh you use for the MeshROI is correctly placed in the scene.
Check that the mesh you use for the MeshROI is closed.
Check that the mesh you use for the MeshROI has its triangles numbered such that the computation of the normal points toward the exterior of the mesh.
MeshROI might be buggy…
Since you have cylinder shapes, try something like this:
<Node name="root"> <VisualStyle displayFlags="showBehaviorModels showForceFields" /> <EulerImplicitSolver/> <CGLinearSolver/> <GenerateCylinder name="mechaCylinder" resCircumferential="20" resRadial="6" resHeight="10"/> <TetrahedronSetTopologyContainer tetrahedra="@mechaCylinder.tetrahedra" position="@mechaCylinder.output_TetrahedraPosition"/> <MechanicalObject/> <TetrahedronFEMForceField youngModulus="5000" poissonRatio="0.45"/> <GenerateCylinder name="constraintCylinder" radius="0.19" resCircumferential="20" resRadial="6" resHeight="10" height="2" origin="0 0 -0.5"/> <MeshROI name="roi" ROIposition="@constraintCylinder.output_TrianglesPosition" ROItriangles="@constraintCylinder.triangles"/> <FixedConstraint indices="@roi.indicesOut"/> </Node>
7 September 2021 at 13:30 in reply to: Extraction of the equation , mass and stiffness matrix of liver from SOFA #20320Alex BilgerBlockedGlobalSystemMatrixExporter is now part of Sofa in its master branch. But it is not yet in any release. It will be in v21.12.
Alex BilgerBlockedI have troubles to understand your problem…
From what I can see MeshROI job is to find all edges, triangles and tetrahedra contained in a mesh made of triangles.
Alex BilgerBlockedHi,
is your shape made of tetrahedra? You can use a Tetra2TriangleTopologicalMapping component. You’ll get a triangle surface.
If you also have a surface for the inside (a hole in your shape), you may use a MeshROI. But it requires that you design a mesh to include only the points you want.Alex
31 August 2021 at 10:59 in reply to: Extraction of the equation , mass and stiffness matrix of liver from SOFA #20263Alex BilgerBlockedYou can have a look on https://github.com/sofa-framework/sofa/pull/2303.
The component GlobalSystemMatrixExporter allows to export the global linear system to solve.Alex
24 August 2021 at 09:15 in reply to: The SOFA functions are not working correctly – iauAtoc13 and iauIcrs2g / iauG2ic #20225Alex BilgerBlockedHi,
I think you are on the wrong SOFA forum. You probably wanted to get help for this SOFA (https://www.iausofa.org/), but our SOFA is sofa-framework.org/.
Good luck.
Alex
Alex BilgerBlockedHi,
I think you are on the wrong SOFA forum. You probably wanted to get help for this SOFA (https://www.iausofa.org/), but our SOFA is sofa-framework.org/.
Good luck.
Alex
9 August 2021 at 18:41 in reply to: [SOLVED] Objects with triangular collision model overlapping #20152Alex BilgerBlockedOk, but do you get any collision response right now?
One thing I would check is ifresponse="FrictionContact"
is compatible with aDefaultAnimationLoop
. I suspect that you need a constraint-compatible animation loop (with a constraint solver), like in the scene https://github.com/sofa-framework/sofa/blob/master/examples/Components/constraint/FrictionContact.scn. Otherwise, you would need to use penalities. Someone else can probably better explain than me.9 August 2021 at 18:14 in reply to: [SOLVED] Objects with triangular collision model overlapping #20149Alex BilgerBlockedHaving triangle/line/point collision models is the usual practice when dealing with collision. It is weird that it freezes.
The warning you get is not necessarily a big deal. It happens when 2 edges are parallel.
Have you noticed that you have two TriangleCollisionModel for each object? I don’t know exactly what the consequences are, but I would not put a TriangleCollisionModel in the main node. Only one one the surface mesh node.Can you be more precise on the result you get with the scene you posted? Do you have collision response? Or it is just that you want better precision in the collision detection?
9 August 2021 at 16:25 in reply to: [SOLVED] Objects with triangular collision model overlapping #20147Alex BilgerBlockedHi,
have you played with the LocalMinDistance parameters? Also, try adding line and point collision models along with the triangle collision models.
Alex
9 August 2021 at 10:25 in reply to: Extraction of the equation , mass and stiffness matrix of liver from SOFA #20144Alex BilgerBlockedHi,
first you need to know that a matrix is not always built. When a template parameter GraphScattered is used in a linear system, it means the matrix is not built. It is for example possible for a conjugate gradient algorithm, where a matrix-vector product is directly computed.
In the cases where the system matrix is built, I am not aware of a way to extract local matrices (mass or force fields). The reason is that mass and force fields directly push their contributions into the global system matrix. It avoids to build local matrices and unnecessary copies.
If you want to extract the global system matrix, it is built here: https://github.com/sofa-framework/sofa/blob/027635f0f0157700f2a01d5bb90afc5802e5f0cb/SofaKernel/modules/SofaBaseLinearSolver/src/SofaBaseLinearSolver/MatrixLinearSolver.inl#L144
You can print it just after if you want.
Your question is legitimate, and we are working towards the possibility to extract matrices. But it is not yet ready. Stay tuned.
Hope it helps.
Alex
27 July 2021 at 09:07 in reply to: [SOLVED] Question about calling header of SofaMeshCollision from SofaBaseCollision #20080Alex BilgerBlockedHi,
you cannot include a file from SofaMeshCollision when you are in SofaBaseCollision, because SofaMeshCollision depends on SofaBaseCollision, but not the inverse.
You can try making SofaBaseCollision depends on SofaMeshCollision, but it would create a cyclic dependency, which is possible only for static libraries.The best solution would be to create your own component, instead of modifying an existing one. Your component would inherit from BruteForceBroadPhase. You can put your component in a plugin, and this plugin can depend on both SofaBaseCollision and SofaMeshCollision.
The lazy solution would be to put your component directly in SofaMeshCollision.31 March 2021 at 08:46 in reply to: [Beginner Question] sofa scenes, plugins and 3rd party applications #19025Alex BilgerBlockedUncheck the CMake variables related to OpenGL and Qt, and the applications such as RunSofa.
Yes, you can use Sofa as an external library.30 March 2021 at 16:42 in reply to: [Beginner Question] sofa scenes, plugins and 3rd party applications #19023Alex BilgerBlockedI am not aware of a plugin written entirely in Python.
You are correct. Creating a scene in C++ follows the same description of a graph that is used in the xml scenes, similarly to how the scenes are created in Python.
My advice would be to try data copies first. Triy to minimize the copies. For example, copy only the vertices but not the triangles.
If performances are bad and if you have a very detailed visual model, you can try to implement the mapping in a shader of your main application. In that case, you can copy the mechanical model dofs, which may be faster to copy than the visual model vertices.30 March 2021 at 08:57 in reply to: [Beginner Question] sofa scenes, plugins and 3rd party applications #19021Alex BilgerBlockedHi,
most of the plugins are actually written in C++. Check out the applications/plugins folder in the sources: https://github.com/alxbilger/sofa/tree/master/applications/plugins
Sofa scenes can be defined in C++. It’s just a bit more sport to write. If you use Sofa as a library you also have the option to load a xml or python scene and embed it in your application.
I am afraid you will need to make data copies at each time steps.
I don’t know if it’s practically possible with Sofa, but you may benefit from CUDA interoperability with your rendering system, in order to avoid the copies. But it’s a dependencies to Nvidia GPUs.Good luck
Alex
29 March 2021 at 11:10 in reply to: visual studio cant work with more than 260 character-length variables #19017Alex BilgerBlockedHi kasra,
check out this doc page: https://docs.microsoft.com/fr-fr/windows/win32/fileio/maximum-file-path-limitation
Does it solve your problem?
Meanwhile, can you describe the context of the issue? Does it happen when you try to install Sofa or compile it? Can you check that the runSofa.exe binary is created despite your errors?
Thank you
22 March 2021 at 08:57 in reply to: [SOLVED] visualizing the difference between two models as a hot plot #18934Alex BilgerBlockedI did not find any component parameter to do what you want.
However, as an immediate workaround, I suggest you two options:
1. Re-order the indices of the faces of your liver, so that the triangle normals are the opposite of the current ones. Blender or MeshLab can help you to do that.
2. In DataDisplay.cpp, change all the glMaterialfv(GL_FRONT,…) to glMaterialfv(GL_FRONT_AND_BACK,…) and recompile.I hope it helps
Alex
5 March 2021 at 09:01 in reply to: [SOLVED] visualizing the difference between two models as a hot plot #18823Alex BilgerBlockedHi Zahra,
if I understand correctly your question, what you are looking for is similar to this scene: https://github.com/sofa-framework/sofa/blob/master/examples/Components/visualmodel/DataDisplay.scn
A combination of EvalPointsDistance, DataDisplay and OglColorMap components.Does it make the trick?
Alex
Alex BilgerBlockedI recommend @epernod for answering this question
Alex BilgerBlockedThanks! Makes sense and it seems to be the only solution. Glad to know that it is possible. I’ll let you know if I go into this direction.
Alex BilgerBlockedIt’s good news! Glad to know someone has results. Good job Erik!
28 March 2017 at 08:42 in reply to: [SOLVED] Queries about tetrahedralization with the CGAL Plugin. #8836Alex BilgerBlockedHello,
I think you should have started another post instead of continuing on this post.
Anyway, your problem is that sofa failed to load the CGAL plugin. If the plugin is not loaded, the other components in the scene cannot work with the CGAL component.
Have you compiled sofa or just downloaded the executable? Here is the documentation on the CGAL plugin: https://www.sofa-framework.org/community/doc/using-sofa/optional-features/cgal-library/Alex
Alex BilgerBlockedHi Hugo,
thanks for pointing me to this interesting discussion. I understand the goal of init functions now. It’s basically a way to link everything together on all platforms.Thanks,
Alex
-
AuthorPosts