Here’s something I always wanted to do:
But, I don’t know if I’m going to do the equal spacing thing.
That being said. Here’s a observation I have made. This is literally a binary tree. G’MIC has no native binary tree support though. So far, I have made this code which creates a full binary tree structure.
#@cli rep_binmapref: depth_level
#@cli : Create a image which can be used to create binary tree.
+rep_binmapref:
check isint($1,1,23)
bin_map_size={(1<<(1+$1))-1}
$bin_map_size,1,1,2
100%
f.. >"begin(
list_of_step_size=vector(#w);
list_of_step_size[0]=$1;
);
step_size=list_of_step_size[x];
step_size?(
list_of_step_size[x+(1<<step_size)]=list_of_step_size[x+1]=step_size-1;
bin_branch=x+[1,1<<step_size];
repeat(2,p,
i[#-1,bin_branch[p]]=x;
);
bin_branch;
):(
[x,x];
);
"
a[-2,-1] c
Run
$ rep_binmapref 4
The first channel is left() index, and second channel is right() index, and third channel is previous() index. When i0 and i1 are the same, that’s a leaf.
The part of transversing a binary tree has been solved. However, I have not came up with a idea to make the phylolegy itself. Like, how to define the boundary? Would it be easier to transverse from bottom up (This can enable equal spacing)? And so on. I don’t really care about generating data to compute evolution phylogeny of an animal here. My goal is generate a random one.
