如何用 tikz 绘制四个正星多面体?

如何用 tikz 绘制四个正星多面体?

我可以绘制正凸多面体, 举些例子

\begin{tikzpicture}[scale=1.0]
  \tikzstyle{every node}=[circle,fill=blue!20,inner sep=0pt,minimum size=0.4cm]
    \foreach \y[count=\a] in {10,9,4}
      {\pgfmathtruncatemacro{\kn}{120*\a-90}
       \node at (\kn:3) (b\a) {\small \y};}
    \foreach \y[count=\a] in {8,7,2}
      {\pgfmathtruncatemacro{\kn}{120*\a-90}
       \node at (\kn:2.2) (d\a) {\small \y};}
    \foreach \y[count=\a] in {1,5,6}
      {\pgfmathtruncatemacro{\jn}{120*\a-30}
       \node at (\jn:1.5) (a\a) {\small \y};}
    \foreach \y[count=\a] in {3,11,12}
      {\pgfmathtruncatemacro{\jn}{120*\a-30}
       \node at (\jn:3) (c\a) {\small \y};}
  \draw[dashed] (a1)--(a2)--(a3)--(a1);
  \draw[ultra thick] (d1)--(d2)--(d3)--(d1);
  \foreach \a in {1,2,3}
   {\draw[dashed] (a\a)--(c\a);
   \draw[ultra thick] (d\a)--(b\a);}
   \draw[ultra thick] (c1)--(b1)--(c3)--(b3)--(c2)--(b2)--(c1);
   \draw[ultra thick] (c1)--(d1)--(c3)--(d3)--(c2)--(d2)--(c1);
   \draw[dashed] (b1)--(a1)--(b2)--(a2)--(b3)--(a3)--(b1);
\end{tikzpicture}

在此处输入图片描述

但我只是不知道如何绘制四个正星多面体使用 tikz 正确(伪三维形状,顶点中的数字不是必需的。)。而且我没有找到任何可能对这个问题有帮助的包。任何评论或答案都将不胜感激!也欢迎使用 tex 中的任何其他方法!

答案1

您可以首先指定 3D 坐标(从神圣几何):

\documentclass{standalone}
\usepackage{tikz}
\begin{document}

\def \phi {1.617}
\begin{tikzpicture}[
    x={(-0.86in, -0.5in)}, y = {(0.86in, -0.5in)}, z = {(0, 1in)},
    rotate = 22,
    scale = 0.6,
    every node/.style = {
      circle, fill = blue!20, inner sep = 0pt, minimum size = 0.5cm
    },
    foreground/.style = { ultra thick },
    background/.style = { dashed }
  ]
  \coordinate (9) at (0, -\phi*\phi,  \phi);
  \coordinate (8) at (0,  \phi*\phi,  \phi);
  \coordinate (12) at (0,  \phi*\phi, -\phi);
  \coordinate (5) at (0, -\phi*\phi, -\phi);
  \coordinate (7) at ( \phi, 0,  \phi*\phi);
  \coordinate (3) at (-\phi, 0,  \phi*\phi);
  \coordinate (6) at (-\phi, 0, -\phi*\phi);
  \coordinate (4) at ( \phi, 0, -\phi*\phi);
  \coordinate (2) at ( \phi*\phi,  \phi, 0);
  \coordinate (10) at (-\phi*\phi,  \phi, 0);
  \coordinate (1) at (-\phi*\phi, -\phi, 0);
  \coordinate (11) at ( \phi*\phi, -\phi, 0);

  \draw[foreground] (10) -- (3) -- (8) -- (10) -- (12) -- (8);
  \draw[foreground] (4) -- (12) -- (2) -- (4) -- (11) -- (2);
  \draw[foreground] (9) -- (3) -- (7) -- (9) -- (11) -- (7);
  \draw[foreground] (7) -- (8) -- (2) -- cycle;
  \draw[background] (12) -- (6) -- (10) -- (1) -- (6) -- (5) -- (1)
    -- (9) -- (5) -- (11);
  \draw[background] (5) -- (4) -- (6);
  \draw[background] (3) -- (1);
  \foreach \n in {1,...,12}
    \node at (\n) {\n};
  \end{tikzpicture}
\end{document}

二十面体

然后绘制星星就只是连接正确的坐标的问题了。不幸的是,这会变得很难看,因为 tikz 不进行“真正的”3D 绘图。我走到这一步,然后才决定结果会是一团乱麻。

