Odering surface around a point

Hi all

I’m trying to make a function to ordering all my surfaces around a point in the same order every time.

I’m creating a surface that I split into different smaller surfaces to make a grid. Where are 8 surfaces around each point and I can split the surface into a different number of points (in this picture 6 points). But the problem is then I get my string of surfaces around each point they do not follow the same index order then I change the number of points. So, I want to get a string that has the same index for surfaces around each point as seen in the picture.

Surface_Aroundpoint.gh (20.8 KB)

Hope you can help :slight_smile:


I’d love to help you out but I’m not sure I understand your issue. In your file your surfaces are already ordered very consistently:

Removing the “Flatten” option of the output in the last component, then reversing and shifting by -1 the list of surfaces will give you the exact order you drew in your first post:

Is that it?


Surface_Aroundpoint.gh (31.2 KB)

Sorry for the late answer but my problem is then ground surface geometry change, the pattern for the surfaces around the point will change as well. So if the surface was square with 2x2 points the surfaces around these points will change order.

And again thanks for the help :slight_smile:

Sorry I don’t understand what you mean here. Here’s what I think you mean by “a square with 2x2 points”, with the surface order the same as you’ve drawn it initially, coming directly from the file I posted above:

Please send an example showing what is changing when it should not.

Yeah exactly, I want the order as shown in your picture. But if you change the underlying square to bigger or smaller or change the number from 4 to 6 points (for example) the order will not stay as seen in your example. So I want to be sure that whatever shape I use as a floor plan and that I can divide it into as many points as I want, the division of surfaces around each point will stay the same.

Best regards Rasmus

The purple group is left over from your code, I replaced all the rest.

Surface_Aroundpoint_2020Nov10a.gh (14.8 KB)

Because I effectively sorted the lines using Weave that split the surfaces, the surface fragments are already in sequential order and don’t need to be sorted along the curve (crcles).

Surface_Aroundpoint_2020Nov10c.gh (11.7 KB)

Conversely, Weave can be skipped if you keep AlongCrv (Sort Along Crv).

Surface_Aroundpoint_2020Nov10b.gh (14.0 KB)

Thanks for the help, it has fixed my problem :slight_smile:
Great help