How to force particle attraction using Open Point Cloud

   1940   3   2
User Avatar
Member
13 posts
Joined: Sept. 2017
Offline
Hello

I have been looking for a way, how to divide a group of particles into a few clusters based on the nearest points and then attract them to each other. Second part is to attract the cluster containing a few particles towards a nearest point on mesh.

When working on the first part of the sim I have found on the forum, that POINT CLOUD OPEN in to POPVOP could do the job. I have found then a file from Jeff, where this technique seems to work pretty well. I have tried to recreate that in all sort of way I was capable of, but I am still not getting the same result.

I am a bit confused with the technique - if I understand well, the POINT CLOUD OPEN looks for nearest points for each point and then it creates the cloud if those points and gives the position attribute of its center. Theoretically it can be used then to calculate the vector pointing to the cloud center for each point in the cloud. That vector can be used then as the velocity to move points to the center. Buuuut here the big question……..let's say I have 15 points coming to PCOPEN….it takes first point and counts 3 nearest points and such creates first point cloud with 4 points. Then I could calculate the velocity to the center of the cloud. For now it is fine. But then the PCOPEN takes teh second point from the 15 incoming points and repeat the searching for nearest points and so on. Then I do again the calculation of the velocity. The problem is that the first and second incoming points to the PCOPEN node might be close to each other and thus the point clouds are overlaping. It means the calculated velocities can't never work well and the system can't work. It would work just in case, that the PCOPEN node would remove already processed nearest points in the first round from the incoming points to be yet processed.

Could anyone explain me, how PCOPEN works and how it can be used for the particle attraction in clusters as Jeff has achieved in the enclosed file?

Btw I am trying to achieve simulation, where particle attraction is the key function and for now, I am bit struggling with that. I have enclosed a picture of the simulation I need to create so if anyone would have an idea or an example file how to deal with that, you are all welcome and it would be great help.

Many thanks for any help.

Image Not Found

Image Not Found

Attachments:
pops_in_dops_pc_self_attraction.hiplc (496.3 KB)
My_Version_ParticleAttraction.hiplc (338.3 KB)
Particle attraction.jpg (501.7 KB)

User Avatar
Member
1391 posts
Joined: Dec. 2010
Offline
Hi

Sorry I didn't have a chance to check your hip file now,
But if I've understood your question correctly, one idea is putting few particles inside a group randomly, then use these particles as a target of nearpoint() function.

In nearpoint() you have an argument to define which group it should search inside.

So rest of the particles should find nearest target point and finally you can use this target position and @P to compute velocity.

You can control number of clusters by number of target particles inside group.

There is no need to find couple of near points, just nearest point inside group should be enough.

For your question about point cloud :

Basically point cloud is useful to find list of the nearest points based on radius and max point number and grab some points attribute from them.

You have couple of function for this purpose such as pcopen and pcfind

In pcopen way you are opening a pc file and have access to each point which found by pciteration() and while loop and to extract point attribute from them you can use pcimport() or pcfilter(). (Second one give you avarage value of all points which be found)

But with pcfind you can give list of are closed points directly(again based on radius and max points).

In my opinion working with pcfind is simpler than pcopen as you can easily grab attributes by point() function.

Also there is 2 more function with roughly same usage which is nearpoints() and nearpoint().
Nearpoints is same as pcfind and nearpoint give you pt number of closest point.

I'm usually using nearpoints and pcfind rather than pcopen.
Edited by Sadjad Rabiee - Jan. 28, 2019 17:46:35
https://www.youtube.com/c/sadjadrabiee [www.youtube.com]
Rabiee.Sadjad@Gmail.Com
User Avatar
Member
13 posts
Joined: Sept. 2017
Offline
Thank you for answer. I will try to use your suggestions and let's what I will be able to come up with.
User Avatar
Member
1391 posts
Joined: Dec. 2010
Offline
Sure, let me know if you couldn't figure it out what to do.
https://www.youtube.com/c/sadjadrabiee [www.youtube.com]
Rabiee.Sadjad@Gmail.Com
  • Quick Links