Collision between geometries

Dear All,

I hope everything is fine by your side during this week. I am trying to find a way to superpose every cylinder brep I inputted like in this picture.

I have internalised the geometry I have inputted but we see that most of geometries are crossing through. The goal is to avoid it.

I have tried something with Kangaroo to create collision between object in Z-order but then when I did it, here is there result : they are floating in the Z direction in an infinite way. I had to stop it


I would like to know if someone have an idea or other that can help.

Many thanks,

Collision_Script.gh (51.9 KB)

You could probably test simple collisions using lines instead of rigid bodies given their simplicity (they’re just cylinders - same as ‘thickened’ line segments?):
Collision_Script.gh (13.3 KB)


*Note:
In the example I turned the lines into mesh pipes at the end for speed, using a Mesh Pipe component - if you don’t have it then simply replace with the regular pipe component.

*Edit:
You can also check out this one if you haven’t:

Hi Rene,

Thank you for the reply. The tricky part is to stop just like that (Image below) as same position as I inputted before (Cylinder in their initial positions). Because the goal is to put objects one above another instead of crossing shapes like they are solid objects.

Here you can see that they are not solids if they intersect :slight_smile:

1 Like

Got you - makes sense - have you tried changing your ‘load’ kangaroo component? I think the one you grabbed is missing an input - I noticed the simulation made everything fall down (as opposed to some rods floating upwards) when I changed it for the latest component:

image

I also made sure the Z vector was not set to “-0.03” but actually larger like at -1

By the way, in the simpler example I shared above, rods are not intersecting each other but if I understand correctly you want rods to end up in a specific position like your image but without the intersections?


understand correctly you want rods to end up in a specific position like your image but without the intersections?

Exactly ! This is the point ! From intersected to superposed through Kangaroo.

1 Like

A thousand days later, @El_Mehdi_Belyasmine, I realized what you can do to get closer to what you’re looking for is go back to using only * thickened line collisions (for the sake of speed), then grab an AnchorXYZ (forgot about that one) from Kangaroo so you restrain XY displacement and so that colliding objects only move in Z, are still affected by gravity, and still have a floor, blah blah - check it - I don’t assume it’s solved :wink: - maybe you’ve already moved on.

Anyway:
Collision_Script.gh (79.2 KB)

rodscollide
image
Check the radius adjust to take care of slight separation after collision:
image

Note:
I tweaked and left the rigid body method in the script (disabled) - I think it works * (maybe not? It seems weird) but you have to wait longer for the *cylinders to settle into place - perhaps unnecessarily slow.
Cheers

2 Likes

Hi René !!

Yeees !! THank you so much (Sorry I was on holidays). I was close to it ! Many thanks

Cheers