@hover I have tested your suggestion to add fibonacci sequence into thorn fractal. It didn’t really change the result all that much.
fibonacci=vector$3(0);
size1=0;size2=1;nextterm=0;
for(iter=0,iter<$3,iter++,
size1=size2;
size2=nextterm;
nextterm=size1+size2;
fibonacci[iter]=nextterm;
);
That goes below if($1>41,ff=$1-38;,ff=abs($1)-1;);
.
vx+=vx<0?-fibonacci[v]:fibonacci[v];
vy+=vy<0?-fibonacci[v]:fibonacci[v];
This goes below the vx+= and vy+= series.
Doing it in altern fashion wouldn’t make much sense. You could replace v with altern.
Now, I got something here, but it’s not turning out quite right. I’m looking to try to fill inside the last layer.
size_sqr=50
mw=${-max_w}
mh=${-max_h}
lw={ceil($mw/$size_sqr)*$size_sqr+2}
lh={ceil($mh/$size_sqr)*$size_sqr+2}
$lw,$lh,100%,1,"x==0||x==w-1||y==0||y==h-1?1"
eval ${-math_lib}"
xx=1;
yy=1;
val=1;
selectable_2=vector2(0);
selectable_3=vector3(0);
const msize=3;
do( selectable_size=0;brk_point=0;
if(!i(#-1,xx-1,yy),selectable_size++;);
if(!i(#-1,xx+1,yy),selectable_size++;);
if(!i(#-1,xx,yy+1),selectable_size++;);
if(!i(#-1,xx,yy-1),selectable_size++;);
if(selectable_size==4,dir=round(u(0,3));
,if(selectable_size==1,
if(!i(#-1,xx-1,yy),dir=0;);
if(!i(#-1,xx+1,yy),dir=1;);
if(!i(#-1,xx,yy+1),dir=2;);
if(!i(#-1,xx,yy-1),dir=3;);
,
if(!i(#-1,xx-1,yy),brk_point++;);
if(!i(#-1,xx+1,yy),if(selectable_size==2,selectable_2[brk_point]=1;,selectable_3[brk_point]=1;);brk_point++;);
if(brk_point<selectable_size,if(!i(#-1,xx,yy+1),if(selectable_size==2,selectable_2[brk_point]=2;,selectable_3[brk_point]=2;);brk_point++;););
if(brk_point<selectable_size,if(!i(#-1,xx,yy-1),if(selectable_size==2,selectable_2[brk_point]=3;,selectable_3[brk_point]=3;);););
if(selectable_size==2,
sdir=round(u(0,1));
dir=selectable_2[sdir];
,
sdir=round(u(0,2));
dir=selectable_2[sdir];
);
);
);
mdist=round(u(1,msize));
cl=0;
if(dir==0,
do(xx--;i(#-1,xx,yy)=val;cl++;,cl<mdist||!i(#-1,xx-1,yy));,
if(dir==1,
do(xx++;i(#-1,xx,yy)=val;cl++;,cl<mdist||!i(#-1,xx+1,yy));,
if(dir==2,
do(yy++;i(#-1,xx,yy)=val;cl++;,cl<mdist||!i(#-1,xx,yy+1));,
do(yy--;i(#-1,xx,yy)=val;cl++;,cl<mdist||!i(#-1,xx,yy-1));
);
);
);
val+=1;,!i(#-1,xx-1,yy)||!i(#-1,xx+1,yy)||!i(#-1,xx,yy-1)||!i(#-1,xx,yy+1)
);
"
Ok, I ended up with filters that can do these.
Those rectangle and squares are generated from a mini-image containing labeled values.
Just one problem, if the max length for both side is over 1, there’s going to be areas that are not rectangles or squares. I only got this tiny image to go by. And the only things I can think of to extract shape is tones {iM}. What I’m having trouble is thinking how I can add a crop to the shape, find if the average is equal to 1, and if it is no change, but if it not, return random values into the shape. After all random values has been inserted to non-quad, label them.