3. Isometric dotsο
Isometric dot layouts can be made using LaTeX.
LaTeX with variables that can be manually altered:
1\documentclass{article}
2\usepackage{tikz}
3\usepackage{geometry}
4\pagestyle{empty}
5\usepackage{xstring}
6
7% === Paper and Margin Variables ===
8\newcommand{\paperwidthcm}{21.0} % A4 width in cm
9\newcommand{\paperheightcm}{29.7} % A4 height in cm
10\newcommand{\hmargin}{1.5} % horizontal margin in cm
11\newcommand{\vmargin}{1.5} % vertical margin in cm
12
13% === Apply geometry using variables ===
14\geometry{
15 paperwidth=\paperwidthcm cm,
16 paperheight=\paperheightcm cm,
17 hmargin=\hmargin cm,
18 vmargin=\vmargin cm
19}
20
21% === Dot Style Variables ===
22\newcommand{\dotfilltype}{open} % options: filled, open
23\newcommand{\dotspacing}{1.0} % spacing between nearest neighbours (cm)
24\newcommand{\dotsize}{2.0pt} % radius of each dot
25\newcommand{\dotlinewidth}{0.4pt} % outline thickness
26
27% Dot shade variable: choose "white", "black", or "gray!<percent>"
28% Define the black percentage (0β100)
29\newcommand{\dotblackpercent}{90} % e.g., 67 = black!67
30% Define the dot color using the variable
31\newcommand{\dotcolor}{black!\dotblackpercent}
32
33% === Orientation Variable ===
34% Set to "vertical" for default layout, "horizontal" for 90-degree rotated
35\newcommand{\gridorientation}{vertical}
36
37% Helper to draw one dot at x, y
38\newcommand{\drawdot}[2]{%
39 \IfStrEq{\dotfilltype}{open}{%
40 \draw[draw=\dotcolor, fill=none, line width=\dotlinewidth] (#1,#2) circle (\dotsize);
41 }{%
42 % filled circle
43 \fill[\dotcolor] (#1,#2) circle (\dotsize);
44 }%
45}
46
47
48
49
50\begin{document}
51\begin{tikzpicture}[remember picture, overlay]
52 % Anchor to bottom-left of the physical page
53 \begin{scope}[shift={(current page.south west)}]
54 % Work in centimeters and shift to content area
55 \begin{scope}[x=1cm, y=1cm, shift={(\hmargin,\vmargin)}]
56
57 % Usable area
58 \pgfmathsetmacro{\usablewidth}{\paperwidthcm - 2*\hmargin}
59 \pgfmathsetmacro{\usableheight}{\paperheightcm - 2*\vmargin}
60
61 % Convert pt to cm for padding
62 \pgfmathsetmacro{\pad}{(\dotsize + 0.5*\dotlinewidth)/28.45274}
63
64 % Clip to content area (+ tiny pad)
65 \clip (-\pad,-\pad) rectangle (\usablewidth+\pad, \usableheight+\pad);
66
67 % Hex grid spacing based on orientation
68 \IfStrEq{\gridorientation}{vertical}{
69 \pgfmathsetmacro{\dx}{\dotspacing}
70 \pgfmathsetmacro{\dy}{\dotspacing * sqrt(3)}
71 \pgfmathsetmacro{\offsetx}{\dx/2}
72 \pgfmathsetmacro{\offsety}{\dy/2}
73 }{
74 \pgfmathsetmacro{\dy}{\dotspacing}
75 \pgfmathsetmacro{\dx}{\dotspacing * sqrt(3)}
76 \pgfmathsetmacro{\offsety}{\dy/2}
77 \pgfmathsetmacro{\offsetx}{\dx/2}
78 }
79
80 % Integer loop bounds
81 \pgfmathtruncatemacro{\xcount}{ceil((\usablewidth+\pad)/\dx)+1}
82 \pgfmathtruncatemacro{\ycount}{ceil((\usableheight+\pad)/\dy)+1}
83
84 % Draw dots
85 \foreach \i in {0,...,\xcount} {
86 \foreach \j in {0,...,\ycount} {
87 \pgfmathsetmacro{\x}{\i * \dx}
88 \pgfmathsetmacro{\y}{\j * \dy}
89 \drawdot{\x}{\y}
90 \drawdot{\x+\offsetx}{\y+\offsety}
91 }
92 }
93
94 \end{scope}
95 \end{scope}
96\end{tikzpicture}
97\end{document}