31 July 2019 at 17 h 53 min #14053
I came across a difference between the AttachConstraint and FixedConstraint in the simulation. The difference will be clear with the following images
AttachConstraint behavior – https://ibb.co/wsbC2f9
FixedConstraint behavior – https://ibb.co/rvP9nBD
Essentially there is too much deformation with attach constraint. I fail to understand why this is as even with fixed constraint I am only fixing the positions of the two vertices. Does it have something to do with the stiffness of the constraint?
Rishabh13 August 2019 at 18 h 04 min #14098
It is a good questions.
The FixedConstraint is a ProjectiveConstraint, which will enforce a zero velocity on specific points of your model.
The AttachConstraint is a PairInteractionConstraint (documentation is missing for now, but we work on it). This component aims at satisfying the constraint defining that two points of two different models (“paired models”) have the same position. In your case of of the two models (red balls) are fixed. So it should give the same result. To get the same result (same physics), you should activate the option twoWay. This option makes sure that forces are projected back from model2 to model1.
Still, could you share the scene you wrote with the AttachConstraint please?
Hugo14 August 2019 at 18 h 27 min #14120
The scene file can be found here in gist, https://gist.github.com/jangirrishabh/3753c2a877535a47c82a954cf6c5a168
I tried the ‘twoWay = True’ param but did not notice any change in the deformations. Although adjusting VelocityFactor, PositionFactor and radius parameters has some minor effects.
I need to move the red balls around as actuators, they are physical objects who can interact with the environment, and controlled by two other virtual input balls, whose position I am essentially changing (and having a spring force field between them). Am I doing something complex here? Is there an easy way to just move the red balls around without having to attach them to virtual balls with a force field
Rishabh23 August 2019 at 11 h 55 min #14147
Before asking any further details, what are the unit of your simulation?
Hugo24 August 2019 at 13 h 05 min #14153
Hi hugo, what do you mean by the unit of simulation?
Rishabh26 August 2019 at 11 h 54 min #14158
I mean, what should be the size the square object, what should be its Young modulus ?26 August 2019 at 12 h 17 min #14159
Okay, for now the simulation units mentioned in the script are alright. All my experiments are in simulation so that does not affect the problem. So yes, the numbers in the script can be used.2 September 2019 at 16 h 37 min #14173
I might have been unclear.
What are your units: mm ? meters ? inches ?
Just make sure that your physical parameters (elasticity, threshold, time steps etc.) are accordingly and properly defined.
To more specifically answer the initial question: whas is the difference betweem FixedConstraint and AttachConstraint (with twoWays option):
- FixedConstraint is a projective constraint. It means at each time step, the fixed nodes will a zero-velocity projected. Therefore, they won’t move.
- AttachConstraint is a PairInteraction constraint. It means it couples a pair of objects and it will constraint each of these objects to respect the constraint that x_object1[indices1]=x_object2[indices2]. This constraint is included in the constraint Jacobian matrix H:
Let me know how I can help further.
Hugo16 April 2020 at 14 h 34 min #15785SarahParticipant
Building upon this topic. I’ve been looking into some of these constraints as well and was using the RestShapeSpringsForceField myself in order to constrain some points. But read in this topic that this would not ‘respect’ the physics: https://www.sofa-framework.org/community/forum/topic/fixed-constraints-not-so-fixed-with-genericconstraintsolver/
Am trying to figure out what the best constraint is to apply to get physical results upon deformation of the mesh object. Would you recommend using the FixedConstraint instead of the RestShapeSpringsForceField, or would it be better to use Attach constraint?
Furthermore I was wondering about the constraint solvers the GenericConstraintSolver seems like it would be applicable to any of these three forms of constraints, but what would the reason for using the LCPConstraintSolver be? Would that be more for collision and friction? Thanks for your input the forum has been a really useful tool for me!
Sarah16 April 2020 at 16 h 06 min #15793
Constraints work well no worries.
If you are looking at defining a fixed boundary condition: then the FixedConstraint is the good solution. But it depends on what is your physical purpose.
Could you describe a bit more your use-case/scene?
Hugo16 April 2020 at 18 h 29 min #15797
- You must be logged in to reply to this topic.