Rotation of Lines with limited Range of Radius


(G Kleinert) #1

Hi Community ,
I have a set of many rectangles, all of the same with but with different heights.
I now would like to draw lines through the center of each rectangle with a length according to their sizes.
So far so good.
I would now like to rotate every single line in a way that the shortest line has an angle of -45 degrees and the longest line has 0 degrees. So kind of a range between -45 and 0 .

Anyone who could help me with this ?
Would be much appreciated !
Thanks in advance !


Post a file!

(David Rutten) #3

Can you show a picture/sketch of what you have and what you’re after? Also some actual rectangle data would go a long way.

(G Kleinert) #4

rotation range of (7.7 KB)

(G Kleinert) #5

sorry, couldn t initially find an upload button …
file and image posted , thanks !


You didn’t internalize your Crv param. :frowning:

And the inset on that screen image is too small to read.

What determines the length of the cyan colored lines that get rotated? (Oh, I see, its Area)

(G Kleinert) #7

oh sorry again :confused: not used to this forum posting much rotation range of (8.2 KB)


You show the rectangles sorted but make no attempt at that in the code?

rotation range of (15.1 KB)

Actually… You are moving these lines up from the rectangle center points which are being used for rotation, so this is wrong… Or is it?

rotation range of (12.5 KB)

(G Kleinert) #9

oh wow thanks so much ! I ll just checkt your file and it works ! I ll have a closer lok whats exactly going on there to understand. I m not that experienced in GH so far.

the moving was just an attempt to move the centerpoint of the lines to the area center of the rectangle but this was a wrong approach…


You could do that this way:

rotation range of (11.1 KB)

(G Kleinert) #11

awesome Joseph !1 Thank you very much !!
Helps me a lot, also to understand .


The white group sorts the rectangles by area first.

rotation range of (18.1 KB)

(G Kleinert) #13

super nice ! actually it was an example… i have a set of rectangles of different sizes that should be mixed as they are. but this is good too for me to learn !


Simple GH “problems” are fun. Just playing around.

(G Kleinert) #15

nice ! I can imagine that these are rather simple topics :slight_smile: