Each collision model such as TTriangleModel (for instance) has a “group” property. This property actually represents the collision group of the collision model as an integer. In your case, you need to assign a different collision group to your object A and object B, because the collision detection is not performed between objects…[Read more]
Thank you very much for your reply. Your way in explaining is very educative to me.
The reason for using “surface_fine” part in my code just is to extract the surface of the tissue, but I do not want it to have a real skin. If I add mechanicalObject, TriangularFEMForceField and TTriangleModel to the surface_fine nod…
In your python file scene, you have to remove the DefaultContactManager at line 22. The component CollisionResponse at line 24 is its substitute.
Your soft tissue ‘surface_fine’ (node) must owns at least a collision model like…[Read more]
Sorry for the late answer. I saw your python script and I understand why it does not work. In fact, I omitted to give you important details about FrictionContact:
FrictionContact only works when combined with the FreeMotionAnimationLoop component and not DefaultAnimationLoop. To clarify, the contacts are solved through a penalty…[Read more]
In SOFA, the simulation of friction between objects is based on the Coulomb friction cone: https://scaron.info/teaching/friction-cones.html
In order to take friction into account within your SOFA scene, you’ll have to use a collision response of type ‘FrictionContact’ and specify its friction coefficient ‘mu’. The value of ‘mu’ should…[Read more]
In SOFA, the component/class which describes the collision pipeline and how the contacts are handled is DefaultPipeline (alias CollisionPipeline). As it is visible in its init() method, the pipeline is very modular and needs additionnal components to be configured:
1 – A component like LocalMinDistance which describes the…[Read more]
Ant0nin replied to the topic How to exclude certain mesh elements from the collision test? in the forum Using SOFA 1 year, 2 months ago
I’m wondering if there is a way to exclude certain elements (nodes, edges, faces, etc.) in a mesh object from collision tests without deactivating the collision on the entire object?
If the elements you want to exclude from your collision models are always the same all along the simulation, a quick solution I see could be to split y…[Read more]
Thank you @hugo (and sorry for the late answer). I tried your solution but the problem is the same (I obtained the same error about GIL). But, I created a classical XML file scene (.scn) containing a PythonScriptController component which is configured to load my python controller. With this setup, when I try to load the XML file scene on C++…[Read more]
I wrote a simple unit test in C++ using GUnit as recommanded in the documentation. In the code example given in https://www.sofa-framework.org/community/doc/programming-with-sofa/contribute-to-sofa/writing-tests/ there is a function called
sceneLoad()which is able to load an existing XML scene. However, when I try to load a valid Python…[Read more]
Ant0nin replied to the topic Apply a force field on a MechanicalObject constructed by SubsetMultiMapping in the forum Programming with SOFA 1 year, 4 months ago
Thanks @Binesh for your suggestion ! Actually I solved my problem because I noticed that using a SubsetMultiMapping generate a topology which is not displayed in the graph. My force field was unable to find it in the first place but it was simply because I called its init() method before insering it in the hierarchy, which is incorrect (My…[Read more]
Ant0nin started the topic Apply a force field on a MechanicalObject constructed by SubsetMultiMapping in the forum Programming with SOFA 1 year, 5 months ago
I have MechanicalObject in my scene (its template type is Vec3) I fill using a SubsetMultiMapping. Thus, it is contructed using 2 subsets of 2 other MechanicalObjects. I now encounter an issue because I would like to apply a force field on the constructed MechanicalObject but it has no associated topology, and, as far as I know, a force…[Read more]
Hi @Hugo ,
We looked at the SlidingConstraint by opening the mentioned example. Thank you Hugo! It was perfectly what we looked for. Roughly, here is what we made: First, we added a fixed line in the space. Then we added 2 points we attached to our screwdriver using a RigidMapping. Finally, we added 2 SlidingConstaint between the line and the…[Read more]
We are trying to model a screwdriver pushing an object. The motion of the screwdriver is imposed thanks to a LinearForceField and we would like to constrain the screwdriver such as it keeps its trajectory (=it moves only along an axis).
However, the screwdriver slippes on the target object and rotates. How could we fix it ?…[Read more]