使用 TiKz 连接三角形上的 3 个节点?

使用 TiKz 连接三角形上的 3 个节点?

可以用 TiKz 绘制这个三角形吗?

在此处输入图片描述

答案1

PSTricks 解决方案:

\documentclass{article}

\usepackage{pstricks}

\begin{document}

\begin{pspicture}(7,6)
  \psset{
    dimen = m,
    fillstyle = solid,
    fillcolor = blue!60,
    framearc = 0.2
  }
  \pspolygon(0.7,1.5)(2.8,4.5)(3.4,4.5)(1.3,1.5)
  \pspolygon(6.3,1.5)(5.7,1.5)(3.6,4.5)(4.2,4.5)
  \pspolygon(2,0.5)(2,1)(5,1)(5,0.5)
  \psframe[fillcolor = green!50](0,0)(2,1.5)
  \rput(1,0.75){Fish}
  \psframe[fillcolor = yellow!50](5,0)(7,1.5)
  \rput(6,0.75){Bird}
  \psframe[fillcolor = purple!50](2.5,4.5)(4.5,6)
  \rput(3.5,5.25){Mammal}
\end{pspicture}

\end{document}

输出

答案2

不是确切地和问题中的图片一样 - 但非常接近。它们的毛需要梳理一下才能拉直一点,但它们都在正确的位置。实际上,只需要稍微修剪一下。

\documentclass[tikz,border=10pt,multi]{standalone}
\usetikzlibrary{shapes.symbols,shapes.callouts,backgrounds,shadows}
\begin{document}
\begin{tikzpicture}
  [
    defaid/.style={cloud, fill=#1!25, drop shadow, draw, minimum width=65pt, minimum height=50pt, thick, label={[cloud, fill=#1!25, cloud puffs=5, anchor=south west, label distance=7.5pt, drop shadow, inner sep=10pt, draw, thick]180:{}}, label={[text centered, ellipse callout, drop shadow, anchor=south east, fill=white, draw, yshift=5pt, font=\sffamily\bfseries]160:Baa}},
    coes/.style={line cap=round, line width=2.5pt, draw},
  ]
  \node (d1) [defaid=orange!50!yellow] {};
  \node (d2) [defaid=red] at (-60:3) {};
  \node (d3) [defaid=green!50!black] at (-120:3) {};
  \scoped[on background layer]{%
    \draw [line width=1pt, double=blue!75!black, double distance=5pt] (0,0) -- (240:3) -- (300:3) -- cycle ;
    \foreach \i in {1,...,3}
    \draw [coes] (d\i.-100) ++(-2.5pt,-10pt) -- ++(2.5pt,20pt) -- ++(1.5pt,-20pt) (d\i.-80) ++(2.5pt,-10pt) -- ++(-2.5pt,20pt) -- ++(-1.5pt,-20pt);
  }
\end{tikzpicture}
\end{document}

3 拖欠

相关内容