tikz 3d 库的文档

tikz 3d 库的文档

在哪里可以找到 tikz 3d 库的文档?手册中似乎没有这样的部分,而且谷歌在这种情况下也没有帮助我。

答案1

对于那些仍然困惑的人来说,这个问题已经很老了,现在有这个3d库的文档。截至 2023 年 9 月,可以在 TikZ/PGF 手册第 V 部分第 40 章第 564 页中找到它。

答案2

我找到了几个相关的答案:

因此,我去研究了 Ti 的来源Z 3D 库,这里是(全部):

% Copyright 2006 by Till Tantau
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.

\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrary3d.code.tex,v 1.1 2008/01/09 17:57:15 tantau Exp $

% New coordinate systems:
\tikzdeclarecoordinatesystem{xyz cylindrical}
{%
  \pgfset{/tikz/cs/.cd,angle=0,radius=0,z=0,#1}%
  \pgfpointcylindrical{\tikz@cs@angle}{\tikz@cs@radius}{\tikz@cs@z}%
}

\tikzdeclarecoordinatesystem{xyz spherical}
{%
  \pgfset{/tikz/cs/.cd,angle=0,radius=0,latitude=0,longitude=0,#1}%
  \pgfpointspherical{\tikz@cs@angle}{\tikz@cs@latitude}{\tikz@cs@radius}%
}

\pgfset{/tikz/cs/longitude/.store in=\tikz@cs@angle}
\pgfset{/tikz/cs/latitude/.store in=\tikz@cs@latitude}

% Options for transforming into a plane:
\tikzoption{plane origin}{\def\tikz@plane@origin{\tikz@scan@one@point\pgfutil@firstofone#1}}
\tikzoption{plane x}{\def\tikz@plane@x{\tikz@scan@one@point\pgfutil@firstofone#1}}
\tikzoption{plane y}{\def\tikz@plane@y{\tikz@scan@one@point\pgfutil@firstofone#1}}

\let\tikz@plane@origin=\pgfpointorigin
\def\tikz@plain@x{\pgfpointxy{1}{0}}
\def\tikz@plain@y{\pgfpointxy{0}{1}}

\tikzoption{canvas is plane}[]{
  \tikz@canvas@is@plane
}
\tikzoption{canvas is xy plane at z}{%
  \tikz@addtransform{\pgftransformshift{\pgfpointxyz{0}{0}{#1}}}%
}
\tikzoption{canvas is yx plane at z}[]{%
  \def\tikz@plane@origin{\pgfpointxyz{0}{0}{#1}}%
  \def\tikz@plane@x{\pgfpointxyz{0}{1}{#1}}%
  \def\tikz@plane@y{\pgfpointxyz{1}{0}{#1}}%
  \tikz@canvas@is@plane
}
\tikzoption{canvas is xz plane at y}[]{%
  \def\tikz@plane@origin{\pgfpointxyz{0}{#1}{0}}%
  \def\tikz@plane@x{\pgfpointxyz{1}{#1}{0}}%
  \def\tikz@plane@y{\pgfpointxyz{0}{#1}{1}}%
  \tikz@canvas@is@plane
}
\tikzoption{canvas is zx plane at y}[]{%
  \def\tikz@plane@origin{\pgfpointxyz{0}{#1}{0}}%
  \def\tikz@plane@x{\pgfpointxyz{0}{#1}{1}}%
  \def\tikz@plane@y{\pgfpointxyz{1}{#1}{0}}%
  \tikz@canvas@is@plane
}
\tikzoption{canvas is yz plane at x}[]{%
  \def\tikz@plane@origin{\pgfpointxyz{#1}{0}{0}}%
  \def\tikz@plane@x{\pgfpointxyz{#1}{1}{0}}%
  \def\tikz@plane@y{\pgfpointxyz{#1}{0}{1}}%
  \tikz@canvas@is@plane
}
\tikzoption{canvas is zy plane at x}[]{%
  \def\tikz@plane@origin{\pgfpointxyz{#1}{0}{0}}%
  \def\tikz@plane@x{\pgfpointxyz{#1}{0}{1}}%
  \def\tikz@plane@y{\pgfpointxyz{#1}{1}{0}}%
  \tikz@canvas@is@plane
}

% Transformation code
\def\tikz@canvas@is@plane{
  \pgf@process{\tikz@plane@x}%
  \pgf@xa=\pgf@x%
  \pgf@ya=\pgf@y%
  \pgf@process{\tikz@plane@y}%
  \pgf@xb=\pgf@x%
  \pgf@yb=\pgf@y%
  \pgf@process{\tikz@plane@origin}%
  \edef\pgf@marshal{\noexpand\tikz@addtransform{%
      \noexpand\pgftransformtriangle
      {\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}
      {\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@ya}}
      {\noexpand\pgfqpoint{\the\pgf@xb}{\the\pgf@yb}}
      \noexpand\pgftransformscale{0.035146}%
      \noexpand\pgfsetxvec{\noexpand\pgfpoint{1cm}{0cm}}%
      \noexpand\pgfsetyvec{\noexpand\pgfpoint{0cm}{1cm}}%
      \noexpand\pgfsetzvec{\noexpand\pgfpoint{0cm}{0cm}}%
    }}%
  \pgf@marshal%
}

\endinput

看起来很简单,但尚未记录。总结一下,它引入了一些新的坐标系统:

  • xyz cylindrical其中angleradiusheight作为参数。
  • xyz spherical使用anglelatituderadius作为选项引入longtitude作为angle定义。

还有一些新的 TikZ 选项需要设置,用于绘制哪个平面:

plane origin
plane x
plane y
canvas is plane
canvas is xy plane at z
canvas is yx plane at z
canvas is xz plane at y
canvas is zx plane at y
canvas is yz plane at x
canvas is zy plane at x

就这样。

相关内容