Identifying and grouping corner pieces in a wall

Hello everyone!

So I’ve made a script that takes a curve drawn on a grid and tuns it into a little wall made of cubes.

I want to use these cubes as bounding boxes to populate them with fancy wall geometry.
The problem is that I need to group corner pieces by the direction each corner is facing so that I can choose what geometry is mapped into each type of the corner.

The grouping should look something like one of the images below (the colors represent different groups)

How should I go about this? It’ll be really helpful if you could you nudge me in the right direction.

Thanks in advance!

aWallOfMine.gh (11.2 KB)

You can use discontinuity component on your polyline. This will give you the cornerpoints. Than use closestpoint component to find the cornerpoints of your list

Thanks Tim, I’ll give it a try!

Discontinuity, is not something I knew about.

However, if I understand correctly this only solves the issue of finding all corners pieces. But I then also need to identify which ones are facing where to group then accordingly.

Oh sorry missed that part. Will have a look al it tomorrow

I re-made the initial part of placing cubes (a half-cube offset is enough to find cube centers).
Then you can evaluate the curve “a bit” forward and backward and make the “difference” of the tangents to get unique directions (with an orthogonal curve total directions are always 8)
aWallOfMine_V2.gh (15.5 KB)

It work only with closed orthogonal polyline and segments should have integer lengths…

Thank you Riccardo!
That’s exactly what I needed.
Your code for making curve into boxes definitely makes a lot more sense than the one I did.

If I ever need to use it on an open curve, I’ll tinker with it a bit.