The Linkage app uses a simplistic simulation algorithm that has some weaknesses. I’m not talking about the issues around links with three connections to the rest of the mechanism where each connection would need one of the others simulated before it could be simulated (being simulated means all of the calculations are done to find where a connector point should be during simulation). I’m talking about link triangles, where three links form a single solid unalterable part. Three links act as a single link. Any number of these links could be actuators that change length, and when they reach their desired length, the triangle becomes solid. At that point, three such link triangles could form a larger link triangle! Although I did add some very specific code to handle this in a very specific situation, the code is not robust and not applicable in many situations.

The Mac Linkage app will circumvent the issues above by creating a set of simulator links that start as copies of the existing regular links. The difference will be that each of these simulator links will have a separate set of coordinates for each connector, so one of these links could change shape during simulation without affecting the shape of any other link. Recall that the Widows Linkage app uses a single connector for each connection between links. That connector holds its coordinates and cannot be changed without all connected links changing. The new method would make actuators easier to manage because they are not a special case for the new simulator. The big benefit comes from finding a link triangle in the regular links and then having a single triangular simulator link to represent them. Link triangles are a little tricky since they can have many connections to other parts of the mechanism, with only their circular set of connections to each link in the triangle being special. Finding these is in itself a bit tricky.

The plan is to create a simulator connector to hold coordinates for the connection and a reference to the in-mechanism connector it represents. This new simulator connector will also have a list of references to all of the links it connects, maybe with the one that owns it being left out. It will also need to have a reference to the other simulator connectors that belong to other simulator links that share the connection. After that, the simulator links will be easy to handle since they will have a set of these simulator connectors and nothing more… I think.

That’s the plan, but I suspect that during implementation, I’ll find improvements that will reduce the complexity of the data or flaws that require more complexity. Hopefully, I’ve developed a reasonable solution, allowing for more flexibility.

And if it wasn’t obvious, whenever the connection between two links is calculated, and the coordinates are available, the temporary point of the original connector in the mechanism will get updated, as well as the coordinates of all of the simulator connectors that share that point.