% !TEX TS-program = XeLaTeX

% This code by Chris Staecker, released to public domain. 
%You are free to do whatever you want with it.

\documentclass{article}
\usepackage{nopageno}
\usepackage[margin=0.25in]{geometry}
\usepackage{qrcode}

\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{patterns,patterns.meta}

% Uses the copperplate font, download here: https://www.dafontfree.co/copperplate-font/
\usepackage{fontspec}
\setmainfont[]{OPTICopperplate-Light}

% arcs on chart: args are # of arcs, angle offset, and draw options
\newcommand{\makearcs}[3]{
\pgfmathsetmacro{\k}{#1-1}
\foreach \a in {0,...,\k} {
	\draw[#3] ({(360/#1)*\a+#2}:\innerrad) to[bend left=10] ({(360/#1)*\a+#2+.8}:\outerrad);
  }
}

\newcommand{\timelabel}[2]{
%\node[rotate={#1-90},align=center,scale=\textscale] at (#1:\outerrad+\timepad) {#2};

 \node[rotate={#1-90},scale=\textscale] at (#1:\outerrad+3*\timepad) {#2};
}

\newcommand{\tikzscale}{1}

% these all measured by hand
\newcommand{\paperrad}{5.5cm} % radius of entire paper
\newcommand{\outerrad}{4.82cm} % outside ring of chart
\newcommand{\innerrad}{1.5cm} % inside ring of chart
\newcommand{\cutoutrad}{.72cm}
\newcommand{\cutoutheight}{.38cm} % measured from center
\newcommand{\tenthickness}{.221333cm} % thickness of radial 10s divisions
\newcommand{\timepad}{\tenthickness * .5} % radial distance from outerrad to center of "6AM" label
\newcommand{\shaderad}{\outerrad + \timepad*4} % radius from center to outer edge of shading
\newcommand{\shadewindowangle}{4} % angle of shade overhangs
\newcommand{\textscale}{.5}
\newcommand{\numbertextscale}{.4}

\newcommand{\chart}[1]{
\begin{scope}[shift={#1}]

\draw (0,0) circle (\paperrad);
\draw (0,0) circle (\outerrad);
\draw (0,0) circle (\innerrad);
%\draw (0,0) circle (\cutoutrad);

% inner rectangle
\begin{scope}
\clip (-\innerrad, -\cutoutheight) rectangle (\innerrad, \cutoutheight);
\draw (0,0) circle (\cutoutrad);
\end{scope}
\begin{scope}
\clip (0,0) circle (\cutoutrad);
\draw (-\innerrad, -\cutoutheight) rectangle (\innerrad, \cutoutheight);
\end{scope}

\node at (0,0) {$\times$};

% thick circles
\foreach \r in {-3,-2,...,12} {
 \draw[thick] (0,0) circle ({\innerrad + (\r +3)*\tenthickness});
}
% thin circles
\foreach \r in {-3,-2.5,...,12} {
 \draw[] (0,0) circle ({\innerrad + (\r +3)*\tenthickness});
}


\makearcs{7}{12.85}{thick}
\makearcs{28}{12.85}{thin}
\makearcs{56}{12.85}{very thin}

% number labels along arcs
\foreach \a in {0,...,6} {
 \foreach \r in {-3,-2,0,...,10} {
  \pgfmathsetmacro{\rlabel}{int(\r*10)}
  \pgfmathsetmacro{\ang}{(360/7)*\a+12.85}
  \path (\ang:\innerrad) to[bend left=10] 
  coordinate[pos={(\r+3)/15}] (C)    % grab locations along the arc- in polar coords these have slightly wrong radius
  ({\ang+.8}:\outerrad);
  
  % use angle from points as above, calculate appropriate radius
  \draw let \p1=(C) in ({atan2(\y1,\x1)}:{\innerrad + (\r+3)*\tenthickness}) node[fill=white,rotate={\ang-90},scale=\numbertextscale] {\rlabel};
}
}

% arched shaded regions
\foreach \a in {0,...,6} {

  \pgfmathsetmacro{\ang}{(360/7)*\a}
  \draw[pattern={Dots[angle=45,radius={.2pt},distance={1pt}]}] (\ang:\shaderad) arc (\ang:\ang+25.7:\shaderad) -- (\ang+25.7:\shaderad-\tenthickness)
    arc (\ang+25.7:\ang+25.7-\shadewindowangle:\shaderad) -- (\ang+25.7-\shadewindowangle:\outerrad) arc (\ang+25.7-\shadewindowangle:\ang+\shadewindowangle:\outerrad)
    -- (\ang+\shadewindowangle:\shaderad-\tenthickness) arc (\ang+\shadewindowangle:\ang:\shaderad-\tenthickness) -- cycle;
  
  % -- (\ang-12.85:\outerrad) -- (\ang:\outerrad) -- (\ang:\shaderad);
}
  
% time labels
\foreach \a in {0,...,6} {
 \pgfmathsetmacro{\ang}{360/7*\a-25.7}
 \node[rotate={\ang-90},scale=\textscale] at (\ang:\outerrad+\timepad) {6 P.M.};
}
\foreach \a in {0,...,6} {
 \pgfmathsetmacro{\ang}{360/7*\a-12.85}
 \node[rotate={\ang-90},scale=\textscale] at (\ang:\outerrad+\timepad) {NOON};
}
\foreach \a in {0,...,6} {
 \pgfmathsetmacro{\ang}{360/7*\a}
 \node[rotate={\ang-90},scale=\textscale] at (\ang:\outerrad+\timepad) {6 A.M.};
}

% day labels
\timelabel{360/7*0-12.85}{TUESDAY}
\timelabel{360/7*1-12.85}{MONDAY}
\timelabel{360/7*2-12.85}{SUNDAY}
\timelabel{360/7*3-12.85}{SATURDAY}
\timelabel{360/7*4-12.85}{FRIDAY}
\timelabel{360/7*5-12.85}{THURSDAY}
\timelabel{360/7*6-12.85}{WEDNESDAY}
 
% middle text
\node[align=center,scale=\textscale] at (0,-\cutoutheight*2) {fits tempscribe\textsuperscript{\textregistered}\\ chart 14-0068};

% deg fahr text
\node[align=center,scale=\textscale*.8] at (-\innerrad*.8, 0) {deg.\\fahr.};
\end{scope}
}

\begin{document}

\begin{tikzpicture}[scale=\tikzscale,transform shape]
\chart{(0,0)}
\chart{(9,-7)}
\chart{(0,-14)}
\node[align=center,scale=1,execute at begin node=\setlength{\baselineskip}{5ex}] at (9,3) {These charts made by Chris Staecker.\\Get more here:\\ \\ \qrcode{https://cstaecker.fairfield.edu/~cstaecker/machines/tempscribe.html}};
\end{tikzpicture}

\end{document}