summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/productbox/productbox.sty
blob: 4a12c20bf500613941e336cce6b4ecd9996926e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
%%
%% This is file `productbox.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% productbox.dtx  (with options: `style')
%% 
%% IMPORTANT NOTICE:
%% 
%% For the copyright see the source file.
%% 
%% Any modified versions of this file must be renamed
%% with new filenames distinct from productbox.sty.
%% 
%% For distribution of the original source see the terms
%% for copying and modification in the file productbox.dtx.
%% 
%% This generated file may be distributed as long as the
%% original source files, as listed above, are part of the
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%%^^A $Id: productbox.dtx 8333 2010-12-29 19:58:06Z gene $
%%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Purpose:
%%      productbox.dtx   provides  a  style  file   for  typesetting  a
%%      three-dimensional product box. This product box can be rendered
%%      as it is standing on a surface and  some light is shed onto it.
%%      Alternatively  it can be typeset as a wireframe  to be  cut out
%%      and glued together. This will lead to a physical product box.
%%
%% Documentation:
%%      The  documentation  can  be  generated  from the  original file
%%      productbox.dtx  with  the  doc style/package.  LaTeX  the  file
%%      productbox.dtx to get the full documentation in pdf format.
%%
%% Prerequisite:
%%      This package needs TikZ to be present at least in version 2.0.
%%
%% Author: Gerd Neugebauer
%%         Im Lerchelsb\"ohl 5
%%         64521 Gro\ss-Gerau
%% Mail:   gene@gerd-neugebauer.de
%%
%% Copyright (C) 2010 Gerd Neugebauer
%%
%%      productbox.dtx is distributed in the hope that it will be useful,
%%      but  WITHOUT ANY WARRANTY.  No  author  or  distributor  accepts
%%      responsibility to anyone for the consequences of using it or for
%%      whether it serves any particular purpose or works at all, unless
%%      he says so in writing.
%%
%%      Everyone is granted permission to  copy, modify and redistribute
%%      productbox.dtx, provided this copyright notice is preserved  and
%%      any modifications are indicated.
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%  \CharacterTable
%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
%%
\begingroup
  \def\ProductBox@VC$#1: #2 #3${#2}
  \def\ProductBox@VCdate$#1: #2-#3-#4 #5${#2/#3/#4}
  \xdef\fileversion{1.1}
  \xdef\filerevision{\ProductBox@VC$Revision: 8333 $}
  \xdef\filedate{\ProductBox@VCdate
    $Date: 2010-12-29 20:58:06 +0100 (Mi, 29 Dez 2010) $}
  \xdef\filename{productbox.dtx}
