| 1 |
% Copyright 2018 by Till Tantau |
| 2 |
% |
| 3 |
% This file may be distributed and/or modified |
| 4 |
% |
| 5 |
% 1. under the LaTeX Project Public License and/or |
| 6 |
% 2. under the GNU Public License. |
| 7 |
% |
| 8 |
% See the file doc/generic/pgf/licenses/LICENSE for more details. |
| 9 |
|
| 10 |
\ProvidesFileRCS{tikzlibrary3d.code.tex} |
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
% New coordinate systems: |
| 15 |
|
| 16 |
\tikzdeclarecoordinatesystem{xyz cylindrical} |
| 17 |
{% |
| 18 |
\pgfset{/tikz/cs/.cd,angle=0,radius=0,z=0,#1}% |
| 19 |
\pgfpointcylindrical{\tikz@cs@angle}{\tikz@cs@xradius}{\tikz@cs@z}% |
| 20 |
}% |
| 21 |
|
| 22 |
\tikzdeclarecoordinatesystem{xyz spherical} |
| 23 |
{% |
| 24 |
\pgfset{/tikz/cs/.cd,angle=0,radius=0,latitude=0,longitude=0,#1}% |
| 25 |
\pgfpointspherical{\tikz@cs@angle}{\tikz@cs@latitude}{\tikz@cs@xradius}% |
| 26 |
}% |
| 27 |
|
| 28 |
\pgfset{/tikz/cs/longitude/.store in=\tikz@cs@angle}% |
| 29 |
\pgfset{/tikz/cs/latitude/.store in=\tikz@cs@latitude}% |
| 30 |
|
| 31 |
|
| 32 |
% Options for transforming into a plane: |
| 33 |
|
| 34 |
\tikzoption{plane origin}{\def\tikz@plane@origin{\tikz@scan@one@point\pgfutil@firstofone#1}}% |
| 35 |
\tikzoption{plane x}{\def\tikz@plane@x{\tikz@scan@one@point\pgfutil@firstofone#1}}% |
| 36 |
\tikzoption{plane y}{\def\tikz@plane@y{\tikz@scan@one@point\pgfutil@firstofone#1}}% |
| 37 |
|
| 38 |
\let\tikz@plane@origin=\pgfpointorigin |
| 39 |
\def\tikz@plane@x{\pgfpointxy{1}{0}}% |
| 40 |
\def\tikz@plane@y{\pgfpointxy{0}{1}}% |
| 41 |
|
| 42 |
\tikzoption{canvas is plane}[]{ |
| 43 |
\tikz@canvas@is@plane |
| 44 |
}% |
| 45 |
\tikzoption{canvas is xy plane at z}[]{% |
| 46 |
\def\tikz@plane@origin{\pgfpointxyz{0}{0}{#1}}% |
| 47 |
\def\tikz@plane@x{\pgfpointxyz{1}{0}{#1}}% |
| 48 |
\def\tikz@plane@y{\pgfpointxyz{0}{1}{#1}}% |
| 49 |
\tikz@canvas@is@plane |
| 50 |
}% |
| 51 |
\tikzoption{canvas is yx plane at z}[]{% |
| 52 |
\def\tikz@plane@origin{\pgfpointxyz{0}{0}{#1}}% |
| 53 |
\def\tikz@plane@x{\pgfpointxyz{0}{1}{#1}}% |
| 54 |
\def\tikz@plane@y{\pgfpointxyz{1}{0}{#1}}% |
| 55 |
\tikz@canvas@is@plane |
| 56 |
}% |
| 57 |
\tikzoption{canvas is xz plane at y}[]{% |
| 58 |
\def\tikz@plane@origin{\pgfpointxyz{0}{#1}{0}}% |
| 59 |
\def\tikz@plane@x{\pgfpointxyz{1}{#1}{0}}% |
| 60 |
\def\tikz@plane@y{\pgfpointxyz{0}{#1}{1}}% |
| 61 |
\tikz@canvas@is@plane |
| 62 |
}% |
| 63 |
\tikzoption{canvas is zx plane at y}[]{% |
| 64 |
\def\tikz@plane@origin{\pgfpointxyz{0}{#1}{0}}% |
| 65 |
\def\tikz@plane@x{\pgfpointxyz{0}{#1}{1}}% |
| 66 |
\def\tikz@plane@y{\pgfpointxyz{1}{#1}{0}}% |
| 67 |
\tikz@canvas@is@plane |
| 68 |
}% |
| 69 |
\tikzoption{canvas is yz plane at x}[]{% |
| 70 |
\def\tikz@plane@origin{\pgfpointxyz{#1}{0}{0}}% |
| 71 |
\def\tikz@plane@x{\pgfpointxyz{#1}{1}{0}}% |
| 72 |
\def\tikz@plane@y{\pgfpointxyz{#1}{0}{1}}% |
| 73 |
\tikz@canvas@is@plane |
| 74 |
}% |
| 75 |
\tikzoption{canvas is zy plane at x}[]{% |
| 76 |
\def\tikz@plane@origin{\pgfpointxyz{#1}{0}{0}}% |
| 77 |
\def\tikz@plane@x{\pgfpointxyz{#1}{0}{1}}% |
| 78 |
\def\tikz@plane@y{\pgfpointxyz{#1}{1}{0}}% |
| 79 |
\tikz@canvas@is@plane |
| 80 |
}% |
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
% Transformation code |
| 85 |
|
| 86 |
\def\tikz@canvas@is@plane{ |
| 87 |
\pgf@process{\tikz@plane@x}% |
| 88 |
\pgf@xa=\pgf@x% |
| 89 |
\pgf@ya=\pgf@y% |
| 90 |
\pgf@process{\tikz@plane@y}% |
| 91 |
\pgf@xb=\pgf@x% |
| 92 |
\pgf@yb=\pgf@y% |
| 93 |
\pgf@process{\tikz@plane@origin}% |
| 94 |
\edef\pgf@marshal{\noexpand\tikz@addtransform{% |
| 95 |
\noexpand\pgftransformtriangle |
| 96 |
{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}} |
| 97 |
{\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@ya}} |
| 98 |
{\noexpand\pgfqpoint{\the\pgf@xb}{\the\pgf@yb}} |
| 99 |
\noexpand\pgftransformscale{0.035146}% |
| 100 |
\noexpand\pgfsetxvec{\noexpand\pgfpoint{1cm}{0cm}}% |
| 101 |
\noexpand\pgfsetyvec{\noexpand\pgfpoint{0cm}{1cm}}% |
| 102 |
\noexpand\pgfsetzvec{\noexpand\pgfpoint{0cm}{0cm}}% |
| 103 |
}}% |
| 104 |
\pgf@marshal% |
| 105 |
}% |
| 106 |
|
| 107 |
|
| 108 |
\endinput |