I am working in TikZ and I am trying to make one line stop, then start again before and after the intersection with another line. I have attempted to put a node at the intersection point and filled it with white, but this has cut both lines. I only want the blue line to break and the black line to continue. Any help would be great!
Here's what the following code does:
\documentclass{article}
\usepackage[dvipsnames]{xcolor}
\usepackage{tikz}%
\usetikzlibrary{arrows.meta,shapes.misc, positioning, shapes.geometric, intersections}%
\begin{document}
\begin{tikzpicture}
\draw [-Latex, RoyalBlue, name path = b1] (0,-1) -- (10,-1);
\draw [-Latex, RoyalBlue, name path = b2] (0,-0.5) -- (10,-0.5);
\draw [-Latex, RoyalBlue, name path = b3] (0,0) -- (10,0);
\draw [-Latex, RoyalBlue, name path = b4] (0,0.5) -- (10,0.5);
\draw [-Latex, RoyalBlue, name path = b5] (0,1) -- (10,1);
\node[trapezium,
draw = black,
thick,
rotate=90,
minimum width = 2.5cm,
minimum height= 1cm,
trapezium left angle = 100,
trapezium right angle = 80,
trapezium stretches=true,
trapezium stretches body =true,
name path = trap1] (t) at (1,0) {};
\draw[name intersections={of=b1 and trap1}] (intersection-1) node[fill=white] {};
\draw[name intersections={of=b2 and trap1}] (intersection-1) node[fill=white] {};
\draw[name intersections={of=b3 and trap1}] (intersection-1) node[fill=white] {};
\draw[name intersections={of=b4 and trap1}] (intersection-1) node[fill=white] {};
\draw[name intersections={of=b5 and trap1}] (intersection-1) node[fill=white] {};
\end{tikzpicture}
\end{document}
Best Answer
I know it is only a workaround but you could use that node twice: first for intersections, and second to actually draw it.
To make things a bit easier you can also add a style for the node so you can reuse it any time you need. The same can be done with coordinates, such that such you can have named coordinates for multiple usage.
EDIT. Example based on
scope
and thebackground
layer.