Attached is the demo for another new node: mesh.
Mesh creates a list of line segments connecting a set of neighboring points. It takes four parameters:
- Points or shapes. A list of points and/or shapes. Any shapes are replaced by their centroids.
- Radius. Limits the area around each point when searching for neighbors. The tighter the radius, the faster this node runs.
- Neighbors. N, the maximum number of neighbors to connect to each point.
- Mutual. If checked, only mutual neighbors will be connected.
For each point or centroid in the input list, mesh connects that point with the closest N other points found within the specified radius. If a line connects point A with point B it means at least one is a neighbor to the other. If "Mutual" is not checked, it means that B is one of the N closest points to A OR A is one of the N closest points to B. If "Mutual" IS checked then a line means that BOTH are true: A is a neighbor of B AND B is a neighbor of A.
Finding neighbors is computationally expensive because you have to measure the distance between each point and every other point, so the number of comparisons grows exponentially with the number of points. Mesh can usually handle a few hundred points, but may bog down if given a thousand points. To avoid freezes, start with a small radius and gradually increase it. Just be aware that if you make the radius too small, some valid neighbors may not be close enough to be found.
You can use the mesh node to quickly create a wide variety of networks, fishnets, cobwebs, etc. Frankly, I'm not sure how useful this node will be, but I suspect that, with some experimentation, we might be able to create some truly surprising effects.
Please try playing with this thing and report back if you come up with anything interesting!
John