Is there a way to join a plot and a line segment in TikZ?
Here is a shape I'm trying to draw:
I almost happy with the result, but there is a gap between the plotted segment and the rest of the drawing:
\documentclass[12pt, border=0.5mm]{standalone}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage[sc]{mathpazo}
\usepackage{tikz}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}[x=1mm, y=1mm]
\def\r{10.5}
\def\w{18}
\coordinate (a) at ({\r*cos(180-\w)}, {\r*sin(180-\w)});
\coordinate (b) at ({\r*cos(\w)}, {\r*sin(\w)});
\draw[domain=\w:{180-\w}, variable=\x, samples=250]
(a) to[out=270, in=180]
(-8, 1.25) --
(-8, 0.75) --
(-1, 0.75) --
(-1, 8) to[out=20, in=250]
(0, 9) to[out=290, in=160]
(1, 8) --
(1, 0.75) --
(8, 0.75) --
(8, 1.25) to[out=0, in=270]
(b) plot ({\r*cos(\x)}, {\r*sin(\x)}) -- (a);
\end{tikzpicture}
\end{document}
The percusse's solution works well:
\documentclass[12pt, border=0.5mm]{standalone}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage[sc]{mathpazo}
\usepackage{tikz}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}[x=1mm, y=1mm]
\def\r{10.5}
\def\w{18}
\coordinate (b) at ({\r*cos(180-\w)}, {\r*sin(180-\w)});
\coordinate (a) at ({\r*cos(\w)}, {\r*sin(\w)});
\coordinate (c) at ({\r*cos(-\w)}, {\r*sin(-\w)});
\coordinate (d) at ({\r*cos(-180+\w)}, {\r*sin(-180+\w)});
\pgfmathsetmacro\t{90-\w}
\pgfmathsetmacro\z{90+\w}
\draw[line width=0.2mm, domain={180-\w}:\w, variable=\x, samples=250] plot ({\r*cos(\x)}, {\r*sin(\x)}) --
(a) to[out=-\t, in=0]
(8, 1.25) --
(8, 0.75) --
(1, 0.75) --
(1, 8) to[out=160, in=290]
(0, 9) to[out=250, in=20]
(-1, 8) --
(-1, 0.75) --
(-8, 0.75) --
(-8, 1.25) to[out=180, in=-\z]
(b) -- cycle;
\end{tikzpicture}
\end{document}
I've adjusted the angles and plotted the round segment first. There is no gap even at 6400%:
If you wonder, why do I need a shape like this, it's a part of the Artobolevskii's tool for drawing of logarithmic spirals:
--cycle
?