Distributing rectangle panels along the curve (and possible use of attractors)

Hi All
I’ve been trying to do this for some time and I feel like I almost got it, but not quite! What I’m trying to do is two things:

1. I would like to distribute panels along curves in such way, that I could specify:

1a. width of the panel

1b. gap between the panels

1c. and ideally height of the panel

… and grasshopper would calculate the best fit for that curve. So going from the midpoint of that curve in both direction would be important for symmetry and even distributions. I’ve attached my messy grasshoper file where I’ve been trying different sollution but I bet there is much simpler way to do it!

I feel like I’m on the right track with divide curve and array and distribute but it looks like I’m just missing some elements! Arggh I keep thinking about this, can someone help please??

  1. The 2nd thing (less urgent) I’m trying to do, is similar to the above, but with the use of attractor instead, so I could move the attractor point left and right, and the panels distribution would be denser where the attractor is, and less dense far away from the attractor.

playing with a panel3.3dm (64.6 KB) Playing with a panel3.gh (35.8 KB)

given the total length of the curve on which the panels will be distributed, you can either input:
-number of panels, gap between panels -> and get the width of each panel
-number of panels, width of each panel -> and get the gap between each panel

panels start to be distributed at the very start point / until the very end point of a line?
or do each distribution start and end with a gap? is that gap the very same that is calculated between the panels? or is it a different value?

Hi @inno

All great questions!

For instance, if my curve was 6400mm, and I would input panel width to be 1200mm, I would like grasshopper to distribute these panels evenly on my curve (so in this example, I could have either:

a) 1200mm panels + 100mm gaps in between + no gaps at the ends
b) or 1200mm panels + 75 gaps + two 50mm gaps at the end

The gaps at the end don’t matter for me, ideally I wouldn’t have them, but if the number is funky I don’t mind having some small gaps at the end. But the gaps in between the panels needs to be all the same and ideally round numbers.

this might not be the best of the solution, but it does the job given a line, number of panels and panel width
custom_gapz.gh (18.3 KB)

no gaps at start/end:

equal gaps everywhere:

custom gaps at start/end:

I just saw your reply! Thank you for looking into that @inno ! I will check it out tomorrow morning, but it looks like you got the solution there!