使用 tikz 绘制徽标

使用 tikz 绘制徽标

我尝试用 tikz 绘制这个标志 enter image description here

画它最简单的方法是什么?有什么建议吗?

我的 MWE:

    \documentclass[12 pt,a4paper]{article}
    \usepackage{xcolor}
    \definecolor{vertforet}{RGB}{153,202,67}
    \definecolor{vert}{RGB}{0,172,95}
    \definecolor{bleu}{RGB}{7,196,234}
    \definecolor{Orange}{RGB}{245,178,31}
    \definecolor{Rose}{RGB}{238,28,131}
    \definecolor{Gray}{RGB}{109,119,125}


    \usepackage{graphicx}
    \usepackage{pgf,tikz}
    \usetikzlibrary{shapes,arrows,chains,trees,calc,positioning}

    %-=-=-=-=-=-=-=-=
    \begin{document}
    %-=-=-=-=-=-=-=-=

    \begin{tikzpicture}[every node/.style={white}]
       \filldraw[Gray](0.2,3.7) circle(0.8) ;
    \node[white] at(0.2,3.7){1};
    \filldraw[vertforet](-2,2) circle(1.2)node{2} ;
    \filldraw[Gray](4.6,1.3) circle(0.8)node{3} ;
    \filldraw[vert](-5.4,1.1) circle(0.6) node{4};
    \filldraw[bleu](1.3,2.3) circle(0.6)node{5} ;
    \filldraw[Rose](-2.7,-0.5) circle(0.4) node{6};
    \filldraw[bleu](1.3,0.3) circle(0.4) node{7};
    \filldraw[Rose](3,1) circle(0.6)node{8};
    \filldraw[Gray](-3,4.7) circle(0.6) node{9};
    \filldraw[Orange](-5.3,3.7) circle(0.5) node{10};
    \filldraw[Rose](3.5,-1.5) circle(0.4) node{11};
    \filldraw[vert](6,-0.25) circle(0.4) node{6};
    \filldraw[Orange](4.7,-1) circle(0.4) node{12};
    \filldraw[vert](3.5,-1.5) circle(0.5) node{13};
    \path[draw=Gray,line width=4 pt](7,-1.5)to[bend left] (-6.5,1);
     \path[draw=Gray,line width=4 pt](0.3,-5.5)to[bend right] (-1.5,-0.5) to(-5.2,3.2);
    \path[draw=Gray,line width=4 pt] (-0.5,-1.5) to (0.8,1.7);
    \path[draw=Gray,line width =4 pt](-1.5,-0.5)--(-0.8,1.2);
    \path[draw=Gray,line width =4 pt](-0.8,1.2)--(-0.3,2.4);
    \path[draw=Gray,line width=4 pt] (0.7,-4.5) to[bend left] (1.7,-1.5);
\path[draw=Gray,line width=4 pt] (1.7,-1.5) to[bend left] (5.6,-0.25);
\path[draw=Gray,line width=4 pt] (1.7,-1.5) to(1.3,-.1);
    \end{tikzpicture}

    \end{document}

答案1

这是从 Wikipedia 中截取的 SVG 徽标的 TikZ 版本。问题是徽标中的路径使用了非常简练的样式(例如....16zm-.384-.423c-.493...没有空格),库无法理解svg.path。因此需要重新格式化。

\documentclass[tikz,border=7mm]{standalone}
\usetikzlibrary{svg.path}

