Kangaroo clamp distance between meshes

Hi there :slight_smile:

I have a set of meshes. I need to set a minimum and a maximum distance between the meshes, so when they move, they don’t go beyond the specified distance limit.

I am not sure what could be the best approach for this, but the most close I could get is using lines in between the faces with clamp length component. The lines, however, still can tilt, which means that the distance between the meshes is not the same as the length of the lines. Also, there are going to be many meshes, and they all should have a min-max span in between, so I find this solution a bit naïve.



distance_between_meshes.gh (51.3 KB)

I looked at the whole forum, old one as well, and I checked all the example files here, but I still couldn’t find a solution.

Please, any advice

A few ideas, depending on what behavior you want:

  • Add angle constraints between your mesh edge and line and use the starting angle as RestAngle (default)
  • Construct a space frame like cross bracing forming a triangle like structure between the two meshes, e.g. like, other configurations would work as well:
  • Construct additional meshes in the void between the volumes you have and use Hinge constraints on their faces to avoid collapse.

Hi @silvano Thank you for your response! Yes, I thought of that as well, and constructing a frame in between the faces does work, but I though that this would be too computationally consuming.

If I create a mesh in between the meshes, how can I use Hinge?

Not sure what is less costly regarding computation time. Best guessing, there shouldn’t be a noticable difference between Hinge and the Space Frame solution with the size of your meshes.