How PIndex works in kangaroo solver

unhandled

#1

Dear @DanielPiker,

I would like to ask about PIndex in K2 solver more about code behind.

For the most simplest case, let say I have two springs. Geometrically lines-length goals are connected by one of end points. More simply it is 3 point polyline.

In such case in the solver do you have 4 particles indexed 0 1 2 3 or 3 particles as one point of two springs in this case is duplicate?

If later do you somehow delete and sort all points ?


(Daniel Piker) #2

Hi Petras,

If you are talking about what happens when using the kangaroo solver components, initial points (PPos) from different goals which are closer than the tolerance get combined into a single particle. Multiple goals would then contain the same PIndex referring to that particle.

If you are scripting using the kangaroo library, you can use the AssignPIndex function, which does the same thing as just described. However with scripting you don’t have to use this - you can also set the PIndex values directly yourself, which sometimes makes more sense if you know already which points should be the same particle, because there is some overhead to calling AssignPIndex, since it searches for coincident points.
When setting PIndex yourself, you can also have points which start out exactly coincident, yet are still treated as separate particles.


#3

Thank you for a reply.

I am trying to apply similar logic to other issue I have not connected with kangaroo.

I would like to ask what kind of method you have for combining points with smaller tolerance?

I assume it is not r-tree search, but something more simple but very fast and accurate?


(Pfotiad0) #4

BTW: PIndex is handy when you have springs where the one end is fixed (is anchor) and the other is related with other springs. See the yellow (start pos) and red (final pos) cables that are pulling a given tensile membrane towards the masts and/or some ground anchors. Obviously cables and membrane edges have different strength values (in fact in membranes we have 3 classes: cables, naked perimeter edges [critical for a real-life membrane worth the name] and clothed ones).

PS: I could provide a de-restriced version of the above (or some other case) in order to clarify what’s happening.