Polar array of kangaroo linkages with a driven parameter

I’m relatively new to grasshopper but I was able to create a simple linkage mechanism with a driven angle parameter that moves the connected components. I am using the Kangaroo2 solver and built off of the logic for the strandbeest example I found online.

This script takes as input some manually specified geometry and a drive angle parameter and results in in-plane motion. What I would like to do is to create a polar array about the z axis of N copies of this linkage, which each move independently in their own planes, but vary the drive angle of each linkage as a function of the polar angle, e.g. drive_angle(n) = .01 sin(2pi n) for array elements 0 <= n < N. I’m not quite sure how to do this, any help would be appreciated!

I have tried duplicating copies of the input geometry and setting the input angle to be a series tree with N branches, each with a different value for the drive angle and duplicating the goal objects, but I don’t think I’m getting the tree structure correct to align the data. I’ve also looked into using the anemone plugin to run N instances of the solver with different input parameters but couldn’t get that to work either. (And I believe the tree approach would be cleaner here.)

Thanks in advance for any help!

linkage_test_for_forum.gh (32.0 KB)

linkage_test_for_forum.3dm (61.5 KB)

I’ve played with this more over the last two days but still struggling to get this to work. When I duplicate the entire block of nodes and feed it into a separate solver node, it behaves as expected, with two independent copies of the geometry. But when I create a duplicate of the goal objects (everything upstream of the solver) and entwine the copy with the original goals as {{goals_0}, {goals_1}} it instead creates a single instance of the geometry which seems to be affected by both input angles. I’m wondering if this is creating a shallow copy instead of a deep copy of the input geometry and perhaps the duplicated set of goals are trying to reference the same objects?

I’m pretty baffled by what’s going on here and maybe there’s something I’m overlooking – @DanielPiker do you have any ideas about what’s happening here?

The file you shared above works fine.

I think if you want any help with this it would be good to also share what doesn’t work?

Here’s the working (using separate solvers) and non-working (unified using one solver) versions. They use the same .3dm file.

I would like to be able to make an arbitrary number of copies of this but it seems like that will require using one solver on vectorized inputs, and I can’t figure out how to get that to work.

linkage_test_for_forum_v2.gh (34.0 KB)

linkage_test_for_forum_v2_separate_solver.gh (35.2 KB)

Your objects are coincident and the solver combines particles within the tolerance specified.

Your example with one solver works when the second linkage is moved upwards a bit.

linkage_test_for_forum_v2_ZZ.gh (36.1 KB)

Amazing thank you!

I modified the file to generate a polar array of N of these mechanisms. It works but it is very slow (the solver runs for ~1 minute), much more than N times the solver duration of a single instance. Is there a way to hint to the solver that the branches of the goals in the tree should be non-interacting?

linkage_test_vectorized.gh (38.2 KB)