![如何装饰 TikZ 中已填充路径的一段?](https://linux22.com/image/346487/%E5%A6%82%E4%BD%95%E8%A3%85%E9%A5%B0%20TikZ%20%E4%B8%AD%E5%B7%B2%E5%A1%AB%E5%85%85%E8%B7%AF%E5%BE%84%E7%9A%84%E4%B8%80%E6%AE%B5%EF%BC%9F.png)
我希望直线段可以作为zigzag
装饰:
这是我的妈妈:
\documentclass[tikz, preview=true]{standalone}
\usetikzlibrary{decorations.pathmorphing}
\begin{document}
\begin{tikzpicture}
\draw[fill=green] (1,1) to[out=45, in=140, bend left] (1,2) to[decorate, decoration=zigzag] (1.5,1.5) to[out=330, in=212, bend right] cycle;
\end{tikzpicture}
\end{document}
答案1
这里的一个解决方案是使用装饰“范围”:
\documentclass[tikz,border=5]{standalone}
\usetikzlibrary{decorations.pathmorphing}
\begin{document}
\begin{tikzpicture}
\draw[fill=green]
(1,1) to [out=45, in=140, bend left] (1,2)
decorate [decoration={zigzag, segment length=3pt, amplitude=1pt}]
{ to (1.5,1.5) } to [out=330, in=212, bend right] cycle;
\end{tikzpicture}
\end{document}