tikz 图片按线宽缩放

tikz 图片按线宽缩放

我怎样才能缩放这个 MWE 中的线宽值?

\documentclass[tikz,border=5mm]{standalone}
\begin{document}
\tikzset{
    mytest/.pic = {
      \draw[blue, line width=0.5cm](0,0)--(90:1.5)--(60:2.5)--(30:3.0); 
      \draw[white, line width=0.4cm,shorten >=1pt,shorten <=1pt](0,0)--(90:1.5)--(60:2.5)--(30:3.0);
    }
}
\begin{tikzpicture}
  \pic at (0cm,0cm){mytest};
  \pic [scale=5] at (5cm,0cm){mytest};
  %HELP GRID LINES: 
  \draw[very thin, gray!20,step=1cm] (current bounding box.south west) grid (current bounding box.north east);
\end{tikzpicture}
\end{document}

相关问题:Tikz 和包围边框][1]

答案1

在此处输入图片描述

\documentclass{article}
\usepackage{tikz}
\begin{document}
\tikzset{
    mytest/.pic = {
        \draw[
        blue,
        scale=#1,
        line width=#1*4pt,
        double distance between line centers=#1*8pt,
        double,
        shorten >=1pt, shorten <=1pt]
        (0,0)--(90:1.5)--(60:2.5)--(30:3.0); 
    }
}
\begin{tikzpicture}
  \pic at (0cm,0cm){mytest={1}};
  \pic at (5cm,0cm) {mytest=4};
  %HELP GRID LINES: 
  \draw[very thin, gray!20,step=1cm] (current bounding box.south west) grid (current bounding box.north east);
\end{tikzpicture}
\end{document}

相关内容