Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

The is a tiny unwanted white line between blue areas (it is a MWE ;-) ) and the black border line is cut by the clipping line. How to avoid this two problems ?

It's not visible on a png image but very annoying on a pdf.

\documentclass[tikz]{standalone}

\begin{document}
\begin{tikzpicture}

\begin{scope}
\clip[rotate=45] (-1,-1) rectangle (0,1) ;
\draw[fill=blue] (0,0) circle (1) ;
\end{scope}

\begin{scope}
\clip[rotate=45] (1,-1) rectangle (0,1) ;
\draw[fill=blue] (0,0) circle (1) ;
\end{scope}


\end{tikzpicture}
\end{document}
share|improve this question

1 Answer 1

up vote 5 down vote accepted

Without any rotation, this is what your code gives:

\documentclass[tikz]{standalone}

\begin{document}
\begin{tikzpicture}

\begin{scope}
\clip[rotate=0] (-1,-1) rectangle (0,1) ;
\draw[fill=blue] (0,0) circle (1) ;
\end{scope}
\end{tikzpicture}
\end{document}

enter image description here

The cuts are clearly seen. With some shifts as below:

\documentclass[tikz]{standalone}

\begin{document}
\begin{tikzpicture}

\begin{scope}
\clip[rotate=0] ([shift={(-0.5\pgflinewidth,-0.5\pgflinewidth)}]-1,-1) rectangle ([shift={(0.5\pgflinewidth,0.5\pgflinewidth)}]0,1) ;
\draw[fill=blue] (0,0) circle (1) ;
\end{scope}
\end{tikzpicture}
\end{document}

enter image description here

You can give appropriate shift with a magnitude of \pgflinewidth to your actual code:

\documentclass[tikz]{standalone}

\begin{document}
\begin{tikzpicture}

\begin{scope}
\clip[rotate=45] ([shift={(-\pgflinewidth,-\pgflinewidth)}]-1,-1) rectangle ([shift={(\pgflinewidth,\pgflinewidth)}]0,1) ;
\draw[fill=blue] (0,0) circle (1) ;
\end{scope}

\begin{scope}
\clip[rotate=45] ([shift={(\pgflinewidth,-\pgflinewidth)}]1,-1) rectangle ([shift={(0.5\pgflinewidth,\pgflinewidth)}]0,1) ;
\draw[fill=blue] (0,0) circle (1) ;
\end{scope}


\end{tikzpicture}
\end{document}

enter image description here

In fact 0.5\pgflinewidth would be enough, but to be on safer side \pgflinewidth has been used.

share|improve this answer
    
You shot too fast ;-) –  Tarass Mar 8 at 15:24
    
@Tarass Only some times ;) –  Harish Kumar Mar 8 at 15:26
    
By default the line is drawn on the path. I hoped there was an option like inner to draw the line inside the path, outer to draw the line around the path (cycle) ? –  Tarass Mar 8 at 15:27
    
@Tarass No, it is only the pgflinewidth –  Harish Kumar Mar 8 at 15:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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