# Uneven subdivision of Grid given XY length curves

Hi guys!

The idea behind is having a grid of points that can adapt to the XY rectangle dimensions.

My approach was to divide X and Y length in a pre-defined sequence
for Y every 250 (code should add more of this sequence in case Y dimension grows)
for X a sequence of 175 (b/2) 100 (a) (code should add more of this sequence in case X dimension grows)

I’m feeling a bit stuck here, I’ve been checking some other posts and I’ve not been able to figure it out, I’d appreciate some help here.

Best,
Sergi

this is for sure the least efficient solution ever, but -considering here it’s 3 am- it does the trick

Grid_maybe.gh (16.6 KB)

it uses the component Parameter Rectangle Grid from the awesome plugin Putterfish

1 Like

Hi Inno, first of all, thanks a lot, didn’t thought about using pufferfish plugin!

I’ve been going through the code and there is something that I can’t solve.
As you see in the images when the X length of the rectangle allows the sequence to starts and end with “175” the distance is equal in both sides, however when the X length changes to another value the grid it’s not centred anymore, giving as a result 2 different distances on the side (Image example: 190.99 left , 103.31 right)

ok, I thought you wanted to equally distribute the (2*C) remaining space on the left and on the right of the grid, like this:

I’m trying to use your settings: when I set the rectangle to be 1630 by 1512. with A=175 and B=70, then C=80
isn’t this right?

Hi Inno, thanks for your reply, I may not explained myself well.

So as you said 80 (variable depending on “X size”) on each side is correct, that’s the main part, but what I also wanted to achieve is to start and end always with 70 “X division length”.

Now we have 80 + 175 on the left side, and on the right, 80 + 70, the idea would be to have on both sides or either:

• 80 (variable depending X size) + 70 [left side] | 80 (variable depending X size) + 70 [right side]
• 80 (variable depending X size) + 175 [left side] | 80 (variable depending X size) + 175 [right side]

this version always starts and finishes with a panel A:
C + A + [B + A] + … + [B + A] + C

Grid_maybe2.gh (17.1 KB)