Rotation of Lines with limited Range of Radius

unhandled

(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 !
GK


#2

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 radians_2.gh (7.7 KB)


(G Kleinert) #5

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


#6

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 radians_3.gh (8.2 KB)


#8

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


rotation range of radians_2018Mar22a.gh (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 radians_2018Mar22b.gh (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…


#10

You could do that this way:


rotation range of radians_2018Mar22c.gh (11.1 KB)


(G Kleinert) #11

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


#12

The white group sorts the rectangles by area first.


rotation range of radians_2018Mar22d.gh (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 !


#14

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


(G Kleinert) #15

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