Can't find near points in POPnet

   1733   1   0
User Avatar
Member
13 posts
Joined: Aug. 2017
Offline
For each particle inside a POPnet I want to find the 10 closest points. This seems like an easy problem but I'm not that well versed in DOPs to say.

I've tried everything from pcopen, pcfind, nearpoints in both POP Wrangle and POP VOP and they all return 0. Tried creating a fresh project with just a POPnet and some particles spawning on a sphere and I still can't find any close points despite there being many. The POP Proximity node works but only returns the closest point - something seems very strange.

edit: I'm on 16.5
Edited by Erik - Dec. 7, 2018 20:34:38
User Avatar
Member
8 posts
Joined: Feb. 2009
Offline
I realize it's been two years but I was just having the same issue today.

There's two gotcha's here:

First, in the wrangle node, go to the “Inputs” tab and set “Input1” to myself. That will let you use something like
int pts[] = nearpoints(0, @P, 0.2, 100);
Where Input1 is actually indexed by 0 because of legacy reasons.

BUT, there's a second gotcha here that I haven't seen mentioned yet. If you look on the docs page for the wrangle node it says “Referring to the geometry currently being processed is special as you have to ensure a copy is made so the VEX functions can refer to its original form. This handles that for you.”

So you are getting the nearest points in a copy of the current sim. It's like referring to a different point cloud entirely. So for the above example
@ptnum = pts[0]
because the current point is closest to it's copy in the “other” point cloud. The true nearest point is pts.

The only reason I noticed this is because I needed a vector between @P and every point in pts and @P-point(0,“P”,pts) kept returning (0,0,0).

I doubt this is useful two years later but hopefully someone else finds this info handy.
-Bob
Edited by rkopinsky - June 16, 2020 15:58:29
  • Quick Links