Home › Forum › SOFA › Using SOFA › [SOLVED] Some doubts about constraints
Tagged: Linux_ubuntu, SOFA_2012
- This topic has 4 replies, 2 voices, and was last updated 3 years, 7 months ago by SergioPM23.
-
AuthorPosts
-
13 May 2021 at 23:54 #19439SergioPM23Blocked
Hello everyone!
I am currently developing a simulation and I have some doubts about constraints.
In first place, I would like to know how to make all points of an object fixed. I know that if I use FixedConstraint with the indices of all points of the object, it will work, but that is not viable when the object has too many points (the one that I am trying to make fixed, has about 1500 points). I would like to know how could I do this in a simpler way.
In second place, I would like to attach an object (which is not subjected to any force) to another object that is subjected to a force field. Therefore, when the second object moves, the first one should be in movement too. I tried to do this attaching points of the second object to points of the first one (with AttachConstraint), but once again, it would not be viable when a lot of points are needed to be attached. I would like to know what would be the most propper way to achieve this.
I would appreciate any help. Thank you all.Cheers,
Sergio.17 May 2021 at 18:14 #19466amazierBlockedHi Sergio,
I am just passing by and trying to give you some information.
– If you want to fix all points of your object you can create a FixedConstraint (in your object node where you have your MechanicalObject) and you have an option in the FixedConstraint called fixAll that you can set at True.
– I am not an expert on this question but AttachConstraint looks to be a good candidate (you have an example examples/Components/constraint/AttachConstraint.scn). Be sure to use MechanicalObject in both objects. If you have too many indices to write down, you can use BoxROI to draw a box and select the index of your ROI. This constraint can handle many DOFs do not worry 🙂
If you have any doubts, do not hesitate to share your code with simple meshes already present in the shared folder.
Have a nice evening,Arnaud
18 May 2021 at 14:29 #19472SergioPM23Blocked@amazier Thank you so much for your response, it helped me a lot.
Just one more question: can I use the fixAll option in PartialFixedConstraint, or is it exclusively for FixedConstraint?Thanks in advance.
Cheers,
Sergio.18 May 2021 at 14:36 #19473amazierBlockedHi @SergioPM23,
Glad to help you!
Yes, you can use the fixAll flag with PartialFixedConstraint. You can see all the properties of PartialFixedConstraint if you double click on it in your Graph Scene. It is sometimes quicker than checking the C++ code.
Have a nice day,
Arnaud18 May 2021 at 14:50 #19474SergioPM23Blocked@amazier Thank you again for your help and thank you also for the tip to see the properties in the Graph Scene.
Cheers,
Sergio -
AuthorPosts
- You must be logged in to reply to this topic.