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.

Self aligning boxes

Hey everybody

 

I've been trying to understand the self aligning process of multiple rigid geometries. In the posted file (B.08.0004) I have set up four boxes. Each corner of each box are attracting one another, the idea is that the self-alignment is controlled by the corners. 

 

Well, as you can see in the file, I can't make the attraction stop when each box is entering the volume of another box. Can anyone give me a hint or a way to limit the attraction in such a way that each corner does not penetrate the geometry of another object?

 

BR Kristoffer

  • up

    Daniel Piker

    Hi Kristoffer,

     

    Interesting definition.

    In most of the self-organizing geometry examples in these videos I limited interpenetration by placing hard spheres at the centres of the objects (by interconnecting them with springs - with rest lengths and cutoffs equal to the sum of the spheres' radii).

    I've attached below an altered version of your definition applying this idea(and also shown how to simplify it a bit and display the output geometry).

    This method doesn't completely prevent the objects from penetrating each other, but if the vertices are snapping to each other, it's often enough to ensure the final solution is not overlapping.

    It also sometimes helps to increase the exponent of the attraction force* (to -2 or -3) - this creates steeper potential energy wells, so the vertices are more likely to snap together than get caught in an in-between state. 

    Also - rather than using the inspheres as shown here, you can use the circumspheres, which would prevent penetration better, but only allows the cubes to connect vertex-to-vertex, not edge-to-edge or face-to-face (This is what is shown in my tetrahedra video on the page linked to above).

    I've not tried it, but perhaps by combining the 2 at different strengths (a hard insphere, and a softer circumsphere) you could get better face-to-face snapping without overlaps.

     

    One issue with this though is that the solution will sometimes jiggle back and forth slightly because of this steepness. Reducing the timestep or switching the integration method (Solver option) to the Runge-Kutta 4th order Archimedes or Yoshida 6th order symplectic should help a bit with this.

    (They should be working a bit better in this latest Kangaroo release)

    Another way of tackling it is to give the attraction forces a small negative cutoff value, to avoid the sharply increasing forces which otherwise occur at short distances.

     

    11