\endgroup
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{productbox}[\filedate Another type of boxes...]
\RequirePackage{keyval}
\RequirePackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{fadings}
\define@key{ProductBox}{scale}{%
  \def\ProductBox@scale{#1}}
\define@key{ProductBox}{width}{%
  \def\ProductBox@x{#1}}
\define@key{ProductBox}{height}{%
  \def\ProductBox@y{#1}}
\define@key{ProductBox}{depth}{%
  \def\ProductBox@z{#1}}
\define@key{ProductBox}{clean}[true]{%
  \csname ProductBox@clean#1\endcsname}
\define@key{ProductBox}{flat}[true]{%
  \def\ProductBox@style{flat}}
\define@key{ProductBox}{fold}[true]{%
  \def\ProductBox@style{fold}}
\define@key{ProductBox}{3d}[true]{%
  \def\ProductBox@style{threeD}}
\define@key{ProductBox}{3D}[true]{%
  \def\ProductBox@style{threeD}}
\define@key{ProductBox}{threeD}[true]{%
  \def\ProductBox@style{threeD}}
\define@key{ProductBox}{top}[true]{%
  \def\ProductBox@style{top}}
\define@key{ProductBox}{bottom}[true]{%
  \def\ProductBox@style{bottom}}
\define@key{ProductBox}{front}[true]{%
  \def\ProductBox@style{front}}
\define@key{ProductBox}{back}[true]{%
  \def\ProductBox@style{back}}
\define@key{ProductBox}{left}[true]{%
  \def\ProductBox@style{left}}
\define@key{ProductBox}{right}[true]{%
  \def\ProductBox@style{right}}
\define@key{ProductBox}{empty}[true]{%
  \def\ProductBox@style{empty}}
\define@key{ProductBox}{style}{%
  \def\ProductBox@style{#1}}
\define@key{ProductBox}{shadow}[true]{%
  \csname ProductBox@shadow#1\endcsname}
\define@key{ProductBox}{mirror}[true]{%
  \csname ProductBox@mirror#1\endcsname}
\define@key{ProductBox}{flare}[true]{%
  \csname ProductBox@flare#1\endcsname}
\define@key{ProductBox}{flareDiameter}{%
  \def\ProductBox@flareDiameter{#1}}
\define@key{ProductBox}{edgeColor}{%
  \def\productBox@edgeColor{#1}}
\define@key{ProductBox}{view}{%
  \@nameuse{ProductBox@View@#1}}
\define@key{ProductBox}{earSize}{%
  \def\ProductBox@earSize{#1}}
\define@key{ProductBox}{foldLine}{%
  \def\ProductBox@foldLine{#1}}
\define@key{ProductBox}{foldOpacity}{%
  \def\ProductBox@foldOpacity{#1}}
\define@key{ProductBox}{faceSep}{%
  \def\ProductBox@FaceSep{#1}}
\newbox\ProductBox@Front
\newbox\ProductBox@Left
\newbox\ProductBox@Top
\newbox\ProductBox@Right
\newbox\ProductBox@Bottom
\newbox\ProductBox@Back
\newcommand\ProductBoxSet[1]{\setkeys{ProductBox}{#1}}
\newcommand\ProductBox@style{threeD}
\newcommand\ProductBox@x{88mm}
\newcommand\ProductBox@y{100mm}
\newcommand\ProductBox@z{30mm}
\newif\ifProductBox@clean
\newif\ifProductBox@active
\newif\ifProductBox@clip \ProductBox@cliptrue
\newcommand\ProductBox@FaceSep{1em}
\newenvironment{ProductBox}[1][]{%
  \setkeys{ProductBox}{#1}%
  \ifProductBox@clean
    \global\setbox\ProductBox@Front\hbox{}%
    \global\setbox\ProductBox@Back\hbox{}%
    \global\setbox\ProductBox@Left\hbox{}%
    \global\setbox\ProductBox@Right\hbox{}%
    \global\setbox\ProductBox@Top\hbox{}%
    \global\setbox\ProductBox@Bottom\hbox{}%
  \fi
  \ifProductBox@active
    \errmessage{Trying to use an environment ProductBox inside the
      environment ProductBox. This is not allowed.}%
  \else
    \ProductBox@activetrue
  \fi
  \let\Front\undefined            \let\endFront\undefined
  \let\Back\undefined             \let\endBack\undefined
  \let\Left\undefined             \let\endLeft\undefined
  \let\Right\undefined            \let\endRight\undefined
  \let\Top\undefined              \let\endTop\undefined
  \let\Bottom\undefined           \let\endBottom\undefined
  \let\FrontFace\undefined        \let\endFrontFace\undefined
  \let\BackFace\undefined         \let\endBackFace\undefined
  \let\LeftFace\undefined         \let\endLeftFace\undefined
  \let\RightFace\undefined        \let\endRightFace\undefined
  \let\TopFace\undefined          \let\endTopFace\undefined
  \let\BottomFace\undefined       \let\endBottomFace\undefined
  \newenvironment{Front}{\ProductBox@Start\ProductBox@Front
    (\ProductBox@x,\ProductBox@y)}{\ProductBox@End}%
  \newenvironment{Back}{\ProductBox@Start\ProductBox@Back
    (\ProductBox@x,\ProductBox@y)}{\ProductBox@End}%
  \newenvironment{Left}{\ProductBox@Start\ProductBox@Left
    (\ProductBox@z,\ProductBox@y)}{\ProductBox@End}%
  \newenvironment{Right}{\ProductBox@Start\ProductBox@Right
    (\ProductBox@z,\ProductBox@y)}{\ProductBox@End}%
  \newenvironment{Top}{\ProductBox@Start\ProductBox@Top
    (\ProductBox@x,\ProductBox@z)}{\ProductBox@End}%
  \newenvironment{Bottom}{\ProductBox@Start\ProductBox@Bottom(
    \ProductBox@x,\ProductBox@z)}{\ProductBox@End}%
  \newenvironment{FrontFace}[1][white]{\ProductBox@StartFace\ProductBox@Front
    {\ProductBox@x}{\ProductBox@y}{##1}}{\ProductBox@EndFace}%
  \newenvironment{BackFace}[1][white]{\ProductBox@StartFace\ProductBox@Back
    {\ProductBox@x}{\ProductBox@y}{##1}}{\ProductBox@EndFace}%
  \newenvironment{LeftFace}[1][white]{\ProductBox@StartFace\ProductBox@Left
    {\ProductBox@z}{\ProductBox@y}{##1}}{\ProductBox@EndFace}%
  \newenvironment{RightFace}[1][white]{\ProductBox@StartFace\ProductBox@Right
    {\ProductBox@z}{\ProductBox@y}{##1}}{\ProductBox@EndFace}%
  \newenvironment{TopFace}[1][white]{\ProductBox@StartFace\ProductBox@Top
    {\ProductBox@x}{\ProductBox@z}{##1}}{\ProductBox@EndFace}%
  \newenvironment{BottomFace}[1][white]{\ProductBox@StartFace\ProductBox@Bottom
    {\ProductBox@x}{\ProductBox@z}{##1}}{\ProductBox@EndFace}%
  \ignorespacesafterend
}{%
  \@ifundefined{ProductBox@style@\ProductBox@style}{%
    \errmessage{Box style '\ProductBox@style' for ProductBox is unknown}%
  }{%
    \@ifundefined{ProductBox@scale}{%
      \@nameuse{ProductBox@style@\ProductBox@style}}{%
      \scalebox{\ProductBox@scale}%
               {\@nameuse{ProductBox@style@\ProductBox@style}}
    }}%
  \ProductBox@activefalse
  \ignorespacesafterend
}
\def\ProductBox@Start#1(#2){%
  \global\setbox#1\hbox\bgroup\begin{tikzpicture}%
    \ifProductBox@clip \clip rectangle (#2); \fi
  }%
\newcommand\ProductBox@End{\end{tikzpicture}\egroup\ignorespacesafterend}
\newcommand\ProductBox@StartFace[4]{%
  \let\ProductBox@@box#1%
  \def\ProductBox@@w{#2}%
  \def\ProductBox@@h{#3}%
  \def\ProductBox@@args{[#4]}%
  \@tempdima=#2
  \advance\@tempdima-\ProductBox@FaceSep
  \advance\@tempdima-\ProductBox@FaceSep
  \setbox#1\hbox\bgroup\begin{minipage}{\the\@tempdima}%
    \ignorespaces
}
\newcommand\ProductBox@EndFace{\end{minipage}\egroup
    \global\setbox\ProductBox@@box=\hbox{\begin{tikzpicture}
    \ifProductBox@clip \clip rectangle (\ProductBox@@w,\ProductBox@@h); \fi
    \expandafter\fill \ProductBox@@args rectangle(\ProductBox@@w,\ProductBox@@h);
    \draw (.5*\ProductBox@@w,.5*\ProductBox@@h)
      node[inner sep=0pt] {\box\ProductBox@@box};
    \end{tikzpicture}}\ignorespacesafterend}
\newcommand\ProductBox@style@empty{}
\newcommand\ProductBox@style@flat{%
  \par\noindent
  \hspace*{\ProductBox@z}\kern1mm \copy\ProductBox@Top\\[1ex]
  \copy\ProductBox@Left\kern1mm \copy\ProductBox@Front\kern1mm
  \copy\ProductBox@Right\kern1mm \copy\ProductBox@Back\\[1ex]
  \hspace*{\ProductBox@z}\kern1mm \copy\ProductBox@Bottom\par
}
\newcommand\ProductBox@style@front{%
  \copy\ProductBox@Front
}
\newcommand\ProductBox@style@back{%class
  \copy\ProductBox@Back
}
\newcommand\ProductBox@style@left{%
  \copy\ProductBox@Left
}
\newcommand\ProductBox@style@right{%
  \copy\ProductBox@Right
}
\newcommand\ProductBox@style@top{%
  \copy\ProductBox@Top
}
\newcommand\ProductBox@style@bottom{%
  \copy\ProductBox@Bottom
}
\newcommand\ProductBox@earSize{12mm}
\newcommand\ProductBox@foldLine{white!80!black}
\newcommand\ProductBox@foldOpacity{.5}
\newcommand\ProductBox@style@fold{%
  \begin{tikzpicture}[sw/.style={anchor=south west,
                                 inner sep=0pt},
                      se/.style={anchor=south east,
                                 inner sep=0pt},
                      nw/.style={anchor=north west,
                                 inner sep=0pt},
                      num/.style={circle,
                                  fill=white!90!black,
                                  fill opacity=.5,
                                  font=\tiny\bfseries\sffamily}]
    \begin{scope}
      \clip rectangle (\ProductBox@z,\ProductBox@y);
      \draw node[sw]{\copy\ProductBox@Left};
      \draw[thin,opacity=\ProductBox@foldOpacity,\ProductBox@foldLine]
        rectangle (\ProductBox@z,\ProductBox@y);
    \end{scope}
    \begin{scope}[xshift=\ProductBox@z]
      \clip rectangle (\ProductBox@x,\ProductBox@y);
      \draw node[sw]{\copy\ProductBox@Front};
      \draw[thin,opacity=\ProductBox@foldOpacity,\ProductBox@foldLine]
        rectangle (\ProductBox@x,\ProductBox@y);
    \end{scope}
    \begin{scope}[xshift=\ProductBox@z+\ProductBox@x]
      \clip rectangle (\ProductBox@z,\ProductBox@y);
      \draw node[sw]{\copy\ProductBox@Right};
      \draw[thin,opacity=\ProductBox@foldOpacity,\ProductBox@foldLine]
        rectangle (\ProductBox@z,\ProductBox@y);
    \end{scope}
    \begin{scope}[xshift=\ProductBox@x+2*\ProductBox@z]
      \clip rectangle (\ProductBox@x,\ProductBox@y);
      \draw node[sw]{\copy\ProductBox@Back};
      \draw[thin,opacity=\ProductBox@foldOpacity,\ProductBox@foldLine]
         rectangle (\ProductBox@x,\ProductBox@y);
    \end{scope}
    \begin{scope}[xshift=\ProductBox@z,yshift=\ProductBox@y]
      \clip rectangle (\ProductBox@x,\ProductBox@z);
      \draw node[sw]{\copy\ProductBox@Top};
      \draw[thin,opacity=\ProductBox@foldOpacity,\ProductBox@foldLine]
        rectangle (\ProductBox@x,\ProductBox@z);
    \end{scope}
    \begin{scope}[xshift=\ProductBox@z]
      \clip
        (0mm,0mm) -- (.5*\ProductBox@z,-.5*\ProductBox@z) --
        (.5*\ProductBox@z,-\ProductBox@z) --
        (\ProductBox@x-.5*\ProductBox@z,-\ProductBox@z) --
        (\ProductBox@x-.5*\ProductBox@z,-.5*\ProductBox@z) --
        (\ProductBox@x,0mm) -- cycle;
      \draw (\ProductBox@x,-\ProductBox@z)
        node[se]{\copy\ProductBox@Bottom};
      \draw [thin,opacity=\ProductBox@foldOpacity,\ProductBox@foldLine]
        (0mm,0mm) -- (.5*\ProductBox@z,-.5*\ProductBox@z) --
        (.5*\ProductBox@z,-\ProductBox@z) --
        (\ProductBox@x-.5*\ProductBox@z,-\ProductBox@z) --
        (\ProductBox@x-.5*\ProductBox@z,-.5*\ProductBox@z) --
        (\ProductBox@x,0mm) -- cycle;
      \draw (.5*\ProductBox@x,-.75*\ProductBox@z) node[num]{3};
    \end{scope}
    \begin{scope}[xshift=\ProductBox@x+2*\ProductBox@z]
      \clip
        (0mm,0mm) -- (0mm,-\ProductBox@z) --
        (.5*\ProductBox@z,-\ProductBox@z) --
        (.5*\ProductBox@z,-.5*\ProductBox@z) --
        (\ProductBox@x-.5*\ProductBox@z,-.5*\ProductBox@z) --
        (\ProductBox@x-.5*\ProductBox@z,-\ProductBox@z) --
        (\ProductBox@x,-\ProductBox@z) -- (\ProductBox@x,0mm) --
        cycle;
      \draw node[se,rotate=180]{\copy\ProductBox@Bottom};
      \draw[thin,opacity=\ProductBox@foldOpacity,\ProductBox@foldLine]
        (0mm,0mm) -- (0mm,-\ProductBox@z) --
        (.5*\ProductBox@z,-\ProductBox@z) --
        (.5*\ProductBox@z,-.5*\ProductBox@z) --
        (\ProductBox@x-.5*\ProductBox@z,-.5*\ProductBox@z) --
        (\ProductBox@x-.5*\ProductBox@z,-\ProductBox@z) --
        (\ProductBox@x,-\ProductBox@z) -- (\ProductBox@x,0mm) --
        cycle;
      \draw (.25*\ProductBox@z,-.75*\ProductBox@z) node[num]{1};
      \draw (\ProductBox@x-.25*\ProductBox@z,-.75*\ProductBox@z)
        node[num]{1};
    \end{scope}
    \begin{scope}[xshift=\ProductBox@z+\ProductBox@x]
      \clip
        (0mm,0mm) -- (\ProductBox@z,0mm) --
        (.5*\ProductBox@z,-.5*\ProductBox@z) --
        (.5*\ProductBox@z,-\ProductBox@z) -- (0mm,-\ProductBox@z) --
        cycle;
      \draw (\ProductBox@z,0mm)
        node[se,rotate=90]{\copy\ProductBox@Bottom};
      \draw[thin,opacity=\ProductBox@foldOpacity,\ProductBox@foldLine]
        (0mm,0mm) -- (\ProductBox@z,0mm) --
        (.5*\ProductBox@z,-.5*\ProductBox@z) --
        (.5*\ProductBox@z,-\ProductBox@z) -- (0mm,-\ProductBox@z) --
        cycle;
      \draw (.25*\ProductBox@z,-.75*\ProductBox@z) node[num]{2};
    \end{scope}
    \begin{scope}
      \clip
        (0mm,0mm) -- (\ProductBox@z,0mm) --
        (\ProductBox@z,-\ProductBox@z) --
        (.5*\ProductBox@z,-\ProductBox@z) --
        (.5*\ProductBox@z,-.5*\ProductBox@z) -- cycle;
      \draw
        node[sw,rotate=270]{\copy\ProductBox@Bottom};
      \draw [thin,opacity=\ProductBox@foldOpacity,\ProductBox@foldLine]
        (0mm,0mm) -- (\ProductBox@z,0mm) --
        (\ProductBox@z,-\ProductBox@z) --
        (.5*\ProductBox@z,-\ProductBox@z) --
        (.5*\ProductBox@z,-.5*\ProductBox@z) -- cycle;
      \draw (.75*\ProductBox@z,-.75*\ProductBox@z) node[num]{2};
    \end{scope}
    \begin{scope}[xshift=2*\ProductBox@x+2*\ProductBox@z]
      \clip
        (0mm,0mm) -- (\ProductBox@earSize/2,\ProductBox@earSize/4) --
        (\ProductBox@earSize/2,\ProductBox@y-\ProductBox@earSize/4) --
        (0mm,\ProductBox@y) -- cycle;
      \draw node[sw]{\copy\ProductBox@Left};
      \draw[thin,opacity=\ProductBox@foldOpacity,\ProductBox@foldLine]
        (0mm,0mm) -- (\ProductBox@earSize/2,\ProductBox@earSize/4) --
        (\ProductBox@earSize/2,\ProductBox@y-\ProductBox@earSize/4) --
        (0mm,\ProductBox@y) -- cycle;
    \end{scope}
    \begin{scope}[yshift=\ProductBox@y]
      \clip
        (0mm,0mm) -- (\ProductBox@earSize/2,\ProductBox@earSize) --
        (\ProductBox@z-\ProductBox@earSize/2,\ProductBox@earSize) --
        (\ProductBox@z,0mm) -- cycle;
      \draw node[nw,rotate=90]{\copy\ProductBox@Top};
      \draw[thin,opacity=\ProductBox@foldOpacity,\ProductBox@foldLine]
        (0mm,0mm) -- (\ProductBox@earSize/2,\ProductBox@earSize) --
        (\ProductBox@z-\ProductBox@earSize/2,\ProductBox@earSize) --
        (\ProductBox@z,0mm) -- cycle;
    \end{scope}
    \begin{scope}[xshift=\ProductBox@x+\ProductBox@z,
                  yshift=\ProductBox@y]
      \clip
        (0mm,0mm) -- (\ProductBox@earSize/2,\ProductBox@earSize) --
        (\ProductBox@z-\ProductBox@earSize/2,\ProductBox@earSize) --
        (\ProductBox@z,0mm) -- cycle;
      \draw node[se,rotate=270]{\copy\ProductBox@Top};
      \draw[thin,opacity=\ProductBox@foldOpacity,\ProductBox@foldLine]
        (0mm,0mm) -- (\ProductBox@earSize/2,\ProductBox@earSize) --
        (\ProductBox@z-\ProductBox@earSize/2,\ProductBox@earSize) --
        (\ProductBox@z,0mm) -- cycle;
    \end{scope}
    \begin{scope}[xshift=\ProductBox@z,
                  yshift=\ProductBox@y+\ProductBox@z]
      \clip
        (0mm,0mm) -- (\ProductBox@earSize/2,\ProductBox@earSize) --
        (\ProductBox@x-\ProductBox@earSize/2,\ProductBox@earSize) --
        (\ProductBox@x,0mm) -- cycle;
      \draw (0mm,\ProductBox@y)
        node[se,rotate=180]{\copy\ProductBox@Back};
      \draw[thin,opacity=\ProductBox@foldOpacity,\ProductBox@foldLine]
        (0mm,0mm) -- (\ProductBox@earSize/2,\ProductBox@earSize) --
        (\ProductBox@x-\ProductBox@earSize/2,\ProductBox@earSize) --
        (\ProductBox@x,0mm) -- cycle;
    \end{scope}
  \end{tikzpicture}}
\newcommand\ProductBoxThreeDStartHook{}
\newcommand\ProductBoxThreeDEndHook{}
\newif\ifProductBox@shadow \ProductBox@shadowtrue
\newif\ifProductBox@mirror
\newif\ifProductBox@flare
\newcommand\ProductBox@edgeColor{white}
\newcommand\ProductBox@flareDiameter{24mm}
\newcommand\ProductBox@angleZ{8}
\newcommand\ProductBox@angleX{10}
\newcommand\ProductBox@style@threeD{
  \begin{tikzpicture}[sw/.style={anchor=south west,
                                 inner sep=0pt}]
    \ProductBoxThreeDStartHook
    \ifProductBox@mirror \ProductBox@threeD@mirror \fi
    \ifProductBox@shadow \ProductBox@threeD@shadow \fi

    \begin{scope}
      \fill[white,
            yslant=\ProductBox@p@front@yslant,
            xscale=\ProductBox@p@front@xscale,
            yscale=\ProductBox@p@front@yscale,
            anchor=south west]
        rectangle (\ProductBox@x,\ProductBox@y);
      \draw
        node[sw,
             yslant=\ProductBox@p@front@yslant,
             xscale=\ProductBox@p@front@xscale,
             yscale=\ProductBox@p@front@yscale]
            {\copy\ProductBox@Front};
      \fill[black,
            fill opacity=.025,
            yslant=\ProductBox@p@front@yslant,
            xscale=\ProductBox@p@front@xscale,
            yscale=\ProductBox@p@front@yscale,
            anchor=south west]
        rectangle (\ProductBox@x,\ProductBox@y);
      \ifProductBox@flare
        \begin{scope}[
            yslant=\ProductBox@p@front@yslant,
            xscale=\ProductBox@p@front@xscale,
            yscale=\ProductBox@p@front@yscale]
          \clip rectangle(\ProductBox@x,\ProductBox@y);
          \ProductBox@threeD@flare
        \end{scope}
      \fi
    \end{scope}
    \begin{scope}[shift={(-\ProductBox@p@left@xscale*\ProductBox@z,
                          \ProductBox@p@left@yslant
                             *\ProductBox@p@left@xscale
                             *\ProductBox@z)}]
      \fill[white,
            yslant=-\ProductBox@p@left@yslant,
            xscale=\ProductBox@p@left@xscale,
            yscale=\ProductBox@p@left@yscale,
            anchor=south west]
        rectangle (\ProductBox@z,\ProductBox@y);
      \draw
        node[sw,
             yslant=-\ProductBox@p@left@yslant,
             xscale=\ProductBox@p@left@xscale,
             yscale=\ProductBox@p@left@yscale]
            {\copy\ProductBox@Left};
      \fill[black,
            fill opacity=.25,
            yslant=-\ProductBox@p@left@yslant,
            xscale=\ProductBox@p@left@xscale,
            yscale=\ProductBox@p@left@yscale,
            anchor=south west]
        rectangle (\ProductBox@z,\ProductBox@y);
    \end{scope}
    \begin{scope}[yshift=\ProductBox@y]
      \fill [white,
             anchor=south west,
             xslant=-\ProductBox@p@top@xslant,
             xscale=\ProductBox@p@top@xscale,
             yslant=\ProductBox@p@top@yslant,
             yscale=\ProductBox@p@top@yscale]
        rectangle (\ProductBox@x,\ProductBox@z);
      \draw
        node[sw,
             xslant=-\ProductBox@p@top@xslant,
             xscale=\ProductBox@p@top@xscale,
             yslant=\ProductBox@p@top@yslant,
             yscale=\ProductBox@p@top@yscale]
            {\copy\ProductBox@Top};
      \fill [black,
             fill opacity=.0025,
             anchor=south west,
             xslant=-\ProductBox@p@top@xslant,
             xscale=\ProductBox@p@top@xscale,
             yslant=\ProductBox@p@top@yslant,
             yscale=\ProductBox@p@top@yscale]
         rectangle (\ProductBox@x,\ProductBox@z);
    \end{scope}
    \begin{scope}[shift={(-\ProductBox@p@left@xscale*\ProductBox@z,
        \ProductBox@p@left@yslant*\ProductBox@p@left@xscale*\ProductBox@z)}]
      \draw [\ProductBox@edgeColor,
             line width=.5mm,
             draw opacity=.25,
             yslant=-\ProductBox@p@left@yslant,
             xscale=\ProductBox@p@left@xscale]
        (\ProductBox@z,0mm) --
        (\ProductBox@z,\ProductBox@y) --
        (0mm,\ProductBox@y);
    \end{scope}
    \draw [\ProductBox@edgeColor,
           line width=.5mm,
           draw opacity=.25,
           yslant=\ProductBox@p@front@yslant,
           xscale=\ProductBox@p@front@xscale,
           anchor=south west]
      (0mm,\ProductBox@y) -- (\ProductBox@x,\ProductBox@y);
    \ProductBoxThreeDEndHook
  \end{tikzpicture}}
\newcommand\ProductBox@setFrontParams[3]{%
  \def\ProductBox@p@front@yslant{#1}%
  \def\ProductBox@p@front@xscale{#2}%
  \def\ProductBox@p@front@yscale{#3}%
}
\newcommand\ProductBox@setLeftParams[3]{%
  \def\ProductBox@p@left@yslant{#1}%
  \def\ProductBox@p@left@xscale{#2}%
  \def\ProductBox@p@left@yscale{#3}%
}
\newcommand\ProductBox@setTopParams[4]{%
  \def\ProductBox@p@top@xslant{#1}%
  \def\ProductBox@p@top@yslant{#2}%
  \def\ProductBox@p@top@xscale{#3}%
  \def\ProductBox@p@top@yscale{#4}%
}
\newcommand\ProductBox@setMirrorParams[1]{%
  \def\ProductBox@p@mirror@yscale{#1}%
}
\@namedef{ProductBox@View@1}{%
  \ProductBox@setFrontParams{.25}{.9090909}{1}%
  \ProductBox@setLeftParams{.5}{.6666666}{1}%
  \ProductBox@setTopParams{2}{.2265}{1.363}{.3333333}%
  \ProductBox@setMirrorParams{.4}}
\@namedef{ProductBox@View@2}{%
  \ProductBox@setFrontParams{.15}{.9090909}{1}%
  \ProductBox@setLeftParams{.6666666}{.5}{1}%
  \ProductBox@setTopParams{1.5}{.12}{1.11}{.333333}%
  \ProductBox@setMirrorParams{.4}}
\@namedef{ProductBox@View@3}{%
  \ProductBox@setFrontParams{.05}{.95}{1}%
  \ProductBox@setLeftParams{.25}{.4}{1}%
  \ProductBox@setTopParams{4}{.04}{1.133333}{.1}%
  \ProductBox@setMirrorParams{.4}}
\@nameuse{ProductBox@View@1}
\newcommand\ProductBox@threeD@shadow{
    \begin{scope}
      \foreach \x in {.5,1,1.5,2,2.5,3,4,5,6,8,10} {
        \filldraw [black,
                   line width=\x mm,
                   rounded corners=2mm,
                   opacity=.01,
                   shift={(-1mm,1mm)}]
          (0mm,0mm) --
          (-\ProductBox@p@top@xslant
           *\ProductBox@p@left@xscale
           *\ProductBox@z,
           \ProductBox@p@top@yscale
           *\ProductBox@z) --
          (0mm,
           \ProductBox@p@top@yscale*\ProductBox@z +
           \ProductBox@p@top@xslant
           *\ProductBox@p@left@xscale
           *\ProductBox@p@top@yslant
           *\ProductBox@z) --
          cycle;
      }
    \end{scope}
}
\tikzfading[name=ProductBoxFade,
            top color=transparent!100,
            bottom color=transparent!50,
            middle color=transparent!100]
\newcommand\ProductBox@threeD@mirror{%
  \fill
    node[anchor=south west,
         inner sep=0pt,
         yslant=\ProductBox@p@front@yslant,
         xscale=\ProductBox@p@front@xscale,
         yscale=-\ProductBox@p@mirror@yscale]
      {\begin{tikzpicture}
            \clip rectangle (\ProductBox@x,
                             \ProductBox@y*\ProductBox@p@mirror@yscale);
            \fill node [scope fading=ProductBoxFade,
                        yscale=\ProductBox@p@mirror@yscale,
                        inner sep=0pt]{\copy\ProductBox@Front};
          \end{tikzpicture}};
  \fill[xshift=-\ProductBox@p@left@xscale*\ProductBox@z,
        yshift=\ProductBox@p@top@yscale*\ProductBox@z]
    node[anchor=south west,
         inner sep=0pt,
         yslant=-\ProductBox@p@left@yslant,
         xscale=\ProductBox@p@left@xscale,
         yscale=-\ProductBox@p@mirror@yscale]
      {\begin{tikzpicture}
         \clip rectangle (\ProductBox@z,
                          \ProductBox@y*\ProductBox@p@mirror@yscale);
         \fill node [scope fading=ProductBoxFade,
                     yscale=\ProductBox@p@mirror@yscale,
                     inner sep=0pt]{\copy\ProductBox@Left};

       \end{tikzpicture}};
}
\newcommand\ProductBox@threeD@flare{
  \fill [white,path fading=ProductBoxFlare]
    (.8*\ProductBox@x,.9*\ProductBox@y)
    circle(\ProductBox@flareDiameter);
}
\tikzfading[name=ProductBoxFlare,
            inner color=transparent!60,
            outer color=transparent!100]
\@namedef{ProductBox@style@3D}{\ProductBox@style@threeD}
\@namedef{ProductBox@style@3d}{\ProductBox@style@threeD}
\endinput
%%
%% End of file `productbox.sty'.