Hello helpful community
I am trying to create a custom node to use in industrial drawing symbolizing interrupted parts looking like that :
Here is my MWE :
\documentclass[tikz,border=5pt]{standalone}
\usepackage{tikz,esvect}
\usetikzlibrary{calc}
\tikzset{%
VueInterromp/.style={
rectangle,
draw=none,
minimum height=2cm,
minimum width=1cm,
inner sep=2pt,
append after command={
(\tikzlastnode.west) -- ($(\tikzlastnode.west)!0.5!(\tikzlastnode.east)+(-0.3,0)$) -- ++(75:1) -- ($(\tikzlastnode.west)!0.5!(\tikzlastnode.east)+(+0.3,0)+(75-180:1)$) -- ($(\tikzlastnode.west)!0.5!(\tikzlastnode.east)+(+0.3,0)$) -- (\tikzlastnode.east)
}
}
}
\begin{document}
\begin{tikzpicture}
\draw[blue,thick] (-3,0) -- (3,0) node[pos=0.3,VueInterromp] {};
\end{tikzpicture}
\end{document}
Question 1
And the result is :
As one could expect, the line appears behind the node. I've tried fill=white
, it doesn't seem to do the job since it covers the node itself.
If you have an idea to solve the problem or to improve my code I am listening.
Thank you.
Question 2
I have noticed also that if the line is not horizontal it doesn't work, sloped
doesn't cut it, so probably I am not doing it the right way...
\draw[blue,thick] (-3,0) -- (0,3) node[pos=0.3,VueInterromp,sloped] {} ;
gives :
Question 3
To go further : drawing several lines :
\draw[blue,thick] (-3,0) -- (0,0) node[pos=0.3,VueInterromp,sloped] {} -- ++(-1.5,-3) ;
gives :
You see the next line draw starts a bit after the node instead of the end of the line like I'd wish. Got an idea for that ?
Question 3.5
Have a look at what cycle does :
\draw[blue,thick] (-3,0) -- (0,0) node[pos=0.5,VueInterromp,sloped] {} node[pos=1] {} -- ++(-1.5,-3) -- cycle;
gives:
Any contribution is appreciated. Thank you very much.