summaryrefslogtreecommitdiff
path: root/info/drawing-with-metapost/src/arch-4-8-8.mp
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-04-15 03:01:57 +0000
committerNorbert Preining <norbert@preining.info>2023-04-15 03:01:57 +0000
commit78e6b19d4678a9d641c4afa4ca800288cfa0a9d5 (patch)
treead774593055c02ade73402379b9df52568f6940f /info/drawing-with-metapost/src/arch-4-8-8.mp
parentb17717e3829bc08efb71ec2537d9d894c8b82d45 (diff)
CTAN sync 202304150301
Diffstat (limited to 'info/drawing-with-metapost/src/arch-4-8-8.mp')
-rw-r--r--info/drawing-with-metapost/src/arch-4-8-8.mp40
1 files changed, 40 insertions, 0 deletions
diff --git a/info/drawing-with-metapost/src/arch-4-8-8.mp b/info/drawing-with-metapost/src/arch-4-8-8.mp
new file mode 100644
index 0000000000..117588ff02
--- /dev/null
+++ b/info/drawing-with-metapost/src/arch-4-8-8.mp
@@ -0,0 +1,40 @@
+\documentclass{standalone}
+\usepackage{luamplib}
+\begin{document}
+\begin{mplibcode}
+beginfig(1);
+input colorbrewer-rgb
+path o, r[];
+o = (for i=0 upto 7: 21 dir 45i -- endfor cycle) rotated -90/4;
+pair t; t = whatever[point 0 of o, point 1 of o]
+ = whatever[point 2 of o, point 3 of o];
+r1 = subpath (1,2) of o -- t -- cycle;
+r2 = r1 rotated 90;
+r3 = r2 rotated 90;
+r4 = r3 rotated 90;
+
+picture filler;
+filler = image(
+ filldraw r1 withcolor Reds 8 3;
+ filldraw r2 withcolor Blues 8 3;
+ filldraw r3 withcolor Reds 8 3;
+ filldraw r4 withcolor Blues 8 3;
+ filldraw o withcolor Purples 8 2;
+);
+pair u, v;
+u = point 0 of o - point 5 of o; v = u rotated 90;
+beginfig(1);
+numeric n; n = 5;
+for i=-n upto n:
+ for j=-n upto n:
+ draw filler rotated ((i+j) mod 2 * 90) shifted (i*u + j * v);
+ endfor
+endfor
+for i=-n upto n:
+ for j=-n upto n:
+ draw o shifted (i*u + j * v);
+ endfor
+endfor
+endfig;
+\end{mplibcode}
+\end{document}