\begin{document}
  % les couleurs
  \definecolor{col1}{HTML}{3F464D}
  \definecolor{col2}{HTML}{F68712}
  \definecolor{col3}{HTML}{00A650}
  \definecolor{col4}{HTML}{3F464D}
  \definecolor{col5}{HTML}{66C430}
  \definecolor{col6}{HTML}{00A650}
  \definecolor{col7}{HTML}{F68712}
  \definecolor{col8}{HTML}{EC086D}
  \definecolor{col9}{HTML}{3F464D}
  \definecolor{col10}{HTML}{35B6ED}
  \definecolor{col11}{HTML}{EC086D}
  \definecolor{col12}{HTML}{00A650}
  % le logo
  \begin{tikzpicture}[scale={1mm/1pt}]
    \fill[col1] svg {M 146.14 73.32 c -3.82 -2.19 -8.01 -3.31 -12.31 -3.65 c 1.04 0.6 2.55 1.67 3.67 3.08 c 1.11 0.39 4.08 1.34 6.2 3.86 l -0.25 0.21 c -1.81 -2.14 -4.26 -3.12 -5.59 -3.59 c 0.44 0.64 0.79 1.34 0.97 2.08 l -0.33 0.08 c -0.2 -0.84 -0.64 -1.64 -1.2 -2.35 c -1.36 -1.73 -3.39 -3 -4.28 -3.42 c -2.36 -0.13 -4.75 -0.03 -7.12 0.26 c 0.2 0.8 0.78 2.27 2.61 3.73 c 2.4 1.91 6.96 3.79 15.64 4.05 l -0.01 0.34 c -2.63 -0.08 -4.89 -0.31 -6.83 -0.64 c 0 0.37 -0.03 0.68 -0.05 0.83 c -0.04 0.26 -0.24 1.17 0.58 2.55 c 0.32 0.53 0.64 0.88 0.63 0.87 l -0.24 0.23 c -0.01 -0.01 -1 -1.08 -1.29 -2.4 c -0.66 1.9 -2.26 3.75 -5.08 4.35 l -0.07 -0.33 c 4.37 -0.93 5.25 -4.67 5.17 -6.17 c -4.29 -0.78 -6.98 -2.08 -8.67 -3.42 c -0.22 -0.17 -0.42 -0.35 -0.6 -0.52 c 0.4 0.89 0.81 2.13 0.81 3.63 c 0 1.28 -0.3 2.75 -1.15 4.37 l -0.3 -0.16 c 0.83 -1.57 1.11 -2.98 1.12 -4.21 c 0 -2.09 -0.83 -3.64 -1.26 -4.46 h 0 c -0.86 -1.05 -1.21 -2.01 -1.35 -2.6 c -1.6 0.21 -3.2 0.49 -4.77 0.85 c -0.19 0.47 -0.4 0.94 -0.64 1.4 c 0.31 4.12 1.08 10.07 6.64 13.81 l -0.18 0.28 c -5.46 -3.68 -6.41 -9.43 -6.75 -13.54 c -0.45 0.79 -0.96 1.54 -1.58 2.23 c -0.37 0.41 -0.76 0.83 -1.18 1.25 c -0.06 0.36 -0.11 0.81 -0.11 1.32 c 0 1.16 0.24 2.66 1.1 4.32 c 1.19 2.3 3.04 5.65 3.05 7.9 c 0 0.42 -0.07 0.81 -0.22 1.15 l -0.3 -0.14 c 0.13 -0.28 0.19 -0.62 0.19 -1.01 c 0 -0.76 -0.24 -1.68 -0.6 -2.66 v 0.12 c 0.01 1.85 -0.99 2.76 -2.02 3.46 c -1.04 0.71 -2.08 1.29 -2.42 2.39 c -0.9 2.94 -2.35 3.8 -3.17 4.74 l -0.25 -0.23 c 0.86 -0.92 2.32 -1.95 3.11 -4.64 c 0.36 -1.22 1.45 -1.79 2.54 -2.53 c 1.01 -0.7 1.87 -1.48 1.87 -3.19 c 0 -0.34 -0.04 -0.72 -0.14 -1.3 c -0.6 -1.37 -1.34 -2.77 -1.93 -3.9 c -0.24 -0.47 -0.44 -0.92 -0.6 -1.37 c -0.15 1.74 -0.93 4.38 -2.46 5.88 l -0.24 -0.24 c 1.61 -1.55 2.47 -4.66 2.4 -6.65 c -0.18 -0.77 -0.25 -1.48 -0.25 -2.1 c 0 -0.35 0.02 -0.66 0.06 -0.94 c -2.87 2.75 -6.71 5.58 -9.89 8.99 c -0.29 0.81 -0.83 2.41 -0.83 4.34 c 0 2.52 0.9 5.57 4.47 8.13 l -0.2 0.28 c -3.66 -2.62 -4.62 -5.81 -4.61 -8.41 c 0 -1.5 0.32 -2.81 0.6 -3.71 c -2 2.25 -3.67 4.77 -4.57 7.67 l -0.49 -0.15 c 1.8 -5.75 6.45 -9.95 10.72 -13.6 c -1.38 0.4 -4.33 1.33 -6.14 1.1 c -0.89 -0.12 -2.15 -0.33 -3.32 -0.33 c -1.01 0 -1.95 0.15 -2.53 0.59 l -0.2 -0.27 c 0.69 -0.51 1.69 -0.66 2.73 -0.66 c 1.21 0 2.38 0.2 3.37 0.34 c 1.87 0.25 5.49 -0.97 6.7 -1.28 c 2.05 -1.75 3.97 -3.37 5.38 -4.99 c 0.97 -1.1 1.71 -2.38 2.29 -3.71 c -10.41 2.5 -19.7 7.99 -23.78 12.22 c 0.62 -2.6 11.25 -10.16 24.14 -13.15 c 1.65 -4.55 1.49 -9.49 1.56 -10.6 l 0.51 0.03 c -0.08 1.04 0.1 5.85 -1.49 10.44 c 1.43 -0.31 2.88 -0.57 4.35 -0.75 c -0.47 -0.91 -1.94 -4.08 -1.93 -8.09 c 0.08 1.25 1.13 6.08 3.73 7.89 c 6.37 -0.55 12.96 0.31 18.91 3.59 l -0.06 0.83 z};
    \fill[col2] svg {M 102.92 92.63 c 0.07 -1.05 -0.71 -1.96 -1.77 -2.03 c -1.05 -0.07 -1.96 0.71 -2.03 1.76 c -0.08 1.05 0.71 1.96 1.76 2.03 c 1.05 0.07 1.96 -0.71 2.04 -1.76};
    \fill[col3] svg {M 103.12 82.98 c 0.09 -1.26 -0.86 -2.35 -2.11 -2.44 c -1.26 -0.09 -2.35 0.86 -2.44 2.12 c -0.09 1.26 0.86 2.35 2.11 2.44 c 1.26 0.09 2.35 -0.86 2.44 -2.12};
    \fill[col4] svg {M 112.19 96.58 c 0.09 -1.26 -0.86 -2.35 -2.11 -2.44 c -1.26 -0.09 -2.35 0.86 -2.44 2.11 c -0.09 1.26 0.86 2.35 2.12 2.44 c 1.26 0.09 2.35 -0.86 2.43 -2.11};
    \fill[col5] svg {M 117.82 87.1 c 0.17 -2.36 -1.61 -4.4 -3.97 -4.57 c -2.36 -0.17 -4.4 1.61 -4.57 3.96 c -0.17 2.36 1.61 4.4 3.97 4.57 c 2.36 0.17 4.4 -1.61 4.57 -3.96};
    \fill[col6] svg {M 136.13 73.84 c 0.07 -1.05 -0.71 -1.96 -1.76 -2.04 c -1.05 -0.07 -1.96 0.71 -2.03 1.77 c -0.07 1.05 0.71 1.96 1.76 2.03 c 1.05 0.08 1.96 -0.71 2.03 -1.76};
    \fill[col7] svg {M 140.04 75.45 c 0.05 -0.76 -0.52 -1.41 -1.28 -1.47 c -0.76 -0.05 -1.42 0.52 -1.46 1.28 c -0.06 0.76 0.52 1.41 1.27 1.46 c 0.76 0.06 1.41 -0.52 1.47 -1.27};
    \fill[col8] svg {M 112.44 77.64 c 0.05 -0.76 -0.52 -1.41 -1.27 -1.46 c -0.76 -0.05 -1.42 0.52 -1.47 1.27 c -0.05 0.76 0.52 1.41 1.27 1.47 c 0.76 0.05 1.41 -0.52 1.47 -1.28};
    \fill[col9] svg {M 140.97 83.72 c 0.11 -1.51 -1.03 -2.82 -2.54 -2.93 c -1.51 -0.11 -2.82 1.03 -2.92 2.54 c -0.11 1.51 1.03 2.82 2.53 2.93 c 1.51 0.11 2.82 -1.03 2.93 -2.54};
    \fill[col10] svg {M 128.31 80.1 c 0.07 -1.05 -0.71 -1.96 -1.76 -2.03 c -1.05 -0.08 -1.96 0.71 -2.03 1.76 c -0.08 1.05 0.71 1.96 1.76 2.03 c 1.05 0.07 1.96 -0.71 2.03 -1.76};
    \fill[col11] svg {M 134.05 82.5 c 0.07 -1.05 -0.71 -1.96 -1.76 -2.03 c -1.05 -0.08 -1.96 0.71 -2.03 1.76 c -0.07 1.05 0.71 1.96 1.76 2.03 c 1.05 0.07 1.96 -0.71 2.03 -1.76};
    \fill[col12] svg {M 145.23 78.25 c 0.07 -1.05 -0.71 -1.96 -1.76 -2.03 c -1.05 -0.07 -1.96 0.71 -2.03 1.76 c -0.07 1.05 0.71 1.96 1.76 2.03 c 1.05 0.07 1.96 -0.71 2.03 -1.76};
  \end{tikzpicture}
