The whole “fastening” thing is a bit troublesome for me. I originally wanted to be able to move drawing elements with links and decided to allow “fastening.” This worked pretty well, though there is a bug where deleting a fastened element somehow causes a crash. But fastening isn’t quite right, bug or no bug. It is especially difficult to use now that I make links and gears move together by fastening them together.

To make the problem even more difficult, I had to make a way for gears to be fastened to the ground so they don’t rotate freely. And this is where I found myself mucking around in the Linkage code tonight.

A simple change to the code that allows and disallows actions let me fasten a gear to the connector at its center. Here’s the mechanism that made me want to make this change:

image

Gear 7 is fastened to anchor H making it not rotate freely.

But now what about gears that have an input anchor at their middle? I originally opted to make the gear rotate with the input even if they are not fastened together. It made sense because there is seldom a need to let a gear spin freely on a shaft that is rotating. I will keep it this way for now because no one really uses gears in the Linkage program anyhow.

Now on to finding the fastening bug!