A friend showed a quilt pattern on which they were working. Ah, I said, I could easily do that in TikZ with pic
s. Well, yes and no: Do it, certainly; easily, not so much. I have the pic
shown below, as well as the finished pattern which was done completely by brute force. There must be a way to do this more efficiently, and in a way that could be generalized for other patters.
\documentclass{article}
\usepackage[papersize={5.5in,8.5in},margin=0.6in]{geometry}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric}
\tikzset{%
dartstyle/.style={kite,draw,kite vertex angles=60,inner sep=0.125in,outer sep=0pt,fill=#1},
pics/quiltdart/.style={%
code={%
\node[dartstyle=red](base) {};
\node[rotate=0,dartstyle=white,anchor=upper vertex] at (base.right vertex) {};
\node[rotate=0,dartstyle=white,anchor=upper vertex] at (base.left vertex) {};
\node[rotate=0,dartstyle=red,anchor=upper vertex] at (base.lower vertex) {};
}%
}%
}
\parindent0pt
\begin{document}
This was easy:
\tikz \pic {quiltdart};
\bigskip
This, not so much\dots
\tikz {\pic {quiltdart};
\pic[yshift=-0.51in,xshift=0.89in,rotate=-60,transform shape] {quiltdart};
\pic[yshift=-1.54in,xshift=0.89in,rotate=-120,transform shape] {quiltdart};
\pic[yshift=-2.05in,xshift=-0in,rotate=-180,transform shape] {quiltdart};
\pic[yshift=-1.54in,xshift=-0.89in,rotate=-240,transform shape] {quiltdart};
\pic[yshift=-0.51in,xshift=-0.89in,rotate=-300,transform shape] {quiltdart};
}
\end{document}
Update
First, I want to thank those who have replied to my post: I have learned an enormous amount. For that reason, I am posting this as an Update rather than an Answer because it would not have been possible without the thought-provoking replies from which I do not in any way wish to detract.
Here is my approach. It works nicely though it is probably not the most efficient code possible. On the other hand it is straightforward and easily maintained/tinkered-with.
\documentclass[]{article}
\usepackage[rgb]{xcolor}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usepackage[margin=1.4in,top=0.5in,left=0.75in]{geometry}
\NewDocumentCommand{\makeshape}{m}{%
\pgfmathsetmacro{\myhuei}{rnd}
\pgfmathsetmacro{\myhueii}{rnd}
\pgfmathsetmacro{\myhueiii}{rnd}
\definecolor{mycolori}{hsb}{\myhuei,1,1}
\definecolor{mycolorii}{hsb}{\myhueii,0.25,1}
\definecolor{mycoloriii}{hsb}{\myhueiii,1,1}
\pgfmathsetmacro{\lang}{180/#1}%
\pgfmathsetmacro{\bang}{90-\lang}%
\tikzset{%
pics/dart/.style={code={%
\draw[fill=mycolorii] (0,0) -- ++(90-\lang:2) --
++(180-\bang:2) -- ++(-90-\lang:2) -- cycle;
\draw[fill=mycolori](0,0) -- ++(90-\lang:1) -- ++(180 - \bang:1)coordinate(T) --
++(-90-\lang:1) -- cycle;
\draw[fill=mycoloriii](T) -- ++(90-\lang:1) -- ++(-180 - \bang:1) --
++(-90-\lang:1)-- cycle;
}%
},%
}%
\begin{tikzpicture}[rotate=\lang,scale=0.5]%% both rotate and scale can be altered to suit
\foreach \i [count=\ii from 0] in {1,...,#1}
\path pic[rotate around={360/#1*\ii:(0,0)},transform shape]{dart};
\end{tikzpicture}
}
\parindent0pt
\begin{document}
\thispagestyle{empty}
\foreach \N in {4,5,...,18}{\makeshape{\N}}
\end{document}