如何填充 TikZ 中不规则形状的角落?

如何填充 TikZ 中不规则形状的角落?

为了模拟徒手构造,我用 或random step来装饰侧面bend right

但着色是在边为直的角上进行的。

如何填充装饰角?

\documentclass{standalone}

\usepackage{tikz}               
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{angles}
%\usetikzlibrary{topaths}
\begin{document}

\begin{tikzpicture}
\draw[bend right=10](0,0)coordinate(U)to (40:2)coordinate(R)to++(-30:2)coordinate(T)to cycle;
\pic[bend right=10,angle radius=6mm,fill=blue!60]{angle =T--U--R};
\draw[densely dotted](R)--(U)--(T);
\end{tikzpicture}

\par

\begin{tikzpicture}[decoration={random steps,segment length=5pt,amplitude=2pt}]
\draw[decorate](0,0)coordinate(U)to (40:2)coordinate(R)to++(-30:2)coordinate(T)to cycle;
\pic[decorate,angle radius=6mm,fill=blue!60]{angle =T--U--R};
\draw[densely dotted](R)--(U)--(T);
\end{tikzpicture}
\end{document}

输出bend right

右弯

输出random step

随机步骤

答案1

您可以使用path picture

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}

\begin{document}

\begin{tikzpicture}
\draw[bend right=10]
  [path picture={\fill[blue!60](U)circle[radius=6mm];}]
  (0,0)coordinate(U)to (40:2)coordinate(R)to++(-30:2)coordinate(T)to cycle;
\end{tikzpicture}

\begin{tikzpicture}[decoration={random steps,segment length=5pt,amplitude=2pt}]
\draw[decorate]
  [path picture={\fill[blue!60](U)circle[radius=6mm];}]
  (0,0)coordinate(U)to (40:2)coordinate(R)to++(-30:2)coordinate(T)to cycle;
\end{tikzpicture}
\end{document}

在此处输入图片描述

答案2

您还可以使用drawclip\path裁剪一个以 为中心 的圆U,例如:

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}

\begin{document}

\begin{tikzpicture}
\begin{scope}
 \path[draw,clip,bend right=10] (0,0) coordinate (U) to (40:2) coordinate (R) to ++(-30:2) coordinate (T) to cycle;
 \fill[blue!60] (U) circle (6mm);
\end{scope}
\end{tikzpicture}

\par

\begin{tikzpicture}[decoration={random steps,segment length=5pt,amplitude=2pt}]
\begin{scope}
 \path[draw,clip,decorate] (0,0) coordinate (U) to (40:2) coordinate (R) to ++(-30:2) coordinate (T) to cycle;
 \fill[blue!60] (U) circle (6mm);
\end{scope}
\end{tikzpicture}

\end{document}

在此处输入图片描述

相关内容