A user contacted me with a mechanism that was not simulating properly. It became clear right when I saw it what was wrong; a link must have two sliding connectors on the same path to just slide. Links that have a single sliding connector can rotate around some other connection but with two sliding connectors, the link can only move in a back and forth motion along that path. So that path needs to be a single path used by both sliders.

But that was not the end of it. I changed the mechanism to something that would work and it doesn’t work. it’s another special case that I didn’t handle properly.


Another Special Case

The image above shows the mechanism. the idea is that he rotating link 1 will rotate the sliding connector C around in a circle and link 5 should slide back and forth on link 4. But it doesn’t because the code was never written to move a link based on a sliding connection. It is because the movement of connector C is driving the movement of link 5, not vice-versa. It’s yet another special case for sliding connections.

The solution is fairly simple. I just write some code that finds all sliding connectors that slide “on” a link and then see if a sliding connector is in a fixed position. Then, with a little crude line movement and rotation, I find where the link needs to be. that crude live movement stuff is what I’m working on now and it’s challenging. Mostly, I just need to take the original positions of the various connectors and then move and rotate them based on the new position of that sliding connector. I have it a bit wrong right now but it’s close enough to know that it should be easy to finish it and get this mechanism working.

By the way, the only thing that was technically wrong with the users mechanism was that the two sliding connectors on link 5 in the picture were following two different paths. Even if the paths are parallel, these sliding connectors allow for rotation and link 5 was not stable in that case. it takes two sliding connectors to stabilize a link because the sliding connections are also rotating connections.