Debian Codegraph @

texmf-dist/tex/latex/sneaker/sneaker.sty

raw
1 %% sneaker.sty
2 %% Copyright 2026 Aaron Molt
3 %%
4 %% This work may be distributed and/or modified under the
5 %% conditions of the LaTeX Project Public License, either
6 %% version 1.3c of this license or (at your option) any later version.
7 %% The latest version of this license is in:
8 %% https://www.latex-project.org/lppl.txt
9 %%
10 %% Maintainer: https://github.com/Aargon06/sneaker
11
12 \NeedsTeXFormat{LaTeX2e}
13 \ProvidesPackage{sneaker}[2026/04/03 v1.0 Configurable TikZ sneaker package]
14
15 \RequirePackage{tikz}
16 \usetikzlibrary{calc}
17
18 %% ---- Feature flags ----
19 \newif\ifsneakerlaces
20 \newif\ifsneakervelcro
21 \newif\ifsneakereyelets
22 \newif\ifsneakerpattern
23 \newif\ifsneakerstitching
24 \newif\ifsneakerrolls
25
26 %% ---- Pattern type storage ----
27 \def\sneakerPatternType{bolt}
28
29 %% ---- Custom colour flags ----
30 \newif\ifsneakercustompatterncolor
31 \newif\ifsneakercustomtonguecolor
32 \newif\ifsneakercustomlacecolor
33 \newif\ifsneakercustomsolecolor
34 \newif\ifsneakercustomtoecapcolor
35
36 %% ---- Default colour ----
37 \colorlet{MainCol}{blue}
38
39 %% ---- TikZ key interface ----
40 \tikzset{
41 sneaker/.cd,
42 color/.code={\colorlet{MainCol}{#1}},
43 laces/.is if=sneakerlaces,
44 velcro/.is if=sneakervelcro,
45 eyelets/.is if=sneakereyelets,
46 pattern/.is if=sneakerpattern,
47 stitching/.is if=sneakerstitching,
48 rolls/.is if=sneakerrolls,
49 %% Pattern type: bolt (default) or star
50 pattern type/.store in=\sneakerPatternType,
51 pattern type/.default=bolt,
52 %% Shortcuts
53 bolt/.style={pattern=true, pattern type=bolt},
54 star/.style={pattern=true, pattern type=star},
55 %% Configurable colours
56 pattern color/.code={\colorlet{CustomPatternCol}{#1}\sneakercustompatterncolortrue},
57 tongue color/.code={\colorlet{CustomTongueCol}{#1}\sneakercustomtonguecolortrue},
58 lace color/.code={\colorlet{CustomLaceCol}{#1}\sneakercustomlacecolortrue},
59 sole color/.code={\colorlet{CustomSoleCol}{#1}\sneakercustomsolecolortrue},
60 toe cap color/.code={\colorlet{CustomToeCapCol}{#1}\sneakercustomtoecapcolortrue},
61 }
62
63 %% =============================================================
64 %% Shared profile macros
65 %% =============================================================
66
67 \newcommand{\sneakerUpperNear}{%
68 (0.12, 0.34)
69 .. controls (0.04,0.50) and (0.02,0.72) .. (0.02, 0.88)
70 .. controls (0.02,1.02) and (0.04,1.14) .. (0.08, 1.20)
71 .. controls (0.10,1.34) and (0.20,1.42) .. (0.34, 1.40)
72 .. controls (0.48,1.36) and (0.56,1.28) .. (0.68, 1.23)
73 .. controls (0.85,1.22) and (1.00,1.21) .. (1.15, 1.20)
74 .. controls (1.50,1.12) and (1.85,1.02) .. (2.10, 0.94)
75 .. controls (2.50,0.78) and (2.80,0.55) .. (3.00, 0.34)
76 }
77
78 \newcommand{\sneakerBevelInner}{%
79 (2.94, 0.42)
80 .. controls (2.74,0.60) and (2.44,0.82) .. (2.05, 0.98)
81 .. controls (1.80,1.06) and (1.46,1.15) .. (1.15, 1.14)
82 .. controls (1.00,1.15) and (0.85,1.16) .. (0.68, 1.17)
83 .. controls (0.56,1.22) and (0.48,1.30) .. (0.34, 1.34)
84 .. controls (0.22,1.36) and (0.14,1.28) .. (0.12, 1.16)
85 .. controls (0.08,1.04) and (0.08,0.88) .. (0.08, 0.74)
86 }
87
88 \newcommand{\sneakerUpperFar}{%
89 ({0.12+\dx}, {0.34+\dy})
90 .. controls ({0.04+\dx},{0.50+\dy}) and ({0.02+\dx},{0.72+\dy})
91 .. ({0.02+\dx}, {0.88+\dy})
92 .. controls ({0.02+\dx},{1.02+\dy}) and ({0.04+\dx},{1.14+\dy})
93 .. ({0.08+\dx}, {1.20+\dy})
94 .. controls ({0.10+\dx},{1.34+\dy}) and ({0.20+\dx},{1.42+\dy})
95 .. ({0.34+\dx}, {1.40+\dy})
96 .. controls ({0.48+\dx},{1.36+\dy}) and ({0.56+\dx},{1.28+\dy})
97 .. ({0.68+\dx}, {1.23+\dy})
98 .. controls ({0.85+\dx},{1.22+\dy}) and ({1.00+\dx},{1.21+\dy})
99 .. ({1.15+\dx}, {1.20+\dy})
100 .. controls ({1.50+\dx},{1.12+\dy}) and ({1.85+\dx},{1.02+\dy})
101 .. ({2.10+\dx}, {0.94+\dy})
102 .. controls ({2.50+\dx},{0.78+\dy}) and ({2.80+\dx},{0.55+\dy})
103 .. ({3.00+\dx}, {0.34+\dy})
104 }
105
106 %% =============================================================
107 %% pic definition
108 %% =============================================================
109 \tikzset{
110 pics/sneaker/.style={
111 code={
112 %% reset all flags
113 \tikzset{sneaker/laces=false, sneaker/velcro=false,
114 sneaker/eyelets=false, sneaker/pattern=false,
115 sneaker/stitching=false,
116 sneaker/rolls=false}
117 \sneakercustompatterncolorfalse
118 \sneakercustomtonguecolorfalse
119 \sneakercustomlacecolorfalse
120 \sneakercustomsolecolorfalse
121 \sneakercustomtoecapcolorfalse
122 \def\sneakerPatternType{bolt}
123 %% apply caller's keys
124 \tikzset{sneaker/.cd, #1}
125
126 %% derived colour palette
127 \colorlet{DarkCol}{MainCol!55!black}
128 \colorlet{MidCol}{MainCol!78!black}
129 \colorlet{LightCol}{MainCol!35!white}
130 \ifsneakercustomtoecapcolor
131 \colorlet{ToeCol}{CustomToeCapCol}
132 \colorlet{ToeTopCol}{CustomToeCapCol!85!black}
133 \else
134 \colorlet{ToeCol}{MainCol!12!white}
135 \colorlet{ToeTopCol}{MainCol!22!white}
136 \fi
137 \ifsneakercustomtonguecolor
138 \colorlet{TongueCol}{CustomTongueCol}
139 \else
140 \colorlet{TongueCol}{MainCol!45!white}
141 \fi
142 \colorlet{BevelCol}{MainCol!30!white}
143 \ifsneakercustomlacecolor
144 \colorlet{LaceCol}{CustomLaceCol}
145 \else
146 \colorlet{LaceCol}{white!90!yellow}
147 \fi
148 \ifsneakercustompatterncolor
149 \colorlet{PatternCol}{CustomPatternCol}
150 \else
151 \colorlet{PatternCol}{white}
152 \fi
153 \ifsneakercustomsolecolor
154 \colorlet{SoleCol}{CustomSoleCol}
155 \else
156 \colorlet{SoleCol}{white}
157 \fi
158
159 %% depth offset
160 \pgfmathsetmacro{\dx}{0.60}
161 \pgfmathsetmacro{\dy}{0.35}
162 \pgfmathsetmacro{\bump}{0.08}
163
164 %% stitch style
165 \tikzset{sneaker stitch/.style={
166 black!40, line width=0.25pt,
167 dash pattern=on 0.8pt off 0.6pt,
168 line cap=round
169 }}
170
171 \begin{scope}[line join=round, line cap=round]
172
173 %% wheel parameters (needed early for far-side rolls in L1)
174 \pgfmathsetmacro{\wheelR}{0.16}
175 \pgfmathsetmacro{\hubR}{0.06}
176 \pgfmathsetmacro{\axleR}{0.025}
177 \pgfmathsetmacro{\wheelEmbed}{0.08}
178 \pgfmathsetmacro{\wheelY}{-\wheelR+\wheelEmbed}
179 \pgfmathsetmacro{\wA}{0.55}
180 \pgfmathsetmacro{\wB}{1.55}
181 \pgfmathsetmacro{\wC}{2.55}
182
183 %% =============================================================
184 %% L1 — far side
185 %% =============================================================
186
187 \fill[SoleCol!96!black, draw=black!20, line width=0.3pt]
188 ({0.10+\dx}, {\dy})
189 .. controls ({0.04+\dx},{\dy}) and ({0.02+\dx},{0.14+\dy})
190 .. ({0.06+\dx}, {0.34+\dy})
191 -- ({2.95+\dx}, {0.34+\dy})
192 .. controls ({3.08+\dx},{0.34+\dy}) and ({3.16+\dx},{0.18+\dy})
193 .. ({3.14+\dx}, {\dy})
194 -- cycle;
195
196 %% ---- far side rolls (behind everything) ----
197 \ifsneakerrolls
198 \fill[black!18, draw=black!30, line width=0.2pt]
199 ({0.25+\dx}, {\dy})
200 -- ({3.00+\dx}, {\dy})
201 -- ({3.00+\dx}, {\wheelY+\wheelR*0.3+\dy})
202 .. controls ({\wC+\wheelR+0.02+\dx}, {\wheelY-\wheelR*0.15+\dy})
203 and ({\wC-\wheelR-0.02+\dx}, {\wheelY-\wheelR*0.15+\dy})
204 .. ({\wC-\wheelR-0.02+\dx}, {\wheelY+\wheelR*0.3+\dy})
205 -- ({\wB+\wheelR+0.04+\dx}, {\wheelY+\wheelR*0.3+\dy})
206 .. controls ({\wB+\wheelR+0.04+\dx}, {\wheelY-\wheelR*0.15+\dy})
207 and ({\wB-\wheelR-0.04+\dx}, {\wheelY-\wheelR*0.15+\dy})
208 .. ({\wB-\wheelR-0.04+\dx}, {\wheelY+\wheelR*0.3+\dy})
209 -- ({\wA+\wheelR+0.04+\dx}, {\wheelY+\wheelR*0.3+\dy})
210 .. controls ({\wA+\wheelR+0.04+\dx}, {\wheelY-\wheelR*0.15+\dy})
211 and ({\wA-\wheelR-0.02+\dx}, {\wheelY-\wheelR*0.15+\dy})
212 .. ({\wA-\wheelR-0.02+\dx}, {\wheelY+\wheelR*0.3+\dy})
213 -- ({0.25+\dx}, {\wheelY+\wheelR*0.3+\dy})
214 -- cycle;
215 \foreach \wx in {\wA, \wB, \wC} {
216 \fill[black!60, draw=black!70, line width=0.2pt]
217 ({\wx+\dx}, {\wheelY+\dy}) circle (\wheelR);
218 \fill[white!85!black, draw=black!25, line width=0.2pt]
219 ({\wx+\dx}, {\wheelY+\dy}) circle ({\wheelR*0.72});
220 \foreach \a in {0,60,...,300} {
221 \draw[black!12, line width=0.15pt]
222 ({\wx+\dx}, {\wheelY+\dy}) -- +(\a:{\wheelR*0.68});
223 }
224 \fill[gray!40, draw=black!35, line width=0.2pt]
225 ({\wx+\dx}, {\wheelY+\dy}) circle (\hubR);
226 \fill[black!45]
227 ({\wx+\dx}, {\wheelY+\dy}) circle (\axleR);
228 }
229 \foreach \wx in {\wA, \wB, \wC} {
230 \fill[black!55, draw=black!65, line width=0.15pt]
231 ({\wx-\wheelR}, \wheelY)
232 arc[start angle=180, end angle=360, radius=\wheelR]
233 -- ({\wx+\wheelR+\dx}, {\wheelY+\dy})
234 arc[start angle=0, end angle=-180, radius=\wheelR]
235 -- cycle;
236 }
237 \fi
238
239 \fill[MidCol, draw=black!25, line width=0.3pt]
240 \sneakerUpperFar -- cycle;
241
242 \fill[DarkCol!75!black, draw=black!20, line width=0.3pt]
243 ({0.12+\dx}, {0.34+\dy})
244 .. controls ({0.04+\dx},{0.50+\dy}) and ({0.02+\dx},{0.72+\dy})
245 .. ({0.02+\dx}, {0.88+\dy})
246 .. controls ({0.02+\dx},{1.02+\dy}) and ({0.04+\dx},{1.14+\dy})
247 .. ({0.08+\dx}, {1.20+\dy})
248 -- ({0.36+\dx}, {1.12+\dy})
249 .. controls ({0.38+\dx}, {0.70+\dy}) and ({0.42+\dx}, {0.45+\dy})
250 .. ({0.48+\dx}, {0.34+\dy})
251 -- cycle;
252
253 %% =============================================================
254 %% L2 — top surfaces
255 %% =============================================================
256
257 \fill[SoleCol, draw=black!15, line width=0.3pt]
258 (0.06, 0.34)
259 .. controls ({0.08+\dx*0.5}, {0.34+\dy*0.5+\bump})
260 .. ({0.08+\dx}, {0.34+\dy})
261 -- ({2.95+\dx}, {0.34+\dy})
262 .. controls ({2.95+\dx*0.5}, {0.34+\dy*0.5+\bump})
263 .. (2.95, 0.34)
264 -- cycle;
265
266 \fill[LightCol, draw=black!25, line width=0.3pt]
267 (0.06, 1.22)
268 .. controls (0.08,1.36) and (0.18,1.44) .. (0.34, 1.42)
269 .. controls ({0.34+\dx*0.5}, {1.42+\dy*0.5+\bump*0.8})
270 .. ({0.34+\dx}, {1.42+\dy})
271 .. controls ({0.18+\dx},{1.44+\dy}) and ({0.08+\dx},{1.36+\dy})
272 .. ({0.06+\dx}, {1.22+\dy})
273 .. controls ({0.06+\dx*0.5}, {1.22+\dy*0.5+\bump*1.2})
274 .. (0.06, 1.22);
275
276 \fill[MidCol]
277 (0.34, 1.42)
278 .. controls (0.46,1.38) and (0.56,1.30) .. (0.68, 1.25)
279 .. controls (0.80,1.24) and (0.90,1.23) .. (1.00, 1.22)
280 -- (1.00, 0.60)
281 .. controls ({1.00+\dx*0.5}, {0.60+\dy*0.5+\bump})
282 .. ({1.00+\dx}, {0.60+\dy})
283 -- ({1.00+\dx}, {1.22+\dy})
284 .. controls ({0.90+\dx},{1.23+\dy}) and ({0.80+\dx},{1.24+\dy})
285 .. ({0.68+\dx}, {1.25+\dy})
286 .. controls ({0.56+\dx},{1.30+\dy}) and ({0.46+\dx},{1.38+\dy})
287 .. ({0.34+\dx}, {1.42+\dy})
288 .. controls ({0.34+\dx*0.5}, {1.42+\dy*0.5+\bump*0.8})
289 .. (0.34, 1.42);
290 \fill[black, opacity=0.35]
291 (0.34, 1.42)
292 .. controls (0.46,1.38) and (0.56,1.30) .. (0.68, 1.25)
293 .. controls (0.80,1.24) and (0.90,1.23) .. (1.00, 1.22)
294 -- (1.00, 0.60)
295 .. controls ({1.00+\dx*0.5}, {0.60+\dy*0.5+\bump})
296 .. ({1.00+\dx}, {0.60+\dy})
297 -- ({1.00+\dx}, {1.22+\dy})
298 .. controls ({0.90+\dx},{1.23+\dy}) and ({0.80+\dx},{1.24+\dy})
299 .. ({0.68+\dx}, {1.25+\dy})
300 .. controls ({0.56+\dx},{1.30+\dy}) and ({0.46+\dx},{1.38+\dy})
301 .. ({0.34+\dx}, {1.42+\dy})
302 .. controls ({0.34+\dx*0.5}, {1.42+\dy*0.5+\bump*0.8})
303 .. (0.34, 1.42);
304
305 %% ---- collar padding ----
306 \colorlet{CollarPadCol}{MainCol!38!white}
307 \fill[CollarPadCol, draw=black!30, line width=0.3pt]
308 (0.34, 1.42)
309 .. controls (0.46,1.38) and (0.56,1.30) .. (0.68, 1.25)
310 .. controls ({0.68+\dx*0.35}, {1.25+\dy*0.35+0.10})
311 .. ({0.68+\dx}, {1.25+\dy})
312 .. controls ({0.56+\dx},{1.30+\dy}) and ({0.46+\dx},{1.38+\dy})
313 .. ({0.34+\dx}, {1.42+\dy})
314 .. controls ({0.34+\dx*0.5}, {1.42+\dy*0.5+0.18})
315 .. (0.34, 1.42);
316 \fill[MainCol!20!white, opacity=0.45]
317 (0.36, 1.41)
318 .. controls (0.46,1.37) and (0.55,1.30) .. (0.65, 1.26)
319 .. controls ({0.65+\dx*0.35}, {1.26+\dy*0.35+0.12})
320 .. ({0.65+\dx}, {1.26+\dy})
321 .. controls ({0.55+\dx},{1.31+\dy}) and ({0.46+\dx},{1.37+\dy})
322 .. ({0.36+\dx}, {1.41+\dy})
323 .. controls ({0.36+\dx*0.5}, {1.41+\dy*0.5+0.20})
324 .. (0.36, 1.41);
325
326 %% ---- far side eyestay ----
327 \fill[MidCol, draw=black!45, line width=0.3pt]
328 ({1.15+\dx}, {1.20+\dy})
329 .. controls ({1.50+\dx},{1.12+\dy}) and ({1.85+\dx},{1.02+\dy})
330 .. ({2.10+\dx}, {0.94+\dy})
331 -- ({2.10+\dx}, {0.94+\dy - 0.08})
332 .. controls ({1.85+\dx},{1.02+\dy - 0.08}) and ({1.50+\dx},{1.12+\dy - 0.08})
333 .. ({1.15+\dx}, {1.20+\dy - 0.08})
334 -- cycle;
335
336 %% ---- eyelets far side ----
337 \ifsneakereyelets
338 \foreach \i in {0,...,3} {
339 \pgfmathsetmacro{\t}{\i/4}
340 \pgfmathsetmacro{\nex}{1.15 + \t*(2.10-1.15)}
341 \pgfmathsetmacro{\ney}{1.20 + \t*(0.94-1.20) - 0.06}
342 \pgfmathsetmacro{\fex}{\nex + \dx}
343 \pgfmathsetmacro{\fey}{\ney + \dy}
344 \fill[gray!50] (\fex, \fey) circle (0.04);
345 \fill[black!45] (\fex, \fey) circle (0.018);
346 }
347 \fi
348
349 %% ---- tongue ----
350 \pgfmathsetmacro{\bumpToe}{0.04}
351 \pgfmathsetmacro{\bumpCollar}{0.26}
352
353 \fill[TongueCol, draw=black!30, line width=0.3pt]
354 (1.15, 1.20)
355 .. controls (1.50,1.12) and (1.85,1.02) .. (2.10, 0.94)
356 .. controls ({2.10+\dx*0.5}, {0.94+\dy*0.5+\bumpToe})
357 .. ({2.10+\dx}, {0.94+\dy-0.01})
358 .. controls ({1.85+\dx},{1.02+\dy-0.07}) and ({1.50+\dx},{1.12+\dy-0.07})
359 .. ({1.15+\dx}, {1.20+\dy-0.02})
360 .. controls ({1.15+\dx*0.5}, {1.20+\dy*0.5+\bumpCollar})
361 .. (1.15, 1.20);
362 \fill[black, opacity=0.18]
363 (1.15, 1.20)
364 .. controls (1.50,1.12) and (1.85,1.02) .. (2.10, 0.94)
365 .. controls ({2.10+\dx*0.5}, {0.94+\dy*0.5+\bumpToe})
366 .. ({2.10+\dx}, {0.94+\dy-0.01})
367 .. controls ({1.85+\dx},{1.02+\dy-0.07}) and ({1.50+\dx},{1.12+\dy-0.07})
368 .. ({1.15+\dx}, {1.20+\dy-0.02})
369 .. controls ({1.15+\dx*0.5}, {1.20+\dy*0.5+\bumpCollar})
370 .. (1.15, 1.20);
371
372 %% ---- toe cap top ----
373 \fill[ToeTopCol, draw=black!30, line width=0.3pt]
374 (2.35, 0.80)
375 .. controls (2.60,0.68) and (2.80,0.50) .. (2.95, 0.33)
376 .. controls ({2.95+\dx*0.5}, {0.34+\dy*0.5+\bump})
377 .. ({2.98+\dx}, {0.35+\dy})
378 .. controls ({2.82+\dx},{0.50+\dy}) and ({2.60+\dx},{0.68+\dy})
379 .. ({2.36+\dx}, {0.81+\dy})
380 .. controls ({2.35+\dx*0.5}, {0.80+\dy*0.5+\bump})
381 .. (2.35, 0.80);
382
383 %% =============================================================
384 %% L3 — near side upper
385 %% =============================================================
386
387 \fill[MainCol, draw=black!45, line width=0.4pt]
388 \sneakerUpperNear -- cycle;
389
390 \fill[ToeCol, draw=black!45, line width=0.4pt]
391 (2.15, 0.34)
392 .. controls (2.20,0.34) and (2.40,0.34) .. (3.00, 0.34)
393 .. controls (2.80,0.55) and (2.60,0.68) .. (2.36, 0.81)
394 .. controls (2.25,0.68) and (2.18,0.52) .. (2.15, 0.34);
395
396 \fill[DarkCol, draw=black!45, line width=0.4pt]
397 (0.12, 0.34)
398 .. controls (0.04,0.50) and (0.02,0.72) .. (0.02, 0.88)
399 .. controls (0.02,1.02) and (0.04,1.14) .. (0.08, 1.2)
400 -- (0.36, 1.12)
401 .. controls (0.38, 0.70) and (0.42, 0.45) .. (0.48, 0.34)
402 -- cycle;
403
404 \fill[MidCol, draw=black!15, line width=0.3pt, opacity=0.25]
405 (0.50, 0.42)
406 .. controls (0.46,0.55) and (0.44,0.72) .. (0.46, 0.88)
407 .. controls (0.95,0.98) and (1.50,0.94) .. (2.00, 0.78)
408 .. controls (2.02,0.60) and (2.02,0.45) .. (2.00, 0.42)
409 -- cycle;
410
411 %% ---- bevel ----
412 \fill[BevelCol, opacity=0.50]
413 (0.06, 1.22)
414 .. controls (0.08,1.36) and (0.18,1.44) .. (0.34, 1.42)
415 .. controls (0.46,1.38) and (0.56,1.30) .. (0.68, 1.25)
416 .. controls (0.80,1.24) and (0.94,1.23) .. (1.10, 1.22)
417 .. controls (1.42,1.18) and (1.72,1.12) .. (2.00, 1.04)
418 .. controls (2.30,0.94) and (2.58,0.82) .. (2.82, 0.68)
419 .. controls (3.00,0.58) and (3.12,0.48) .. (3.20, 0.36)
420 -- (3.14, 0.42)
421 .. controls (3.06,0.52) and (2.94,0.62) .. (2.76, 0.72)
422 .. controls (2.52,0.86) and (2.24,0.98) .. (1.96, 1.08)
423 .. controls (1.68,1.16) and (1.38,1.20) .. (1.10, 1.16)
424 .. controls (0.94,1.17) and (0.80,1.18) .. (0.68, 1.19)
425 .. controls (0.56,1.24) and (0.46,1.32) .. (0.34, 1.36)
426 .. controls (0.20,1.38) and (0.12,1.30) .. (0.10, 1.18)
427 -- cycle;
428
429 %% =============================================================
430 %% L4 — near side sole
431 %% =============================================================
432
433 \ifsneakerrolls
434 \fill[SoleCol, draw=black!40, line width=0.4pt]
435 (0.10, {\wheelY+\wheelR*0.3})
436 .. controls (0.04, {\wheelY+\wheelR*0.3}) and (0.02, 0.14) .. (0.06, 0.34)
437 -- (2.95, 0.34)
438 .. controls (3.08, 0.34) and (3.16, 0.18) .. (3.14, {\wheelY+\wheelR*0.3})
439 .. controls ({\wC+\wheelR+0.04}, {\wheelY+\wheelR*0.3})
440 and ({\wC+\wheelR+0.02}, {\wheelY+\wheelR*0.85})
441 .. ({\wC+\wheelR*0.5}, {\wheelY+\wheelR})
442 .. controls ({\wC}, {\wheelY+\wheelR*1.05})
443 and ({\wC-\wheelR*0.5}, {\wheelY+\wheelR})
444 .. ({\wC-\wheelR-0.02}, {\wheelY+\wheelR*0.85})
445 .. controls ({\wC-\wheelR-0.04}, {\wheelY+\wheelR*0.3})
446 and ({\wB+\wheelR+0.04}, {\wheelY+\wheelR*0.3})
447 .. ({\wB+\wheelR+0.04}, {\wheelY+\wheelR*0.3})
448 .. controls ({\wB+\wheelR+0.02}, {\wheelY+\wheelR*0.85})
449 and ({\wB+\wheelR*0.5}, {\wheelY+\wheelR})
450 .. ({\wB}, {\wheelY+\wheelR*1.05})
451 .. controls ({\wB-\wheelR*0.5}, {\wheelY+\wheelR})
452 and ({\wB-\wheelR-0.02}, {\wheelY+\wheelR*0.85})
453 .. ({\wB-\wheelR-0.04}, {\wheelY+\wheelR*0.3})
454 .. controls ({\wA+\wheelR+0.04}, {\wheelY+\wheelR*0.3})
455 and ({\wA+\wheelR+0.02}, {\wheelY+\wheelR*0.85})
456 .. ({\wA+\wheelR*0.5}, {\wheelY+\wheelR})
457 .. controls ({\wA}, {\wheelY+\wheelR*1.05})
458 and ({\wA-\wheelR*0.5}, {\wheelY+\wheelR})
459 .. ({\wA-\wheelR-0.02}, {\wheelY+\wheelR*0.85})
460 .. controls ({\wA-\wheelR-0.04}, {\wheelY+\wheelR*0.3})
461 and (0.12, {\wheelY+\wheelR*0.3})
462 .. (0.10, {\wheelY+\wheelR*0.3})
463 -- cycle;
464 \draw[black!13, line width=0.25pt]
465 (0.14, 0.16) .. controls (1.5, 0.16) and (2.8, 0.14) .. (3.06, 0.16);
466
467 \fill[black!12, draw=black!30, line width=0.2pt]
468 (0.25, 0) -- (3.00, 0)
469 -- (3.00, {\wheelY+\wheelR*0.3})
470 .. controls ({\wC+\wheelR+0.02}, {\wheelY-\wheelR*0.15})
471 and ({\wC-\wheelR-0.02}, {\wheelY-\wheelR*0.15})
472 .. ({\wC-\wheelR-0.02}, {\wheelY+\wheelR*0.3})
473 -- ({\wB+\wheelR+0.04}, {\wheelY+\wheelR*0.3})
474 .. controls ({\wB+\wheelR+0.04}, {\wheelY-\wheelR*0.15})
475 and ({\wB-\wheelR-0.04}, {\wheelY-\wheelR*0.15})
476 .. ({\wB-\wheelR-0.04}, {\wheelY+\wheelR*0.3})
477 -- ({\wA+\wheelR+0.04}, {\wheelY+\wheelR*0.3})
478 .. controls ({\wA+\wheelR+0.04}, {\wheelY-\wheelR*0.15})
479 and ({\wA-\wheelR-0.02}, {\wheelY-\wheelR*0.15})
480 .. ({\wA-\wheelR-0.02}, {\wheelY+\wheelR*0.3})
481 -- (0.25, {\wheelY+\wheelR*0.3})
482 -- cycle;
483
484 \foreach \wx in {\wA, \wB, \wC} {
485 \fill[black!70, draw=black!80, line width=0.3pt]
486 (\wx, \wheelY) circle (\wheelR);
487 \fill[white!92!black, draw=black!30, line width=0.2pt]
488 (\wx, \wheelY) circle ({\wheelR*0.72});
489 \foreach \a in {0,60,...,300} {
490 \draw[black!15, line width=0.2pt]
491 (\wx, \wheelY) -- +(\a:{\wheelR*0.68});
492 }
493 \fill[gray!30, draw=black!40, line width=0.25pt]
494 (\wx, \wheelY) circle (\hubR);
495 \fill[black!50]
496 (\wx, \wheelY) circle (\axleR);
497 }
498
499 \fill[SoleCol, draw=black!25, line width=0.2pt]
500 (2.98, 0.34)
501 .. controls ({2.98+\dx*0.5}, {0.34+\dy*0.5+\bump})
502 .. ({2.98+\dx}, {0.34+\dy})
503 .. controls ({3.08+\dx},{0.34+\dy}) and ({3.14+\dx},{0.18+\dy})
504 .. ({3.15+\dx}, {\dy})
505 -- (3.15, 0)
506 .. controls (3.14, 0.18) and (3.08, 0.34) .. (2.95, 0.34);
507
508 \else
509 \fill[SoleCol, draw=black!40, line width=0.4pt]
510 (0.10, 0)
511 .. controls (0.04, 0) and (0.02, 0.14) .. (0.06, 0.34)
512 -- (2.95, 0.34)
513 .. controls (3.08, 0.34) and (3.16, 0.18) .. (3.14, 0)
514 -- cycle;
515 \draw[black!13, line width=0.25pt]
516 (0.14, 0.16) .. controls (1.5, 0.16) and (2.8, 0.14) .. (3.06, 0.16);
517 \fill[SoleCol, draw=black!25, line width=0.2pt]
518 (2.98, 0.34)
519 .. controls ({2.98+\dx*0.5}, {0.34+\dy*0.5+\bump})
520 .. ({2.98+\dx}, {0.34+\dy})
521 .. controls ({3.08+\dx},{0.34+\dy}) and ({3.14+\dx},{0.18+\dy})
522 .. ({3.15+\dx}, {\dy})
523 -- (3.15, 0)
524 .. controls (3.14, 0.18) and (3.08, 0.34) .. (2.95, 0.34);
525 \fi
526
527 %% =============================================================
528 %% features
529 %% =============================================================
530
531 %% ---- stitching ----
532 \ifsneakerstitching
533 \draw[sneaker stitch]
534 (2.15, 0.36)
535 .. controls (2.18,0.52) and (2.25,0.68) .. (2.36, 0.81);
536 \draw[sneaker stitch]
537 (0.48, 0.36)
538 .. controls (0.44,0.46) and (0.40,0.62) .. (0.37, 1.10);
539 \draw[sneaker stitch]
540 (0.52, 0.44)
541 .. controls (0.90,0.48) and (1.50,0.46) .. (1.98, 0.44);
542 \draw[sneaker stitch]
543 (0.48, 0.88)
544 .. controls (0.95,0.98) and (1.50,0.94) .. (2.00, 0.78);
545 \draw[sneaker stitch]
546 (0.14, 0.36)
547 -- (2.92, 0.36);
548 \fi
549
550 %% ---- pattern ----
551 \ifsneakerpattern
552 \def\tmpbolt{bolt}
553 \def\tmpstar{star}
554 \ifx\sneakerPatternType\tmpstar
555 \fill[PatternCol, opacity=0.88]
556 (1.30, 0.92) -- (1.37, 0.73) -- (1.55, 0.67)
557 -- (1.40, 0.58) -- (1.44, 0.38)
558 -- (1.30, 0.50) -- (1.16, 0.38)
559 -- (1.20, 0.58) -- (1.05, 0.67)
560 -- (1.23, 0.73) -- cycle;
561 \draw[PatternCol!50!black, line width=0.3pt, opacity=0.5]
562 (1.30, 0.92) -- (1.37, 0.73) -- (1.55, 0.67)
563 -- (1.40, 0.58) -- (1.44, 0.38)
564 -- (1.30, 0.50) -- (1.16, 0.38)
565 -- (1.20, 0.58) -- (1.05, 0.67)
566 -- (1.23, 0.73) -- cycle;
567 \else
568 \fill[PatternCol, opacity=0.88]
569 (1.05, 0.95) -- (1.35, 0.70) -- (1.15, 0.70)
570 -- (1.55, 0.40) -- (1.40, 0.62) -- (1.60, 0.62) -- cycle;
571 \draw[PatternCol!50!black, line width=0.3pt, opacity=0.5]
572 (1.05, 0.95) -- (1.35, 0.70) -- (1.15, 0.70)
573 -- (1.55, 0.40) -- (1.40, 0.62) -- (1.60, 0.62) -- cycle;
574 \fi
575 \fi
576
577 %% ---- eyelets near side ----
578 \ifsneakereyelets
579 \foreach \i in {0,...,4} {
580 \pgfmathsetmacro{\t}{\i/4}
581 \pgfmathsetmacro{\nex}{1.15 + \t*(2.10-1.15)}
582 \pgfmathsetmacro{\ney}{1.20 + \t*(0.94-1.20) - 0.06}
583 \fill[gray!40] (\nex, \ney) circle (0.050);
584 \fill[black!50] (\nex, \ney) circle (0.025);
585 }
586 \fi
587
588 %% ---- laces ----
589 \ifsneakerlaces
590 \pgfmathsetmacro{\outx}{0.032}
591 \pgfmathsetmacro{\outy}{0.074}
592 \pgfmathsetmacro{\inx}{0.01}
593 \pgfmathsetmacro{\iny}{-0.03}
594
595 \ifsneakervelcro
596 \pgfmathsetmacro{\t}{0}
597 \pgfmathsetmacro{\nex}{1.15 + \t*(2.10-1.15)}
598 \pgfmathsetmacro{\ney}{1.20 + \t*(0.94-1.20) - 0.06}
599 \pgfmathsetmacro{\fex}{1.15 + \t*(2.10-1.15) + \dx}
600 \pgfmathsetmacro{\fey}{1.20 + \t*(0.94-1.20) + \dy}
601 \draw[LaceCol, line width=0.7pt] (\nex, \ney) -- (\fex, \fey);
602 \foreach \i in {0,...,1} {
603 \pgfmathsetmacro{\ta}{\i/4}
604 \pgfmathsetmacro{\tb}{(\i+1)/4}
605 \pgfmathsetmacro{\nexa}{1.15 + \ta*(2.10-1.15)}
606 \pgfmathsetmacro{\neya}{1.20 + \ta*(0.94-1.20) - 0.06}
607 \pgfmathsetmacro{\nexb}{1.15 + \tb*(2.10-1.15)}
608 \pgfmathsetmacro{\neyb}{1.20 + \tb*(0.94-1.20) - 0.06}
609 \pgfmathsetmacro{\fexa}{1.15 + \ta*(2.10-1.15) + \dx}
610 \pgfmathsetmacro{\feya}{1.20 + \ta*(0.94-1.20) + \dy}
611 \pgfmathsetmacro{\fexb}{1.15 + \tb*(2.10-1.15) + \dx}
612 \pgfmathsetmacro{\feyb}{1.20 + \tb*(0.94-1.20) + \dy}
613 \draw[LaceCol, line width=0.7pt]
614 (\nexa, \neya) -- ({\fexb+\inx}, {\feyb+\iny});
615 \draw[LaceCol, line width=0.7pt]
616 (\fexa + 0.01, \feya + 0.01) -- (\nexb + \outx, \neyb+ \outy);
617 \pgfmathsetmacro{\tend}{(2)/4}
618 \pgfmathsetmacro{\nex}{1.15 + \tend*(2.10-1.15)}
619 \pgfmathsetmacro{\ney}{1.20 + \tend*(0.94-1.20) - 0.06}
620 \draw[LaceCol, line width=0.7pt] (\nex, \ney) -- ({\nex+\dx}, {\ney+\dy});
621 }
622 \else
623 \pgfmathsetmacro{\t}{0}
624 \pgfmathsetmacro{\nex}{1.15 + \t*(2.10-1.15)}
625 \pgfmathsetmacro{\ney}{1.20 + \t*(0.94-1.20) - 0.06}
626 \pgfmathsetmacro{\fex}{1.15 + \t*(2.10-1.15) + \dx}
627 \pgfmathsetmacro{\fey}{1.20 + \t*(0.94-1.20) + \dy}
628 \draw[LaceCol, line width=0.7pt] (\nex, \ney) -- (\fex, \fey);
629 \foreach \i in {0,...,3} {
630 \pgfmathsetmacro{\ta}{\i/4}
631 \pgfmathsetmacro{\tb}{(\i+1)/4}
632 \pgfmathsetmacro{\nexa}{1.15 + \ta*(2.10-1.15)}
633 \pgfmathsetmacro{\neya}{1.20 + \ta*(0.94-1.20) - 0.06}
634 \pgfmathsetmacro{\nexb}{1.15 + \tb*(2.10-1.15)}
635 \pgfmathsetmacro{\neyb}{1.20 + \tb*(0.94-1.20) - 0.06}
636 \pgfmathsetmacro{\fexa}{1.15 + \ta*(2.10-1.15) + \dx}
637 \pgfmathsetmacro{\feya}{1.20 + \ta*(0.94-1.20) + \dy}
638 \pgfmathsetmacro{\fexb}{1.15 + \tb*(2.10-1.15) + \dx}
639 \pgfmathsetmacro{\feyb}{1.20 + \tb*(0.94-1.20) + \dy}
640 \ifnum\i=3
641 \draw[LaceCol, line width=0.7pt]
642 (\nexa, \neya) -- ({\fexb+\inx-0.1}, {\feyb+\iny-0.02});
643 \else
644 \draw[LaceCol, line width=0.7pt]
645 (\nexa, \neya) -- ({\fexb+\inx}, {\feyb+\iny});
646 \fi
647 \draw[LaceCol, line width=0.7pt]
648 (\fexa + 0.01, \feya + 0.01) -- (\nexb + \outx, \neyb+ \outy);
649 \pgfmathsetmacro{\tend}{(4)/4}
650 \pgfmathsetmacro{\nex}{1.15 + \tend*(2.10-1.15)}
651 \pgfmathsetmacro{\ney}{1.20 + \tend*(0.94-1.20)}
652 \draw[LaceCol, line width=0.7pt]
653 (\nex, \ney -0.06) -- ({\nex+\dx}, {\ney+\dy});
654 }
655 \fi
656
657 %% bow
658 \pgfmathsetmacro{\bx}{1.18 + \dx*0.5}
659 \pgfmathsetmacro{\by}{1.20 + \dy*0.5 + 0.01}
660 \begin{scope}[shift={(\bx,\by)}, rotate=37, yscale=0.8, xscale=1.1]
661 \draw[LaceCol, fill=LaceCol] (0,0) circle (0.02);
662 \draw[LaceCol, line width=0.8pt, line cap=round]
663 (0,0) .. controls (-0.4, 0.4) and (-0.8, 0.1) .. (0,0);
664 \draw[LaceCol, line width=0.8pt, line cap=round]
665 (0,0) .. controls (0.5, -0.3) and (0.9, 0.1) .. (0,0);
666 \draw[LaceCol, line width=0.7pt, line cap=round]
667 (0,0) .. controls (-0.2, -0.1) .. (-0.5, -0.2);
668 \draw[LaceCol, line width=0.7pt, line cap=round]
669 (0,0) .. controls (0.2, -0.4) .. (0.6, -0.5);
670 \end{scope}
671 \fi
672
673 %% ---- velcro ----
674 \ifsneakervelcro
675 \ifsneakerlaces
676 \pgfmathsetmacro{\ta}{0.70}
677 \pgfmathsetmacro{\tb}{0.95}
678 \pgfmathsetmacro{\na}{1.15 + \ta*(2.10-1.15)}
679 \pgfmathsetmacro{\naz}{1.20 + \ta*(0.94-1.20)}
680 \pgfmathsetmacro{\nb}{1.15 + \tb*(2.10-1.15)}
681 \pgfmathsetmacro{\nbz}{1.20 + \tb*(0.94-1.20)}
682 \pgfmathsetmacro{\fa}{\na + \dx}
683 \pgfmathsetmacro{\faz}{\naz + \dy}
684 \pgfmathsetmacro{\fb}{\nb + \dx}
685 \pgfmathsetmacro{\fbz}{\nbz + \dy}
686 \fill[gray!15, draw=gray!55, line width=0.5pt]
687 (\na, \naz) -- (\fa, \faz) -- (\fb, \fbz) -- (\nb, \nbz) -- cycle;
688 \pgfmathsetmacro{\mx}{(\na+\fb)/2}
689 \pgfmathsetmacro{\my}{(\naz+\fbz)/2}
690 \foreach \jj in {-0.08,-0.02,0.04,0.10} {
691 \foreach \kk in {-0.03,0.03} {
692 \fill[gray!40] ({\mx+\jj},{\my+\kk}) circle (0.011);
693 }
694 }
695 \fill[gray!30, draw=gray!60, line width=0.4pt]
696 ({\fa-0.02},\faz) -- ({\fa+0.06},{\faz+0.02})
697 -- ({\fb+0.06},{\fbz+0.02}) -- ({\fb-0.02},\fbz) -- cycle;
698 \else
699 \foreach \i in {0,1} {
700 \pgfmathsetmacro{\ta}{0.12 + \i*0.42}
701 \pgfmathsetmacro{\tb}{\ta + 0.22}
702 \pgfmathsetmacro{\na}{1.15 + \ta*(2.10-1.15)}
703 \pgfmathsetmacro{\naz}{1.20 + \ta*(0.94-1.20)}
704 \pgfmathsetmacro{\nb}{1.15 + \tb*(2.10-1.15)}
705 \pgfmathsetmacro{\nbz}{1.20 + \tb*(0.94-1.20)}
706 \pgfmathsetmacro{\fa}{\na + \dx}
707 \pgfmathsetmacro{\faz}{\naz + \dy}
708 \pgfmathsetmacro{\fb}{\nb + \dx}
709 \pgfmathsetmacro{\fbz}{\nbz + \dy}
710 \fill[gray!15, draw=gray!55, line width=0.5pt]
711 (\na, \naz) -- (\fa, \faz) -- (\fb, \fbz) -- (\nb, \nbz) -- cycle;
712 \pgfmathsetmacro{\mx}{(\na+\fb)/2}
713 \pgfmathsetmacro{\my}{(\naz+\fbz)/2}
714 \foreach \jj in {-0.08,-0.02,0.04,0.10} {
715 \foreach \kk in {-0.03,0.03} {
716 \fill[gray!40] ({\mx+\jj},{\my+\kk}) circle (0.011);
717 }
718 }
719 \fill[gray!30, draw=gray!60, line width=0.4pt]
720 ({\fa-0.02},\faz) -- ({\fa+0.06},{\faz+0.02})
721 -- ({\fb+0.06},{\fbz+0.02}) -- ({\fb-0.02},\fbz) -- cycle;
722 }
723 \fi
724 \fi
725
726 \end{scope}
727 }
728 }
729 }
730
731 \endinput