I want to draw the blue line part 1-2-3-1 filled and the blue line part 1-4-3 dashed. The definition of the blue line (EllA path) is made of computed nodes.

I can't find intersection points during preaction of the drawing because tikz doesn't know the name of the path at this time. It will be nice if it will become possible in a next version of tikz.

I need to extract a part of EllA path (and I don't know if it's possible, steel asking the question ?) and draw it after, but to determine the intersection points it has to be drawed (at least without the draw option), but how to draw again a part of it even reuse it as part of a new path ?.

It is a vicious ellipse ;-)

PS clip half of the blue line is not a solution has I don't know his shape in advance. I want a dynamic solution based only on pathes themselves. If such a solution is possible with tikz.

\usepackage[marginparsep=3pt, top=2cm, bottom=1.5cm, left=3cm, right=1.5cm]{geometry}


\tikzset{small dot/.style={fill=black,circle,scale=0.3},}



% Complex computed path
% here an ellipse for the example
\foreach \A in {0,10,...,350} {%
    \EllA{\A} ;         
    \coordinate (EA\A) at (\CX,\CY) ;

% The draw option is here to see what it looks like
% but I just want to draw a part of it          
\path[name path=EllA,draw,blue]
    \foreach \A in {10,20,...,350} {%
        --(EA\A) } --cycle ;

% Another path who may be computed as the first
\path[name path=EllB,draw,xslant=tan(30)] (0,0) circle (1) ;

\fill [red,
name intersections={of=EllA and EllB,
name=i,sort by=EllA,
[every node/.style={above left, black, opacity=1}]
\foreach \s in {1,...,\t}
    {(i-\s) circle (1pt) node {\footnotesize\s}};

\path[draw] (i-2)--(i-4) ;


enter image description here

  • Have you tried drawing the paths using color=white in order to determine the intersections? – John Kormylo Feb 27 '14 at 15:32
  • Come to think of it, you could draw the dashes in white after you draw them in solid color. – John Kormylo Feb 27 '14 at 15:34
  • How to do this on half a path. It is the question : how to extract a part of the path... – Tarass Feb 27 '14 at 17:55
  • 1
  • 1
    See also this question, whose answers may be helpful. – Charles Staats Feb 28 '14 at 11:38

I'm not sure if these are the arcs you wanted filled. I assumed that there was a reason for drawing a line from (i-2) to (i-4).



\tikzset{small dot/.style={fill=black,circle,scale=0.3},}


\newcommand{\myangle}[2]{% #1 = coordinate name, #2 = macro name

\newcommand{\myotherangle}[2]{% #1 = coordinate name, #2 = macro name


%first ellipse
\draw[color=blue, name path=EllA] (0,0) circle[x radius=1, y radius=2];

%second ellipse
\draw[name path=EllB,xslant=tan(30)] (0,0) circle(1);

\path[name intersections={of=EllA and EllB,
  name=i,sort by=EllA,total=\t}];

\draw (i-2)--(i-4);

%dashed line from i-1 to i-2
\draw[color=white,dashed] (i-1) arc(\angleA:\angleB:1 and 2);

%dashed line from i-2 to i-3
\draw[color=white,dashed,xslant=tan(30)] (i-2) arc(\angleC:\angleD:1);

%fill arc from i-2 to i-4
\fill[color=blue,opacity=.2] (i-2) arc(\angleA:\angleB+360:1 and 2);

%fill arc from i-1 to i-4
\fill[color=blue,opacity=.2] (i-4) arc(\angleB:\angleA:1 and 2);

%unfill arc from i-1 to i-4
\path[draw=black,fill=white,xslant=tan(30)] (i-4) arc(\angleC:\angleD:1);

% draw intersections
\fill[color=red, every node/.style={above left, black, opacity=1}]
  \foreach \s in {1,2,3,4}%
    {(i-\s) circle[radius=1pt] node{\footnotesize\s}};



| improve this answer | |
  • I don't understant how I can achieve with this help ? – Tarass Feb 27 '14 at 15:55
  • Okay, I replaced the it with a full solution. – John Kormylo Feb 27 '14 at 21:05
  • Thank you very much. But as I said, I have an ellipse calculated by a complex process, in wich I don't know the small nor the big radius. As tikz made the calculations for the path for me I expect than tikz can cut the path on point it has calculated itself then draw the line following this very path between such points. If tikz is not made for this (not yet ;-) ), let just a specialist says it : Tarass you ask for impossible thinks ! ;-) – Tarass Feb 28 '14 at 6:05
  • 1
    The problem is that TeX doesn't really support arrays, which makes it difficult to store numbers. – John Kormylo Feb 28 '14 at 17:15

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.