[OS X TeX] Angular Vernier scale
Aaron Jackson
jackson at msrce.howard.edu
Sat Jun 1 21:42:37 EDT 2013
On Jun 1, 2013, at 4:15 PM, Michael Sharpe <msharpe at ucsd.edu> wrote:
>
> On Jun 1, 2013, at 12:21 PM, Aaron Jackson <jackson at msrce.howard.edu> wrote:
>
>> I have to make some documentation for a piece of scientific equipment. This will entail making quite a few illustrations of different settings on an angular vernier scale, similar to the one show here
>>
>> http://www.craftsmanspace.com/sites/default/files/free-knowledge-articles/bevel_protractor_vernier_scale.jpg
>>
>> Does anybody know an easy way to draw this sort of scale?
>>
>> Thanks,
>>
>
> The LaTeX packages pstricks and tikz/pgf would be suitable, as would a number of others. There is code on which you could base your drawing at
>
> http://tug.org/PSTricks/main.cgi?file=examples#compass
>
> or
>
> http://www.texample.net/tikz/examples/degree-wheel/
>
> Michael
Thanks for the pointer. For completeness, this is what I came up with. It is a modified version of the tikz example:
% A simple compass
% Author: Dario Orescanin
\documentclass{minimal}
\usepackage{tikz}
\begin{document}
\begin{centering}
% Define a few constants for easy configuration
\def\radius{2cm}
\def\onedegrad{1.8cm}
\def\fivedegrad{1.75cm}
\def\tendegrad{1.7cm}
\def\labelrad{1.6cm}
\def\minradius{2.3cm}
\def\fifteenmin{2.2cm}
\def\fivemin{2.1cm}
\def\minlabel{2.25cm}
\def\vernierunit{1.9}
\def\verniercount{10}
\def\rotation{31.6}
\begin{tikzpicture}[scale=4]
% adding a subtle gray tone to add a bit of "personality"
\shade[shading=radial, inner color=white, outer color=gray!15] (0,0) circle (\radius);
\draw (0,0) circle (\radius);
\draw[fill=black] (0,0) circle (.02mm);
\node[draw, circle, inner sep=.2mm] (a) at (0,0) {};
% helper lines
\foreach \x in {0, 45, ..., 360} \draw[very thin, gray!40] (a) -- (\x+\rotation:\radius);
% main lines
\foreach \x in {0,...,359} \draw (\x+\rotation:\onedegrad) -- (\x+\rotation:\radius);
% labels and longer lines at every 10 degrees
\foreach \x in {0,10,...,350}
{
\node[scale=1.4] at (270-\x+\rotation:\labelrad) {\x};
\draw (\x+\rotation:\tendegrad) -- (\x+\rotation:\radius);
};
% lines at every 5 degrees
\foreach \x in {0,5,...,355} \draw (\x+\rotation:\fivedegrad) -- (\x+\rotation:\radius);
\draw (0,0) circle (\minradius);
\foreach \x in {0,...,20} \draw (270-\vernierunit*\verniercount+\x*\vernierunit:\radius) -- (270-\vernierunit*\verniercount+\x*\vernierunit:\fivemin);
\foreach \x in {0,5,...,20} \draw (270-\vernierunit*\verniercount+\x*\vernierunit:\radius) -- (270-\vernierunit*\verniercount+\x*\vernierunit:\fifteenmin);
\node at (270:\minlabel) {0'};
\node at (270-\vernierunit*\verniercount:\minlabel) {60'};
\node at (270+\vernierunit*\verniercount:\minlabel) {60'};
\node at (270-\vernierunit*\verniercount+5*\vernierunit:\minlabel) {30'};
\node at (270-\vernierunit*\verniercount+15*\vernierunit:\minlabel) {30'};
\end{tikzpicture}
\end{centering}
\end{document}
More information about the MacOSX-TeX
mailing list