tikz - 使用 to 命令进行形状跟踪

tikz - 使用 to 命令进行形状跟踪

我使用 inkscape 跟踪工具得到了一个形状,它运行完美,但我想使用命令跟踪该形状以获得更简单的 tex 代码(目前使用 3 个点)。

它看起来不错,但与下面显示的原始图像仍略有不同:

\documentclass{standalone}
\usepackage{tikz}
\begin{document}
    \begin{tikzpicture}
        \node[anchor=south west,inner sep=0,opacity=0.8] (image) {
            \begin{tikzpicture}[y=0.80pt, x=0.80pt, yscale=-1,xscale=1,inner sep=0pt, outer sep=0pt]
                \draw[] (472.1277,432.2926) -- (462.9696,432.0051) -- (460.1149,421.0051) .. controls (454.0316,397.5641) and (444.2057,371.7197) .. (436.3491,358.4951) .. controls (427.0138,342.7815) and (413.1269,332.7275) .. (399.4016,331.7455) .. controls (378.6775,330.2627) and (362.5159,345.6736) .. (343.7857,384.7782) .. controls (339.3857,393.9644) and (335.2121,401.4860) .. (334.5110,401.4928) .. controls (333.8098,401.4998) and (332.7688,400.2758) .. (332.1976,398.7734) .. controls (328.8979,390.0944) and (315.5706,364.7072) .. (310.7594,357.9357) .. controls (303.4032,347.5822) and (293.7507,338.3715) .. (286.5529,334.8370) .. controls (281.5794,332.3948) and (279.6030,332.0051) .. (272.1918,332.0051) .. controls (264.1750,332.0051) and (263.0795,332.2682) .. (255.8791,335.9239) .. controls (244.2081,341.8493) and (236.9388,350.2239) .. (228.2891,367.7091) .. controls (221.6457,381.1383) and (213.1289,404.9622) .. (208.2530,423.7551) -- (205.9828,432.5051) -- (196.6343,432.5051) .. controls (191.4925,432.5051) and (187.2857,432.2604) .. (187.2857,431.9613);
            \end{tikzpicture}           
        };
        \begin{scope}[x={(image.south east)},y={(image.north west)}]
            \begin{scope}[shift={(0.5,0.5)}]
                \draw[red,line width=1pt]
                (-0.435,-0.5) to[out=70,in=180] (-0.2,0.48) to[out=0,in=120] (0.015,-0.2);
            \end{scope}
        \end{scope}
    \end{tikzpicture}
\end{document}

希望调整代码以完全匹配原始形状! 在此处输入图片描述

答案1

这是我做的贝塞尔曲线完美适合您的图片(可能需要缩放)但更简单: 贝塞尔曲线

\documentclass[tikz,border=3.14mm]{standalone}
\begin{document}
    \begin{tikzpicture}
        \draw[line width=1pt]
            (0,0)       .. controls ++ (1.2,5.1)    and ++ (-1.1,0) ..
            (3.9,6)     .. controls ++ (2,0)        and ++ (-0.8,1) ..
            (7.6,1.8)   .. controls ++ (0.8,1)      and ++ (-2,0) ..
            (11.3,6)    .. controls ++ (1.1,0)      and ++ (-1.2,5.1) ..
            (15.2,0);
    \end{tikzpicture}
\end{document}

相关内容