First: I have also posted this question at the LaTeX Community a few days ago but I have not got any answer.
Consider the following MWE, illustrating rays of light coming from the Sun through the Oculus in the Pantheon, Rome:
\documentclass{article}
\usepackage{auto-pst-pdf,pst-eucl,pstricks-add}
\usepackage[locale=DE]{siunitx}
\usepackage{expl3}
\ExplSyntaxOn
\cs_new_eq:NN
\calculate
\fp_eval:n
\ExplSyntaxOff
\begin{document}
\def\radius{21.65 } % Radius of the dome
\def\vinkelA{12 } % Width of the Oculus
\def\vinkelB{71 } % Angle of the Sun's rays
\def\faktor{\calculate{1/3} }
\def\RelRadius{\calculate{\faktor*\radius} }
\def\vinkelC{\calculate{90-\vinkelA} }
\def\vinkelD{\calculate{90+\vinkelA} }
\def\vinkelE{\calculate{180+\vinkelC} }
\def\vinkelF{\calculate{180+\vinkelD} }
\def\vinkelG{\calculate{180-\vinkelB} }
\def\vinkelH{\calculate{180+\vinkelG} }
\begin{figure}
\centering
\begin{pspicture}(44,50)
\psset{unit=0.5cm,linecolor=red}
\pnode(0,0){A}
\pnode(!0 \RelRadius){B}
\pnode(!2 \RelRadius mul \RelRadius){C}
\pnode(!2 \RelRadius mul 0){D}
\pnode(!\RelRadius \RelRadius){E}
\psarc(E){\RelRadius}{0}{\vinkelC}
\psarc(E){\RelRadius}{\vinkelD}{180}
\psset{linestyle=none,linecolor=black,dotsep=2pt}
\psRelLine[angle=\vinkelF](E)(B){1}{P1}
\psRelLine[angle=\vinkelE](E)(B){1}{P2}
\psRelLine[angle=\vinkelG](P1)(P2){1}{L1}
\psRelLine[angle=\vinkelH,linestyle=dotted](P2)(P1){1}{L2}
\psRelLine[angle=\vinkelG](P2)(P1){1 \vinkelA cos add 2 \vinkelA sin mul \vinkelB sin mul div}{L3}
\psParallelLine(L2)(L3)(L1){1}{L4}
\pspolygon[fillstyle=solid,fillcolor=yellow](L1)(L2)(L3)(L4)
\pnode(!0 1 \vinkelA cos add \RelRadius mul){T1}
\pnode(!2 \RelRadius mul 1 \vinkelA cos add \RelRadius mul){T2}
\pcline[linestyle=dotted](T1)(T2)
\pstMarkAngle[linestyle=solid,MarkAngleRadius=0.8,LabelSep=1.5,arrows=<->]{L2}{P2}{T1}{\footnotesize{\SI{\vinkelB}{\degree}}}
\psline[linestyle=solid,linecolor=red](C)(D)(A)(B)
\end{pspicture}
\end{figure}
\end{document}
I would like to cut off the yellow parallelogram if it reaches the left or right, vertical part of the closed red curve, i.e., if the rays of light hit the walls. How do I do this?
P.S. I have no experience at all using TikZ, so if I am to understand a possible answer, TikZ is not the way to go. That said, I will not mind a TikZ answer but then the code has to be complete enough for me to copy directly.





