If you come across this article, you may also be interested in RobotSimulation
Some time ago, I also experimented with this, without going any deeper.
CustomCylinderAndSphereKnee
CustomCylinderAndKnee
All from the collection Collection of examples from discourse.threejs.org