I can generate pipe shapes from a collection fairly easily. My node setup only generates them on some points controlled but a colorRamp and a Noise texture. I've just now figured out how to use the pick index, and by replacing the randomValue node from my screenshot with an integer I can define which pipe I want to select; there are 5. Cap, Straight, Elbow, T, and Clover.
The points are not responsive to each-other in any way that I can find, however. I would like the points to obviously select the right pick index before spawning the instances, so that the pipes line up with each-other, or are capped with the Cap piece.
How can I detect if the other surrounding points in a Von-Nuemann neighborhood are selected and make change my integer pick index based on that? like this: