\input fig4tex

% 1. Definition of characteristic points
\figinit{6cm, rea}
% Points defining the cube
\figpt 1:(0,0)
\figpttraC 2:=1/1,0,0/
\figpttraC 3:=1/1,1,0/
\figpttraC 4:=1/0,1,0/
\figvectC 10(0,0,1)\figptstra 5=1,2,3,4/1,10/
\figset write(ptname=$P_#1$)
% Points defining the plane
\figptbary 11:[6,7 ; 1,2]
\figptbary 12:[3,4 ; 1,1]
\figptbary 13:[1,5 ; 1,1]
% Three other intersections with the cube
\figvectN 100 [11,12,13]
\figvectP 101 [5,6]\figptinterlineplane 14 :[5,101; 11,100]
\figvectP 101 [1,4]\figptinterlineplane 15 :[1,101; 11,100]
\figvectP 101 [3,7]\figptinterlineplane 16 :[3,101; 11,100]
%
% 2. Creation of the graphical file
\figset projection(psi=-55, theta=30)
\figdrawbegin{}
\figdrawline[1,2,3]\figdrawline[5,6,7,8,5]
\figdrawline[1,5]\figdrawline[2,6]\figdrawline[3,7]
\figset(dash=4)\figdrawline[1,4,3]\figdrawline[4,8]
\figset(alpha=0.3,color=\Redrgb, filmode=yes)
\figdrawline[16,12,15,13,14,11,16]\figset(alpha=1, filmode=no)
\figset(width=1,color=\Redrgb)\figdrawline[16,12,15,13]
\figset(dash=1)\figdrawline[13,14,11,16]
\figdrawend
% 3. Writing text on the figure
\def\dist{2pt}
\figvisu{\figBoxA}{Intersection of a plane and a cube.}{
% Show vertices of the cube
\figwritesw 1:(\dist)\figwritese 2:(\dist)
\figwritee 3:(\dist)\figwritenw 4:(\dist)
\figwritenw 5:(\dist)\figwritese 6:(\dist)
\figwritene 7:(\dist)\figwritenw 8:(\dist)
% Show points defining the plane
\figset write(mark=$\bullet$)
\figwritep[11,12,13]
}
\centerline{\box\figBoxA}
\bye