Its also possible to do it with a vop-sop inside a foreach node.
It took me a while to figure it out but since I know nothing about python or how to work with VEX script, this is my solution.
step 1 - setting up the base:
Create a
for-each node set to "Each Number" mode with an 0 & npoints("../
previous node")-1 exp
ression in the first two number range fields.
Turn off merge results to set the for-each node into a feedback loop.
Feed your geometry into the foreach sop.
step 2 - inside the foreach node:
Create a
group node with point pattern: `stamp("../","FORVALUE",0)` to isolate the current point to check.
After this create a
vopsop node and feed the groups output into its first input.
step 3 - inside the vop sop:
Create a
for-loop node and a
neighbourcount node.
Connect
Global1's Point number to the
neighbourcount nodes input slot as well as to the "Next Input" slot of the
for_loop node.
Connect the
neighbourcount1's output to the for_loop's "End Value" input slot.
step 4 - inside the for_loop vop
Create a
add_point_to_group node and a
neighbour node. (not
neighbourcount like before)
Connect the
subinput1's "initial value" output to the
Neighbour node's "neighbour number" input.
Connect the
subinput1's "point number" output to the
Neighbour node's "point number" input.
Connect the
Neighbour node's output to the
add_point_to_group's "point number" input.
Inside the add_point_to_group node, promote the Group string input value to become a parameter.
Step 5 - back to the for_each node layer
select the vopsop and in its new Group_Name attribute, add: PG_`stamp("../","FORVALUE",0)`
The result:
For each point number you will now get a group called PG_# (with # the points number)
Each group will hold this points neighbouring point numbers.
Edited by hyperforce, 10 April 2012 - 11:55 PM.