8

Is there a way to combine rounded corners and arc? If I try it like this, I always get "additional lines".

I need the black shape (without lines on both corners) and the 180 degree rotated version.

\documentclass{standalone}
\usepackage{pgfplots}                 
\usepackage{tikz}
\usetikzlibrary{shadows, shadows.blur, shapes, arrows, positioning, circuits.ee.IEC, decorations, matrix, intersections, patterns, shapes}   % Zusätzlich Libraries, werden standardmäßig nicht geladen
\pgfplotsset{compat=newest}




\begin{document}


\begin{tikzpicture}

\begin{axis}[name=plot1, xmin=-3, xmax=3, ymin=-3, ymax=3, x=2cm, y=2cm, ytick=\empty, xtick=\empty,
            axis lines=none, disabledatascaling]

            \draw[-, thin, blue]{[rounded corners=20pt] (0, 1.6) -- (1.4, 1.6) -- (0, 2.6) -- (-1.4, 1.6) -- (0, 1.6)}; 

            \draw[-, thin]{[rounded corners=20pt] (0, 0.1) -- (1.4, 0.1) -- (1.4, 0.1) arc[start angle=0, end angle=180, radius=1.4] -- (-1.4, 0.1) -- (0, 0.1)};               

            \draw[-, thin, red]{[rounded corners=20pt] (0, -0.1) -- (1.4, -0.1) -- (1.4, -0.1) arc[start angle=0, end angle=-180, radius=1.4] -- (-1.4, -0.1) -- (0, -0.1)};

        \end{axis}


\end{tikzpicture}       

\end{document}

pic1

Thanks, Konne.

1 Answer 1

12

Like this?

enter image description here

Code:

\documentclass[border=10pt]{standalone}
\usepackage{pgfplots}
\usepackage{tikz}
\usetikzlibrary{shadows, shadows.blur, shapes, arrows, positioning, circuits.ee.IEC, decorations, matrix, intersections, patterns, shapes}   % Zusätzlich Libraries, werden standardmäßig nicht geladen
\pgfplotsset{compat=newest}

\begin{document}


\begin{tikzpicture}

\begin{axis}[name=plot1, xmin=-3, xmax=3, ymin=-3, ymax=3, x=2cm, y=2cm, ytick=\empty,
                     xtick=\empty, axis lines=none, disabledatascaling]

            \draw[-, thin, blue]{[rounded corners=20pt] (0, 1.6) -- (1.4, 1.6) -- 
                   (0, 2.6) -- (-1.4, 1.6) -- (0, 1.6)};

            \draw[-, thin,rounded corners=20pt] (0, 0.1) -- (1.4, 0.1)  arc[start
                   angle=0, end angle=180, radius=1.4] -- (0, 0.1);

            \draw[-, thin, red,rounded corners=20pt] (0, -0.1) -- (1.4, -0.1)
                   arc[start angle=0, end angle=-180, radius=1.4] -- (0, -0.1);

        \end{axis}


\end{tikzpicture}

\end{document}

Instead of

\draw[-, thin]{[rounded corners=20pt] (0, 0.1) -- (1.4, 0.1) -- (1.4, 0.1) arc[start
                         angle=0, end angle=180, radius=1.4] -- (-1.4, 0.1) -- 
                         (0, 0.1)}; 

you should use

\draw[-, thin,rounded corners=20pt] (0, 0.1) -- (1.4, 0.1)  arc[start angle=0, end
                          angle=180, radius=1.4] -- (0, 0.1);

then every thing works.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .