Rigid curve collide with offset

Hi all,

I been trying to set up a kangaroo system to solve this problem but I’m not sure it is possible at the moment.

The challenge is this:
All objects are rigid - that means they can collide but not changing their shapes.
The red curves are offset from the black curves.
The red curve in the photos cannot touch each other. The red curves can touch the boundary in blue.
The black curves cannot touch the boundary.
The black curves and their offset twin (in red) should always move together.

Included here is the grasshopper file of my attempt. The first attempt is the classic set up for rigid curve collision system, which do not work with the offset in this case.

My second attempt is to create a shape that include both inner curve and offset curve then extract the points of inner curve and include them in other goal such as insideMesh or curve point inclusion. This of course did not work either because the two goals act independently from each other. But I still include here as food for thought.

One way to work around is to offset the boundary but I want to research if there’s a more elegant and accurate method211031_KangarooOffset.gh (520.8 KB)

You can use the ‘Frame’ inputs and outputs to identify rigid curves and lock them together like this:
offset_collide.gh (7.2 KB)
Here the offset rectangles collide with each other, while the inner rectangles collide with the containing ellipse, and the corresponding inner/offset rectangles are locked together.

To get the outer boundary you need to use this trick to make it external

4 Likes

Hi @DanielPiker. I tried coupling the curve collide with other K2 goals and it seem that they are working independently. The curves collide and move with their frames but if their points have to move due to other forces they don\t move along. Why is that? And is there a way to couple the curve collide with the rest?
offset_collide.gh (27.0 KB)

Hi @Mesrop

Are you looking for something like this?
offset_collide_rigidptset.gh (17.0 KB)

The Curve colliders do not automatically create particles for the corners of the curves - they act as rigid bodies, where a single frame (i.e. an oriented particle) tracks the position/rotation of the curve, and the collisions are calculated directly from the curves by finding intersections.
If you do want to also include the vertices as particles which can be acted on by other goals, then you can use the “RigidPointSet” goal.
This adds the given set of points to that frame then keeps them in the same position relative to the frame as it moves (and it’s bidirectional, so pulling the points also applies a pull and torque to the frame).

2 Likes

Ahh so that’s where it was. I had made another script doing that without actually realising that there is such a thing and it worked and felt very natural. Now when it wasn’t working, it became very strange. Thank you so so much for the prompt reply :pray:. Will transfer the logic to the mane script now.

2 Likes