Screw Fastening Simulation

gary
Posts: 1
Joined: Wed Oct 21, 2020 3:46 pm

Screw Fastening Simulation

Post by gary »

Hi all, I would like to implement a simulation for threading a bolt through a nut and other related screw fastening activities. I saw a video of related behavior: https://www.youtube.com/watch?v=tmgrAB8 ... winCoumans, where a nut and bolt are grouped together using contact constraints.

Is there a way to also model the screwing action itself? Perhaps something similar to the dynamic simulation in Autodesk Inventor: https://www.youtube.com/watch?v=i5QYOJp ... AMTUTORIAL. I'd like to be able to parameterize this behavior by setting factors like required torque, duration of the screwing, and others.
User avatar
drleviathan
Posts: 849
Joined: Tue Sep 30, 2014 6:03 pm
Location: San Francisco

Re: Screw Fastening Simulation

Post by drleviathan »

Do you want to simulate accurate or semi-accurate physics of threaded nut on bolt? Or do you just want an interactive threaded nut on bolt behavior (e.g. as a game mechanic)?

If the former then Bullet might not be accurate enough, since it is a rigid body simulation and accurate nut on bolt physics, especially when tightened, would probably require some flex. Yes, Bullet has "soft-body physics" but I doubt it is up to the task. I'm not sure about that. Perhaps you could scale and tune the physics simulation to give decent non-real-time results, but it would require blood sweat and knowledge.

If the latter, then yes I believe it could be done. You could "fake" it with a custom Action. The btActionInterface is an interface with a pure virtual method called updateAction(). You could derive NutBoltAction from that interface, and implement the method to keep track of the nut and bolt interaction. When you add your Action to the simulation then Bullet will call its updateAction() every substep. Alternatively, if you know how to write the Jacobian of the threaded behavior you could to write your own custom constraint.