Collision confusion

In kanagroo2, there is a component called Collider. The description states that it is used for “collisions between thickened line segments”. Can someone better what this component does and how to use it?

I have tried to use it to calculate the collisions between some curves I have representing wires of different thicknesses as they droop. However, whenever I plug the goal object into the solver, it fails giving the error “more than one error occurred” with no further details.

I have attached the grasshopper file I am using as reference. Wires are anchored on either end, then there is a load goal for gravity. There is also a rod goal to add rigidity to the wires so they don’t stretch infinitely. Finally there is the “collider” goal with the different wire radii. Without the “Collider” goal attached, everything works fine. The solver fails and gives the aforementioned error only when collider is connected.

Wire Collisions Example.gh (14.7 KB)

What is most important to me is to better understand what the “Collider” component does and what “thickened line segments” means in this context.

1 Like

Your first mistake is trying to input PolyCurve into the Collider, which results in the error.
The collider takes in Lines and Points.


Wire Collisions Example.gh (33.7 KB)

i would give my two cents. I am not an expert in Kangaroo but I do work with codes that simulate a similar process of how Kangaroo works.

The most important concept of Kangaroo is that those GoalObjects are a set of “rules” or “forces” so to speak. For each iteration that the solver runs, the points that you input tries to push against each other according to these “forces”.

For instance,
For each iteration

  1. the Anchor Goal Object pulls the “Anchor Points” to the Target Point
  2. The Load Goal Object pulls all the “Points” downwards
  3. The Rod Goal Object pulls the “Curve Points” away from each other AND towards each other, giving it a tensile-like feel.
  4. The Collider Goal Object pulls the “Line” away from each other so they don’t collide.
  5. Each iteration pulls the “Points” minimally until all these conditions are satisfied.

Notice all these Goal Object works with Points or Lines. Not Curves. This is something you would understand immediately when you delve deeper into the code. The PolyCurve Class or the Curve Class have complications that Kangaroo doesn’t like dealing with, whereas Polylines, Lines or Points represent just a set of Points in a particular order, with which they are joined.

That’s why, inside your code, the “Entwine” Component is not needed. Kangaroo takes in a resultant Goal Objects for each points. Entwining it into different Branch will make the script runs iterations redundantly.

1 Like

I don’t see why you would want to use the bouncy solver for this simulation.

Using the standard kangaroo solver, the tree structure is preserved. Using the show component and entwining the inputs with the graft option, the output data tree can be split with a mask and the resulting 10 paths are the control points of the curves.

Wire Collisions Example.gh (35.2 KB)