多面体

为了正确做到这一点,你可能需要一个更好的 3D 渲染引擎,例如渐近线

更新

根据要求,这是我用来绘制上述多面体的代码。

\documentclass{standalone}
\usepackage{tikz}

\begin{document}
  \def \phi {1.617}
  \begin{tikzpicture}[
      x={(-0.86in, -0.5in)}, y = {(0.86in, -0.5in)}, z = {(0, 1in)},
      rotate = 22,
      scale = 0.6,
      every node/.style = {
        circle, fill = blue!20, inner sep = 0pt, minimum size = 0.5cm
      },
      foreground/.style = { ultra thick },
      background/.style = { dashed }
    ]
    \coordinate (9) at (0, -\phi*\phi,  \phi);
    \coordinate (8) at (0,  \phi*\phi,  \phi);
    \coordinate (12) at (0,  \phi*\phi, -\phi);
    \coordinate (5) at (0, -\phi*\phi, -\phi);
    \coordinate (7) at ( \phi, 0,  \phi*\phi);
    \coordinate (3) at (-\phi, 0,  \phi*\phi);
    \coordinate (6) at (-\phi, 0, -\phi*\phi);
    \coordinate (4) at ( \phi, 0, -\phi*\phi);
    \coordinate (2) at ( \phi*\phi,  \phi, 0);
    \coordinate (10) at (-\phi*\phi,  \phi, 0);
    \coordinate (1) at (-\phi*\phi, -\phi, 0);
    \coordinate (11) at ( \phi*\phi, -\phi, 0);

    \coordinate (13) at ( \phi, 0,  1 / \phi);
    \coordinate (14) at (-\phi, 0,  1 / \phi);
    \coordinate (15) at (-\phi, 0, -1 / \phi);
    \coordinate (16) at ( \phi, 0, -1 / \phi);
    \coordinate (17) at ( 1 / \phi,  \phi, 0);
    \coordinate (18) at ( 1 / \phi, -\phi, 0);
    \coordinate (19) at (-1 / \phi, -\phi, 0);
    \coordinate (20) at (-1 / \phi,  \phi, 0);
    \coordinate (21) at (0,  1 / \phi,  \phi);
    \coordinate (22) at (0,  1 / \phi, -\phi);
    \coordinate (23) at (0, -1 / \phi, -\phi);
    \coordinate (24) at (0, -1 / \phi,  \phi);
    \coordinate (25) at ( 1,  1,  1);
    \coordinate (26) at ( 1, -1,  1);
    \coordinate (27) at (-1, -1,  1);
    \coordinate (28) at (-1,  1,  1);
    \coordinate (29) at (-1,  1, -1);
    \coordinate (30) at ( 1,  1, -1);
    \coordinate (31) at ( 1, -1, -1);
    \coordinate (32) at (-1, -1, -1);

    \draw[background] (12) -- (6) -- (10) (1) -- (6) -- (5) -- (1)
      (9) -- (5) -- (11);
    \draw[background] (5) -- (4) -- (6);
    \draw[background]
      (3) -- (27) (3) -- (14) (24) -- (27) -- (14) -- (28) -- (21) -- cycle
      (14) -- (1) -- (27);
    \draw[foreground] (10) -- (12) -- (8);
    \draw[foreground] (4) -- (12) -- (2) -- (4) -- (11) -- (2);
    \draw[foreground] (7) -- (11) -- (9);
    \draw[foreground] (8) -- (2) -- (7);
    \draw[foreground] (3) -- (24) (3) -- (21) (3) -- (28)
      (10) -- (14) (27) -- (9) -- (8) -- (28) (24) -- (7) -- (10);
  \end{tikzpicture}
\end{document}

答案2

仅用于使用 PSTricks 进行打字练习。

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-node,pst-plot}
\def\Atom#1{%
\begin{pspicture}(-4,-4)(4,4)
    \curvepnodes[plotpoints=\numexpr#1+1]{0}{TwoPi}{4 t RadtoDeg PtoC}{P}
    \pscustom{\psnline(0,\numexpr#1-1){P}\closepath}
    \rput(0,0){$n=#1$}
\end{pspicture}}

\begin{document}
\multido{\i=3+1}{10}{\Atom{\i}}
\end{document}

在此处输入图片描述

相关内容