1

I am trying to draw a region. I am not able to draw arrows parallel to line connecting inner region to outer region. This is what I have enter image description here

and this is what I want enter image description here

The code I have so far is below. Thanks is advance.

    \documentclass[tikz,border=3.14mm]{standalone}
    \usepackage{graphicx,wrapfig}
    \usetikzlibrary{calc,hobby} % To draw the smooth curve
     \begin{document}


    \begin{tikzpicture}

    \draw (0,1) to [closed,curve through={(2,3) (3.3,4) (3,6) (-1,6)(-1.4,5)(-3,3.8) }] (0,1);

    \draw [blue](1,5) to [closed,curve through={(1.3,5.6)(2,5.8)(2.4,5.2)(2.2,4.7) (1.4,4.6)}] (1,5); 
    \draw [red](-1.6,2.5) to [closed,curve through={(-1.5,2.7)(-0.5,3.3)(-0.1,2.7)(-0.3,2.2) (-0.9,1.9)}] (-1.6,2.5); 
    \draw[densely dashed] (101:2.15) -- (74:1.3);
    \draw[->] (101:1.75) -- (77:1);
    \end{tikzpicture}
    \end{document}
2

Since you are already loading calc, you can use the methods of section 13.5.4 The Syntax of Distance Modifiers of the pgfmanual v3.1.5 (as well as section 13.5.3 The Syntax of Partway Modifiers) to define points away by some distance from the dashed path.

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{calc,hobby} % To draw the smooth curve
 \begin{document}


\begin{tikzpicture}

\draw (0,1) to [closed,curve through={(2,3) (3.3,4) (3,6) (-1,6)(-1.4,5)(-3,3.8) }] (0,1);

\draw [blue](1,5) to [closed,curve through={(1.3,5.6)(2,5.8)(2.4,5.2)(2.2,4.7) (1.4,4.6)}] (1,5); 
\draw [red](-1.6,2.5) to [closed,curve through={(-1.5,2.7)(-0.5,3.3)(-0.1,2.7)(-0.3,2.2) (-0.9,1.9)}] (-1.6,2.5); 
\draw[densely dashed] (101:2.15) -- (74:1.3) coordinate [pos=0] (p0) 
coordinate [pos=1] (p1);
\draw[-stealth] ($ ($(p0)!0.2!(p1)$)!0.3cm!90:(p1) $) --  
($ ($(p0)!0.8!(p1)$)!0.3cm!90:(p1) $) ;
\end{tikzpicture}
\end{document}

enter image description here

However, since you seem to want to construct segments that are orthogonal to these curves, I'd recommend another approach.

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{arrows.meta,bending,hobby,intersections,decorations.markings} % To draw the smooth curve
\tikzset{% 
    attach arrow/.style={
    decoration={
        markings,
         mark=at position 0 with {\pgfextra{%
         \pgfmathsetmacro{\tmpArrowTime}{\pgfkeysvalueof{/tikz/arc arrow/length}/(\pgfdecoratedpathlength)}%
         \xdef\tmpArrowTime{\tmpArrowTime}}},
        mark=at position {#1-3*\tmpArrowTime} with {\coordinate(@1);},
        mark=at position {#1-2*\tmpArrowTime} with {\coordinate(@2);},
        mark=at position {#1-1*\tmpArrowTime} with {\coordinate(@3);},
        mark=at position {#1+\tmpArrowTime/2} with {\coordinate(@4);
        \draw[-{Stealth[length=\pgfkeysvalueof{/tikz/arc arrow/length},bend]}] plot[smooth]
         coordinates {(@1) (@2) (@3) (@4)};},
        },
     postaction=decorate,
     },
     attach arrow/.default=0.5,
     arc arrow/.cd,length/.initial=2mm,
}


\begin{document}


\begin{tikzpicture}

\draw[name path=outer,attach arrow/.list={0.1,0.6,0.9}] (0,1) to [closed,curve through={(2,3) (3.3,4) (3,6) (-1,6)(-1.4,5)(-3,3.8) }] (0,1);
\def\BluePath{(1,5) to [closed,curve through={(1.3,5.6)(2,5.8)(2.4,5.2)(2.2,4.7) (1.4,4.6)}] (1,5)}
\draw[blue,attach arrow/.list={0.2,0.7}] \BluePath; 
\path[postaction={decorate,decoration={markings,
mark=at position 0.4 with {\path[overlay,name path=blue] (0,0) coordinate (b0) -- (0,2) coordinate (b1);}}}]
    \BluePath; 
\def\RedPath{(-1.6,2.5) to [closed,curve through={(-1.5,2.7)(-0.1,2.7)(-0.3,2.2) (-0.9,1.9)}] (-1.6,2.5)}   
\draw[red,attach arrow/.list={0.3,0.8}] \RedPath; 
\path[postaction={decorate,decoration={markings,
mark=at position 0.65 with {\path[overlay,name path=red] (0,0) coordinate (r0) -- (0,2) coordinate (r1);}}}]
    \RedPath; 
\draw[densely dashed,
    name intersections={of=blue and outer,by=b1},
    postaction={decorate,decoration={markings,
    mark={at position 0.5 with {
        \draw[-stealth,solid] (-0.2,0.2) -- (0.2,0.2);
        \draw[-stealth,solid] (0.2,-0.2) -- (-0.2,-0.2);}}}}] 
    (b0) -- (b1);
\draw[densely dashed,
    name intersections={of=red and outer,by=r1},
    postaction={decorate,decoration={markings,
    mark={at position 0.5 with {
        \draw[-stealth,solid] (-0.2,0.2) -- (0.2,0.2);
        \draw[-stealth,solid] (0.2,-0.2) -- (-0.2,-0.2);}}}}] 
    (r0) -- (r1);
\end{tikzpicture}
\end{document}

enter image description here

| improve this answer | |
  • Thank you for the suggestion on calc and also for second method. Although I prefer first solution. The second one is too complicated for me. You are awesome. – Kumarm Apr 2 at 14:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.