Need kangaroo's CurvePointCollide to affect both point and curve

Hello people !
In the kangaroo goal “SolidPointCollide” there’s the option “Unidirectional” which allows the component to affect both the points and the solid. I would like to apply this function to the goal “CurvePointCollide” as I have a set of points that I want to keep out of planar closed polylines but I want to allow those polylines to be able to move too (I’ve applied other goals to the vertices of these polylines, so they’re changing positions during the relaxation and I want the curves of “CurvePointCollide” to follow).
I’m pretty sure the only way to do that is to script my own component except I really can’t do that… has anyone ever tried it or knows how to solve it?

Depending on what you are doing with it, you might find you can use the ‘Collider’ goal with the line segments, like in this example:

This goal handles collisions between moving spheres and cylinders (or rather, capsules, since the ends are rounded). This does mean your curves need to have a thickness. If you need specific dimensions you can offset to counteract this thickness.

1 Like

This is actually a neat exercise but unfortunately it’s not quite what I need.
The points that I would like to keep out of the closed curves might be inside them in the initial position, so with a collision they’ll stay stuck inside.

Here is the current definition:
200712_CrvPtCollide.gh (26.2 KB)

I tried SolidPointCollide but it doesn’t work in plan (with a flat mesh), so i tried extruding the mesh but the model becomes too heavy and super messy since I end up with duplicate points in Z.


I think I still don’t follow entirely what the aim is here.
It looks something like

  • the white closed polylines to keep their shape rigidly while moving around.
  • the black polylines each stay in a straight line, while their points can slide along them.
  • the black points to stay outside of the (moving) white polylines
  • the vertices of the white polylines to keep a minimum distance apart, based on the colour of the underlying mesh.

Is that an accurate summary of what you are after?

Note that this ImgCircles goal does not stop the white polylines penetrating each other.
Also, only the Red parameter of the colour affects the radius, so the blue/green areas result in the same radius. Also, for the ImgCircles component to work properly, the mesh needs to be triangulated.

There’s actually an older version of the curve collide called Collide2d, which isn’t exposed as a component any more, since I wanted to avoid confusion with the new CurveCollide, which I was thinking replaced it in all use cases, but perhaps there is some use in keeping the old functionality after all.
It does work on deformable polylines, including even open ones. The component is marked as legacy, so doesn’t appear on the toolbar, but definitions containing it will still open, and you can paste it from there.

Here’s an example file:

OldCollide2dExample.gh (12.2 KB)

This still won’t solve the case where points start inside the curve but you want them outside. Perhaps you will still need a custom goal for that, but take a look at this first.

4 Likes

Hey Daniel,
Thanks a lot for this component, it’s actually helpful to have the polyline collision, I used it for another assembly (I had been looking for that functionality for a while).
The goals are as you described + I needed the points of the black lines to remain outside the closed white polylines at all times (the white elements become people around tables and the black ones are a column grid and I end up generating a plan). I solved it by extruding the polylines, making a closed mesh, using “SolidPointCollide” and adding the “transform” goal to the vertical direction of the extrusion. It’s a little heavy and ugly but it’s behaving perfectly :slight_smile: I’ll be sharing the assembly when it’s completely done.
Thanks again !

1 Like