Kangaroo

THIS FORUM IS NO LONGER ACTIVE. PLEASE POST ANY NEW QUESTIONS OR DISCUSSION ON:

https://discourse.mcneel.com/c/grasshopper/kangaroo

The discussions here are preserved for reference, but new questions posted here are likely to go unanswered.

Kangaroo is a Live Physics engine for interactive simulation, optimization and form-finding directly within Grasshopper.

Using Kangaroo on clustered sets of points

Hi Daniel,

I am working on an algorithm that can help to automatically organize components on the grasshopper canvas. It is going quite well in that I am able to create a rough optimized layout of all the components. See attached images.

Before cleanup

After cleanup

After the first run, I would like to tweak the position of the "in between parameters" to create strictly horizontal connection curves and ideally concentrate any "vertical" wire movement only in certain areas. (as illustrated in the 3rd image.)

I have a feeling Kangaroo might help me with this. However, I'm running into some issues.

I would need to be able to have kangaroo drive the location of the component, but the input and output parameters need to move with the component. These input and output parameters will drive the location and shape of the connecting wires, which should be optimized for as many horizontal ones as possible.

Could you help me get started, by explaining how I would setup these constraints using kangaroo? I have tried for days, and my head is hurting...

Load Previous Replies
  • up

    Ramon van der Heijden

    Thank you so much for your prompt response to my inquiry. It definitely answers the main question. However, I need to be able to solve this on an enormous amount of components and connections. A few issues are standing in the way of that:
    • When multiple components connect to a single one, at the moment, I believe the goal is to get all connections as straight as possible. However, I would need as many connections to be exactly straight. So if there are 4 connections coming in, only 1 can be straight. the rest is curved. Can you suggest how to setup a goal for that? Perhaps something like awarding exponential points for straightness, with exactly straight hitting a million points.
    • Components can not overlap. At the moment, I have applied a "Collide2D" goal, that seems to work.
    • Components can only move in the y direction. This is a tricky one. When I apply a "Anchor XYZ" constraint to the original points, the clustered points no longer seem to maintain their relationship to the original point.
    Please find my example file attached.
    Your help is much appreciated.
    Best regards,
    Ramon
    5
  • up

    Ramon van der Heijden

    Hi Daniel,

    Thanks for your response. I was able to work your custom goal into a working global definition. It works quite well, and may actually provide a way forward. However, as you may see in the animated GIF below (you may have to click it), the current configuration does not allow components or parameters to "pass" one another:

     If the wires are tangled at the start of the solving, they will remain tangled when the solver is done:

    The reason is that there is a collision goal as well as an axis anchor in place and so these two goals working together prevent any order shifting in any column. Would you have a suggestions to address this issue? I'm basically looking for a way to allow the components to pass one another, but ultimately never overlap.

    Also, I couldn't use the sphere collision goal, as it only accepts a single radius value. The GH components each have different dimensions, So I ended up using the (probably less efficient) "collider" goal. Is there a way to have the SphereCollide goal to take one specified radius per point? (see image below).

    Your help is again much appreciated.

    Ramon

    1
    • up

      Ramon van der Heijden

      Hi Everyone,

      For those of you who have shown interest in this project, I'd like to announce that a first incarnation has been posted on Food4Rhino. Unfortunately, at the moment it is not yet utilizing any Kangaroo functionality, but that might change in the next version.

      Please feel free to check it out and leave your comments.

      A group has been created here:

      http://www.grasshopper3d.com/group/autograph

      Download:

      http://www.food4rhino.com/app/autograph

      1