Set Data for a point other than the one being iterated

Discussions about SOFTIMAGEs© Interactive Creative Environment©
christophklemmt
Posts: 3
Joined: 09 Apr 2015, 08:45

Set Data for a point other than the one being iterated

Post by christophklemmt » 10 Apr 2015, 03:05

Hello

Is it possible in a simulated ICE tree of a pointcloud to use Set Data for a point other than the one currently being iterated? I regularly come across trying to do this for various situations.

One example is that I want each particle to react to its closest neighbour, but I also want the closest neighbour to react back in return. So I made an array familyID, which should contain the ID of the closest neighbour, as well as of those points whose closest neighbour is the current point.

In the example below, the array visualised in green contains the current point's ID as well as the ID of its closest neighbour. Points 3 and 4 have each other as closest neighbours, and so do points 1 and 2. Point 0 has point 2 as its closest neighbour, therefore I now also want to add "0" to the array of point 2, which should then be [2,1,0] assigned to point 2.

Therefore I am hoping to use Set Data for the property of point 2 while I am iterating point 0. Can this work and if how? This is only a simple example, but I have come across the same issue several times, for example when trying to make a Delaunay triangulation / alpha shape meshing between the points.

Image

Thank you for your help!

Christoph

User avatar
owei
Administrator
Posts: 840
Joined: 03 Jun 2009, 15:25
Location: Siegen/Germany

Re: Set Data for a point other than the one being iterated

Post by owei » 10 Apr 2015, 10:08

Hey Christoph!

I´n not exactly sure if I got you right...but this is what comes into my mind.
First, I would build a 2D array per point. The first value represents the self.ID, the second the closest point IDs.
Build one per object array out of the per point array. Now you can step through that array in point context and check, if the self.ID is found in other indices of the array than you already "know" per point. If found, add the ID value to your local array...Does that make sense?

cheers,
oli

christophklemmt
Posts: 3
Joined: 09 Apr 2015, 08:45

Re: Set Data for a point other than the one being iterated

Post by christophklemmt » 15 Apr 2015, 02:29

Great, thank you!