答案1
您的任务没有现成的组件,但您可以轻松定义自己的组件。
pst-optexp
提供平面、曲线和路径接口(参见例如https://tex.stackexchange.com/a/209818/33933(这是一个高级示例)。
以下是主要步骤
使用 定义一个新组件
\newOptexpDipole{conicalmirror}
。您也可以使用\newOptxpTripole
。您的情况的不同之处仅在于您需要两个或三个节点进行定位。使用以下方式定义组件的实际外观
\def\conicalmirror@comp
\conicalmirror@nodes
使用定义内部的光学接口\newOptexpComp
。这里,我们使用PathIfc
,它将先前定义的任意路径作为使用 的接口pst-intersect
。
完整绘图:
\documentclass[margin=5pt]{standalone}
\usepackage[dvipsnames,svgnames,pdf]{pstricks}
\usepackage{auto-pst-pdf}
\usepackage{pst-optexp}
\SpecialCoor
\makeatletter
% Define a custom dipole command
\newOptexpDipole{conicalmirror}
%
% Define how the dipole component is drawn
\def\conicalmirror@comp{%
\pspolygon[fillstyle=solid,fillcolor=gray,linestyle=none](1,-1)(0,0)(1,1)(2,1)(2,-1)
\pspolygon[fillstyle=solid,fillcolor=green!50!black,linestyle=none]%
(1,-1)(1.1,-0.9)(0.2,0)(1.1,0.9)(1,1)(0,0)
}
% Define the optical interfaces of the component
\def\conicalmirror@nodes{%
% save the path, a triangle, which defines the optical interface
\pssavepath[linestyle=none]{\oenode@Path{A}}{%
\psline(1,-1)(0,0)(1,1)}
% define the optical interface for use to draw beams
\newOptexpComp{%
{0 0} tx@IntersectDict /\PIT@name{\oenode@Path{A}} get 0 0 refl {PathIfc} 1
}%
}%
\makeatother
\begin{document}
\begin{pspicture}(10,6)
\pnode(0,1){Input}
\pnode(5,1){Mirror}
\pnode(5,4){ConicalMirror}
\pnode(2,4){End1}
\pnode(8,4){End2}
\begin{optexp}
\lens[lens=3 3 2, n=1.6, compname=Lens](Input)(Mirror)
\newpsstyle{ExtendedMirror}{fillstyle=solid, fillcolor=green!50!black}
\mirror[mirrorwidth=3, linestyle=none, mirrordepth=0.1414, mirrortype=extended, compname=Mirror](Input)(Mirror)(ConicalMirror)
\conicalmirror[position=end, compname=ConicalMirror](Mirror)(ConicalMirror)
\optplate[position=end, plateheight=3, platelinewidth=0.3, compshift=-0.5, compname=End1](ConicalMirror)(End1)
\optplate[position=end, plateheight=3, platelinewidth=0.3, compshift=0.5, compname=End2](ConicalMirror)(End2)
%
% First, only draw the filled beam, otherwise the fillings overlap with boundary beams
\newpsstyle{Beam}{fillstyle=solid, fillcolor=red!10, linestyle=none}
\drawwidebeam[beamdiv=20, beamangle=-10.01](Input){Lens}{Mirror}{ConicalMirror}{End1}
\drawwidebeam[beamdiv=20, beamangle=10.01](Input){Lens}{Mirror}{ConicalMirror}{End2}
%
% now draw the boundary beams
\newpsstyle{Beam}{linecolor=red, linewidth=0.5\pslinewidth}
\drawbeam[beamangle=20](Input){Lens}{Mirror}{ConicalMirror}{End2}
\drawbeam[beamangle=0.01](Input){Lens}{Mirror}{ConicalMirror}{End2}
\drawbeam[beamangle=-0.01](Input){Lens}{Mirror}{ConicalMirror}{End1}
\drawbeam[beamangle=-20](Input){Lens}{Mirror}{ConicalMirror}{End1}
\end{optexp}
\end{pspicture}
\end{document}