Debian Codegraph @

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

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