I'd like to model one body attached to 2 other bodies (= 2 articulated arms) by means of springs (procedural forces in reality). Obviously when the arms rotate the body doesn't move linearly :
Then I'd like to constrain the 3rd body along the axis given by the 2 insertion points. I thought building one joint with 2 parents and 1 child like this: https://ibb.co/pbWVVsn Would it be some way more appropriate ? Thks
Last edited by blackbird_dream on Tue Dec 01, 2020 5:20 pm, edited 1 time in total.
you can attach the control body to one arms using a sliding contacts. thet the joint that is use to make fires without steering then you are free to move the body with spring or what ever other force along the sliding dof.
Yes. It is a hinge with a slider. There are two variants One is named corkscrew. Which a hinge that slides along the hinge axis. The other is the sliding contact which slides along an axis perpendicular to the hinge axis.
You know you can make your own joints, is not that difficulty.
I say this because the sliding contact assume the sliding frame is fixes on a parent frame, but in you case you need to modify the function so the the sliding direction is the direction vctor between the two attachment point in the two arms.
That vector changes direction as the arms rotate. You can subclass from the sliding contact, them overload the submiticonstraint callback and there you can realign the frame matrix of the parent so the sign pin met the instant sling direction. The call the base function.
crystalclear. What about a slider between one body and 2 other bodies (eachone supporting one end of the sliding axis) ? Is it feasible as a joint (between 3 bodies in fact)? I used to implement joints many many times ago with rows and I don't feel comfortale right now.
You can also refine the design. You do not need two sliding contacts.
A better way is use a ball and socket in one pivot. So the controll body does not slides, only rotates. The the second pivot you use the sliding contact.
And that one you apply the spring force. This is fart more robust, stable and simple design.
This avoid the problem of the two sliders sliding along two axis that is ideally parallel, but even using exact arithmetic are not, since each one will slide along a path tangent to the arch of the attachment, and that path drift with each step.
This numerical error translate to large penalty that try to keep the slider in the path. You do not want that to happens.
you disregard what I said about the overloading of the callback to recalculate the alignment, I forget the the hinge part doe that, it should be fine with just the sliding contact and the ball and socket. you can experiment with diffrent building blocks, but at some point yo uwill need to chnage a joint.
is the movie using those sliding contacts configuration?
the movie comes from a mechanical software I use for validation. If I use a ball&socket, the distance between the sphere and the pin stays constant, doesn't it ? In my case it must be free, so the distance can change depending on the spring forces.
you can however make the hinge between the two are, had the spring damper and one extra row.
basically one spring dampend is calculate by the adding a linear row that calculate the linear spring force between the tow pivot on eth two arm.
this will probably be the most efficient and maybe more correct way because adding the a third body add a mass that is not part of teh system, yes tha mass of that body change the total initial of the system. while the linear row act as an ideal spring damper
again is goes back to sub classing the hinge, and overloading the calculateConstraints function for that so teh you call the base class an dthe add teh extra linear row.
blackbird_dream wrote:In my case it must be free, so the distance can change depending on the spring forces.
the distance still changes, the control body will be fixed to one arm and move with it but the spring use teh distance for the center of the control body to the other attachment point wich still changes by the same amount.
What I mean is the 2 distances must change. The distance between the control body and one arm and the distance between the control body and the other arm. I don't understand how it is possible if the control body is connected to one arm through a B&S joint.
Last edited by blackbird_dream on Sun Nov 29, 2020 2:20 pm, edited 2 times in total.
I just read your last msghttp://newtondynamics.com/forum/posting.php?mode=quote&f=9&p=65961. I think thi is not possible that way because the control body is an internal dof indeed and it's non linear (non linear laws of both distances and relative velocities). I can not compute equivalent stifness for the 2 'springs' in series. So I need the knowledge of the control body relative position between the 2 insertions points.
so the effective k becomes k/2 but since each displacement dist/2 the effect is the same as one spring that displace the full distance.
This is not true in my case, because these are not pure springs but non linear forces depending on the position and speed of th eCbody.