% generate forward painted sequence and then reverse painted sequence

load parameters_pairwisem_5_3

P=pintegrate(p,244);

% forward-painted sequence
for k=170:4:290;  % this creates about 480 pixels high canvas
  %eval(sprintf('cementcolor(P,170,k,4,''forward%03d'',170,290);',k)) % no box
  eval(sprintf('cementcolor(P,170,k,4,''forward%03d'',170,290,k);',k))% bordered
  eval(sprintf('!temp_dattopnm_hp forward%03d > forward%03d.ppm',k,k))
  eval(sprintf('!rm forward%03d/data',k))        % less risk than rm -r
  eval(sprintf('!rm forward%03d/descriptor',k))
  eval(sprintf('!rmdir forward%03d',k))
end%for

% generate reverse-painted sequence
for k=290:-4:170;  % this creates about 480 pixels high canvas
  %eval(sprintf('cementcolor(P,290,k,-4,''reverse%03d'',170,290);',k)) % no bord
  eval(sprintf('cementcolor(P,290,k,-4,''reverse%03d'',170,290,k);',k))% border
  eval(sprintf('!temp_dattopnm_hp reverse%03d > reverse%03d.ppm',k,k))
  eval(sprintf('!rm reverse%03d/data',k))        % less risk than rm -r
  eval(sprintf('!rm reverse%03d/descriptor',k))
  eval(sprintf('!rmdir reverse%03d',k))
end%for

