I have an issue with a reverse clipping on a 2D surface represented in a 3D space.
Although the reversed clipping is working, the cut part is not projected on a plane.
Here is the MWE:
\documentclass{standalone}
\usepackage{amsmath, amssymb}
\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{arrows,decorations.pathmorphing}
\usepackage{tikz-3dplot}
\usetikzlibrary{arrows}
\usetikzlibrary{calc}
\usetikzlibrary{shadings}
\tikzset{>=latex}
\tdplotsetmaincoords{70}{120}
%Cavity
\def \xcav {5}
\def \zcav {5}
\def \ycav {2}
\tikzset{
invclip/.style={clip,insert path={{[reset cm]
(-16383.99999pt,-16383.99999pt) rectangle (16383.99999pt,16383.99999pt)
}}}
}
\begin{document}
\begin{tikzpicture}
[
scale=1,
tdplot_main_coords
]
% Cavity
\draw (-\xcav/2,-\ycav,-\zcav/2) --++ (\xcav,0,0) --++ (0,0,\zcav) --++ (-\xcav,0,0) -- cycle;
\draw (-\xcav/2,-\ycav,-\zcav/2) --++ (0,\ycav,0) --++ (0,0,\zcav) --++ (0,-\ycav,0) -- cycle;
\draw (-\xcav/2,-\ycav,-\zcav/2) --++ (0,\ycav,0) --++ (\xcav,0,0) --++ (0,-\ycav,0) -- cycle;
\begin{scope}[canvas is xz plane at y=0]
\begin{pgfinterruptboundingbox} % useful to avoid the rectangle in the bounding box
\path[invclip](0,0) circle (0.25);
\end{pgfinterruptboundingbox}
\shadedraw[clip] (-\xcav/2,-\zcav/2) --++ (\xcav,0) --++ (0,\zcav) --++ (-\xcav,0) -- cycle;
\end{scope}
\draw (\xcav/2,-\ycav,-\zcav/2) --++ (0,\ycav,0) --++ (0,0,\zcav) --++ (0,-\ycav,0) -- cycle;
\draw (-\xcav/2,-\ycav,+\zcav/2) --++ (0,\ycav,0) --++ (\xcav,0,0) --++ (0,-\ycav,0) -- cycle;
\end{tikzpicture}
\end{document}
Any thoughts ?
reset cm
... what did you expect?invclip/.style={clip,insert path={{(-10,-10)rectangle(10,10)}}
.