如何在这个 tikz 绘制的山中添加雪?

如何在这个 tikz 绘制的山中添加雪?

我编辑了Elena Botoeva 的 tikz 示例画一座山。它看起来是这样的:

山水画

这幅画的象征意义大于现实意义。

以下是绘制它的 LaTeX/tikz 代码:

\documentclass[crop,margin=1mm]{standalone}

\usepackage{tikz}
\usetikzlibrary{decorations}
\usepgflibrary{decorations.pathmorphing}

\begin{document}

\begin{tikzpicture}
  \fill[brown,draw=black]
    decorate [decoration={random steps,segment length=3pt,amplitude=1pt}]%
    {(0,0) -- (0.5,0.6) -- (1,2) -- (1.5,0.6) -- (2,0)}%
    -- (2,-0.7) -- (0,-0.7) -- (0,0);
\end{tikzpicture}

\end{document}

问题:我怎样才能把它变成一座雪峰呢?

我不知道该怎么做。

答案1

像这样?

在此处输入图片描述

我使用这条mountain小路来表示剪辑,另一条装饰小路表示雪,并使用一个普通的棕色矩形表示没有积雪的山。

\documentclass[crop,margin=1mm]{standalone}

\usepackage{tikz}
\usetikzlibrary{decorations}
\usepgflibrary{decorations.pathmorphing}

\begin{document}

\begin{tikzpicture}

  \draw[clip]
    decorate [decoration={random steps,segment length=3pt,amplitude=1pt}]%
    {(0,0) -- (0.5,0.6) -- (1,2) -- (1.5,0.6) -- (2,0)}%
    -- (2,-0.7) -- (0,-0.7) -- (0,0);
    \fill[brown](0,-.7) rectangle (2,2);
    \fill[white]
    decorate [decoration={random steps,segment length=3pt,amplitude=1pt}]%
    {(.75,2) -- (0.85,1.5) -- (0.92,1.2) -- (0.99,1.7) -- (1.05,1.4) -- (1.3,2)}%
    -- (0,2);
\end{tikzpicture}

\end{document}

相关内容