a=-1;b=0.5;de=4;
e=b*Sqrt[(1+a/b/de)/(-1-b/a*de)]
d=de*e
c=Sqrt[a^2+d^2-b^2-e^2]
pmatrix={{a,0,d},{b,c,e}}

O2={6,3.4};
Header="#FIG 3.2  Produced by xfig version 3.2.5c\nLandscape\nCenter\nMetric\nA4\n100.00\nSingle\n-2\n1200 2\n";

Makeline[l_]:=Module[{head,tstr},head="2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 ";
head<>ToString[Length[l]]<>"\n"<>StringJoin @@Map[("\t "<>ToString[Round[#[[1]]]]<>" "<>ToString[Round[#[[2]]]]<>"\n")&,450*l]]

Openfig[name_]:=Module[{s},s=OpenWrite[name];WriteString[s,Header];s]

Writeline[s_,l_]:=WriteString[s,Makeline[l]];
Write3Dline[s_,l_]:=Module[{l2},l2=Map[(O2+pmatrix.#)&,l];Writeline[s,l2]]

s=Openfig["testfigure.fig"];
(*Writeline[s,{{1,2},{3,4}}]; *)
A=.8; R=1.8;R2=.32; R3=.45;ds=-3.2;
phi1=40; phi2=50;
(*Write3Dline[s,{{0,0,-R},{0,0,R}}] *)
Write3Dline[s,{{-R,0,0},{R,0,0}}]
Write3Dline[s,{{0,-R,0},{0,R,0}}]
Write3Dline[s,{{A,A,ds},{A,-A,ds},{-A,-A,ds},{-A,A,ds}}]
M=40;
c1=Table[{R*Cos[i/M*2*Pi],R*Sin[i/M*2*Pi],0},{i,0,M}];
c2=Table[{R*Cos[i/M*2*Pi],0,R*Sin[i/M*2*Pi]},{i,0,M}];
c3=Table[{0,R*Cos[i/M*2*Pi],R*Sin[i/M*2*Pi]},{i,0,M}];
c4=Table[{R2*Cos[i/M*2*Pi],R2*Sin[i/M*2*Pi],ds},{i,0,M}];
Write3Dline[s,c1];Write3Dline[s,c2];Write3Dline[s,c3];(* Write3Dline[s,c4]; *)
Write3Dline[s,{{0,0,-4},{0,0,3}}]
r5a=R*Sin[phi1*Pi/180]; z5a=R*Cos[phi1*Pi/180];
r5b=R*Sin[phi2*Pi/180]; z5b=R*Cos[phi2*Pi/180];
pt=Table[{{r5a*Cos[i/M*2*Pi],r5a*Sin[i/M*2*Pi],z5a},{r5a*Cos[(i+1)/M*2*Pi],r5a*Sin[(i+1)/M*2*Pi],z5a},{r5b*Cos[(i+1)/M*2*Pi],r5b*Sin[(i+1)/M*2*Pi],z5b},{r5b*Cos[i/M*2*Pi],r5b*Sin[i/M*2*Pi],z5b},{r5a*Cos[i/M*2*Pi],r5a*Sin[i/M*2*Pi],z5a}},{i,0,M-1}];
Map[Write3Dline[s,#]&,pt];

r5a=R2; r5b=R3;z5a=ds; z5b=ds;
pt=Table[{{r5a*Cos[i/M*2*Pi],r5a*Sin[i/M*2*Pi],z5a},{r5a*Cos[(i+1)/M*2*Pi],r5a*Sin[(i+1)/M*2*Pi],z5a},{r5b*Cos[(i+1)/M*2*Pi],r5b*Sin[(i+1)/M*2*Pi],z5b},{r5b*Cos[i/M*2*Pi],r5b*Sin[i/M*2*Pi],z5b},{r5a*Cos[i/M*2*Pi],r5a*Sin[i/M*2*Pi],z5a}},{i,0,M-1}];
Map[Write3Dline[s,#]&,pt];

Write3Dline[s,{{-A,0,ds},{A,0,ds}}]
Write3Dline[s,{{0,0,ds},{0,-A,ds}}]
(*r5=R*Sin[60*Pi/180]; z5=R*Cos[60*Pi/180];
c5=Table[{r5*Cos[i/M*2*Pi],r5*Sin[i/M*2*Pi],z5},{i,0,M}];
Write3Dline[s,c5]; *)

Close[s];

solid angle demo

s=Openfig["testfigure2.fig"];
(*Writeline[s,{{1,2},{3,4}}]; *)
A=.8; R=1.8;R2=.32; R3=.45;ds=-3.2;
phi1=40; phi2=50;
Write3Dline[s,{{0,0,-R},{0,0,R}}] 
Write3Dline[s,{{-R,0,0},{R,0,0}}]
Write3Dline[s,{{0,-1.5R,0},{0,1.5R,0}}]

M=40;
c1=Table[{R*Cos[i/M*2*Pi],R*Sin[i/M*2*Pi],0},{i,0,M}];
c2=Table[{R*Cos[i/M*2*Pi],0,R*Sin[i/M*2*Pi]},{i,0,M}];
c3=Table[{0,R*Cos[i/M*2*Pi],R*Sin[i/M*2*Pi]},{i,0,M}];
c4=Table[{R2*Cos[i/M*2*Pi],R2*Sin[i/M*2*Pi],ds},{i,0,M}];
Write3Dline[s,c1];Write3Dline[s,c2];Write3Dline[s,c3];(* Write3Dline[s,c4]; *)
M=360;
r5a=R*Sin[phi1*Pi/180]; z5a=-R*Cos[phi1*Pi/180];
r5b=R*Sin[phi2*Pi/180]; z5b=-R*Cos[phi2*Pi/180];
p1=Table[{r5a*Cos[i/M*2*Pi],z5a,r5a*Sin[i/M*2*Pi]},{i,60,70}];
p2=Table[{r5b*Cos[i/M*2*Pi],z5b,r5b*Sin[i/M*2*Pi]},{i,70,60,-1}];
Write3Dline[s,Join[p1,p2,{p1[[1]]}]];
q1=(r5a+r5b)/2*{Cos[65/180*Pi],0,Sin[65/180*Pi]};
q2={(r5a+r5b)/2*Cos[65/180*Pi],(z5b+z5a)/2,(r5a+r5b)/2*Sin[65/180*Pi]};
q3={0,0,0};
Write3Dline[s,{q3,q1}];Write3Dline[s,{q3,q2}];Write3Dline[s,{q2,q1}];


(*r5=R*Sin[60*Pi/180]; z5=R*Cos[60*Pi/180];
c5=Table[{r5*Cos[i/M*2*Pi],r5*Sin[i/M*2*Pi],z5},{i,0,M}];
Write3Dline[s,c5]; *)

Close[s];

tangentialplane  demo

s=Openfig["testfigure3.fig"];
(*Writeline[s,{{1,2},{3,4}}]; *)
A=.8; R=1.8;R2=.32; R3=.45;ds=-3.2;
phi1=30; phi2=45;
Write3Dline[s,{{0,0,-R},{0,0,R}}] 
Write3Dline[s,{{-R,0,0},{R,0,0}}]
Write3Dline[s,{{0,-1.5R,0},{0,1.5R,0}}]

M=40;
c1=Table[{R*Cos[i/M*2*Pi],R*Sin[i/M*2*Pi],0},{i,0,M}];
c2=Table[{R*Cos[i/M*2*Pi],0,R*Sin[i/M*2*Pi]},{i,0,M}];
c3=Table[{0,R*Cos[i/M*2*Pi],R*Sin[i/M*2*Pi]},{i,0,M}];
c4=Table[{R2*Cos[i/M*2*Pi],R2*Sin[i/M*2*Pi],ds},{i,0,M}];
Write3Dline[s,c1];Write3Dline[s,c2];Write3Dline[s,c3];(* Write3Dline[s,c4]; *)
M=360;
r5a=R*Sin[phi1*Pi/180]; z5a=-R*Cos[phi1*Pi/180];
r5b=R*Sin[phi2*Pi/180]; z5b=-R*Cos[phi2*Pi/180];
p1=Table[{r5a*Cos[i/M*2*Pi],z5a,r5a*Sin[i/M*2*Pi]},{i,45,70}];
p2=Table[{r5b*Cos[i/M*2*Pi],z5b,r5b*Sin[i/M*2*Pi]},{i,70,45,-1}];
Write3Dline[s,Join[p1,p2,{p1[[1]]}]];
(*q1=(r5a+r5b)/2*{Cos[65/180*Pi],0,Sin[65/180*Pi]};
q2={(r5a+r5b)/2*Cos[65/180*Pi],(z5b+z5a)/2,(r5a+r5b)/2*Sin[65/180*Pi]};
q3={0,0,0};
Write3Dline[s,{q3,q1}];Write3Dline[s,{q3,q2}];Write3Dline[s,{q2,q1}]; *)


(*r5=R*Sin[60*Pi/180]; z5=R*Cos[60*Pi/180];
c5=Table[{r5*Cos[i/M*2*Pi],r5*Sin[i/M*2*Pi],z5},{i,0,M}];
Write3Dline[s,c5]; *)

Close[s];