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.

I'm trying to display a line "under" a rectangle. For this I tried using the intersections package, but somehow I the line doesn't stop:

\documentclass[a4paper]{article}
\usepackage{tikz}
\usetikzlibrary{intersections}
\begin{document}

\begin{tikzpicture}
% rectangle
\fill[name path=hrectangle, fill opacity=.5, rounded corners=1ex, shift={(-4cm,0cm)}, rotate=-30] ( -1,-.5) rectangle ( 1,.5);

% line
\draw[name path=x axis, <->, dashed] (7,0) -- (-4,0);

% intersection
\path[name intersections={of= x axis and hrectangle}];
\foreach \i in {1,...,2}
    \fill [color=red] (intersection-\i) circle (2pt) ;

\end{tikzpicture}
\end{document}

When I compile I get the error :

Package pgf Error: No shape named intersection-1 is known.
Package pgf Error: No shape named intersection-2 is known.

Is there any other way I can do it?

Edit: The problem appears when I add the rounded corner of the rectangle...

share|improve this question
1  
Your axis is short. extend it to -7 and it works on my computer with TikZ v.2.10 –  percusse May 11 '13 at 17:56
    
Or remove shift={(-4cm,0cm)} –  Marco Daniel May 11 '13 at 17:57
    
Hum yeah the "rounded corners=1ex" make it not working... –  user30552 May 11 '13 at 19:02
1  
I can confirm this is a bug. The intersections library should apply \pgfprocessround for both intersection paths. In fact, it does it for neither. I'm surprised this hasn't been noticed before, in particular by the author of pgflibraryintersections.code.tex. ` –  Mark Wibrow May 11 '13 at 20:30
    
@MarkWibrow At present, I guess this is an 'answer': could you make it one (or update us on a fix)? –  Joseph Wright Aug 15 '13 at 19:42

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.