1

In this drawing there are two ellipses: a blue one, above the hexagon, and an orange one, below the hexagon. How can I make the hexagon shape hide the orange ellipse part underneath?

\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[full]{textcomp}
\usepackage{subcaption}
\usepackage{tikz}

\usetikzlibrary{arrows.meta,
                positioning,
                fit}


\begin{document}
    \begin{figure}
    \centering
    \begin{tikzpicture}[
            >={Stealth},line width=0.25px
        ]
        
        \draw[->,orange,thick] (0,-0.75) arc [start angle=270,
                                end angle=-90, 
                                x radius=2.5,
                                y radius =0.75];
        
        \draw[thick] (2,-1) -- (-2,-1);
        \draw[thick] (-2,-1) -- (-3,0);
        \draw[densely dotted] (-3,0) -- (-2,1);
        \draw[densely dotted] (-2,1) -- (2,1);
        \draw[densely dotted] (2,1) -- (3,0);
        \draw[thick] (3,0) -- (2,-1);
        \draw[->,orange,thick] (0,-1.5) arc [start angle=270,
                end angle=-90, 
                x radius=2.5,
                y radius =0.75];
    \end{tikzpicture}

    \end{figure}
\end{document}

enter image description here

1 Answer 1

2

The easy way is to draw the circles in the other order and then put a white, opaque hexagon down before drawing the hexagon boundaries around it, like so:

\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[full]{textcomp}
\usepackage{subcaption}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,positioning,fit}
\begin{document}
    \begin{figure}
    \centering
    \begin{tikzpicture}[>={Stealth},line width=0.25px]
        \draw[->,orange,thick] (0,-1.5) arc [start angle=270,
                end angle=-90,
                x radius=2.5,
                y radius =0.75];
        \fill[white] (2,-1) -- (-2,-1) -- (-3,0) -- (-2,1) -- (2,1) -- (3,0)
            -- cycle;
        \draw[thick] (0,-1) -- (-2,-1) -- (-3,0);
        \draw[densely dotted] (-3,0) -- (-2,1) -- (2,1) -- (3,0);
        \draw[thick] (3,0) -- (2,-1) -- (0,-1);
        \draw[->,orange,thick] (0,-0.75) arc [start angle=270,
                                end angle=-90, 
                                x radius=2.5,
                                y radius =0.75];
    \end{tikzpicture}
    \end{figure}
\end{document}

I redrew your hexagon to start in the middle and joined the line segments at the corners, but there's no easy way to avoid the disconnected corners when the line goes from solid to dotted, as far as I know.

1
  • 2
    You could use two hexagons: one draw and one clip (in a scope with the botton ellipse). Commented Oct 10, 2023 at 20:18

You must log in to answer this question.

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