# tikz - shape trace with to command

I got a shape using inkscape trace tool, it works perfect but I would like to trace the shape with to command to get more simple tex code (3 points used currently).

It looks good but still a little bit differ then original image show below:

\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}


Wish to adjust the code to match original shape exactly!

• I posted an answer and just saw that your original curve is a Bezier curve... Why would you do that with something else? Bezier curves are the best way to fine controlling curvatures. – SebGlav May 4 at 15:47

## 1 Answer

Here's a Bezier curve I did that perfectly fit your picture (scaling needed, probably) but is way simpler:

\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}

• Great, how can we get the control points? Any visualize tool can be used? – lucky1928 May 4 at 15:51
• You won't believe how I did. I pasted your picture into Word, recreated it with the curve tool, put a millimetric paper underneath and measured all the dimensions. You can do that directly with Inkscape, if you define your curve with only three points, then you'll get the appropriate Bezier curve. – SebGlav May 4 at 15:53