1

I am the basic user of \LaTex. It would be great if someone can help me to sort out this problem.

In the following shown figure, If I fill the middle section with some colors the straight line in filled section get vanished!! I want the solid line connecting straight between two ends. enter image description here

1
  • 1
    Draw (or redraw) that line after you draw the filled section. Commented Jan 23, 2016 at 18:18

1 Answer 1

1

In general, three-dimensional drawing in TikZ does not have z buffering capability (there are some exceptions to this, namely 3D plots in pgfplots, but that does not apply here).

What does this mean? It means that while you can conveniently specify coordinates as (x,y,z) triples, TikZ makes no attempt to store these off and take care of which drawing elements should appear "in front of" other elements. It simply draws everything in the order specified in the picture code.

Because of this, it is up to the user to draw overlapping things in the order desired. No code was given; so I'll show a simple example of this here:

\documentclass[tikz]{standalone}

\begin{document}
\begin{tikzpicture}[
  x={(0.935cm,-0.118cm)},
  y={(0.354cm, 0.312cm)},
  z={(0.000cm, 0.943cm)},
]
\draw[red] (0,0,-1) -- ++(0,6,0); % drawn first, so rectangle covers it up
\draw[fill=blue!10] (0,0,0) -- (2,0,0) -- (2,0,1) -- (0,0,1) -- cycle;
\draw[green] (0.1,0,-1) -- ++(0,6,0); % should be "below" the rectangle, but appears on top
\end{tikzpicture}
\end{document}

enter image description here

In practice, you can manage this by drawing (or redrawing) items in the foreground "after" (on top of) any background items.

You must log in to answer this question.

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