如何对与两条线段相交的椭圆中的区域进行交叉影线?

如何对与两条线段相交的椭圆中的区域进行交叉影线?

我的朋友们,我想画一张这样的画:

椭圆

我的 MWE 在这里:

\documentclass[12pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\usepackage{mathrsfs}
\usetikzlibrary{arrows}
\pagestyle{empty}
 
\usetikzlibrary[patterns]

\begin{document}

\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]
\clip(-4.3,-11.42) rectangle (21.78,6.3);
\fill[line width=2.8pt,color=black,fill=black,pattern=north east lines,pattern color=white] (4.,-1.) -- (4.,-7.) -- (16.,-7.) -- (16.,-1.) -- cycle;
\draw [line width=2.8pt,color=black] (4.,-1.)-- (4.,-7.);
\draw [line width=2.8pt,color=black] (4.,-7.)-- (16.,-7.);
\draw [line width=2.8pt,color=black] (16.,-7.)-- (16.,-1.);
\draw [line width=2.8pt,color=black] (16.,-1.)-- (4.,-1.);
\draw [rotate around={0.:(10.,-4.)},line width=2.pt] (10.,-4.) ellipse (3.7022649707724398cm and 2.169508219345722cm);
\draw [line width=2.pt] (8.,-1.)-- (8.,-7.);
\draw [line width=2.pt] (12.,-7.)-- (12.,-1.);
\draw [line width=2.pt] (4.,-1.)-- (4.,-7.);
\draw [line width=2.pt] (4.,-7.)-- (16.,-7.);
\draw [line width=2.pt] (16.,-7.)-- (16.,-1.);
\draw [line width=2.pt] (16.,-1.)-- (4.,-1.);
\draw (5.5,-0.04) node[anchor=north west] {$B_1$};
\draw (9.62,-0.04) node[anchor=north west] {$B_2$};
\draw (13.88,-0.04) node[anchor=north west] {$B_3$};
\draw (15.35,-1) node[anchor=north west] {$\Omega$};
\begin{scriptsize}
\draw [fill=black] (4.,-1.) circle (2.5pt);
\draw [fill=black] (4.,-7.) circle (2.5pt);
\draw [fill=black] (16.,-7.) circle (2.5pt);
\draw [fill=black] (16.,-1.) circle (2.5pt);
\draw [fill=black] (8.,-1.) circle (2.0pt);
\draw [fill=black] (8.,-7.) circle (2.0pt);
\draw [fill=black] (12.,-7.) circle (2.0pt);
\draw [fill=black] (12.,-1.) circle (2.0pt);
\end{scriptsize}
\end{tikzpicture}

\end{document}

其结果如下:

椭圆形无交叉影线

有人能帮我画十字线吗?提前谢谢了!

答案1

\documentclass[12pt]{standalone}
%\usepackage{pgfplots}
%\pgfplotsset{compat=1.18}
\usepackage{tikz}
%\usepackage{mathrsfs}
\usetikzlibrary{arrows}
%\pagestyle{empty}
 
\usetikzlibrary{patterns.meta}

\begin{document}

\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]
%\clip(-4.3,-11.42) rectangle (21.78,6.3);
%\fill[line width=2.8pt,color=black,fill=black,pattern=north east lines,pattern color=white] (4.,-1.) -- (4.,-7.) -- (16.,-7.) -- (16.,-1.) -- cycle;
\draw [line width=2.8pt,color=black] (4.,-1.)-- (4.,-7.);
\draw [line width=2.8pt,color=black] (4.,-7.)-- (16.,-7.);
\draw [line width=2.8pt,color=black] (16.,-7.)-- (16.,-1.);
\draw [line width=2.8pt,color=black] (16.,-1.)-- (4.,-1.);
\begin{scope}
\clip (4,-1)rectangle(8,-7);
\draw [pattern={Lines[angle=-45,distance=6pt,line width=1pt]},rotate around={0.:(10.,-4.)},line width=2.pt] (10.,-4.) ellipse (3.7022649707724398cm and 2.169508219345722cm);
\end{scope}
\begin{scope}
\clip (8,-1)rectangle(12,-7);
\draw [pattern={Lines[angle=45,distance=6pt,line width=1pt]},rotate around={0.:(10.,-4.)},line width=2.pt] (10.,-4.) ellipse (3.7022649707724398cm and 2.169508219345722cm);
\end{scope}
\begin{scope}
\clip (12,-1)rectangle(16,-7);
\draw [pattern={Lines[angle=-45,distance=6pt,line width=1pt]},rotate around={0.:(10.,-4.)},line width=2.pt] (10.,-4.) ellipse (3.7022649707724398cm and 2.169508219345722cm);
\end{scope}
\draw [line width=2.pt] (8.,-1.)-- (8.,-7.);
\draw [line width=2.pt] (12.,-7.)-- (12.,-1.);
%\draw [line width=2.pt] (4.,-1.)-- (4.,-7.);
%\draw [line width=2.pt] (4.,-7.)-- (16.,-7.);
%\draw [line width=2.pt] (16.,-7.)-- (16.,-1.);
%\draw [line width=2.pt] (16.,-1.)-- (4.,-1.);
\draw (5.5,-0.04) node[anchor=north west] {$B_1$};
\draw (9.62,-0.04) node[anchor=north west] {$B_2$};
\draw (13.88,-0.04) node[anchor=north west] {$B_3$};
\draw (15.35,-1) node[anchor=north west] {$\Omega$};
\begin{scriptsize}
\draw [fill=black] (4.,-1.) circle (2.5pt);
\draw [fill=black] (4.,-7.) circle (2.5pt);
\draw [fill=black] (16.,-7.) circle (2.5pt);
\draw [fill=black] (16.,-1.) circle (2.5pt);
\draw [fill=black] (8.,-1.) circle (2.0pt);
\draw [fill=black] (8.,-7.) circle (2.0pt);
\draw [fill=black] (12.,-7.) circle (2.0pt);
\draw [fill=black] (12.,-1.) circle (2.0pt);
\end{scriptsize}
\end{tikzpicture}

\end{document}

一些增强...

\documentclass[12pt]{standalone}
%\usepackage{pgfplots}
%\pgfplotsset{compat=1.18}
\usepackage{tikz}
%\usepackage{mathrsfs}
\usetikzlibrary{arrows}
%\pagestyle{empty}
 
\usetikzlibrary{patterns.meta}

\begin{document}

\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45]

\coordinate(A1) at(4,-1);
\coordinate(A2) at(8,-1);
\coordinate(A3) at(12,-1);
\coordinate(A4) at(16,-1);

\coordinate(C1) at(4,-7);
\coordinate(C2) at(8,-7);
\coordinate(C3) at(12,-7);
\coordinate(C4) at(16,-7);

\begin{scope}[line width=2.8pt,color=black] 
\draw (A1) rectangle (C4);
\draw [save path=\ellipse] (10.,-4.) ellipse (3.70cm and 2.17cm);

\begin{scope}[line width=1pt]
\clip (A1)rectangle(C2);
\path[pattern={Lines[angle=-45,distance=6pt,line width=1pt]}] [use path=\ellipse];
\end{scope}
\begin{scope}
\clip (A2)rectangle(C3);
\path [pattern={Lines[angle=45,distance=6pt,line width=1pt]}] [use path=\ellipse];
\end{scope}
\begin{scope}
\clip (A3)rectangle(C4);
\path [pattern={Lines[angle=-45,distance=6pt,line width=1pt]}] [use path=\ellipse];
\end{scope}
\draw (A2)-- (C2);
\draw (A3)-- (C3);
\end{scope}
\path[every node/.style={above=3mm}](A1)--node{$B_1$}
                (A2)--node{$B_2$}
                (A3)--node{$B_3$}(A4);
                
\draw (A4) node[anchor=north east] {$\Omega$};

\foreach \i in{A,C}{
\foreach \j in{1,4}{
\filldraw(\i\j)circle[radius=2.5pt];}
\foreach \j in{2,3}{
\filldraw(\i\j)circle[radius=2pt];}}


\end{tikzpicture}

\end{document}

在此处输入图片描述

相关内容