I would like to do something like here in order to clip text outside of an area. But I'd like to specify the area using precisely a given node (that, in my case, is constructed using fit). The thing is that I can't find how to convert a node border into a path. Any idea?
MWE:
\documentclass{report}
\usepackage{tikz}
\usetikzlibrary{fit,shapes.misc}
\begin{document}
\begin{tikzpicture}
[
mybox/.style={fill=#1!30,draw=#1,rounded corners}
]
\node[mybox=green] at (0,0) (a) {A};
\node[mybox=blue] at (0,3) (b) {B};
\node[mybox=orange] at (3,0) (c) {C};
\node[mybox=pink] at (5,3) (d) {D};
\draw[-latex] (a) -- (b);
\draw[-latex] (b) -- (c);
\draw[-latex] (c) -- (a);
\draw[-latex] (c) -- (d);
\node[fit=(a)(c), rounded rectangle, draw, inner sep=10pt] (fitnode) {};
% How to remove
\fill[white,fill opacity=.75] [even odd rule]
(current bounding box.south west) rectangle (current bounding box.north east)
(fitnode.south west) rectangle (fitnode.north east);
\end{tikzpicture}
\end{document}
NB: I want a precise border fit, not just an approximation of my node by a rectangle.



drawfrom the\nodecommand and put a\draw[restore spath=fit];after the last\fillcommand. – Andrew Stacey Apr 24 '18 at 20:48