- This topic has 3 replies, 3 voices, and was last updated 6 years, 3 months ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.
Home › Forum › SOFA › Programming with SOFA › [SOLVED] Apply a force field on a MechanicalObject constructed by SubsetMultiMapping
Tagged: 64_bits, Linux_other, SOFA_1712
Hi guys,
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 field always needs a topology to works properly. So I planned to generate a topology from the MechanicalObject. I thought that a SparseGridTopology will do the trick but it seems that this one is intended to generate from an existing topology and not from a MechanicalObject. I’ve also noticed that an InteractionForceField may be an alternative solution to my goal.
What will be the best solution from your point of view?
I use SOFA 17.12.02 on Fedora 26
Hi @ant0nin
I think that “InteractionEllipsoidForceField” is better solution for this problem because this component work with Mechanical Object and no need to topology
Best Wishes,
Behnam Binesh
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 MechanicalObject, SubsetMultiMapping and the force field are dynamically created when a contact between two objects occurs). Now my force field can apply on the generated MechanicalObject.
Thanks anto0nin for sharing the final solution!
Looking forward to seeing your achievements!
Cheers,
Hugo
WARNING
The forum has been moved to GitHub Discussions.
Old topics and replies are kept here as an archive.