// 09.10.29 // 09.11.15 // 10.08.17 debug (line 66) function Menkakusi2(Face,Nf,Ptype) global THETA PHI EyePoint FocusPoint VELNO VELHI; Eps0=10^(-6); Eps=10^(-4); Tmp1=Face(1)-Face(2); Tmp2=Face(3)-Face(2); if norm(Tmp1)1-Eps // P3, Q3 are necessary Flg=I; break; end; if abs(Te-Ts)>Eps0 // if modulo(I,2)==1 Out1($+1)=list(Pe3,P3); else if Qe3==[] Tmp=Op(2,TenL(I-1)); if Ptype==-1 Tmp1=Invperspt(Tmp,Spaceline(Face)); else Tmp1=Invparapt(Tmp,Spaceline(Face)); end; Qe3=Tmp1(1); end; PM=0.5*(Pe3+P3); QM=0.5*(Qe3+Q3); if Ptype==-1 Z1=Zperspt(PM); Z2=Zperspt(QM); else Z1=Zparapt(PM); Z2=Zparapt(QM); end; if Z1>Z2 Out1($+1)=list(Pe3,P3); else Out2($+1)=list(Pe3,P3); end; end; end; Te=Ts; Pe3=P3; Qe3=Q3; end; if Flg==0 if norm(Pe3-Edge(2))>Eps0 Out1($+1)=list(Pe3,Edge(2)); end; else if modulo(Flg,2)==1 Out1($+1)=list(Pe3,Edge(2)); else PM=0.5*(Pe3+P3); QM=0.5*(Qe3+Q3); if Ptype==-1 Z1=Zperspt(PM); Z2=Zperspt(QM); else Z1=Zparapt(PM); Z2=Zparapt(QM); end; if Z1>Z2 Out1($+1)=list(Pe3,Edge(2)); else Out2($+1)=list(Pe3,Edge(2)); end; end; end; for I=1:length(Out1) Tmp=Out1(I); if I==1 SeL=Tmp; else if norm(SeL(2)-Tmp(1))0 Out1L($+1)=list(SeL,Ne,NNe); end; for I=1:length(Out2) Tmp=Out2(I); if I==1 SeL=Tmp; else if norm(SeL(2)-Tmp(1))0 Out2L($+1)=list(SeL,Ne,NNe); end; end; VELNO=Out1L; VELHI=Out2L; endfunction