\startMPpage


linejoin := mitered ;



% First part, oblique squares

picture oblsquare ; 
	oblsquare:= image (
		path blsq;
       	blsq := (1/3,0) -- (1,1/3) -- (2/3,1) -- (0,2/3) -- (1/3,0) -- cycle;
	   	fill blsq;
	);
	

picture squaremos ;
	squaremos := image (
		draw oblsquare ;
		draw oblsquare reflectedabout ((1,0),(1,1));
		draw oblsquare shifted (2,0) ;
		draw oblsquare reflectedabout ((0,1),(1,1));
		draw oblsquare shifted (1,1) ;
		draw oblsquare reflectedabout ((0,1),(1,1)) shifted (2,0);
		draw oblsquare shifted (0,2) ;
		draw oblsquare reflectedabout ((0,1),(1,1)) shifted (1,1);
		draw oblsquare shifted (2,2) ;
	);


draw squaremos scaled (1/3);



% second part, triangles

path triangle ; % triangles
triangle = ( % we're on an 2 step grid
       (0,0) --
       (1/2,1/4) --
       (1/4,1/2) --
       (0,0)
		-- cycle
   )
	scaled 2;

% a four-triangle group
picture trisquare;
	trisquare :=
		image (
			fill triangle ;
			fill triangle rotatedaround ((1,1),90);
			fill triangle rotatedaround ((1,1),180) ;
			fill triangle rotatedaround ((1,1),270) ;
			);


% tiling four squares into a mosaic
picture trimosaic;
	trimosaic :=
		image (
			draw trisquare;
			draw trisquare shifted (2,2);
			draw trisquare shifted (2,0);
			draw trisquare shifted (0,2);
			);

draw trimosaic scaled (1/4) shifted (14/12,0);
 



% third part, wheel 

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)) ;
			fill whtrcomp shifted (6/10,6/10) ;
		);

% tiling the blocks into a wheel
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 scaled (1/2) shifted (28/12,0);





% frames
picture frames;
	frames :=
		image (
			draw boundingbox squaremos scaled (1/3) enlarged 1/24 withpen pencircle scaled (1/12);
			draw boundingbox trimosaic scaled (1/4) enlarged 1/24 withpen pencircle scaled (1/12) shifted (14/12,0);
			draw boundingbox wheel scaled (1/2) enlarged 1/24 withpen pencircle scaled (1/12) shifted (28/12,0);
			);
			
			
draw frames ;

currentpicture := currentpicture xsized 15cm ;



\stopMPpage