I am trying to create a Fibonacci sequence curve in Grasshopper in C#. My plan is to create the numerical sequence, then change these numbers to squares and at the end make arcs out of these squares to get the resulting Fibonacci sequence curve. However, when I was working on it, I didn’t think how I would place the rectangles in order for them to go in this pattern.
My first though is different approach, that doesn’t even require calculation of sizes of these squares:
Take existing squares
Get Bounding Box for them together (BBox will be a rectangle then)
Take longer side of this Bounding Box
Create square with this longer side of BBox
Place it next to longer side of BBox
Go to point 1. and continue
To place it to the correct side of the BBox we should track which side is taken, as there is pattern:
Bottom, Left, Top, Right, Bottom, Left, Top, Right, Bottom, Left, Top, Right and so on and on.
Just the idea, I guess there is plenty of better existing solutions
The idea is something like this:
each rectangle (square for you btw) have corners; first at bottom left, second at bottom right, etc etc.
We can locate the center and orientation of the next square by looking at the first 2 corners of the last square in the list, pick the second corner and move it towards the first corner by the distance of “i” in the fibonacci series. Then put there a plane correctly aligned…
@w.radaczynski@maje90@PeterFotiadis
Thank you all for the rapid responses you have given me, and the amazing solutions. My problem is solved, thanks to you and this amazing community. I will play with all of the different solutions, and if I will have any questions regarding them I will contact you directly!
I can’t express enough, how much I am in awe of the support you have provided me!
I am only 13 and it is phenomenal, how much you have helped me! Especially in the Covid times, a forum like this is one of the few places where you can gain any programming experience or interaction.
I do need to get back to learning, so you are an inspiration! Btw, quite an impressive portfolio you have on your site for such a young age, congratulations!! Your dad rocks!
Enjoy your young years and don’t forget to have fun too!