How to divide points into lists with defined list length

Hi guys
I have a question about how can I divide points into 3 branch, which length in first and last branch remind on 1/3 of overall number of points. no matter how many points will remind in middle branch. points are changeable, it would get more or less. I tried section list but I have no control on list length. I mean I failed to define what I need is 1/3 of overall number of points in first and last branch.
I wonder if anyone could help me.
best regards
mary baro

divide (12.7 KB)

All three sections will get ~1/3rd each. No need to sort these points.

divide (18.1 KB) (DEPRECATED due to errors)

Actually, those domains overlap. :thinking:

Version ‘B’: yellow group fixes domain overlap and wrapping issue.

divide (19.2 KB)

1 Like

divide (8.1 KB)

Here you go;)

hope that helps


1 Like

exactly! one of my problem was its overlap and wrapping issue which you fixed in version B now I GOT IT!
but what is my other problem is that 1/3rd in first and last branch stay constant (1/3rd of overall points) even if I changed divide domain to more than 3 for example 4 or 5. as @benedict done with c#. is it possible by grasshopper components?
thank you very much!

thank you very much! unfortunately, I’m unfamiliar with C#.

Do you have a specific set of parameters where this code is failing?

divide (24.6 KB)

I need first and last 1/3 of overall points stay constant while for more freely deformation of middle part I tried to divide it to more than one branch, but I failed. because when I change divide domain it change first and last part length.

other fault lie to shift list. when I try to interpolate points they are not overlap and it make separate curves and I cant join them or some thing like that.

divide (34.0 KB)

I’m just working to have this shape.

1 Like

hey M Baarou,

sorry I have extremely little time today.

you basically have three ranges:
1st range = 0 To length of Pointlist divided by number of divisions (P.count/D)
2nd range = end range 1 plus one To length of Pointlist - length of pointlist/(d-1)
3rd range:
end of 2nd range +1 To pointlist length-1

(the minus one is for index correction, as lists start to count at index 0)

and then you can just plug the ranges to list items element.

in any way I would try to obtain what you are looking for with tweencurves instead of constructing every single curve.

However, as you would like to do it with Grasshopper elements, I guess @Joseph_Oster is a better choice than me, he’s very experienced in knowing all the plugins and existing elements from plugins. I work so much with c#, so my help is pragmatic but leads you to no learning effect :smiley:

I added the corrected CS element anyway, it might be of use for you. the element can be copied to other files without problem or any plugins missing.
divide (11.5 KB)

have a good day


1 Like


No idea if this is exactly what you’re looking for, but it should give you an idea on how to tackle something like this!

Be aware that the chamfer-ing towards the end of the definition is a super heavy operation, especially if you have lots of slices. It can easily take up to 15 minutes or longer! It’s thus optional. (256.0 KB)

1 Like

hi ben,
I wanted to express my gratitude for your training and clear explanation.
Thank You

1 Like

thank you very much for helping me. :boom: