calculating neighbours of primitive cubes

   2253   4   0
User Avatar
Member
7 posts
Joined: March 2016
Offline
Hi there,

I was wondering how i might go about storing the neighbours of primitive cubes. i've packed the geometry so i have 1 ID per cube but i wanted to get some advice on how i might store each cube's neighbours, preferably in python?

Attachments:
1.JPG (43.8 KB)

User Avatar
Member
1737 posts
Joined: May 2006
Offline
nearpoints will do that for you.

Attachments:
nearpoints_example.hipnc (58.5 KB)

http://www.tokeru.com/cgwiki [www.tokeru.com]
https://www.patreon.com/mattestela [www.patreon.com]
User Avatar
Member
7 posts
Joined: March 2016
Offline
hmm, i need to obtain the diagonal neighbours also, so all the primitives that share a vertex with the primitive cube in question
User Avatar
Member
1737 posts
Joined: May 2006
Offline
You can increase the radius of the search to get the diagonals, the docs should give you all you need to know:

http://www.sidefx.com/docs/houdini/vex/functions/nearpoints [www.sidefx.com]

If you've connected your packed prims with edges, then you want to use the neighbours function instead:

http://www.sidefx.com/docs/houdini/vex/functions/neighbours [www.sidefx.com]
Edited by mestela - Sept. 9, 2017 17:30:39
http://www.tokeru.com/cgwiki [www.tokeru.com]
https://www.patreon.com/mattestela [www.patreon.com]
User Avatar
Member
7 posts
Joined: March 2016
Offline
thanks mestela i'll give it a go
  • Quick Links