Page 1 of 1

point to point spring constraint possible?

Posted: Thu May 21, 2009 12:07 am
by linksan
Hi,

I was wondering whether it is possible to create a spring constraint from one point to another allowing full rotation?
slider constraints don't seem to allow that

it would be something like a six dof constraint with motors

Thank you.

Re: point to point spring constraint possible?

Posted: Thu May 21, 2009 10:08 am
by Dirk Gregorius
You can have a distance constraint through the center of gravity of each body. That would not effect rotations.

C = p2 - p1
dC/dt = v2 - v1
J = ( 0 -E 0 E ) where 0 is the 3x3 zero matrix and E is the 3x3 identity matrix

If you now use CFM and ERP you have a stiff spring. I am not sure whether Bullet supports CFM.

Re: point to point spring constraint possible?

Posted: Thu May 21, 2009 6:25 pm
by rponomarev
Hello,

Do you mean a constraint where all rotational DOF are free, 2 translation DOF are locked and one translation has a spring motor?

In the next release (2.75) we'll have the btGeneric6DOFSpring constraint where you can set a spring to any DOF, so this should solve your problem.

Thanks,
Roman

Re: point to point spring constraint possible?

Posted: Fri May 22, 2009 7:45 pm
by linksan
Yes that sound exactly like what I need :)
glad to hear that it's coming soon.

Thanks

Re: point to point spring constraint possible?

Posted: Mon May 25, 2009 4:47 am
by Erwin Coumans
Bullet 2.75 beta1 has support for springs through the btGeneric6DofSpringConstraint.

Hope this helps,
Erwin

Re: point to point spring constraint possible?

Posted: Wed Jan 06, 2021 1:52 pm
by Ehsanizadi
Hi, does btGeneric6DofSpringConstraint support point to point spring constraint when two dynamic objects are moving with respect to each other?

I see that for btGeneric6DofSpringConstraint, spring and damping coefficients can be defined only in 3 directions, which means, if the location of two connected objects are changed with respect to each other, the values of spring stiffnesses should be adapted at each time step.



Regards,
E30

Re: point to point spring constraint possible?

Posted: Wed Jan 06, 2021 3:17 pm
by drleviathan
Try the btPoint2PointConstraint.

Edit: I'm sorry I didn't ready that carefully enough. You want it to swivel on both ends but to be springy along one linear direction. The btGeneric6DofConstraint would allow you to make only one swivel point. The btPoint2PointConstraint would allow you to swivel both ends but would be stiff along the axis. Hrm...

Yeah, none of the existing constraints would do it for you in one easy solution.

So, you'd have to write your own custom constraint or... it might be possible to achieve it using four bodies and three constraints:

SwivelA <---- Point2PointConstraint ----> PivotA <---- 6DofSpringConstraint ----> PivotB <---- Point2PointContraint ----> SwivelB

Where:
(1) the 6DofSpringContraint is enabled at only one dimension
(2) the Swivels and Pivots overlap but don't collide with each other (using collision groups). The Pivots would be "hidden" inside the Swivels.

Challenges with this method are: (a) For stability purposes the relative mass differences between Pivot and Swivel must NOT be high. Best to split the mass that should be at each Swivel with its respective Pivot (give each 1/2 the mass). (b) Long chains of constraints will make the constraints "soft" (solver does not achieve high accuracy), however for just three constraints you should be fine. (c) Performance issues: if you want to have lots of these structures bouncing around then the simulation could burn lots of CPU power, but if you only need one or a handfull then you should be fine.