//ランダムな山並みを作るイラレスクリプト var arr=[],N=10,H=100,S=25,B=0.1,pts=[]; for(i=0;i<N;i++)arr.push(Math.random()*H); for(var i=-S;i<=H+S;i++)pts.push([i,f(i)]); pts.push([H+S,-S],[-S,-S]) app.activeDocument.pathItems.add().setEntirePath(pts) function f(x){ var d,y=0; for(var i=0;i<N;i++)if((d=S-Math.abs(arr[i]-x))>0)y+=d*B; return y; } // #dtp
![あるふぁ(仮) (@peprintenpa@dtp-mstdn.jp)](https://cdn-ak-scissors.b.st-hatena.com/image/square/2899fbd48ed016932a485715b86e158cf957c6d3/height=288;version=1;width=512/https%3A%2F%2Fdtp-mstdn.jp%2Favatars%2Foriginal%2Fmissing.png)