algorithmic modeling for Rhino
Hello everybody,
I guess you can consider this the daily geometry challenge... I hope somebody can help me with it.
Very simply definition, but quite complex relations between the parameters:
A line divides itself in 3.
Parameters: Length and Angle (the middle one is fixed, the other two vary in angle).
Goal: The circles need to be tangent at all times. So if you reduce the radius, the angle would close in order to bring the circles close together, till they are tangent.
When you increase the radius, the angle opens, up to a maximum of 90 degrees. From this point onward, the only parameter that can make the circles still be tangent is the length of the lines, which should increase in order to keep the circles tangent.
Thanks for any help
Shynn
Tags:
Fortunately not too complicated... All we need to do is establish some trigonometry, and then decide which value to use in each case (the angle, if it doesn't need to be too big, the length if it does - but we don't want to change the length if the angle is changing).
Basically, to be tangent, the end points of the branches (center points of the circle) need to be 2x the radius distance from each other. By drawing a line between the branch tips, we know that the bisector of the angles in between the branches will also perpendicularly bisect the line in between the branches. Therefore we can use Sine to get our desired angle. We use the min and max components to do conditionals: if the angle is greater than 90, we only use 90, and then the remainder is taken care of by assuming that angle is "fixed" and adjusting the length of the lines accordingly. Let me know if that makes sense - I've uploaded the file for you to play around with. Everything is based off of the Radius and Base length (the length of the lines when the angle is changing only.)
(as an additional note - not sure why you'd use the Hframe component to get the end points - if you just use the end points component and use those as planes, grasshopper will default to treating them as XY centers, which is what you need for those circles. But to each their own.)
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by