findClosestPoint not implemented

   2479   4   0
User Avatar
Member
228 posts
Joined: Dec. 2012
Offline
Hi, I need to find the nearest point in a geometry in Python but the geo.findClosestPoint() function says ‘not yet implemented’. Is there a way around this for the time being?
www.kmcnamara.com
User Avatar
Member
575 posts
Joined: Nov. 2005
Offline
You could use the nearPointVOP or vexfuntion in a vop/vex node to store the index of the nearest point in a attribute that You can then query in python

Martin
User Avatar
Member
228 posts
Joined: Dec. 2012
Offline
Thanks for the reply! Unfortunately I am trying to implement non-uniform Poisson sampling and I don't know the locations until I'm actually generating them from within Python, so I can't store closest points beforehand. Further, each new point that I generate depends on the previous point's closest point, so I need to get able to get the closest point during run time of the python code.

The reason I need this is because I have to create noise on a grid beforehand and then sample that grid for its noise values. (I have to do this because most of the noise functions are also ‘not yet implemented’ in Python )
www.kmcnamara.com
User Avatar
Member
228 posts
Joined: Dec. 2012
Offline
Is there a way to call a VEX function from within Python?

Any other ideas?
www.kmcnamara.com
User Avatar
Member
1390 posts
Joined: July 2005
Offline
KMcNamara
Is there a way to call a VEX function from within Python?

Indeed there is: http://www.sidefx.com/docs/houdini12.5/hom/hou/runVex [sidefx.com]

I'm not saying this is good idea though. I haven't touched that field for a long time but I would start with generating points up front and use VEX for placing them around (unless there is something in it, I'm not aware of).
  • Quick Links