\startMPpage


linejoin := mitered ;



path whtrcomp ; % triangle for the wheel pattern
whtrcomp = ( % on a 5-step grid
	(0,0) --
	(2/5,1/5) --
	(1/5,2/5) --
	(0,0) --
	cycle
	)  ;

path whsqcomp; % square for the wheel pattern
whsqcomp = ( % on a 5-step grid
	(4/10,2/10) --
	(8/10,0) --
	(10/10,4/10) --
	(6/10,6/10) --
	(4/10,2/10) --
	cycle
	) ;


 
% tiling the triangles and squares into a mosaic block of 2+2
picture whmosaic;
	whmosaic :=
		image (
			fill whtrcomp;
			fill whsqcomp ;
			fill whsqcomp reflectedabout ((0,0),(1,1)) withcolor red;
			fill whtrcomp shifted (6/10,6/10) ;
		);

picture wheel ;
	wheel :=
		image (
			draw whmosaic;
			draw whmosaic rotatedaround ((1,1),90);
			draw whmosaic rotatedaround ((1,1),180);
			draw whmosaic rotatedaround ((1,1),270);
			) ;


draw wheel ;


% making the wheel pattern
% picture wheelcombo ;
% 	wheelcombo :=
% 		image (
% 			draw wheelsq (whsqcomp);
% 			draw wheelsq (whsqcomp) reflectedabout ((0,0),(1,1));
% 			draw wheeltr (whtrcomp);
% 			draw wheeltr (whtrcomp) shifted (6/10,6/10) ;
% 			) ;
% 
% 
% picture wheel ;
% 	wheel :=
% 		image (
%  			draw wheelcombo shifted (-1,-1) ;
% 			draw wheelcombo rotated 90 shifted (1,-1) ;
% 			draw wheelcombo rotated 180 shifted (1,1) ;
% 			draw wheelcombo rotated 270 shifted (-1,1) ;
% 			draw boundingbox currentpicture
% 			enlarged (1/12)
% 			withpen pencircle scaled (1/6) ;
% 		) ;
% 
% 
% 		draw wheel scaled (1/2) shifted (2+5/6,1/2) ;
% 
% 

% frame

currentpicture := currentpicture xsized 5cm ;



\stopMPpage