# Sorting a grid concentrically

Hi all,

I have a large grid of points, and the tree structure has paths in the x direction and items in the y direction, is there a way to reorder the tree concentrically - so that each ring is its own path?

I think it’s possible to do by culling trees and items in a series but it’s quite roundabout, is there a more straightforward way?

Thanks,

Laurens

What is the logic which puts a specific point into one circle as opposed to the next? Is it just a matter of smallest distance to the ordering circle family? Or something else?

The grid and tree is just from the 2D square grid component

There are no “rings” in a grid. Are you talking about “rectangular rings”.
Please by more specific, post some picture, sketches or else.

1 Like

Hello,

Are you looking for concentric squares like this?

Your description of rings could equally mean rings by straight line distance or Manhattan distance…

yes exactly,
So from

To

1 Like
1 Like

In addition to circles, this method happens to work pretty well with rectangles and polygons too:

rings_2019Jul9c.gh (32.7 KB)

It could use further refinements though… Polygons give an error when radius is zero, which revealed a subtle bug - temporarily fixed with a “!= zero” panel set to 0.01, but that still leaves a tiny “ring” in the center, essentially with zero radius. That’s not right. There are some alignment issues along the edges and points in corners can get assigned to the wrong “ring”, because they are closer to the “wrong one”. Still, some decent GH concepts illustrated here.

As the ‘Tree/List Viewer’ shows, this isn’t just coloring. The points are organized as one branch per ring.

2 Likes