\startMPpage

path loopcomponent ;
loopcomponent = ( % we're on a 16 step grid
       (9/16,2+7/16) --
       (1/2,5/2) --
       (1/2,7/2) --
       (3/2,7/2) --
       (2+9/16,2+7/16)
   )
   scaled (1/4) ;

vardef completeloop (expr loopcomponent) =
   image (
       draw loopcomponent ;
       draw loopcomponent rotated  90 shifted (1,0) ;
       draw loopcomponent rotated 180 shifted (1,1) ;
       draw loopcomponent rotated 270 shifted (0,1) ;
   )
enddef ;

vardef halfloop (expr loopcomponent) =
   image (
       draw loopcomponent ;
       draw loopcomponent rotated  90 shifted (1,0) ;
%       draw loopcomponent rotated 180 shifted (1,1) ;
%       draw loopcomponent rotated 270 shifted (0,1) ;
   )
enddef ;



interim linecap := squared ;

% draw completeloop (loopcomponent)
%    withcolor white
%    withpen pencircle scaled (9/64) ;


draw halfloop (loopcomponent)
   withcolor white
   withpen pencircle scaled (9/64) ;


setbounds currentpicture to boundingbox currentpicture enlarged 1/16 ;

addbackground withcolor black ;

currentpicture := currentpicture xsized 2cm ;

\stopMPpage
