transform fibonacci sequence script to add scaling
Hello,
I found this great script for taking an object and creating a fibonacci sequence (sunflower pattern).. it works great.
But you may notice that sunflower get bigger as they move from the inside out, so I would like to adjust the script to accommodate that.
here is the original script that works perfect for making the pattern.
var docSel=app.activeDocument;
var docSelSel=app.activeDocument.selection[0];
for (var i=1; i<1200;i++)
{
var r=10*Math.sqrt(i);
var t=137.5*Math.PI/180*i;
var newSel=docSelSel.duplicate(docSelSel);
newSel.translate(r*Math.cos(t),r*Math.sin(t));
}
docSelSel.remove();
here is my failed attempt to create scaling
var docSel=app.activeDocument;
var docSelSel=app.activeDocument.selection[0];
for (var i=1; i<1200;i++)
{
var r=10*Math.sqrt(i);
var t=137.5*Math.PI/180*i;
var f = ( 2 / newSel.width ) * 100;
var newSel=docSelSel.duplicate(docSelSel);
newSel.translate(r*Math.cos(t),r*Math.sin(t));
newSel.resize( f,f,true,true,true,true,f,Transformation.DOCUMENTORIGIN );
}
docSelSel.remove();
