A Golden Ratio tool/macro?
Okay, I was asked to come up with a building plan that uses a nautiloid shape. Has anyone attempted a building of this kind, and if so, did you use a macro or is there a tool in CC3 that allows you to quickly whip out a building like this? If not, what would be the best way to come up with something like this (and hopefully have the segmentations for rooms included to keep the proportions intact). I don't want to say too much about the concept as it's something being published, but suffice it to say the concept behind the building is that it's extruded.
Thanks in advance for any help.
Thanks in advance for any help.
Comments
It got me intrigued though, and a macro building a Golden Spiral was suprisingly quick to write once I realized that the Golden Ratio phi = 2cos(72°).
MACRO GoldS
SELSAVE
SAVESETTINGS
GP Pctr 0,0
GP Pctr ^DOrigin point[0.00000,0.00000]:
GV R0 1
GV R0 ^DGreatest radius [1.00000]:
IFN R0 MacroDone
IFZ R0 MacroDone
GN aN 10
GN aN ^DIterations number [10]:
IFZ aN MacroDone
IFN aN MacroDone
GCOS phi 72°
GV phi phi*2
GV ang 0
:loop
GP P1 ref Pctr <ang,R0
ARCS Pctr P1 ang+90
GV ang ang+90
GP Pctr ref Pctr <ang,R0*(1-phi)
GV R0 R0*phi
GN aN aN-1
IFZ aN MacroDone
GO loop
:MacroDone
GETSETTINGS
SELREST
ENDM
The macro file is included in the zip file and should be placed in the CC3 root folder.
To use, load the GoldenSpiral.mac macro (using LOADMAC or Tools->Macros->Load Macros) and launch with the GOLDS keyboard command.
Example below with 20 iterations.
MACRO GoldS
SELSAVE
SAVESETTINGS
GP Pctr 0,0
GP Pctr ^DOrigin point[0.00000,0.00000]:
GV R0 1
GV R0 ^DGreatest radius [1.00000]:
IFN R0 MacroDone
IFZ R0 MacroDone
GN aN 10
GN aN ^DIterations number [10]:
IFZ aN MacroDone
IFN aN MacroDone
GCOS phi 72°
GV phi phi*2
GV phi ^DRatio [Golden Ratio]:
GV ang 0
:loop
GP P1 ref Pctr <ang,R0
ARCS Pctr P1 ang+90
GV ang ang+90
GP Pctr ref Pctr <ang,R0*(1-phi)
GV R0 R0*phi
GN aN aN-1
IFZ aN MacroDone
GO loop
:MacroDone
GETSETTINGS
SELREST
ENDM
Note: with a ratio of 1 you'll get a circle and above 1 the spiral starts from small to large. A ratio of 0 is not interesting but a negative ratio is quite funny...
I hope you'll be able to show us the result
When you load the macro file through the LOAD MACRO command, it also un-loads the standard FCW32.mac file containig all these commands you have lost.
This is standard behaviour.
I see two solutions
1. once you're done with the macro, use LOAD MACRO to load FCW32.mac again.
2. open both macro files (FCW32.mac and GoldenSpiral.mac) with a simple text editor like Wordpad, copy/paste the lines from GoldenSpiral.mac (or even from above) to the end of the FCW32.mac file, making sure there is a blank line between the last ENDM and the begining of the pasted text. Make also sure there is at least one blank line at the new end.
In this case, I'd go with 1. as you'll probably won't draw spirals every other minute...
Note that if you choose 2., you'll have to start again after an update as updates overwrite FCW32.mac with the new version.
Hope I'm clear.
One other strange thing that occurs is if I use any value ending in a 0 over 20. For some reason CC3 says it can't map it. I also don't know how you got your spirals to be as large as they are. When I draw mine, I have to scale them to fit the dimensions I need, and that's with increasing the size of the radius from 1 to 10.
Once I get the parameters of the map set up, I'll post some shots of my progress. Maybe I'll even do some for a fictional asylum based on the Kirkbride design.
Change the greatest radius input (second).
As to the second, how large of a number are you using? I used 10 and it was still rather small and I was just curious as how to make them bigger without going through so much extra work.
When the prompt asks for: Ratio [Golden Ratio]: just hit Enter to choose the default value instead of typing a value. You can do this with any CC3 command having default values in square brakets.
Also note that the Origin point is the center of the first arc. On the samples below, the double-arrow lines show the max radius between the first arc an its center point.
Funny thing, on my computer, when the radius gets to small it's rounded to 0.00001 so I don't get CC3 message you have and didn't notice anything wrong. Thanks for detecting this.
If you want a formula, the number of iterations should be under -5/log(ratio)/Radius input (under 24 for a Radius input of 1).
Or download the edited macro below that stops once the radius is under 0.00002.
MACRO GoldS
SELSAVE
SAVESETTINGS
GP Pctr 0,0
GP Pctr ^DOrigin point[0.00000,0.00000]:
GV R0 1
GV R0 ^DGreatest radius [1.00000]:
IFN R0 MacroDone
IFZ R0 MacroDone
GN aN 10
GN aN ^DIterations number [10]:
IFZ aN MacroDone
IFN aN MacroDone
GCOS phi 72°
GV phi phi*2
GV phi ^DRatio [Golden Ratio]:
GV ang 0
:loop
GP P1 ref Pctr <ang,R0
ARCS Pctr P1 ang+90
GV ang ang+90
GP Pctr ref Pctr <ang,R0*(1-phi)
GV R0 R0*phi
IFN R0-0.00002 MacroDone <- add this line
GN aN aN-1
IFZ aN MacroDone
GO loop
:MacroDone
GETSETTINGS
SELREST
ENDM
I hope no one would need to vacate the structure in a hurry from one of those inner rooms, though! Yikes.
~Dogtag
And, cool.