// s : 2014.06.22 // 2014.08.26 debugged 1,-1 => "+","-" // 2014.09.07 Objjoin added // 2016.10.09 Np in Spacecurve changed function Out=Objcurve(varargin) global OBJFIGNO OBJJOIN Eps=10^(-6); Args=varargin; Nargs=length(Args) Tmp=Args(1); PtL=Flattenlist(Tmp); PL=list(); for J=1:length(PtL) Tmp=PtL(J); for K=1:size(Tmp,1) PL=lstcat(PL,list(Tmp(K,:))) end; end; Closed=norm(PL(length(PL))-PL(1))=2 then Sz=Args(2) end; if Nargs>=3 then Np=Args(3) end; Assign("Sz",Sz) if Pstr=="xy" then Vz=[0,0,1]; Fs=Assign("[Sz*cos(t),Sz*sin(t),0]") end; if Pstr=="yz" then Vz=[1,0,0]; Fs=Assign("[0,Sz*cos(t),Sz*sin(t)]") end; if Pstr=="zx" then Vz=[0,1,0]; Fs=Assign("[Sz*sin(t),0,Sz*cos(t)]") end; Gc0=Spacecurve(Fs,"t=[0,2*%pi]","N="+string(Np));//16.10.09 P=PL(1); Q=PL(2); R=PL(length(PL)-1); PQ1=Q-P; if ~Closed then PQ2=PQ1 else PQ2=P-R end; Vp=PQ1/norm(PQ1)+PQ2/norm(PQ2); Vp1=Vp/norm(Vp); Theta=acos(min(Dotprod(Vz,Vp1),1)); Vj=Crossprod(Vz,Vp1); if norm(Vj)