\end{document}

enter image description here

笔记:有 11 个圆是用贝塞尔曲线近似的,应该用简单的circle指令代替。只有第一个路径应该保持原样。

编辑:这是优化版本(带有圆圈、组合颜色和更短的 svg 路径)。

\documentclass[tikz,border=7mm]{standalone}
\usetikzlibrary{svg.path}

\begin{document}
  % les couleurs
  \definecolor{gris}{HTML}{3F464D}
  \definecolor{vertf}{HTML}{00A650}
  \definecolor{vertc}{HTML}{66C430}
  \definecolor{orange}{HTML}{F68712}
  \definecolor{rose}{HTML}{EC086D}
  \definecolor{bleu}{HTML}{35B6ED}
  % le logo
  \begin{tikzpicture}
    \fill[gris,scale={1mm/1pt}] svg{M146.14 73.32c-3.82-2.19-8.01-3.31-12.31-3.65 1.04 .6 2.55 1.67 3.67 3.08 1.11 .39 4.08 1.34 6.2 3.86l-.25 .21c-1.81-2.14-4.26-3.12-5.59-3.59 .44 .64 .79 1.34 .97 2.08l-.33 .08c-.2-.84-.64-1.64-1.2-2.35-1.36-1.73-3.39-3-4.28-3.42-2.36-.13-4.75-.03-7.12 .26 .2 .8 .78 2.27 2.61 3.73 2.4 1.91 6.96 3.79 15.64 4.05l-.01 .34c-2.63-.08-4.89-.31-6.83-.64 0 .37-.03 .68-.05 .83-.04 .26-.24 1.17 .58 2.55 .32 .53 .64 .88 .63 .87l-.24 .23c-.01-.01-1-1.08-1.29-2.4-.66 1.9-2.26 3.75-5.08 4.35l-.07-.33c4.37-.93 5.25-4.67 5.17-6.17-4.29-.78-6.98-2.08-8.67-3.42-.22-.17-.42-.35-.6-.52 .4 .89 .81 2.13 .81 3.63 0 1.28-.3 2.75-1.15 4.37l-.3-.16c.83-1.57 1.11-2.98 1.12-4.21 0-2.09-.83-3.64-1.26-4.46-.86-1.05-1.21-2.01-1.35-2.6-1.6 .21-3.2 .49-4.77 .85-.19 .47-.4 .94-.64 1.4 .31 4.12 1.08 10.07 6.64 13.81l-.18 .28c-5.46-3.68-6.41-9.43-6.75-13.54-.45 .79-.96 1.54-1.58 2.23-.37 .41-.76 .83-1.18 1.25-.06 .36-.11 .81-.11 1.32 0 1.16 .24 2.66 1.1 4.32 1.19 2.3 3.04 5.65 3.05 7.9 0 .42-.07 .81-.22 1.15l-.3-.14c.13-.28 .19-.62 .19-1.01 0-.76-.24-1.68-.6-2.66v.12c.01 1.85-.99 2.76-2.02 3.46-1.04 .71-2.08 1.29-2.42 2.39-.9 2.94-2.35 3.8-3.17 4.74l-.25-.23c.86-.92 2.32-1.95 3.11-4.64 .36-1.22 1.45-1.79 2.54-2.53 1.01-.7 1.87-1.48 1.87-3.19 0-.34-.04-.72-.14-1.3-.6-1.37-1.34-2.77-1.93-3.9-.24-.47-.44-.92-.6-1.37-.15 1.74-.93 4.38-2.46 5.88l-.24-.24c1.61-1.55 2.47-4.66 2.4-6.65-.18-.77-.25-1.48-.25-2.1 0-.35 .02-.66 .06-.94-2.87 2.75-6.71 5.58-9.89 8.99-.29 .81-.83 2.41-.83 4.34 0 2.52 .9 5.57 4.47 8.13l-.2 .28c-3.66-2.62-4.62-5.81-4.61-8.41 0-1.5 .32-2.81 .6-3.71-2 2.25-3.67 4.77-4.57 7.67l-.49-.15c1.8-5.75 6.45-9.95 10.72-13.6-1.38 .4-4.33 1.33-6.14 1.1-.89-.12-2.15-.33-3.32-.33-1.01 0-1.95 .15-2.53 .59l-.2-.27c.69-.51 1.69-.66 2.73-.66 1.21 0 2.38 .2 3.37 .34 1.87 .25 5.49-.97 6.7-1.28 2.05-1.75 3.97-3.37 5.38-4.99 .97-1.1 1.71-2.38 2.29-3.71-10.41 2.5-19.7 7.99-23.78 12.22 .62-2.6 11.25-10.16 24.14-13.15 1.65-4.55 1.49-9.49 1.56-10.6l.51 .03c-.08 1.04 .1 5.85-1.49 10.44 1.43-.31 2.88-.57 4.35-.75-.47-.91-1.94-4.08-1.93-8.09 .08 1.25 1.13 6.08 3.73 7.89 6.37-.55 12.96 .31 18.91 3.59l-.06 .83z};
    \fill[gris](10.992,9.641) circle(.228) (13.824,8.352) circle(.274);
    \fill[vertf](14.334,7.811) circle(.19) (10.085,8.282) circle(.228) (13.424,7.37) circle(.19);
    \fill[vertc](11.355,8.68) circle(.428);
    \fill[orange](10.102,9.25) circle(.19) (13.867,7.535) circle(.137);
    \fill[rose](13.216,8.236) circle(.19) (11.107,7.755) circle(.137);
    \fill[bleu](12.641,7.996) circle(.19);
  \end{tikzpicture}
\end{document}

相关内容