イラストレーターの個別に変形のランダムでは物足りないあなたに送るスクリプト
拡大縮小・回転・移動に、シアーが加わって
それらをランダムに摘要することにより、
「個別に変形」のランダムを摘要するよりも1.25倍お得です。
//IN:PathItem,PlaseItem,GroupItem..... function ramdomMatrix(o){ var param = 0.5; var getRondom = function(X){return X*Math.random();} var pORm = function(){return Math.random() > 0.5 ? 1 : -1} var mymatrix = new Matrix(); //ここらへんは、まぁ適当に。カスタマイズ。 mymatrix.mValueA = 1+getRondom(param)*pORm(); mymatrix.mValueD = 1+getRondom(param)*pORm(); mymatrix.mValueB = getRondom(1)*Math.sin(getRondom(90)); mymatrix.mValueC = getRondom(1)*Math.cos(getRondom(90)); mymatrix.mValueTX = (o.width+getRondom(o.width*param)*pORm()); mymatrix.mValueTY = (o.height+getRondom(o.width*param)*pORm()); o.transform(mymatrix); o.rotate(getRondom(360)); //o.position[0] +=getRondom(o.width); //o.position[1] +=getRondom(o.height); } //TEST #include 'c.js';//http://svn.coderepos.org//share/platform/illustrator/javascript/lib/c.js c('selection').each(ramdomMatrix);