如何孵化这个区域

如何孵化这个区域

我想对矩形内部但椭圆外部的区域进行阴影处理。我尝试了以下方法,但椭圆的交叉点也得到了阴影。有什么建议吗?

\begin{pspicture*}(3.4,0)(11,4)
\pspolygon(4,3.4)(10,3.4)(10,0.4)(4,0.4)
\psellipse(6,2)(1.4142135623731025,1.)
\psellipse(8,2)(1.4142135623730998,1.)
\rput[tl](4.2,3){$A$}
\rput[tl](9.4,3){$B$}
\rput[tl](9.6,3.9){$U$}


\pscustom[fillstyle=hlines]{% 
    \pspolygon(4,3.4)(10,3.4)(10,0.4)(4,0.4)    
    \psellipse(6,2)(1.4142135623731025,1.)
    \psellipse(8,2)(1.4142135623731025,1.)
}
\end{pspicture*}

答案1

\begin{pspicture}(3.4,0)(11,4)
  \pspolygon[fillstyle=hlines](4,3.4)(10,3.4)(10,0.4)(4,0.4)
  \pscustom[fillstyle=solid]{\psellipse(6,2)(1.414,1.)\psellipse(8,2)(1.414,1.)}
  \rput*[tl](4.2,3){$A$}
  \rput*[tl](9.4,3){$B$}
  \rput[tl](9.7,3.9){$U$}   
\end{pspicture}

答案2

我这样解决了

\begin{pspicture*}(3.4,0)(11,4)
  \pspolygon[fillstyle=hlines](4,3.4)(10,3.4)(10,0.4)(4,0.4)
  \psellipse[fillstyle=solid](6,2)(1.414213562373,1.)
  \psellipse[fillstyle=solid](8,2)(1.414213562373,1.)
  \psellipse(6,2)(1.414213562373,1.)
      \rput[tl](4.2,3){$A$}
      \rput[tl](9.4,3){$B$}
      \rput[tl](9.7,3.9){$U$}   
\end{pspicture*}

相关内容