![是否可以用纯色填充(A 联合 B 联合 C)的补集,但其余区域保持透明?](https://linux22.com/image/253915/%E6%98%AF%E5%90%A6%E5%8F%AF%E4%BB%A5%E7%94%A8%E7%BA%AF%E8%89%B2%E5%A1%AB%E5%85%85%EF%BC%88A%20%E8%81%94%E5%90%88%20B%20%E8%81%94%E5%90%88%20C%EF%BC%89%E7%9A%84%E8%A1%A5%E9%9B%86%EF%BC%8C%E4%BD%86%E5%85%B6%E4%BD%99%E5%8C%BA%E5%9F%9F%E4%BF%9D%E6%8C%81%E9%80%8F%E6%98%8E%EF%BC%9F.png)
请忽略二进制数。
如果不提前找到交点,是否可以用纯色填充(A 并集 B 并集 C)的补集,而其余区域保持透明?
答案1
使用中描述的方法如何在 TikZ 中反转“剪辑”选择?:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\tikzstyle{reverseclip}=[insert path={(current page.north east) --
(current page.south east) --
(current page.south west) --
(current page.north west) --
(current page.north east)}
]
\begin{tikzpicture}[remember picture]
\draw [gray!20, ultra thick] (-3,-3) grid (3,3);
\begin{pgfinterruptboundingbox}
\path [clip] (90:0.7cm) circle [radius=1cm] [reverseclip];
\path [clip] (-30:0.7cm) circle [radius=1cm] [reverseclip];
\path [clip] (210:0.7cm) circle [radius=1cm] [reverseclip];
\end{pgfinterruptboundingbox}
\fill [orange] (-2,-2) rectangle (2,2);
\end{tikzpicture}
\end{document}
答案2
需要最新pstricks.tex
的http://texnik.dante.de/tex/generic/pstricks/几天后将在 CTAN 上线
\documentclass{minimal}
\usepackage{pstricks}\SpecialCoor
\begin{document}
\begin{pspicture}(-3,-3)(3,3)\psgrid[gridlabels=0pt]
\pscustom[linestyle=none]{%
\pspolygon(-2,-2)(-2,2)(2,2)(2,-2)
\moveto(0.7;90)\rmoveto(1,0)\pscircle(0.7;90){1}
\moveto(0.7;-30)\rmoveto(1,0)\pscircle(0.7;-30){1}
\moveto(0.7;210)\rmoveto(1,0)\pscircle(0.7;210){1}
\closepath
\code{eoclip}
\pspolygon(-2,-2)(-2,2)(2,2)(2,-2)
\fill[fillcolor=blue!60,fillstyle=solid,linestyle=none]}
\end{pspicture}
\end{document}
但圆圈处仍有一些小线条: