![在圆圈外面添加图案(球面镜)](https://linux22.com/image/319830/%E5%9C%A8%E5%9C%86%E5%9C%88%E5%A4%96%E9%9D%A2%E6%B7%BB%E5%8A%A0%E5%9B%BE%E6%A1%88%EF%BC%88%E7%90%83%E9%9D%A2%E9%95%9C%EF%BC%89.png)
我想绘制一些基本的光学图形。我咨询过 pst-optics,但这个非常好的软件包对于我需要的图形来说太复杂了。
我的问题是:我想在圆的外面添加一个图案(平面镜也一样)。事实上我也需要在里面添加图案(几毫米),但我认为当我有第一个时,第二个也会类似。
\documentclass{article}
\usepackage{tkz-euclide}
\usetkzobj{all}
\newcommand{\midarrow}{\tikz \draw[-triangle 60] (0,0) -- +(.1,0);}
\begin{document}
\begin{center}
\begin{tikzpicture}
\tkzInit[ymin=0,ymax=5,xmin=0,xmax=10]
\tkzClip
%\tkzGrid
\tkzDefPoints{4/1/B, 2/1/C, 6/1/D, 6/0.8/F}
\tkzDefShiftPoint[B](135:4){A};
\draw (A)-- node[sloped] {\midarrow} (B);
\tkzDrawSegment[very thick](C,D);
\draw [fill,pattern=north east lines,draw=none] (C) rectangle (F);
\end{tikzpicture}
\end{center}
\begin{tikzpicture}
\tkzInit[ymin=0,ymax=8,xmin=0,xmax=14]
\tkzClip
%\tkzGrid
\tkzDefPoints{11/4/O, 1/4/S, 6/4/F}
\tkzDefCircle[radius](O,S)
\tkzDrawCircle(O,S)
\tkzDrawPoints(O,S,F)
\tkzLabelPoints(O,S,F)
\draw [->, very thick] (11,4) -- (11,6);
\draw [thick] (0,4) -- (18,4);
\end{tikzpicture}
\end{document}
答案1
这是一个选项:
\documentclass{article}
\usepackage{tkz-euclide}
\usetkzobj{all}
\newcommand{\midarrow}{\tikz \draw[-triangle 60] (0,0) -- +(.1,0);}
\begin{document}
\begin{center}
\begin{tikzpicture}
\tkzInit[ymin=0,ymax=5,xmin=0,xmax=10]
\tkzClip
%\tkzGrid
\tkzDefPoints{4/1/B, 2/1/C, 6/1/D, 6/0.8/F}
\tkzDefShiftPoint[B](135:4){A};
\draw (A)-- node[sloped] {\midarrow} (B);
\tkzDrawSegment[very thick](C,D);
\draw [fill,pattern=north east lines,draw=none] (C) rectangle (F);
\end{tikzpicture}
\end{center}
\begin{tikzpicture}
\tkzInit[ymin=0,ymax=8,xmin=0,xmax=14]
\tkzClip
%\tkzGrid
\tkzDefPoints{11/4/O, 1/4/S, 6/4/F, 8/4/V}
\tkzDefShiftPoint[V](90:2){VV};
\tkzDefCircle[radius](O,S)
\tkzGetLength{rOSpt}
\tkzpttocm(\rOSpt){rOScm}
\tkzDrawCircle(O,S)
\tkzDrawPoints(O,S,F)
\tkzLabelPoints(O,S,F)
\draw [->, thick] (V) -- (VV);
\tkzDrawLines[add= 0.1 and 0.2](O,S);
\fill[pattern=north east lines]
(S) arc[start angle=180,end angle=140,radius=\rOScm cm] --
++(-10pt,0pt) arc[start angle=140,end angle=220,radius=\rOScm cm] --
++(10pt,0pt) arc[start angle=220,end angle=180,radius=\rOScm cm];
\end{tikzpicture}
\end{document}
另一个选项是使用圆弧代替完整的剪裁圆:
\documentclass{article}
\usepackage{tkz-euclide}
\usetkzobj{all}
\newcommand{\midarrow}{\tikz \draw[-triangle 60] (0,0) -- +(.1,0);}
\begin{document}
\begin{center}
\begin{tikzpicture}
\tkzInit[ymin=0,ymax=5,xmin=0,xmax=10]
\tkzClip
%\tkzGrid
\tkzDefPoints{4/1/B, 2/1/C, 6/1/D, 6/0.8/F}
\tkzDefShiftPoint[B](135:4){A};
\draw (A)-- node[sloped] {\midarrow} (B);
\tkzDrawSegment[very thick](C,D);
\draw [fill,pattern=north east lines,draw=none] (C) rectangle (F);
\end{tikzpicture}
\end{center}
\begin{tikzpicture}
\def\StartAngle{150}
\def\EndAngle{210}
\tkzInit[ymin=0,ymax=8,xmin=0,xmax=14]
\tkzClip
%\tkzGrid
\tkzDefPoints{11/4/O, 1/4/S, 6/4/F, 8/4/V}
\tkzDefShiftPoint[V](90:2){VV};
\tkzDefCircle[radius](O,S)
\tkzGetLength{rOSpt}
\tkzpttocm(\rOSpt){rOScm}
% the two ends of the arc M is the upper end and N is the lower end
\tkzDefPoint[shift={(11,4)}](\StartAngle:\rOScm){M}
\tkzDefPoint[shift={(11,4)}](\EndAngle:\rOScm){N}
\tkzDrawArc(O,M)(N)
%\tkzDrawCircle(O,S)
\tkzDrawPoints(O,S,F)
\tkzLabelPoints(O,S,F)
\draw [->, thick] (V) -- (VV);
\tkzDrawLines[add= 0.1 and 0.2](O,S);
\fill[pattern=north east lines]
(M) --
++(-10pt,0pt) arc[start angle=\StartAngle,end angle=\EndAngle,radius=\rOScm cm] --
++(10pt,0pt) arc[start angle=\EndAngle,end angle=\StartAngle,radius=\rOScm cm] -- cycle;
\end{tikzpicture}
\end{document}