diff options
author | Norbert Preining <preining@logic.at> | 2018-06-14 06:17:13 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2018-06-14 06:17:13 +0000 |
commit | 5c25b51ce087f0f8464448ac3ad03f16c16b35be (patch) | |
tree | ae3fe9521878d9807dff023b0e75a3cd2355bf40 /Master/texmf-dist/scripts/ketcindy/ketlib | |
parent | 4d4bd63ff233db4e2269bde8909633cc914d38f8 (diff) |
ketcindy 20180614.2
git-svn-id: svn://tug.org/texlive/trunk@48014 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/ketcindy/ketlib')
18 files changed, 2565 insertions, 1049 deletions
diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dhelpE.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dhelpE.txt index 27b40955e62..27b40955e62 100644..100755 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dhelpE.txt +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dhelpE.txt diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dhelpJ.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dhelpJ.txt index bd29d25ff24..2d33176d4e7 100644..100755 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dhelpJ.txt +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dhelpJ.txt @@ -36,7 +36,6 @@ //help:Concatobj*(いくつかのobjデータを結合); //help:Crvsfparadata*(曲線の曲面による陰線処理); //help:Intersectcrvsf*(曲線と曲面の交点を求める); -//help:Intersectcrvsf*(曲線と曲面の交点を求める); //help:Sfbdparaparadata*(空間曲面の陰線処理); //help:Wireparadata*(曲面のワイヤフレームを陰線処理); //help:Dist3d*(空間の2点の距離); diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dlogr.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dlogr.txt index 55b2fc71c23..7dcdd198e91 100644 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dlogr.txt +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dlogr.txt @@ -1,3 +1,44 @@ +// 20180614 +// Setangle changed (for angle list) +// 20180613 +// Getangle changed ("Disp=y" options added ) +// 20180608 +// Xyzaxparaname changed ( former names deleted ) +// Projpara changed (default: Msg=no ) +// Start3d changed ( Setfiles(Namecdy) added ) +// 20180607 +// Getangle debugged (output) +// 20180606 +// Start3d changed (ADDPACK ) +// 20180603 +// Projpara,... changed (KCOLOR) +// 20180602 +// divoptions ( 8,9 ->length(tmp)-1,length(tmp)) +// Projara,... changed (color supported ) +// Rotatedata3d,Translatedatad3 changed ( Level of RSform to 1) +// Changestyle3d changed ( for case where name not found) +// 20180601 +// Start3d changed (CutFunList, EraseList added) +// 20180531 +// Start3d changed (CommandListC added) +// ExeccmdC added +// SfbdparadataC,CrvsfparadataC,... changed ( for "c" option) +// 20180522 +// Sfbdparadata debugged ( "Proj" ) +// 20180517 +// Isangle(isAngle),Getangle added +// kcC changed ( "resultC" => "end") +// 20180510 +// Wireparadata,Sfcutparadata debugged +// 20180509 +// Sfbdparadata,... changed ( name2,name2h removed) +// Crvsfparadata renamed to Crv3sfparadata +// Crvs3fparadata, changed ( Proj from GLIST removed) +// 20180508 +// Sfbdparadata,... changed ( to Projpara(name3) ) +// 20180426 +// Sfbdparadata,... changed (.dat => .Rdata ) +// WriteCdata,ReadCdata => WritedataC,ReaddataC // 2018.03.27 // Start3d changed (for C) // 2018.02.27 diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dr.cs b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dr.cs index ce7a65f1074..ffb4798b846 100644 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dr.cs +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dr.cs @@ -14,7 +14,7 @@ // along with this program. If not, see <http://www.gnu.org/licenses/> // -println("ketcindylib3d(20180327) loaded"); +println("ketcindylib3d(20180614) loaded"); //help:start(); @@ -85,9 +85,13 @@ Start3d(ptexception):=( //help:Start3d(execptionptlist); regional(xmn,xMx,ymn,yMx,pt,pt3,pt2, xPos,yTh,yPh,Eps,tmp,tmp1,tmp2,tmp3,tmp4); + Setfiles(Namecdy); //180608 ConstantListC=[[50,50],[5000,1500,500,200],[0.00001,0.01,0.1]]; FuncListC=[]; - CommandListC=[]; + CommandListC=[]; //180531 + CutFunList=[];//180601 + EraseList=[];//180601 + ADDPACK=[]; //180606 GCLIST=[]; GLIST=[]; FUNLIST=[]; @@ -206,6 +210,7 @@ Start3d(ptexception):=( Ptseg3data(ptexception); //16.08.23 ); +Setangle(angL):=Setangle(ang_1,ang_2);//180614 Setangle(theta,phi):=( //16.12.24 //help:Setangle(60,30); regional(xmn,xMx,ymn,yMx,pt,pt3,pt2, @@ -278,6 +283,28 @@ Setangle(theta,phi):=( //16.12.24 Ptseg3data(ptexception); ); +Getangle():=getangle(["Disp=y"]); //180613from +Getangle(option):=( + regional(tmp,tmp1,dispflg,eqL); + tmp=divoptions(option); + dispflg="N"; + eqL=tmp_7; + forall(eqL, + if(Toupper(#_1)=="DISP", + dispflg=Toupper(#_1); + dispflg=substring(dispflg,0,1); + ); + ); + tmp=[THETA*180/pi, PHI*180/pi]; + if(dispflg=="Y", + println(textformat(tmp,6)); + ); + tmp; //180607 +); //180613to + +isAngle():=Isangle(); //180517 +Isangle():=isselected(TH)%isselected(FI); //180517 + Changestyle3d(nameL,style):=( //help:Changestyle3d(["geoseg3d","ax3d"],["notex"]); regional(nmL,name,tmp,tmp1,tmp2); @@ -285,15 +312,17 @@ Changestyle3d(nameL,style):=( tmp1=[]; forall(nmL,name, tmp=parse(name); - if(isstring(tmp_1), - tmp1=concat(tmp1,tmp); - , - tmp1=append(tmp1,name); + if(islist(tmp), + if(isstring(tmp_1), + tmp1=concat(tmp1,tmp); + , + tmp1=append(tmp1,name); + ); + tmp=apply(tmp1,replace(#,"3d","2d")); + Changestyle(tmp,style); + tmp=apply(tmp,"sub"+#); // 15.05.24 + Changestyle(tmp,style); ); - tmp=apply(tmp1,replace(#,"3d","2d")); - Changestyle(tmp,style); - tmp=apply(tmp,"sub"+#); // 15.05.24 - Changestyle(tmp,style); ); ); @@ -421,16 +450,30 @@ ProjCurve(crv):=( ); Projpara(ptdata):=Projpara(ptdata,[]); -Projpara(ptdata,options):=( - regional(name2,name3,Ltype,Noflg,opcindy,dtL,ptL,tmp,Out); +Projpara(ptdata,optionsorg):=( +//help:Projpara("sf3d1"); +//help:Projpara(options=["Msg=no"]); + regional(options,name2,name3,Ltype,Noflg,eqL,opcindy, + dtL,ptL,tmp,tmp1,Out,color,msgflg); + options=optionsorg; tmp=Divoptions(options); Ltype=tmp_1; Noflg=tmp_2; + eqL=tmp_5; + color=tmp_(length(tmp)-2); opcindy=tmp_(length(tmp)); - if(islist(ptdata),dtL=ptdata,dtL=[ptdata]); + msgflg=0; //180602from + forall(eqL, + tmp=Strsplit(#,"="); + if(Toupper(tmp_1)=="MSG", + tmp=substring(tmp_2,0,1); + if(Toupper(tmp)=="Y", msgflg=1); + options=remove(options,[#]); + ); + );//180602to Out=[]; + if(islist(ptdata),dtL=ptdata,dtL=[ptdata]); forall(dtL,name3, -// name3=#; if(indexof(name3,"3d")>0, //17.05.24 name2=replace(name3,"3d","2d"); , @@ -443,7 +486,9 @@ Projpara(ptdata,options):=( ); Out=append(Out,ptL); if(Noflg<3, - println("generate projparadata "+name2); + if(msgflg==1,//180602from + println("generate projparadata "+name2); + );//180602to tmp=name2+"="+textformat(ptL,5); parse(tmp); tmp=name2+"=Projpara("+name3+")"; @@ -451,15 +496,16 @@ Projpara(ptdata,options):=( ); if(Noflg<2, if(isstring(Ltype), + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); Ltype=GetLinestyle(text(Noflg)+Ltype,name2); + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); , if(Noflg==1,Ltype=0); ); - GCLIST=append(GCLIST,[name2,Ltype,opcindy]); + GCLIST=append(GCLIST,[name2,Ltype,opcindy]); ); ); if(length(Out)==1,Out=Out_1); -// Out=Flattenlist(Out); if(length(Out)==1,Out=Out_1); // 15.02.24 tmp=[]; forall(Out, @@ -562,7 +608,7 @@ Spaceline(nm,ptlistorg,optionorg):=( //help:Spaceline("1",[[2,5,1],[4,2,3]]); //help:Spaceline([A,B]); regional(name2,name3,options,Out,tmp,tmp1,tmp2, - opstr,opcindy,Ltype,Noflg,eqL,ptlist, Msg); + opstr,opcindy,Ltype,Noflg,eqL,ptlist, Msg,color); ptlist=apply(ptlistorg,if(ispoint(#),parse(text(#)+"3d"),#)); // 16.02.10 if(substring(nm,0,2)=="bz", name2=replace(nm,"bz","bz2d"); @@ -582,6 +628,7 @@ Spaceline(nm,ptlistorg,optionorg):=( Ltype=tmp_1; Noflg=tmp_2; eqL=tmp_5; + color=tmp_(length(tmp)-2); opcindy=tmp_(length(tmp)); Msg=1; forall(eqL, @@ -620,7 +667,9 @@ Spaceline(nm,ptlistorg,optionorg):=( ); if(Noflg<2, if(isstring(Ltype), - Ltype=GetLinestyle(text(Noflg)+Ltype,name2); + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); + Ltype=GetLinestyle(text(Noflg)+Ltype,name2); + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); , if(Noflg==1,Ltype=0); ); @@ -636,7 +685,7 @@ Spacecurve(nm,funstr,variable):=Spacecurve(nm,funstr,variable,[]); Spacecurve(nm,funstr,variable,optionorg):=( //help:Spacecurve("1","[cos(t),sin(t),0.5*t]","t=[0,4*pi]",["Num=200"]); regional(name2,name3,options,Out,tmp,tmp1,tmp2,vname,tmpfn,str,Rng,Num,Msg, - Ec,Exfun,Dc,opstr,opcindy,Fntmp,Vatmp,Ltype,Noflg,eqL,t1,t2,dt,tt,pa,ke); + Ec,Exfun,Dc,opstr,opcindy,Fntmp,Vatmp,Ltype,Noflg,eqL,t1,t2,dt,tt,pa,ke,color); if(substring(nm,0,2)=="bz", name2=replace(nm,"bz","bz2d"); name3=replace(nm,"bz","bz3d"); @@ -654,6 +703,7 @@ Spacecurve(nm,funstr,variable,optionorg):=( Ltype=tmp_1; Noflg=tmp_2; eqL=tmp_5; + color=tmp_(length(tmp)-2); opstr=tmp_(length(tmp)-1); opcindy=tmp_(length(tmp)); Msg=1; @@ -778,7 +828,9 @@ Spacecurve(nm,funstr,variable,optionorg):=( ); if(Noflg<2, if(isstring(Ltype), + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); Ltype=GetLinestyle(text(Noflg)+Ltype,name2); + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); , if(Noflg==1,Ltype=0); ); @@ -826,7 +878,7 @@ Partcrv3d(nm,pA,pB,PkLstr,options):=( dt1=partcrv("",p1,p2,tmp,["nodata"]); dts=partcrv("",q1,q2,"sub"+tmp,["nodata"]); dt=apply(1..length(dt1), - Xyzcoord(dt1_#_1,dt1_#_2,dts_#_2)); + Xyzcoord(dt1_#_1,dt1_#_2,dts_#_2)); Spaceline("-part3d"+nm,dt,options); ); @@ -834,7 +886,7 @@ Joincrvs3d(nm,plotstrL):=Joincrvs3d(nm,plotstrL,[]);//16.10.06 Joincrvs3d(nm,plotstrL,options):=( //help:Joincrvs3d("1",["bz3da1","bz3da1"]); regional(PtL,Eps,QdL,Flg,Ni,Qd,pP,pS,pQ,pR,rMN, - opcindy,tmp,tmp1,tmp2,str,name2,name3,Ltype,Noflg); + opcindy,tmp,tmp1,tmp2,str,name2,name3,Ltype,Noflg,color); name2="join2d"+nm; name3="join3d"+nm; QdL=[]; @@ -850,6 +902,7 @@ Joincrvs3d(nm,plotstrL,options):=( tmp=Divoptions(options); Ltype=tmp_1; Noflg=tmp_2; + color=tmp_(length(tmp)-2); opcindy=tmp_(length(tmp)); tmp1=tmp_6; if(length(tmp1)>0,Eps=tmp1_1); @@ -905,7 +958,9 @@ Joincrvs3d(nm,plotstrL,options):=( ); if(Noflg<2, if(isstring(Ltype), + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); Ltype=GetLinestyle(text(Noflg)+Ltype,name2); + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); , if(Noflg==1,Ltype=0); ); @@ -926,7 +981,7 @@ Xyzax3data(nm,Xrange,Yrange,Zrange,options):=( //help:Xyzax3data("","x=[-5,5]","y=[-5,5]","z=[-5,5]"); //help:Xyzax3data(Options2=["a1","Osw"]); regional(name2,name3,Out,tmp,tmp1,tmp2,eqL,reL,strL, - opstr,opcindy,Ltype,Noflg,Axname,Arrow,Origin); + opstr,opcindy,Ltype,Noflg,Axname,Arrow,Origin,color); name2="ax2d"+nm; name3="ax3d"+nm; tmp=Divoptions(options); @@ -935,6 +990,7 @@ Xyzax3data(nm,Xrange,Yrange,Zrange,options):=( eqL=tmp_5; reL=tmp_6; strL=tmp_7; + color=tmp_(length(tmp)-2); opcindy=tmp_(length(tmp)); Axname=1; Arrow=0; // 16.08.14 @@ -994,7 +1050,9 @@ Xyzax3data(nm,Xrange,Yrange,Zrange,options):=( ); if(Noflg<2, if(isstring(Ltype), + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); Ltype=GetLinestyle(text(Noflg)+Ltype,name2); + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); , if(Noflg==1,Ltype=0); ); @@ -1022,6 +1080,7 @@ Xyzax3data(nm,Xrange,Yrange,Zrange,options):=( Xyzaxparaname(Xrange,Yrange,Zrange):= Xyzaxparaname(Xrange,Yrange,Zrange,[]); Xyzaxparaname(Xrange,Yrange,Zrange,options):=( +//help:Xyzaxparaname("x=[-5,5]","y=[-5,5]","z=[-5,5]"); regional(tmp,tmp1,tmp2,Eps,Dr,Noflg,Xname,Yname,Zname, px,qx,py,qy,pz,qz,ph,qh,rr,ch); Eps=10.0^(-6); @@ -1030,18 +1089,21 @@ Xyzaxparaname(Xrange,Yrange,Zrange,options):=( forall(options, if(isreal(#),Dr=Dr*#); ); - tmp=indexof(Xrange,"="); - Xname=substring(Xrange,0,tmp-1); - tmp=parse(substring(Xrange,tmp,length(Xrange))); + tmp1=Strsplit(Xrange,"="); + Xname=tmp1_1; + tmp=parse(tmp1_2); px=[tmp_1,0,0]; qx=[tmp_2,0,0]; - tmp=indexof(Yrange,"="); - Yname=substring(Yrange,0,tmp-1); - tmp=parse(substring(Yrange,tmp,length(Yrange))); + tmp1=Strsplit(Yrange,"="); + Yname=tmp1_1; + tmp=parse(tmp1_2); py=[0,tmp_1,0]; qy=[0,tmp_2,0]; - tmp=indexof(Zrange,"="); - Zname=substring(Zrange,0,tmp-1); - tmp=parse(substring(Zrange,tmp,length(Zrange))); + tmp1=Strsplit(Zrange,"="); + Zname=tmp1_1; + tmp=parse(tmp1_2); pz=[0,0,tmp_1]; qz=[0,0,tmp_2]; + COM2ndlist=select(COM2ndlist,indexof(#,Dqq("$"+Xname+"$"))==0);//180608(3lines) + COM2ndlist=select(COM2ndlist,indexof(#,Dqq("$"+Yname+"$"))==0); + COM2ndlist=select(COM2ndlist,indexof(#,Dqq("$"+Zname+"$"))==0); ph=Parapt(px); qh=Parapt(qx); rr=|ph-qh|; if(rr>Eps, ch=qh+Dr/rr*(qh-ph); @@ -1084,7 +1146,7 @@ Embed(nm,Pd2str,funstr,varstr):= Embed(nm,Pd2str,funstr,varstr,options):=( //help:Embed("1",["gr1"],"A3d+x*(B3d-A3d)+y*(C3d-A3d)","[x,y]"); regional(name2,name3,Pd2L,Pd2,tmp,tmp1,xstr,ystr, - Ltype,Noflg,opstr,opcindy,Out); + Ltype,Noflg,opstr,opcindy,Out,color); name2="em2d"+nm; name3="em3d"+nm; if(!islist(Pd2str),Pd2L=[Pd2str],Pd2L=Pd2str); // 15.03.06 @@ -1111,6 +1173,7 @@ Embed(nm,Pd2str,funstr,varstr,options):=( tmp=Divoptions(options); Ltype=tmp_1; Noflg=tmp_2; + color=tmp_(length(tmp)-2); opcindy=tmp_(length(tmp)); Out=[]; forall(Pd2L,Pd2, @@ -1148,7 +1211,9 @@ Embed(nm,Pd2str,funstr,varstr,options):=( ); if(Noflg<2, if(isstring(Ltype), + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); Ltype=GetLinestyle(text(Noflg)+Ltype,name2); + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); , if(Noflg==1,Ltype=0); ); @@ -1259,13 +1324,14 @@ Rotatedata3d(nm,P3data,w1,w2,options):= Rotate3data(nm,P3data,w1,w2):=Rotate3data(nm,P3data,w1,w2,[]); Rotate3data(nm,P3data,w1,w2,options):=( regional(name3,name2,center,pdata,Pd3,Pd,Out,tmp,tmp1, - Ltype,Noflg,opcindy,opstr); + Ltype,Noflg,opcindy,opstr,color); name3="rot3d"+nm; name2="rot2d"+nm; center=[0,0,0]; tmp=Divoptions(options); Ltype=tmp_1; Noflg=tmp_2; + color=tmp_(length(tmp)-2); opstr=tmp_(length(tmp)-1); opcindy=tmp_(length(tmp)); tmp1=tmp_6; @@ -1294,7 +1360,7 @@ Rotate3data(nm,P3data,w1,w2,options):=( tmp=name2+"="+textformat(tmp1,5); parse(tmp); tmp=textformat(P3data,5); // 17.12.23 - tmp=RSform(tmp); // 17.12.23 + tmp=RSform(tmp,1); //180602 // tmp=replace(tmp,"[","list("); // tmp=replace(tmp,"]",")"); tmp=name3+"=Rotate3data("+tmp+"," @@ -1305,7 +1371,9 @@ Rotate3data(nm,P3data,w1,w2,options):=( ); if(Noflg<2, if(isstring(Ltype), + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); Ltype=GetLinestyle(text(Noflg)+Ltype,name2); + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); , if(Noflg==1,Ltype=0); ); @@ -1353,12 +1421,13 @@ Translatedata3d(nm,P3data,w1,options):= Translate3data(nm,P3data,w1):=Translate3data(nm,P3data,w1,[]); Translate3data(nm,P3data,w1,options):=( regional(name3,name2,pdata,Pd3,Pd,Out,tmp,tmp1, - Ltype,Noflg,opcindy); + Ltype,Noflg,opcindy,color); name3="tra3d"+nm; name2="tra2d"+nm; tmp=Divoptions(options); Ltype=tmp_1; Noflg=tmp_2; + color=tmp_(length(tmp)-2); opcindy=tmp_(length(tmp)); if(islist(P3data) & isstring(P3data_1),Pd3=P3data,Pd3=[P3data]); Out=[]; @@ -1382,7 +1451,7 @@ Translate3data(nm,P3data,w1,options):=( tmp=name2+"="+textformat(tmp1,5); parse(tmp); tmp=textformat(P3data,5); // 17.12.23 - tmp=RSform(tmp); // 17.12.23 + tmp=RSform(tmp,1); // 180602 // tmp=text(P3data); // tmp=replace(tmp,"[","list("); // tmp=replace(tmp,"]",")"); @@ -1393,7 +1462,9 @@ Translate3data(nm,P3data,w1,options):=( ); if(Noflg<2, if(isstring(Ltype), + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); Ltype=GetLinestyle(text(Noflg)+Ltype,name2); + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); , if(Noflg==1,Ltype=0); ); @@ -2001,7 +2072,7 @@ Bezier3(nm,Ag1,Ag2):=( ); Bezier3(nm,ptlistorg,ctrlistorg,options):=( //17.10.08 greatly changed regional(name,name3,name2,tmp,tmp1,tmp2, - Ltype,Noflg,opstr,eqL,Num,ii,knt,ctr,out); + Ltype,Noflg,opstr,eqL,Num,ii,knt,ctr,out,color); name="bz"+nm; name3="bz3d"+nm; name2="bz2d"+nm; @@ -2009,6 +2080,7 @@ Bezier3(nm,ptlistorg,ctrlistorg,options):=( //17.10.08 greatly changed Ltype=tmp_1; Noflg=tmp_2; eqL=tmp_5; + color=tmp_(length(tmp)-2); opcindy=tmp_(length(tmp)); Num=20; forall(eqL, @@ -2062,7 +2134,9 @@ Bezier3(nm,ptlistorg,ctrlistorg,options):=( //17.10.08 greatly changed ); if(Noflg<2, if(isstring(Ltype), + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); Ltype=GetLinestyle(text(Noflg)+Ltype,name2); + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); , if(Noflg==1,Ltype=0); ); @@ -2550,7 +2624,7 @@ Phparadata(nm,nmvf,Arg1):=( Phparadata(nm,nmvf,vfL,options):=( //help:Phparadata("1","1",["do"]); regional(name2,name3,nameh2,nameh3,Ltype,Noflg,eqL,Hidden, - opstr,opcindy,Outflg,Inflg,pdata1,tmp,tmp1,tmp2); + opstr,opcindy,Outflg,Inflg,pdata1,tmp,tmp1,tmp2,color); name2="php2d"+nm; name3="php3d"+nm; nameh2="phh2d"+nm; @@ -2562,6 +2636,7 @@ Phparadata(nm,nmvf,vfL,options):=( Outflg=tmp_4; if(Inflg==0 & Outflg==0, Inflg=1;Outflg=1); // 15.05.15 eqL=tmp_5; + color=tmp_(length(tmp)-2); opstr=tmp_(length(tmp)-1); opcindy=tmp_(length(tmp)); Hidden=""; @@ -2606,7 +2681,9 @@ Phparadata(nm,nmvf,vfL,options):=( ); if(Noflg<2, if(isstring(Ltype), + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); Ltype=GetLinestyle(text(Noflg)+Ltype,name2); + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); , if(Noflg==1,Ltype=0); ); @@ -2950,7 +3027,7 @@ Nohiddenbyfaces(nm,segstr,facestr,optionorg,optionsh):=( Faceremovaldata(nm,vfdata,crvdata):=Faceremovaldata(nm,vfdata,crvdata,[]); Faceremovaldata(nm,vfdata,crvdata,options):=( regional(name2,name3,nameh2,nameh3,Ltype,Noflg,eqL,Hidden, - opstr,opcindy,Outflg,Inflg,tmp,tmp1,tmp2); + opstr,opcindy,Outflg,Inflg,tmp,tmp1,tmp2,color); name2="frc2d"+nm; name3="frc3d"+nm; nameh2="frch2d"+nm; @@ -2962,6 +3039,7 @@ Faceremovaldata(nm,vfdata,crvdata,options):=( Outflg=tmp_4; if(Inflg==0 & Outflg==0, Inflg=1;Outflg=1); // 15.05.15 eqL=tmp_5; + color=tmp_(length(tmp)-2); opstr=tmp_(length(tmp)-1); opcindy=tmp_(length(tmp)); Hidden=""; @@ -2999,7 +3077,9 @@ Faceremovaldata(nm,vfdata,crvdata,options):=( ); if(Noflg<2, if(isstring(Ltype), + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); Ltype=GetLinestyle(text(Noflg)+Ltype,name2); + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); , if(Noflg==1,Ltype=0); ); @@ -3223,12 +3303,12 @@ Sfbdparadata(nm,fd,options):= Sfbdparadata(nm,fd,options,["nodisp"]); Sfbdparadata(nm,fdorg,optionorg,optionsh):=( //help:Sfbdparadata("1",Fd); -//help:Sfbdparadata(options2=["Wait=60",division(c(50,50)),Eps1(c(0.01,1)), Eps2(0.05)]); - regional(fd,options,name2,name3,name2h,name3h,waiting, +//help:Sfbdparadata(options2=["Wait=60",division(c(50,50)),Eps1(0.01), Eps2(0.05)]); + regional(fd,options,name3,name3h,waiting, eqL,reL,strL,fname,tmp,tmp1,tmp2,flg,wflg); - name2="sfbd2d"+nm; + tmp=ConvertFdtoC(fdorg);//180430(2lines) + FuncListC=append(FuncListC,tmp); name3="sfbd3d"+nm; - name2h="sfbdh2d"+nm; name3h="sfbdh3d"+nm; fname=Fhead+"sfbd"+nm+".txt"; tmp=apply(fdorg,if(isstring(#),"'"+#+"'",#)); @@ -3262,32 +3342,31 @@ Sfbdparadata(nm,fdorg,optionorg,optionsh):=( options=remove(options,[#]); ); ); + cmdL=[]; //180509from + tmp=Select(GLIST,indexof(#,"Proj")==0); + cmdL=MkprecommandR(tmp);//180509to tmp=["fd"+nm]; if(length(reL)>0, reL=textformat(reL,4); reL=substring(reL,1,length(reL)-1); - reL=Rsform(reL); + reL=RSform(reL); tmp=append(tmp,reL); ); - tmp1=[Dqq(fname),Dqq(name3),name3,Dqq(name2),name2]; - tmp1=concat(tmp1,[Dqq(name3h),name3h,Dqq(name2h),name2h]); -// tmp1=concat(tmp1,[Dqq("CUSPPT"),"CUSPPT"]); -// tmp1=concat(tmp1,[Dqq("OTHERPARTITION"),"OTHERPARTITION"]); - tmp2=replace(fname,".txt",".dat"); //18.02.18 - cmdL=[ + tmp1=[Dqq(fname),Dqq(name3),name3,Dqq(name3h),name3h];//180509 + tmp2=replace(fname,".txt",".Rdata"); //18.02.18 + cmdL=concat(cmdL,[ "print",[Dqq("fd"+nm)], //18.02.22 "fd"+nm+"="+fd,[], name3+"=Sfbdparadata",tmp, - name2+"=Projpara",[name3], name3h+"=HIDDENDATA",[], - name2h+"=Projpara",[name3h], "WriteOutData",tmp1, "save",["CUSPPT","OTHERPARTITION","file='"+tmp2+"'"] - ]; + ]); tmp=replace(fname,".txt","end.txt"); options=concat(options,["Out=no","Wait="+text(waiting),"Res="+tmp]); if(wflg==1,options=append(options,"m")); if(wflg==-1,options=append(options,"r")); + options=append(options,"Pre=!G"); //180509 if(ErrFlag==0, CalcbyR("sfbd"+nm,cmdL,options); ); @@ -3295,10 +3374,11 @@ Sfbdparadata(nm,fdorg,optionorg,optionsh):=( err("Sfbdparadata not completed"); , ReadOutData(fname); - if(islist(parse(name2)), - Extractdata(name2,options); + if(islist(parse(name3)), //180508(2lines) + Extractdata(name3,["nodisp"]); + Projpara(name3,options); if(length(optionsh)>0,tmp=optionsh,tmp=["nodisp"]); - Extractdata(name2h,tmp); + Projpara(name3h,tmp); //180508 , ErrFlag=1; ); @@ -3317,25 +3397,25 @@ Addpoints(ptlist):=( if(length(ptlist)==0, ADDPOINT="list()"; , - ADDPOINT=Rsform(textformat(ptlist,6),2); + ADDPOINT=RSform(textformat(ptlist,6),2); ); ADDPOINT; ); -Wireparadata(nm,sf,wr1,wr2,fd):= - Wireparadata(nm,sf,fd,wr1,wr2,[],["nodisp"]); -Wireparadata(nm,sf,fd,wr1,wr2,options):= - Wireparadata(nm,sf,fd,wr1,wr2,options,["nodisp"]); -Wireparadata(nm,sfstr,fdorg,wr1,wr2,optionorg,optionsh):=( -//help:Wireparadata("1","sfbd3d1",fd,5,5); -//help:Wireparadata(options2=[division(c(50,50)),Eps1(0.01), Eps2(0.05)]); - regional(fd,options,name2,name3,name2h,name3h,outreg, - eqL,reL,strL,fname,rfname,waiting,tmp,tmp1,tmp2,flg,wflg); - name2="wire2d"+nm; - name3="wiref3d"+nm; - name2h="wireh2d"+nm; - name3h="wireh3d"+nm; - fname=Fhead+"wire"+nm+".txt"; +Crvsfparadata(nm,crv,sf,fd):= + Crvsfparadata(nm,crv,sf,fd,[],["nodisp"]); +Crvsfparadata(nm,crv,sf,fd,options):= + Crvsfparadata(nm,crv,sf,fd,options,["nodisp"]); +Crvsfparadata(nm,crvstr,sfstr,fdorg,optionorg,optionsh):=( +//help:Crvsfparadata("1","ax3d","sfbd3d1",fd); +//help:Crvsfparadata(options2=[division(c(50,50)),Eps1(0.01), Eps2(0.05)]); + regional(gd,out,fd,options,name3,name3h, + eqL,reL,strL,fname,rfname,waiting,tmp,tmp1,tmp2,tmp3,flg,wflg); + tmp=replace(crvstr,"3d","2d"); + Changestyle(tmp,["nodisp"]); + name3="crvsf3d"+nm; + name3h="crvsfh3d"+nm; + fname=Fhead+"crvsf"+nm+".txt"; rfname=Fhead+sfstr+".txt"; rfname=replace(rfname,"3d",""); tmp=apply(fdorg,if(isstring(#),"'"+#+"'",#)); @@ -3346,7 +3426,7 @@ Wireparadata(nm,sfstr,fdorg,wr1,wr2,optionorg,optionsh):=( eqL=tmp_5; reL=tmp_6; strL=tmp_7; - waiting=600; + waiting=120; forall(eqL, tmp=indexof(#,"="); tmp1=Toupper(substring(#,0,1)); @@ -3369,74 +3449,84 @@ Wireparadata(nm,sfstr,fdorg,wr1,wr2,optionorg,optionsh):=( options=remove(options,[#]); ); ); - tmp1=textformat(wr1,6); - tmp1=Rsform(tmp1,1); - tmp2=textformat(wr2,6); - tmp2=Rsform(tmp2,1); - tmp=[sfstr,"fd"+nm,tmp1,tmp2]; reL=RSform(text(reL),2); reL=substring(reL,5,length(reL)-1); + cmdL=[]; //180509from + tmp=Select(GLIST,indexof(#,"Proj")==0); + cmdL=MkprecommandR(tmp);//180509to + tmp2=replace(rfname,".txt",".Rdata"); + cmdL=concat(cmdL,[ + "print",[Dqq("crv"+nm)], //18.02.22 + "fd"+nm+"="+fd,[], + "ReadOutData",[Dqq(rfname)], + "load",[Dqq(tmp2)], + "Addpoints",[Addpoints()] + ]); + tmp3=select(GLIST,indexof(#,crvstr+"=")>0); //18.02.22from + if(length(tmp3)==0, + tmp3=Fhead+crvstr+".txt"; + tmp3=replace(tmp3,"3d",""); + cmdL=concat(cmdL,[ + "ReadOutData",[Dqq(tmp3)] + ]); + ); //18.02.22to + tmp=[crvstr,sfstr,"fd"+nm]; if(length(reL)>0, reL=textformat(reL,4); reL=substring(reL,1,length(reL)-1); reL=Rsform(reL); tmp=append(tmp,reL); ); - tmp1=[Dqq(fname),Dqq(name3),name3,Dqq(name2),name2]; - tmp1=concat(tmp1,[Dqq(name3h),name3h,Dqq(name2h),name2h]); - tmp2=replace(rfname,".txt",".dat"); - cmdL=[ - "print",[Dqq("wire"+nm)], //18.02.22 - "fd"+nm+"="+fd,[], - "ReadOutData",[Dqq(rfname)], - "load",[Dqq(tmp2)], - "Addpoints",[Addpoints()], - name3+"=Wireparadata",tmp, - name2+"=Projpara",[name3], - name3h+"=WIREHIDDENDATA",[], - name2h+"=Projpara",[name3h], + tmp1=[DqDq(fname),DqDq(name3),name3,DqDq(name3h),name3h]; + cmdL=concat(cmdL,[ + name3+"=Crvsfparadata",tmp, + name3h+"=CRVSFHIDDENDATA",[], "WriteOutData",tmp1 - ]; + ]); tmp=replace(fname,".txt","end.txt"); options=concat(options,["Out=no","Wait="+text(waiting),"Res="+tmp]); - if(wflg==1,options=concat(options,["m"])); - if(wflg==-1,options=concat(options,["r"])); + if(wflg==1,options=append(options,"m")); + if(wflg==-1,options=append(options,"r")); + options=append(options,"Pre=!G");//180509 if(ErrFlag==0, - CalcbyR("wire"+nm,cmdL,options); + CalcbyR("crvsf"+nm,cmdL,options); ); if(ErrFlag==1, - err("Wireparadata not completed"); + err("Crvsfparadata not completed"); , ReadOutData(fname); - if(islist(parse(name2)), - Extractdata(name2,options); + if(islist(parse(name3)), //180507(2lines) + Extractdata(name3,["nodisp"]); + Projpara(name3,options); if(length(optionsh)>0,tmp=optionsh,tmp=["nodisp"]); - Extractdata(name2h,tmp); + Projpara(name3h,tmp);//180507 , ErrFlag=1; ); ); ); -Crvsfparadata(nm,crv,sf,fd):= - Crvsfparadata(nm,crv,sf,fd,[],["nodisp"]); -Crvsfparadata(nm,crv,sf,fd,options):= - Crvsfparadata(nm,crv,sf,fd,options,["nodisp"]); -Crvsfparadata(nm,crvstr,sfstr,fdorg,optionorg,optionsh):=( -//help:Crvsfparadata("1","ax3d","sfbd3d1",fd); -//help:Crvsfparadata(options2=[division(c(50,50)),Eps1(0.01), Eps2(0.05)]); - regional(gd,out,fd,options,name2,name3,name2h,name3h, +Crv3onsfparadata(nm,crv3d,sf,fd):= + Crvs3onfparadata(nm,crv3d,sf,fd,[],["nodisp"]); +Crv3onsfparadata(nm,crv3d,sf,fd,options):= + Crv3onsfparadata(nm,crv3d,sf,fd,options,["nodisp"]); +Crv3onsfparadata(nm,crv3dstr,sfstr,fdorg,optionorg,optionsh):=( +//help:Crv3onsfparadata("1","sc1","sfbd3d1",fd); +//help:Crv3onsfparadata(options2=[division(c(50,50)),Eps1(0.01), Eps2(0.05)]); + regional(gd,out,fd,options,name3,name3h, eqL,reL,strL,fname,rfname,waiting,tmp,tmp1,tmp2,tmp3,flg,wflg); - tmp=replace(crvstr,"3d","2d"); + tmp1=replace(crv3dstr,"3d","2d"); + tmp=apply(GCLIST,#_1); + if(contains(tmp,tmp1), + Changestyle3d(tmp1,["nodisp"]);//180428 + ); Changestyle(tmp,["nodisp"]); - name2="crvsf2d"+nm; - name3="crvsf3d"+nm; - name2h="crvsfh2d"+nm; - name3h="crvsfh3d"+nm; - fname=Fhead+"crvsf"+nm+".txt"; + name3="crv3onsf3d"+nm; + name3h="crv3onsfh3d"+nm; + fname=Fhead+"crv3onsf"+nm+".txt"; rfname=Fhead+sfstr+".txt"; rfname=replace(rfname,"3d",""); - tmp=apply(fdorg,if(isstring(#),"'"+#+"'",#)); + tmp=apply(fdorg,if(isstring(#),Dqq(#),#)); tmp=text(tmp); fd=RSform(tmp,2); options=optionorg; @@ -3469,73 +3559,68 @@ Crvsfparadata(nm,crvstr,sfstr,fdorg,optionorg,optionsh):=( ); reL=RSform(text(reL),2); reL=substring(reL,5,length(reL)-1); - tmp=[crvstr,sfstr,"fd"+nm]; + cmdL=[]; //180509from + tmp=Select(GLIST,indexof(#,"Proj")==0); + cmdL=MkprecommandR(tmp);//180509to + tmp=["crv",sfstr,"fd"+nm]; if(length(reL)>0, reL=textformat(reL,4); reL=substring(reL,1,length(reL)-1); reL=Rsform(reL); tmp=append(tmp,reL); ); - tmp1=[DqDq(fname),DqDq(name3),name3,DqDq(name2),name2]; - tmp1=concat(tmp1,[DqDq(name3h),name3h,DqDq(name2h),name2h]); - tmp2=replace(rfname,".txt",".dat"); - cmdL=[ - "print",[Dqq("crv"+nm)], //18.02.22 + tmp1=[Dqq(fname),Dqq(name3),name3,Dqq(name3h),name3h]; + tmp2=replace(rfname,".txt",".Rdata"); + cmdL=concat(cmdL,[ + "print",[Dqq("crv3onsf"+nm)], //180222 "fd"+nm+"="+fd,[], "ReadOutData",[Dqq(rfname)], - "load",[Dqq(tmp2)], - "Addpoints",[Addpoints()] - ]; - tmp3=select(GLIST,indexof(#,crvstr+"=")>0); //18.02.22from - if(length(tmp3)==0, - tmp3=Fhead+crvstr+".txt"; - tmp3=replace(tmp3,"3d",""); - cmdL=concat(cmdL,[ - "ReadOutData",[Dqq(tmp3)] - ]); - ); //18.02.22until - cmdL=concat(cmdL,[ - name3+"=Crvsfparadata",tmp, - name2+"=Projpara",[name3], - name3h+"=CRVSFHIDDENDATA",[], - name2h+"=Projpara",[name3h], + "load",[Dqq(tmp2)] + ]); + cmdL=concat(cmdL,[ + "Addpoints",[Addpoints()], + "crv="+crv3dstr,[], + name3+"=Crv3onsfparadata",tmp, + name3h+"=HIDDENDATA",[], "WriteOutData",tmp1 ]); tmp=replace(fname,".txt","end.txt"); options=concat(options,["Out=no","Wait="+text(waiting),"Res="+tmp]); if(wflg==1,options=append(options,"m")); if(wflg==-1,options=append(options,"r")); + options=append(options,"Pre=!G"); //180508 if(ErrFlag==0, - CalcbyR("crvsf"+nm,cmdL,options); + CalcbyR("crv3onsf"+nm,cmdL,options); ); if(ErrFlag==1, - err("Crvsfparadata not completed"); + err("Crv3onsfparadata not completed"); , ReadOutData(fname); - if(islist(parse(name2)), - Extractdata(name2,options); + if(islist(parse(name3)), + Extractdata(name3,["nodisp"]); + Projpara(name3,options); //180507 if(length(optionsh)>0,tmp=optionsh,tmp=["nodisp"]); - Extractdata(name2h,tmp); + Extractdata(name3h,["nodisp"]); + Projpara(name3h,tmp); , ErrFlag=1; ); ); ); -Crvonsfparadata(nm,crv2d,sf,fd):= - Crvsonfparadata(nm,crv2d,sf,fd,[],["nodisp"]); -Crvonsfparadata(nm,crv2d,sf,fd,options):= - Crvonsfparadata(nm,crv2d,sf,fd,options,["nodisp"]); -Crvonsfparadata(nm,crv2dstr,sfstr,fdorg,optionorg,optionsh):=( -//help:Crvonsfparadata("1",["[1,t]","t=[0,2*pi]","Num=50"],"sfbd3d1",fd); -//help:Crvonsfparadata(options2=[division(c(50,50)),Eps1(0.01), Eps2(0.05)]); - regional(gd,out,fd,options,name2,name3,name2h,name3h, +Crv2onsfparadata(nm,crv2d,sf,fd):= + Crvs2onfparadata(nm,crv2d,sf,fd,[],["nodisp"]); +Crv2onsfparadata(nm,crv2d,sf,fd,options):= + Crv2onsfparadata(nm,crv2d,sf,fd,options,["nodisp"]); +Crv2onsfparadata(nm,crv2dstr,sfstr,fdorg,optionorg,optionsh):=( +//help:Crv2onsfparadata("1","pa1","sfbd3d1",fd); +//help:Crv2onsfparadata(options2=[division(c(50,50)),Eps1(0.01), Eps2(0.05)]); + regional(gd,out,fd,options,name3,name3h, eqL,reL,strL,fname,rfname,waiting,tmp,tmp1,tmp2,tmp3,flg,wflg); - name2="crvonsf2d"+nm; - name3="crvonsf3d"+nm; - name2h="crvonsfh2d"+nm; - name3h="crvonsfh3d"+nm; - fname=Fhead+"crvonsf"+nm+".txt"; + Changestyle(crv2dstr,["nodisp"]); + name3="crv2onsf3d"+nm; + name3h="crv2onsfh3d"+nm; + fname=Fhead+"crv2onsf"+nm+".txt"; rfname=Fhead+sfstr+".txt"; rfname=replace(rfname,"3d",""); tmp=apply(fdorg,if(isstring(#),Dqq(#),#)); @@ -3578,6 +3663,9 @@ Crvonsfparadata(nm,crv2dstr,sfstr,fdorg,optionorg,optionsh):=( ); reL=RSform(text(reL),2); reL=substring(reL,5,length(reL)-1); + cmdL=[]; //180509from + tmp=Select(GLIST,indexof(#,"Proj")==0); + cmdL=MkprecommandR(tmp);//180509to tmp=["crv",sfstr,"fd"+nm]; if(length(reL)>0, reL=textformat(reL,4); @@ -3585,37 +3673,141 @@ Crvonsfparadata(nm,crv2dstr,sfstr,fdorg,optionorg,optionsh):=( reL=Rsform(reL); tmp=append(tmp,reL); ); - tmp1=[Dqq(fname),Dqq(name3),name3,Dqq(name2),name2]; - tmp1=concat(tmp1,[Dqq(name3h),name3h,Dqq(name2h),name2h]); - tmp2=replace(rfname,".txt",".dat"); - cmdL=[ - "print",[Dqq("crvonsf"+nm)], //18.02.22 + tmp1=[Dqq(fname),Dqq(name3),name3,Dqq(name3h),name3h]; + tmp2=replace(rfname,".txt",".Rdata"); + cmdL=concat(cmdL,[ + "print",[Dqq("crv2onsf"+nm)], //18.02.22 "fd"+nm+"="+fd,[], "ReadOutData",[Dqq(rfname)], - "load",[Dqq(tmp2)], + "load",[Dqq(tmp2)] + ]); + cmdL=concat(cmdL,[ "Addpoints",[Addpoints()], - "crv="+crv,[], - name3+"=Crvonsfparadata",tmp, - name2+"=Projpara",[name3], + "crv="+crv2dstr,[], + name3+"=Crv2onsfparadata",tmp, name3h+"=HIDDENDATA",[], - name2h+"=Projpara",[name3h], "WriteOutData",tmp1 - ]; + ]); tmp=replace(fname,".txt","end.txt"); options=concat(options,["Out=no","Wait="+text(waiting),"Res="+tmp]); if(wflg==1,options=append(options,"m")); if(wflg==-1,options=append(options,"r")); + options=append(options,"Pre=!G"); //180508 + if(ErrFlag==0, + CalcbyR("crv2onsf"+nm,cmdL,options); + ); + if(ErrFlag==1, + err("Crv2onsfparadata not completed"); + , + ReadOutData(fname); + if(islist(parse(name3)), + Extractdata(name3,["nodisp"]); + Projpara(name3,options); //180507 + if(length(optionsh)>0,tmp=optionsh,tmp=["nodisp"]); + Projpara(name3h,tmp); + , + ErrFlag=1; + ); + ); +); + +Wireparadata(nm,sf,wr1,wr2,fd):= + Wireparadata(nm,sf,fd,wr1,wr2,[],["nodisp"]); +Wireparadata(nm,sf,fd,wr1,wr2,options):= + Wireparadata(nm,sf,fd,wr1,wr2,options,["nodisp"]); +Wireparadata(nm,sfstr,fdorg,wr1,wr2,optionorg,optionsh):=( +//help:Wireparadata("1","sfbd3d1",fd,5,5); +//help:Wireparadata(options2=[division(c(50,50)),Eps1(0.01), Eps2(0.05)]); + regional(fd,options,name3,name3h,outreg, + eqL,reL,strL,fname,rfname,waiting,tmp,tmp1,tmp2,flg,wflg); + name3="wire3d"+nm; + name3h="wireh3d"+nm; + fname=Fhead+"wire"+nm+".txt"; + rfname=Fhead+sfstr+".txt"; + rfname=replace(rfname,"3d",""); + tmp=apply(fdorg,if(isstring(#),"'"+#+"'",#)); + tmp=text(tmp); + fd=RSform(tmp,2); + options=optionorg; + tmp=Divoptions(options); + eqL=tmp_5; + reL=tmp_6; + strL=tmp_7; + waiting=600; + forall(eqL, + tmp=indexof(#,"="); + tmp1=Toupper(substring(#,0,1)); + tmp2=substring(#,tmp,length(#)); + if(tmp1=="W", + waiting=parse(tmp2); + options=remove(options,[#]); + ); + ); + options=remove(options,reL); + wflg=0; + forall(strL, + tmp=Toupper(substring(#,0,1)); + if(tmp=="M", + wflg=1; + options=remove(options,[#]); + ); + if(tmp=="R", + wflg=-1; + options=remove(options,[#]); + ); + ); + tmp1=textformat(wr1,6); + tmp1=Rsform(tmp1,1); + tmp2=textformat(wr2,6); + tmp2=Rsform(tmp2,1); + tmp=[sfstr,"fd"+nm,tmp1,tmp2]; + reL=RSform(text(reL),2); + reL=substring(reL,5,length(reL)-1); + cmdL=[]; //180509from + tmp=Select(GLIST,indexof(#,"Proj")==0); + cmdL=MkprecommandR(tmp);//180509to + tmp1=textformat(wr1,6); + tmp1=Rsform(tmp1,1); + tmp2=textformat(wr2,6); + tmp2=Rsform(tmp2,1); + tmp=[sfstr,"fd"+nm,tmp1,tmp2]; + reL=RSform(text(reL),2); + reL=substring(reL,5,length(reL)-1); + if(length(reL)>0, + reL=textformat(reL,4); + reL=substring(reL,1,length(reL)-1); + reL=Rsform(reL); + tmp=append(tmp,reL); + ); + tmp1=[Dqq(fname),Dqq(name3),name3,Dqq(name3h),name3h]; + tmp2=replace(rfname,".txt",".Rdata"); + cmdL=concat(cmdL,[ + "print",[Dqq("wire"+nm)], //18.02.22 + "fd"+nm+"="+fd,[], + "ReadOutData",[Dqq(rfname)], + "load",[Dqq(tmp2)], + "Addpoints",[Addpoints()], + name3+"=Wireparadata",tmp, + name3h+"=WIREHIDDENDATA",[], + "WriteOutData",tmp1 + ]); + tmp=replace(fname,".txt","end.txt"); + options=concat(options,["Out=no","Wait="+text(waiting),"Res="+tmp]); + if(wflg==1,options=concat(options,["m"])); + if(wflg==-1,options=concat(options,["r"])); + options=append(options,"Pre=!G"); //180508 if(ErrFlag==0, - CalcbyR("crvonsf"+nm,cmdL,options); + CalcbyR("wire"+nm,cmdL,options); ); if(ErrFlag==1, - err("Crvonsfparadata not completed"); + err("Wireparadata not completed"); , ReadOutData(fname); - if(islist(parse(name2)), - Extractdata(name2,options); + if(islist(parse(name3)), + Extractdata(name3,["nodisp"]); + Projpara(name3,options); if(length(optionsh)>0,tmp=optionsh,tmp=["nodisp"]); - Extractdata(name2h,tmp); + Projpara(name3h,tmp); , ErrFlag=1; ); @@ -3716,16 +3908,20 @@ Sfcutparadata(nm,eqstr,sf,fd):= Sfcutparadata(nm,eqstr,sf,fd,[]); Sfcutparadata(nm,eqstr,sf,fd,options):= Sfcutparadata(nm,eqstr,sf,fd,options,["nodisp"]); -Sfcutparadata(nm,eqstr,sf,fdorg,optionorg,optionsh):=( -//help:Sfcutparadata("1","x+y+z=1","sfbd3d1",fd,"x+y+z=1"); -//help:Sfcutparadata(options2=[division(c(50,50)),Eps1(0.01), Eps2(0.05)]); - regional(gd,out,fd,options,name2,name3,name2h,name3h, +Sfcutparadata(nm,eqstrorg,sf,fdorg,optionorg,optionsh):=( +//help:Sfcutparadata("1","x+y+z=1","sfbd3d1",fd); +//help:Sfcutparadata(options2=[Division(c(50,50)),Eps1(0.01), Eps2(0.05)]); + regional(gd,out,fd,options,name3,name3h,eqstr, eqL,reL,strL,fname,rfname,waiting,tmp,tmp1,tmp2,tmp3,flg,wflg); + tmp=Strsplit(eqstrorg,"="); + if(length(tmp)==1, + eqstr=tmp_1; + , + eqstr=tmp_1+"-("+tmp_2+")"; + ); tmp=replace(sfcut,"3d","2d"); Changestyle(tmp,["nodisp"]); - name2="sfcut2d"+nm; name3="sfcut3d"+nm; - name2h="sfcuth2d"+nm; name3h="sfcuth3d"+nm; fname=Fhead+"sfcut"+nm+".txt"; rfname=Fhead+sf+".txt"; @@ -3763,6 +3959,9 @@ Sfcutparadata(nm,eqstr,sf,fdorg,optionorg,optionsh):=( ); reL=RSform(text(reL),2); reL=substring(reL,5,length(reL)-1); + cmdL=[]; //180509from + tmp=Select(GLIST,indexof(#,"Proj")==0); + cmdL=MkprecommandR(tmp);//180509to tmp=[Dqq(eqstr),sf,"fd"+nm]; if(length(reL)>0, reL=textformat(reL,4); @@ -3770,24 +3969,22 @@ Sfcutparadata(nm,eqstr,sf,fdorg,optionorg,optionsh):=( reL=Rsform(reL); tmp=append(tmp,reL); ); - tmp1=[DqDq(fname),DqDq(name3),name3,DqDq(name2),name2]; - tmp1=concat(tmp1,[DqDq(name3h),name3h,DqDq(name2h),name2h]); - tmp2=replace(rfname,".txt",".dat"); - cmdL=[ + tmp1=[DqDq(fname),DqDq(name3),name3,DqDq(name3h),name3h]; + tmp2=replace(rfname,".txt",".Rdata"); + cmdL=concat(cmdL,[ "print",[Dqq("sfcut"+nm)], //18.02.22 "fd"+nm+"="+fd,[], "ReadOutData",[Dqq(rfname)], "load",[Dqq(tmp2)], name3+"=Sfcutparadata",tmp, - name2+"=Projpara",[name3], name3h+"=CRVONSFHIDDENDATA",[], - name2h+"=Projpara",[name3h], "WriteOutData",tmp1 - ]; + ]); tmp=replace(fname,".txt","end.txt"); options=concat(options,["Out=no","Wait="+text(waiting),"Res="+tmp]); if(wflg==1,options=append(options,"m")); if(wflg==-1,options=append(options,"r")); + options=append(options,"Pre=!G"); //180508 if(ErrFlag==0, CalcbyR("sfcut"+nm,cmdL,options); ); @@ -3795,10 +3992,11 @@ Sfcutparadata(nm,eqstr,sf,fdorg,optionorg,optionsh):=( err("Sfcutparadata not completed"); , ReadOutData(fname); - if(islist(parse(name2)), - Extractdata(name2,options); + if(islist(parse(name3)), + Extractdata(name3,["nodisp"]); + Projpara(name3,options); if(length(optionsh)>0,tmp=optionsh,tmp=["nodisp"]); - Extractdata(name2h,tmp); + Projpara(name3h,tmp); , ErrFlag=1; ); @@ -3826,7 +4024,7 @@ Skeletondatacindy(nm,pltdata1org,pltdata2org,options):=( //help:Skeletonparadata("1"); //help:Skeletonparadata("1",[pdata1,pdata2],[pdata3]); //help:Skeletondata(options2=[1(width)]); - regional(Eps,Eps2,name2,name3,Ltype,Noflg,reL,opcindy, + regional(Eps,Eps2,name2,name3,Ltype,Noflg,reL,opcindy,color, Data,Out,ObjL,Plt3L,Rr,pltdata1,pltdata2,Plt2L,ObjL,ii,Data, Obj3,jj,Gd,PtD,size,tmp,tmp1,tmp2); name2="sk2d"+nm; @@ -3845,7 +4043,8 @@ Skeletondatacindy(nm,pltdata1org,pltdata2org,options):=( Ltype=tmp_1; Noflg=tmp_2; reL=tmp_6; //16.02.28 - opcindy=tmp_9; + color=tmp_(length(tmp)-2); + opcindy=tmp_(length(tmp)); Rr=0.15*1000/2.54/MilliIn; size=1; Eps2=0.05; @@ -3880,7 +4079,9 @@ Skeletondatacindy(nm,pltdata1org,pltdata2org,options):=( ); if(Noflg<2, if(isstring(Ltype), + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); Ltype=GetLinestyle(text(Noflg)+Ltype,name2); + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); , if(Noflg==1,Ltype=0); ); @@ -4020,7 +4221,7 @@ Skeletondatacindy(nm,pltdata1org,pltdata2org,options):=( //help:Skeletondatacindy(options2=[1(width)]); regional(Eps,Eps2,name2,name3,Ltype,Noflg,reL,opcindy, Out,ObjL,Plt3L,Rr,pltdata1,pltdata2,Plt2L,ObjL,ii,Data, - Obj3,jj,Gd,PtD,size,tmp,tmp1,tmp2); + Obj3,jj,Gd,PtD,size,tmp,tmp1,tmp2,color); name2="sk2d"+nm; name3="sk3d"+nm; pltdata1=[];// 16.01.31 @@ -4037,7 +4238,8 @@ Skeletondatacindy(nm,pltdata1org,pltdata2org,options):=( Ltype=tmp_1; Noflg=tmp_2; reL=tmp_6; //16.02.28 - opcindy=tmp_9; + color=tmp_(length(tmp)-2); + opcindy=tmp_(length(tmp)); Rr=0.075*1000/2.54/MilliIn; size=1; Eps2=0.05; @@ -4092,7 +4294,9 @@ Skeletondatacindy(nm,pltdata1org,pltdata2org,options):=( ); if(Noflg<2, if(isstring(Ltype), + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); Ltype=GetLinestyle(text(Noflg)+Ltype,name2); + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); , if(Noflg==1,Ltype=0); ); diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1logr.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1logr.txt index d815618a97a..4f23caa52b0 100644 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1logr.txt +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1logr.txt @@ -1,3 +1,48 @@ +//20180613 +// Shade changed ( name, pointlist supported, Com2nd("before")) +// Shade debugged (color,opcindy) +// WritetoRS changed (for COM2ndlistb) +//20180612 +// Com2nd changed ("before" options added ) +//20180609 +// Ketinit changed (CommonMake added ) +//20180608 +// Ketinit changed (Namecdy defined ) +//20180606 +// Changework debugged ( case where "Sub=n" ) +//20180605 +// Changework changed ( "Sub=n" option supported ) +//20180603 +// Shade changed ( option density supported ) +// Addcolor removed +// Setcolor(color,option),Setcolorrgb removed +// Setcolor renewed +// Divoptions degugged (KCOLOR) +// Listplot,... changed (KCOLOR) +// Pointdata changed (color) +//20180602 +// Divoptions changed ( "Color=" supported ) +// Changestyle,.... changed ("Color=" supported) +// Changetyle changed (case in which name not found) +// Shade debugged ( color ) +// Rotatedata,... degugged ( for list of plotdata ) +//20180530 +// Anglemark changed (opstr,Brat=1.2) +// Pointdata degugged (for single point) +//20180527 +// Deqplot changed ( ' as default ) +//20180513 +// Setunitlen debugged ( string => UI ) +//20180506 +// Anglemark changed ( [A,B,angle] supported ) +//20180505 +// Strsplit added +//20180501 +// MeasureDepth debugged ( for blank list ) +//20180420 +// Ketinit changed ( Changesetting moved to ketoutset.txt ) +//20180413 +// Ketinit changed ( utf for windows removed ) //20180408 // Divoptions changed ( to remove null string ) // Changework changed (nkfwin) diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1r.cs b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1r.cs index f45ffee8d7a..024f9df129b 100644 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1r.cs +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1r.cs @@ -14,9 +14,9 @@ // along with this program. If not, see <http://www.gnu.org/licenses/> // -println("KETCindy V.3.2.0(20180409)"); -println(ketjavaversion());//17.06.05 -println("ketcindylibbasic1(20180408) loaded"); +println("KeTCindy V.3.2.1(20180614)"); +println(ketjavaversion()); +println("ketcindylibbasic1(20180613) loaded"); //help:start(); @@ -48,7 +48,7 @@ Ketinit(sy,rangex,rangey):=( MEMORIInit=MEMORI; MEMORINow=MEMORI; MARKLEN=0.05; - MARKLENInit=MARKLEN: + MARKLENInit=MARKLEN; //180504 MARKLENNow= MARKLEN; GENTEN=[0,0];//18.01.15until KETPICLAYER=20; @@ -72,10 +72,12 @@ Ketinit(sy,rangex,rangey):=( COM0thlist=[]; COM1stlist=[]; COM2ndlist=[]; + COM2ndlistb=[]; //180612 ADDAXES="1"; LFmark=unicode("000a"); CRmark=unicode("000d");//16.12.13 Dq=unicode("0022"); + CommonMake=0;//180610 WaitUnit=10; CONTINUED=0; OutComList=[]; @@ -90,6 +92,7 @@ Ketinit(sy,rangex,rangey):=( Slidename=Fhead; //17.10.24 );//17.11.12 Dircdy=replace(Dircdy,"%E3%80%80"," ");//180405 + Namecdy=Cindyname();//180608 tmp1=Indexall(Dircdy,"%"); //180329from if(length(tmp1)>0, tmp1=append(tmp1,length(Dircdy)); @@ -106,9 +109,9 @@ Ketinit(sy,rangex,rangey):=( if(substring(Dircdy,0,1)==pathsep(), Dircdy=substring(Dircdy,1,length(Dircdy)); ); - Changesetting([gethome(), gethome()+"\Desktop","C:"]); //180405 +// Changesetting([gethome(), gethome()+"\Desktop","C:"]); //180405 , - Changesetting([gethome(),gethome()+"/Desktop"]); +// Changesetting([gethome(),gethome()+"/Desktop"]); ); Changework(Dircdy+pathsep()+"fig"); //180329to Fnametex=Fhead+".tex"; @@ -186,7 +189,7 @@ Changesetting(dirL):=( //180329 Cindyname():=Getcdyname(); Cdyname():=Getcdyname(); Getcdyname():=( //17.12.27 -//help:Cdyname(); +//help:Cindyname(); regional(out); out=text(curkernel()); out=replace(out,".cdy",""); @@ -436,6 +439,18 @@ Indexall(str,key):=( out; ); +Strsplit(str,key):=( //180505 + regional(start,out,tmp1,tmp2); + tmp1=Indexall(str,key); + out=[]; start=0; + forall(tmp1, + out=append(out,substring(str,start,#-1)); + start=#; + ); + out=append(out,substring(str,start,length(str))); + out; +); + Parlevel(str):=Bracket(str); // 16.05.22from Bracket(str):=Bracket(str,"()"); Bracket(str,br):=( @@ -559,9 +574,24 @@ Pardiagram(str,options):=( out; ); -Changework(dirorg):=( //16.10.21 +Changework(dirorg):=Changework(dirorg,["Sub=y"]); +Changework(dirorg,options):=( //16.10.21 //help:Changework(directory); - regional(dir,subdir,tmp); +//help:Changework(Dircdy+"fig"); +//help:Changework(options=["Sub=y"]); + regional(dir,subdir,tmp,,eqL,makesub); + tmp=Divoptions(options); + eqL=tmp_5; //180605from + makesub=1; + forall(eqL, + tmp=Strsplit(#,"="); + if(Toupper(tmp_1)=="SUB", + tmp=Toupper(tmp_2); + if(substring(tmp,0,1)=="N", + makesub=0; + ); + ); + ); //180605to dir=replace(dirorg,"/",pathsep());//17.11.20from dir=replace(dir,"\",pathsep()); dir=replace(dir,pathsep()+pathsep(),pathsep());//17.11.24 @@ -577,11 +607,14 @@ Changework(dirorg):=( //16.10.21 dir=substring(dir,0,tmp-1); ); //17.11.24until if(dir=="" % !isexists(dir,""), - println("Directory "+dir+" not exist, so set to "+Dirwork); + println("Directory "+dir+" not exist, so set to "+Dircdy);//180604(2lines) + Dirwork=Dircdy; ErrFlag=-1; , - if(length(subdir)>0, //17.11.24from - println(makedir(dir,subdir)); + if(length(subdir)>0, //180605 + if(makesub==1,//180606from + println(makedir(dir,subdir)); + );//180606 Dirwork=dir+pathsep()+subdir; , Dirwork=dir; @@ -593,37 +626,36 @@ Changework(dirorg):=( //16.10.21 closefile(SCEOUTPUT); println(setexec(Dirwork,"/kc.sh")); ); - , - if(isincludefull(Dirwork),//180408from - SCEOUTPUT = openfile("utf8.txt"); - println(SCEOUTPUT,"tmp="+Dqq(Dirwork)+";"); - closefile(SCEOUTPUT); - nkfwin("C:",Dirwork,"utf8.txt","sjis.txt");//180408to - ); ); ); ); Changestyle(nameL,style):=( //help:Changestyle(["sgAB"],["da"]); - regional(nmL,name,Ltype,Ltypeorg,Noflg,opcindy,tmp); + regional(nmL,name,Ltype,Ltypeorg,Noflg,color,opcindy,tmp); tmp=Divoptions(style); Ltypeorg=tmp_1; Noflg=tmp_2; + color=tmp_(length(tmp)-2); opcindy=tmp_(length(tmp)); if(islist(nameL),nmL=nameL,nmL=[nameL]); forall(nmL,name, - Ltype=Ltypeorg; - GCLIST=select(GCLIST,#_1!=name); - COM2ndlist=select(COM2ndlist, - (indexof(#,"("+name)==0)%(indexof(#,"Shade")>0)); // 15.05.23,16.12.13 - if(Noflg<2, - if(isstring(Ltype), - Ltype=GetLinestyle(text(Noflg)+Ltype,name); - , - if(Noflg==1,Ltype=0); + tmp=select(GCLIST,#_1==name); + if(length(tmp)>0, + Ltype=Ltypeorg; + GCLIST=select(GCLIST,#_1!=name); + COM2ndlist=select(COM2ndlist, + (indexof(#,"("+name)==0)%(indexof(#,"Shade")>0)); // 15.05.23,16.12.13 + if(Noflg<2, + if(isstring(Ltype), + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); + Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); + , + if(Noflg==1,Ltype=0); + ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); ); - GCLIST=append(GCLIST,[name,Ltype,opcindy]); ); ); ); @@ -908,24 +940,26 @@ MeasureDepth(list):=( regional(tmp,tmp1,Depth,Flg); Flg=0; Depth=0; - if(ispoint(list), // 15.01.22 - Depth=0; - Flg=1; - , - tmp1=select(1..(length(list)),length(list_#)>0);//17.05.21from - tmp=list_(tmp1_1);//17.05.21until - ); - repeat(4, - if(Flg==0, - if(islist(tmp), - tmp=tmp_1; - Depth=Depth+1; - , - if(ispoint(tmp),Depth=Depth+1); - Flg=1; + if(length(list)>0, //180501 + if(ispoint(list), + Depth=0; + Flg=1; + , + tmp1=select(1..(length(list)),length(list_#)>0);//17.05.21from + tmp=list_(tmp1_1);//17.05.21until + ); + repeat(4, + if(Flg==0, + if(islist(tmp), + tmp=tmp_1; + Depth=Depth+1; + , + if(ispoint(tmp),Depth=Depth+1); + Flg=1; + ); ); ); - ); + );//180501 Depth; ); @@ -953,7 +987,7 @@ Flattenlist(pltlist):=( Divoptions(options):=( //help:Divoptions(options); - regional(Ltype,Noflg,Inflg,Outflg,eqL,realL,strL,opstr,opcindy,flg,tmp,tmp1); + regional(Ltype,Noflg,Inflg,Outflg,eqL,realL,strL,color,opstr,opcindy,flg,tmp,tmp1,tmp2); Ltype="dr"; // 2015.01.13 Noflg=0; Inflg=0; @@ -961,6 +995,7 @@ Divoptions(options):=( eqL=[]; realL=[]; strL=[]; + color=KCOLOR; //180603 opstr=""; opcindy=""; forall(options, @@ -974,7 +1009,31 @@ Divoptions(options):=( ); if(flg==0, if(indexof(#,"=")>0, - eqL=append(eqL,#); + tmp=Strsplit(#,"="); //180602from + tmp1=Toupper(tmp_1); + tmp2=tmp_2; + if(tmp1=="COLOR", + if(substring(tmp2,0,1)=="[", + tmp1=parse(tmp2); + color=tmp1; + if(length(tmp1)==4, + tmp1=colorCmyk2Rgb(tmp1); + ); + , + if(tmp2=="red",tmp1=[1,0,0];color=tmp1); + if(tmp2=="green",tmp1=[0,1,0];color=tmp1); + if(tmp2=="blue",tmp1=[0,0,1];color=tmp1); + if(tmp2=="black",tmp1=[0,0,0];color=tmp1); + if(tmp2=="white",tmp1=[1,1,1];color=tmp1); + if(tmp2=="cyan",tmp1=[0,1,1];color=tmp1); + if(tmp2=="magenta",tmp1=[1,0,1];color=tmp1); + if(tmp2=="yellow",tmp1=[1,1,0];color=tmp1); + ); + tmp="color->"+text(tmp1); + opcindy=opcindy+","+tmp; + , + eqL=append(eqL,#); + );//180602to flg=1; ); ); @@ -1032,9 +1091,9 @@ Divoptions(options):=( ); ); if(indexof(opcindy,"color->")==0,// 16.10.07from - opcindy=opcindy+",color->[0,0,0]"; + opcindy=opcindy+",color->"+text(KCOLOR); ); - [Ltype,Noflg,Inflg,Outflg,eqL,realL,strL,opstr,opcindy]; + [Ltype,Noflg,Inflg,Outflg,eqL,realL,strL,color,opstr,opcindy]; ); Dotprod(vec1,vec2):=( @@ -2229,11 +2288,17 @@ Com1st(String):=( // COM1stlist=append(COM1stlist,str); ); -Com2nd(String):=( -// help:Com2nd(""); - regional(str); - str=replace(String,LFmark,""); +Com2nd(String):=Com2nd(String,["a"]);//180612 +Com2nd(String,option):=( +// help:Com2nd(str,["before"]); + regional(str,tmp); + str=replace(String,LFmark,""); + tmp=substring(option_1,0,1);//180612from + if(Toupper(tmp)=="B", + COM2ndlistb=append(COM2ndlistb,str); + , COM2ndlist=append(COM2ndlist,str); + );//180612to ); Com2ndpre(String):=( @@ -2306,6 +2371,7 @@ Setunitlen():=( println(ULEN); ); Setunitlen(UI):=( +//help:Setunitlen("1.5cm"); regional(Dx,Dy,Sym,SL,OL,Is,VL,Ucode,ii,cha, str,Unit,Valu,flg,tmp); Dx=XMAX-XMIN; @@ -2315,7 +2381,7 @@ Setunitlen(UI):=( OL="+-*/"; if(length(UI)>0, ULEN=UI; - GLIST=append(GLIST,"Setunitlen("+Dq+string+Dq+")"); + GLIST=append(GLIST,"Setunitlen("+Dq+UI+Dq+")");//180513 ); Is=1; VL=""; @@ -2484,46 +2550,33 @@ Definecolor(name,data):=( Texcom(tmp); ); -Setcolor(Par):=( +Setcolor(parorg):=( //180603renew //help:Setcolor([1,0,0,1]); //help:Setcolor([1,1,0]); - if(islist(Par), - if(length(Par)==3, - Setcolorrgb(Par); // 2015.04.28 -// KCOLOR=Par; - ); - if(length(Par)==4, - Setcolor(Par,[]); - ); - , - Setcolor(Par,[]); - ); -); - -Setcolor(colorname,options):=( -//help:Setcolor("greenyellow",0.3); - regional(tmp); - if(isstring(colorname), - tmp="Setcolor("+Dq+colorname+Dq; - if(length(options)>0, - tmp=tmp+","+text(options_1); - ); - Com2nd(tmp+")"); - ); - if(islist(colorname), - tmp=text(colorname); - tmp=substring(tmp,1,length(tmp)-1); - Texcom("\color[cmyk]{"+tmp+"}"); //17.09.22 - ); -); - -Setcolorrgb(colorlist):=( -// help:Setcolorrgb([0.5,0.3,0.4]); - regional(tmp); - tmp=text(colorlist); - tmp=substring(tmp,1,length(tmp)-1); - tmp="Texcom("+Dq+"\\color[rgb]{"+tmp+"}"+Dq+")"; //17.10.07 - Com2nd(tmp); + regional(par,cstr,tmp,tmp1); + par=parorg; + if(isstring(par), + if(par=="black",par=[0,0,0]); + if(par=="white",par=[1,1,1]); + if(par=="red",par=[1,0,0]); + if(par=="green",par=[0,1,0]); + if(par=="blue",par=[0,0,1]); + if(par=="cyan",par=[0,1,1]); + if(par=="magenta",par=[1,0,1]); + if(par=="yellow",par=[1,1,0]); + ); + cstr=text(par); + cstr=substring(cstr,1,length(cstr)-1); + if(length(par)==3, + cstr="Texcom('\\color[rgb]{"+cstr+"}')"; + KCOLOR=par; + ); + if(length(par)==4, + cstr="Texcom('\\color[cmyk]{"+cstr+"}')"; + tmp=ColorCmyk2Rgb(par); + KCOLOR=tmp; + ); + Com2nd(cstr); ); ColorRgb2Cmyk(clr):=( @@ -2815,30 +2868,6 @@ Colorcode(src,dest,sL):=( dL; ); -Addcolor(cmdorg,list):=( -//help:Addcolor("Plotdata('1','x^2','x',[])",[1,1,0]); - regional(rgb,cmyk,cmd,tmp,tmp1,tmp2,tmp3,tmp4); - cmd=replace(cmdorg,"'",Dq); - if(length(list)==3, - rgb=list; - cmyk=Colorcode("rgb","cmyk",list); - , - cmyk=list; - rgb=Colorcode("cmyk","rgb",list); - ); - tmp1="color->"+text(rgb); - tmp2="Setcolor("+text(cmyk)+");"; - tmp3=substring(cmd,0,length(cmd)-2); - tmp=substring(tmp3,length(tmp3)-1,length(tmp3)); - if(tmp!="[", - tmp3=tmp3+","; - ); - tmp3=tmp3+Dq+tmp1+Dq+"])"; - parse(tmp2); - parse(tmp3); - Setcolor("black"); -); - Colorinfile(filename,clrf,clrt):=( regional(tmp,tmp1,tmp2,head,cstrL,chstrL,head,body); if(length(clrf_1)==3, @@ -2974,23 +3003,12 @@ Chunderscore(str):=( tmp1; ); -//AddGraph(pltdata):=AddGraph("-"+pltdata,pltdata,[]); AddGraph(nm,pltdata):=AddGraph(nm,pltdata,[]); -// if(isstring(Arg2), -// AddGraph(Arg1,Arg2,[]); -// , -// if(MeasureDepth(Arg2)>0, -// Addgraph(Arg1,Arg2,[]); -// , -// Addgraph("-"+Arg1,Arg1,Arg2); -// ); -// ); -//); AddGraph(nm,pltdata,options):=( //help:AddGraph("1","imp1"); // 16.04.04 //help:Addgraph("1",["[pt1]","gr1"],["nodisp"]); regional(name,Ltype,Noflg,opcindy,pdata,fname,flg, - tmp,tmp1,tmp2,tmp3); + tmp,tmp1,tmp2,tmp3,color); if(substring(nm,0,1)=="-", name=substring(nm,1,length(nm)); , @@ -2999,7 +3017,8 @@ AddGraph(nm,pltdata,options):=( tmp=Divoptions(options); Ltype=tmp_1; Noflg=tmp_2; - opcindy=tmp_9; + color=tmp_(length(tmp)-2); + opcindy=tmp_(length(tmp)); if(isstring(pltdata), pdata=parse(pltdata) , @@ -3072,7 +3091,9 @@ AddGraph(nm,pltdata,options):=( ); // 16.04.04 until if(Noflg<2, if(isstring(Ltype), + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); , if(Noflg==1,Ltype=0); ); @@ -3084,7 +3105,7 @@ Joincrvs(nm,plotstrL):=Joincrvs(nm,plotstrL,[]); Joincrvs(nm,plotstrL,options):=( //help:Joincrvs("1",["sgAB","sgDCB"]); regional(plotlist,PtL,Eps,QdL,Flg,Ni,Qd,pP,pS,pQ,pR,rMN, - opcindy,tmp,tmp1,tmp2,str,name,Ltype,Noflg); + opcindy,tmp,tmp1,tmp2,str,name,Ltype,Noflg,color); name="join"+nm; plotlist=[]; forall(plotstrL,str, @@ -3100,6 +3121,7 @@ Joincrvs(nm,plotstrL,options):=( tmp=Divoptions(options); Ltype=tmp_1; Noflg=tmp_2; + color=tmp_(length(tmp)-2); opcindy=tmp_(length(tmp)); tmp1=tmp_6; if(length(tmp1)>0,Eps=tmp1_1); @@ -3162,7 +3184,9 @@ Joincrvs(nm,plotstrL,options):=( ); if(Noflg<2, if(isstring(Ltype), + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); , if(Noflg==1,Ltype=0); ); @@ -3176,7 +3200,7 @@ Partcrv(nm,pA,pB,PkLstr,options):=( //help:Partcrv("1",A,B,"sgABC"); //help:Partcrv("1",1.3,2.5,"sgABC"); regional(PkL,Ans,Eps,Npt,Out1,Out2,tmp,tmp1,Flg,nS,nE,PPL,pP, - opcindy,Ta,Tb,name,Ltype,Noflg,DepthFlg); + opcindy,Ta,Tb,name,Ltype,Noflg,DepthFlg,color); name="part"+nm; if(isstring(PkLstr),PkL=parse(PkLstr),PkL=PkLstr); DepthFlg=0; @@ -3188,6 +3212,7 @@ Partcrv(nm,pA,pB,PkLstr,options):=( tmp=Divoptions(options); Ltype=tmp_1; Noflg=tmp_2; + color=tmp_(length(tmp)-2); opcindy=tmp_(length(tmp)); Eps=10^(-3); Flg=0; @@ -3246,7 +3271,9 @@ Partcrv(nm,pA,pB,PkLstr,options):=( ); if(Noflg<2, if(isstring(Ltype), + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); , if(Noflg==1,Ltype=0); ); @@ -3271,17 +3298,18 @@ Pointdata(nm,listorg,options):=( //help:Pointdata("1",[2,4],["Size=5"]); //help:Pointdata("2",[[2,3],[4,1]]); regional(list,name,nameL,ptlist,opstr,opcindy, - eqL,size,thick,tmp,tmp1,tmp2,tmp3,Ltype,Noflg); + eqL,size,thick,tmp,tmp1,tmp2,tmp3,Ltype,Noflg,color); name="pt"+nm; nameL=name+"L"; println("generate pointdata "+name); tmp=Divoptions(options); Ltype=tmp_1; Noflg=tmp_2; + eqL=tmp_5; opcindy=tmp_(length(tmp)); opstr=tmp_(length(tmp)-1); + color=tmp_(length(tmp)-2); size=""; - eqL=tmp_5; if(length(eqL)>0, forall(eqL, tmp=substring(#,0,1); @@ -3292,6 +3320,7 @@ Pointdata(nm,listorg,options):=( ); ); if(isstring(listorg),list=parse(listorg),list=listorg); //17.10.23 + if(MeasureDepth(list)==0,list=[list]);//180530 tmp=MeasureDepth(list); if(tmp>0, // 2015.02.21 if(tmp==1,ptlist=list,ptlist=list_1); @@ -3337,7 +3366,9 @@ Pointdata(nm,listorg,options):=( if(length(size)>0,tmp1=parse(size),tmp1=1); tmp1=max(tmp1,1)/8; Setpen(tmp1); // 16.04.09 until + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); Com2nd("Drwpt(list("+name+")"+opstr+")"); + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); Setpen(thick); // 16.04.09 if(length(size)>0, Com2nd("Setpt("+textformat(TenSize/TenSizeInit,1)+")"); @@ -3352,7 +3383,7 @@ Listplot(nm,list,options):=( // help:Listplot(["A","B"]); //help:Listplot("1",[[2,1],[3,3]]); //help:Listplot(options2=["Msg=yes"]); - regional(name,tmp,tmp1,ptlist,Ltype,opcindy,Noflg,eqL,Msg); + regional(name,tmp,tmp1,ptlist,Ltype,opcindy,Noflg,eqL,Msg,color); if(substring(nm,0,1)=="-", // 16.01.27 from name=substring(nm,1,length(nm)); , @@ -3362,6 +3393,7 @@ Listplot(nm,list,options):=( Ltype=tmp_1; Noflg=tmp_2; eqL=tmp_5; + color=tmp_(length(tmp)-2); opcindy=tmp_(length(tmp)); Msg=1; // 15.09.17 forall(eqL, @@ -3386,7 +3418,9 @@ Listplot(nm,list,options):=( ); if(Noflg<2, if(isstring(Ltype), + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); , if(Noflg==1,Ltype=0); ); @@ -3417,13 +3451,14 @@ Lineplot(nm,list,options):=( //help:Lineplot([A,B]); //help:Lineplot("1",[[2,1],[3,3]]); regional(name,Out,tmp,tmp1,opstr,opcindy,Mag,Semi, - Vec,pA,pB,Ltype,Noflg); + Vec,pA,pB,Ltype,Noflg,color); name="ln"+nm; Mag=100; Semi=""; tmp=Divoptions(options); Ltype=tmp_1; Noflg=tmp_2; + color=tmp_(length(tmp)-2); opcindy=tmp_(length(tmp)); opstr=tmp_(length(tmp)-1); tmp1=tmp_6; @@ -3450,7 +3485,9 @@ Lineplot(nm,list,options):=( ); if(Noflg<2, if(isstring(Ltype), + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); , if(Noflg==1,Ltype=0); ); @@ -3483,7 +3520,7 @@ Plotdata(name1,func,variable,options):=( //help:Plotdata("3","Fout(x)","x",["out"]); regional(Fn,Va,tmp,tmp1,tmp2,eqL,name,Vname,x1,x2,dx, PdL,QdL,Num,Ec,Dc,Fun,Exfun,x,Ke,Eps,Pa, - Ltype,Noflg,Inflg,Outflg,opstr,opcindy); + Ltype,Noflg,Inflg,Outflg,opstr,opcindy,color); name="gr"+name1; tmp=Divoptions(options); Ltype=tmp_1; @@ -3491,6 +3528,7 @@ Plotdata(name1,func,variable,options):=( Inflg=tmp_3; Outflg=tmp_4; opstr=tmp_(length(tmp)-1); + color=tmp_(length(tmp)-2); opcindy=tmp_(length(tmp)); eqL=tmp_5; Num=50; @@ -3617,8 +3655,10 @@ Plotdata(name1,func,variable,options):=( ); if(Noflg<2, if(isstring(Ltype), + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); Ltype=GetLinestyle(text(Noflg)+Ltype,name); - , + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); + , if(Noflg==1,Ltype=0); ); GCLIST=append(GCLIST,[name,Ltype,opcindy]); @@ -3627,7 +3667,9 @@ Plotdata(name1,func,variable,options):=( , if(Noflg<2, if(isstring(Ltype), + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); , if(Noflg==1,Ltype=0); ); @@ -3643,7 +3685,7 @@ Paramplot(name1,funstr,variable,options):=( //help:Paramplot("1","[2*cos(t),sin(t)]","t=[0,2*pi]"); regional(name,Out,tmp,tmp1,tmp2,vname,func,str,Rng,Num, Ec,Exfun,Dc,eqL,Fntmp,Vatmp,t1,t2,dt,tt,pa,ke, - Ltype,Noflg,Inflg,Outflg,opstr,opcindy); + Ltype,Noflg,Inflg,Outflg,opstr,opcindy,color); name="gp"+name1; Eps=10^(-4); tmp=Divoptions(options); @@ -3651,6 +3693,7 @@ Paramplot(name1,funstr,variable,options):=( Noflg=tmp_2; Inflg=tmp_3; Outflg=tmp_4; + color=tmp_(length(tmp)-2); opstr=tmp_(length(tmp)-1); opcindy=tmp_(length(tmp)); eqL=tmp_5; @@ -3760,7 +3803,9 @@ Paramplot(name1,funstr,variable,options):=( ); if(Noflg<2, if(isstring(Ltype), + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); , if(Noflg==1,Ltype=0); ); @@ -3770,7 +3815,9 @@ Paramplot(name1,funstr,variable,options):=( , if(Noflg<2, if(isstring(Ltype), + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); , if(Noflg==1,Ltype=0); ); @@ -3850,7 +3897,7 @@ Implicitplot(name1,func,xrng,yrng,options):=( //help:Implicitplot("1","x^2+x*y+y^2=1","x=[-3,3]","y=[-3,3]"); //help:Implicitplot(options=["Num=[50,50]"]); regional(name,Fn,varx,vary,rngx,rngy,Mdv,Ndv,tmp,tmp1,tmp2, - Eps,Ltype,Noflg,eqL,opsr,opcindy,dx,dy,out,jj,ii,kk, + Eps,Ltype,Noflg,eqL,color,opsr,opcindy,dx,dy,out,jj,ii,kk, yval1,yval2,xval1,xval2,eval11,eva12,eval21,eval22,pL,vL,qL); name="imp"+name1; Eps=10^(-4); @@ -3858,6 +3905,7 @@ Implicitplot(name1,func,xrng,yrng,options):=( Ltype=tmp_1; Noflg=tmp_2; eqL=tmp_5; + color=tmp_(length(tmp)-2); opstr=tmp_(length(tmp)-1); opcindy=tmp_(length(tmp)); Mdv=50;Ndv=50; @@ -3961,7 +4009,9 @@ Implicitplot(name1,func,xrng,yrng,options):=( ); if(Noflg<2, if(isstring(Ltype), + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); , if(Noflg==1,Ltype=0); ); @@ -3990,15 +4040,16 @@ Circledata(para1,para2):=( Circledata(name,cenrad,options); ); Circledata(nm,cenrad,options):=( - regional(name,Out,Ctr,Ptcir,ra,Num,Rg,opstr,opcindy, + regional(name,Out,Ctr,Ptcir,ra,Num,Rg,opstr,opcindy,color, tmp,tmp1,tmp1,Th,Ltype,Noflg,eqL,pA,pB,pC,d1,d2,Eps); name="cr"+nm; tmp=Divoptions(options); Ltype=tmp_1; Noflg=tmp_2; + eqL=tmp_5; + color=tmp_(length(tmp)-2); opstr=tmp_(length(tmp)-1); opcindy=tmp_(length(tmp)); - eqL=tmp_5; Num=50; Rg=[0,2*pi]; forall(eqL, @@ -4065,7 +4116,9 @@ Circledata(nm,cenrad,options):=( ); if(Noflg<2, if(isstring(Ltype), + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); , if(Noflg==1,Ltype=0); ); @@ -4107,11 +4160,12 @@ Framedata(nm,list,options):=( //help:Framedata("1",[C,A]); //help:Framedata("1",[C,dx,dy]); regional(name,Out,tmp,tmp1,pB,x1,x2,y1,y2,dx,dy, - opcindy,Ltype,Noflg,cent,dx,dy); + opcindy,Ltype,Noflg,cent,dx,dy,color); name="fr"+nm; tmp=Divoptions(options); Ltype=tmp_1; Noflg=tmp_2; + color=tmp_(length(tmp)-2); opcindy=tmp_(length(tmp)); if(length(list)==2, // 15.05.12 pA=Lcrd(list_1); pB=Lcrd(list_2); @@ -4132,7 +4186,9 @@ Framedata(nm,list,options):=( ); if(Noflg<2, if(isstring(Ltype), + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); , if(Noflg==1,Ltype=0); ); @@ -4142,11 +4198,12 @@ Framedata(nm,list,options):=( ); Framedata(nm,cent,dx,dy):=Framedata(nm,cent,dx,dy,[]); Framedata(nm,cent,dx,dy,options):=( - regional(name,Out,tmp,tmp1,x1,y1,x2,y2,Ltype,opcindy,Noflg); + regional(name,Out,tmp,tmp1,x1,y1,x2,y2,Ltype,opcindy,Noflg,color); name="fr"+nm; tmp=Divoptions(options); Ltype=tmp_1; Noflg=tmp_2; + color=tmp_(length(tmp)-2); opcindy=tmp_(length(tmp)); x1=cent.x-dx; x2=cent.x+dx; y1=cent.y-dy; y2=cent.y+dy; @@ -4160,7 +4217,9 @@ Framedata(nm,cent,dx,dy,options):=( ); if(Noflg<2, if(isstring(Ltype), + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); , if(Noflg==1,Ltype=0); ); @@ -4183,11 +4242,12 @@ Ovaldata(nm,Pdata,options):=( //help:Ovaldata("1",[A,B]); //help:Ovaldata(optios=[size]); regional(name,Graph,Ctr,Dx,Dy,Rc,Out,Point,Graph, - opstr,opcindy,tmp,tmp1,tmp2,tmp3,Ltype,Noflg); + opstr,opcindy,tmp,tmp1,tmp2,tmp3,Ltype,Noflg,color); name="ov"+nm; tmp=Divoptions(options); Ltype=tmp_1; Noflg=tmp_2; + color=tmp_(length(tmp)-2); opcindy=tmp_(length(tmp)); opstr=tmp_(length(tmp)-1); Rc=0.2; @@ -4226,7 +4286,9 @@ Ovaldata(nm,Pdata,options):=( ); if(Noflg<2, if(isstring(Ltype), + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); , if(Noflg==1,Ltype=0); ); @@ -4240,7 +4302,7 @@ Ovaldata(nm,Pdata,options):=( ); Segmark(nm,ptlist):=Segmark(nm,ptlist,[]); -Segmark(nm,ptlist,options):=Drawsegmark(nm,ptlist,options); +Segmark(nm,ptlist,options):=Drawsegmark(nm,ptlist,options,color); Drawsegmark(nm,ptlist):=Drawsegmark(nm,ptlist,[]); Drawsegmark(nm,ptlist,options):=( //help:Segmark("1",[A,B]); @@ -4255,6 +4317,7 @@ Drawsegmark(nm,ptlist,options):=( tp=1; tmp1=Divoptions(options); eqL=tmp1_5; + color=tmp_(length(tmp)-2); forall(eqL, tmp=indexof(#,"="); tmp1=substring(#,tmp,length(#)); @@ -4516,7 +4579,7 @@ Putintersect(nm,pdata1,pdata2,ptno):=( Arrowheaddata(point,direction):=Arrowheaddata(point,direction,[]); Arrowheaddata(point,direction,options):=( -//help:Arrowheaddata(A,B); +// help:Arrowheaddata(A,B); regional(list,Ookisa,Hiraki,Futosa,Houkou,Str,Flg,tmp,Ev,Nv,pA,pB, pP,rF,gG,Flg,Nj,Eps,tmp1,scx,scy); Eps=10^(-3); @@ -4609,7 +4672,8 @@ Arrowhead(point,Houkou,options):=( //help:Arrowhead(B,B-A,[1.5,30]); //help:Arrowhead(A,"gr1"); // global ArrowheadNumber - regional(name,Ltype,Noflg,reL,opstr,opcindy,ptstr,hostr,tmp,tmp1,list); + regional(name,Ltype,Noflg,reL,opstr,opcindy,color, + ptstr,hostr,tmp,tmp1,list); name="arh"+text(ArrowheadNumber); ArrowheadNumber=ArrowheadNumber+1; ptstr=textformat(point,5); @@ -4631,6 +4695,7 @@ Arrowhead(point,Houkou,options):=( Ltype=tmp_1; Noflg=tmp_2; reL=tmp_6; + color=tmp_(length(tmp)-2); opstr=tmp_(length(tmp)-1); opcindy=tmp_(length(tmp)); list=Arrowheaddata(point,Houkou,options); @@ -4643,7 +4708,9 @@ Arrowhead(point,Houkou,options):=( ); if(Noflg<2, if(isstring(Ltype), + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); Ltype=GetLinestyle(text(1)+Ltype,name); + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); , // if(Noflg==1,Ltype=0); Ltype=0; @@ -4691,7 +4758,7 @@ Arrowdata(Arg1,Arg2,options):=( //help:Arrowdata([A,B],[2,10]); //help:Arrowdata("1",[p1,p2]); regional(Retflg,nm,ptlist,name,opstr,opcindy,realL,strL,size, - flg,Ltype,Noflg,lineflg,tmp,tmp1,tmp2,pA,pB,segpos); + flg,Ltype,Noflg,lineflg,tmp,tmp1,tmp2,pA,pB,segpos,color); Retflg=0; Noflg=0; Ltype=0; @@ -4711,6 +4778,7 @@ Arrowdata(Arg1,Arg2,options):=( Noflg=tmp_2; realL=tmp_6; strL=tmp_7; + color=tmp_(length(tmp)-2); opstr=tmp_(length(tmp)-1); opcindy=tmp_(length(tmp)); size=1; // 15.06.11 @@ -4741,7 +4809,9 @@ Arrowdata(Arg1,Arg2,options):=( ); if(Noflg<2, if(isstring(Ltype), + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); , if(Noflg==1,Ltype=0); ); @@ -4811,12 +4881,13 @@ Anglemark(Arg1,Arg2):=( // 2015.04.28 from nm=substring(tmp,1,length(tmp)-1); Anglemark(nm,plist,options); ); -); // until +); // to Anglemark(nm,plist,options):=( -//help:Anglemark([A,B,C],["E=\theta",2]); +//help([A,B,C],["E=\theta",2]); //help:Anglemark("1",[A,B,C],["E=1.2,\theta",2]); -//help:Anglemark(options=["E/L=(sep,)letter",size]); - regional(name,Out,pB,pA,pC,Ctr,ra,sab,sac,ratio,opstr,Bname,Bpos, +//help:Anglemark("1",[A,B,2*pi]); +//help:Anglemark(options=[size,"E/L=(sep,)letter"]); + regional(name,Out,pB,pA,pC,Ctr,ra,sab,sac,ratio,opstr,Bname,Bpos,color, Brat,tmp,tmp1,tmp2,Num,opcindy,Ltype,eqL,realL,Rg,Th,Noflg); name="ag"+nm; Bpos="md"+name; @@ -4824,16 +4895,18 @@ Anglemark(nm,plist,options):=( tmp=Divoptions(options); Ltype=tmp_1; Noflg=tmp_2; - opstr=tmp_(length(tmp)-1); +// opstr=tmp_(length(tmp)-1);//180530 + color=tmp_(length(tmp)-2); opcindy=tmp_(length(tmp)); eqL=tmp_5; realL=tmp_6; Bname=""; - Brat=1.5; + Brat=1.2; //180530 Num=20; + opstr=""; if(length(realL)>0, ra=realL_1*ra; - opstr=opstr+","+text(realL_1); + opstr=","+text(realL_1);//180530 ); forall(eqL, if(substring(#,0,1)=="L",Bname="Letter("); @@ -4846,11 +4919,16 @@ Anglemark(nm,plist,options):=( Brat=parse(substring(tmp,0,tmp1-1)); ); ); - pB=Lcrd(plist_1); pA=Lcrd(plist_2); pC=Lcrd(plist_3); - Ctr=Lcrd(pA); - sab=pB-pA; - sac=pC-pA; - Rg=[arctan2(sab)+0,arctan2(sac)+0]; + pB=Lcrd(plist_1); pA=Lcrd(plist_2); sab=pB-pA; + Ctr=pA; + if((length(plist_3)>1)%(ispoint(plist_3)), //180506from + pC=Lcrd(plist_3); + sac=pC-pA; + Rg=[arctan2(sab)+0,arctan2(sac)+0]; + , + sac=pB-pA; + Rg=[arctan2(sab)+0,arctan2(sab)+plist_3]; + ); //180506to if(Rg_2<Rg_1,Rg_2=Rg_2+2*pi); Out=[]; if(ra>min(|sab|,|sac|), // 16.12.29 @@ -4880,7 +4958,9 @@ Anglemark(nm,plist,options):=( ); if(Noflg<2, if(isstring(Ltype), + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); , if(Noflg==1,Ltype=0); ); @@ -4910,11 +4990,12 @@ Paramark(nm,plist,options):=( //help:Paramark([A,B,C],["E=\theta"]); //help:Paramark("1",[p1,p2,p3],["E=\theta"]); regional(name,Out,pB,pA,pC,ra,sab,sac,ratio,opstr,Bname,Bpos, - Brat,tmp,tmp1,tmp2,Ltype,Noflg,eqL,realL,opcindy); + Brat,tmp,tmp1,tmp2,Ltype,Noflg,eqL,realL,opcindy,color); name="pm"+nm; tmp=Divoptions(options); Ltype=tmp_1; Noflg=tmp_2; + color=tmp_(length(tmp)-2); opstr=tmp_(length(tmp)-1); opcindy=tmp_(length(tmp)); eqL=tmp_5; @@ -4962,7 +5043,9 @@ Paramark(nm,plist,options):=( ); if(Noflg<2, if(isstring(Ltype), + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); , if(Noflg==1,Ltype=0); ); @@ -5006,11 +5089,12 @@ Bowdata(nm,plist,options):=( //help:Bowdata([A,B],["Exprrot=t0n2r,a"]); regional(name,Out,pB,pA,pC,ra,tmp,tmp1,tmp2,Ltype,eqL,realL, Bname,Bpos,Th,Cut,Num,Hgt,opstr,opcindy,Ydata,pC, - Th1,Th2,Noflg,Bops,Bmov,Tmov,Nmov,rev); + Th1,Th2,Noflg,Bops,Bmov,Tmov,Nmov,rev,color); name="bw"+nm; tmp=Divoptions(options); Ltype=tmp_1; Noflg=tmp_2; + color=tmp_(length(tmp)-2); opstr=tmp_(length(tmp)-1); opcindy=tmp_(length(tmp)); eqL=tmp_5; @@ -5138,7 +5222,9 @@ Bowdata(nm,plist,options):=( ); if(Noflg<2, if(isstring(Ltype), + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); , if(Noflg==1,Ltype=0); ); @@ -5242,16 +5328,17 @@ Deqplot(nm,deq,rng,Arg1,Arg2):=( Deqplot(nm,deq,rng,initt,initf,options); ); Deqplot(nm,deqorg,rngorg,initt,initf,options):=( //17.10.06 -//help:Deqplot("2","y`=y*(1-y)","x",0, 0.5,["Num=100"]); -//help:Deqplot("1","y``=-y","x",0, [1,0]); -//help:Deqplot("3","[x,y]`=[x*(1-y),0.3*y*(x-1)]","t=[0,20]",0,[1,0.5]); +//help:Deqplot("2","y'=y*(1-y)","x",0, 0.5,["Num=100"]); +//help:Deqplot("1","y''=-y","x",0, [1,0]); +//help:Deqplot("3","[x,y]'=[x*(1-y),0.3*y*(x-1)]","t=[0,20]",0,[1,0.5]); regional(deq,rng,Ltype,Noflg,eqL,opcindy,Num,name,nn,pdL,phase, - sel,tmp,tmp1,tmp2); + sel,tmp,tmp1,tmp2,color); name="de"+nm; tmp=Divoptions(options); Ltype=tmp_1; Noflg=tmp_2; eqL=tmp_5; + color=tmp_(length(tmp)-2); opcindy=tmp_(length(tmp)); Num=50; forall(eqL, @@ -5268,6 +5355,7 @@ Deqplot(nm,deqorg,rngorg,initt,initf,options):=( //17.10.06 rng=rng+"="+textformat([XMIN,XMAX],6); ); deq=deqorg; + deq=replace(deq,"'","`"); //180527 tmp=indexof(deq,"="); tmp1=substring(deq,0,tmp-1); if(indexof(tmp1,"[")==0, @@ -5338,7 +5426,9 @@ Deqplot(nm,deqorg,rngorg,initt,initf,options):=( //17.10.06 ); if(Noflg<2, if(isstring(Ltype), + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); , if(Noflg==1,Ltype=0); ); @@ -5353,7 +5443,7 @@ Enclosing(nm,plist,options):=EnclosingS(nm,plist,options); EnclosingS(nm,plist):=EnclosingS(nm,plist,[]); EnclosingS(nm,plist,options):=( //help:Enclosing("1",["sc2","crAB","sc2","Invert(sc1)"],[pt,"dr"]); - regional(name,AnsL,Start,Eps,EEps,S,Flg,Fdata,Gdata,KL,pt,qt, + regional(name,AnsL,Start,Eps,EEps,S,Flg,Fdata,Gdata,KL,pt,qt,color t1,t2,t3,ii,nn,tmp,tmp1,tmp2,Ltype,Noflg,realL,eqL,opstr,opcindy); name="en"+nm; tmp=Divoptions(options); @@ -5361,6 +5451,7 @@ EnclosingS(nm,plist,options):=( Noflg=tmp_2; eqL=tmp_5; realL=tmp_6; + color=tmp_(length(tmp)-2); opstr=tmp_(length(tmp)-1); opcindy=tmp_(length(tmp)); Eps=10^(-5); // 16.12.05 @@ -5488,25 +5579,12 @@ EnclosingS(nm,plist,options):=( ); tmp=tmp+substring(tmp1,0,length(tmp1)-1)+")"+opstr+")"; GLIST=append(GLIST,tmp);//16.11.07until - // GLIST=append(GLIST,"Tmp=[]"); // 16.11.05from -// nn=floor(length(AnsL)/20); -// forall(1..nn,ii, -// tmp=AnsL_(((ii-1)*20+1)..(ii*20)); -// tmp=apply(tmp,LLcrd(#)); -// tmp="Tmp=[Tmp,"+textformat(tmp,5)+"]"; -// GLIST=append(GLIST,tmp); -// ); -// if(length(AnsL)>nn*20, -// tmp=AnsL_((nn*20+1)..(length(AnsL))); -// tmp=apply(tmp,LLcrd(#)); -// tmp="Tmp=[Tmp,"+textformat(tmp,5)+"]"; -// GLIST=append(GLIST,tmp); -// ); -// GLIST=append(GLIST,name+"=Listplot(Tmp)"); // 16.11.05until ); if(Noflg<2, if(isstring(Ltype), + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); , if(Noflg==1,Ltype=0); ); @@ -5524,7 +5602,7 @@ Enclosing2(nm,plistorg,options):=( //help:Enclosing2(options=[Eps1(0.01),Eps2(0.1)]); regional(name,plist,AnsL,Start,Eps,Eps1,Eps2,flg,Fdata,Gdata,KL, t1,t2,tst,ss,ii,nn,nxtno,Ltype,Noflg,realL,eqL,opstr,opcindy, - tmp,tmp1,tmp2); + tmp,tmp1,tmp2,color); name="en"+nm; plist=plistorg; tmp=Divoptions(options); @@ -5532,6 +5610,7 @@ Enclosing2(nm,plistorg,options):=( Noflg=tmp_2; eqL=tmp_5; realL=tmp_6; + color=tmp_(length(tmp)-2); opstr=tmp_(length(tmp)-1); opcindy=tmp_(length(tmp)); Eps=10^(-5); // 16.12.05 @@ -5654,7 +5733,9 @@ Enclosing2(nm,plistorg,options):=( ); if(Noflg<2, if(isstring(Ltype), + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); , if(Noflg==1,Ltype=0); ); @@ -5746,11 +5827,12 @@ Makehatch(iolistorg,pt,vec,bdylist):=( ); Hatchdatacindy(nm,iostr,bdylist):=Hatchdatacindy(nm,iostr,bdylist,[]); +Hatchdata(nm,iostr,bdylist,options):=Hatchdatacindy(nm,iostr,bdylist,options); Hatchdatacindy(nm,iostr,bdylistorg,options):=( -//help:Hatchdatacindy("1",["ii"],[["ln1","Invert(gr1)"],["gr2","n"]]); -//help:Hatchdatacindy(options=[angle,width]); +//help:Hatchdata("1",["ii"],[["ln1","Invert(gr1)"],["gr2","n"]]); +//help:Hatchdata(options=[angle,width]); regional(name,bdylist,bdynameL,bname,Ltype,Noflg,opstr,opcindy,reL,startP,angle, - interval,vec,nvec,flg,pt,kk,delta,sha,AnsL,tmp,tmp1,tmp2); + interval,vec,nvec,flg,pt,kk,delta,sha,AnsL,tmp,tmp1,tmp2,color); name="ha"+nm; bdylist=[]; bdynameL=[]; @@ -5797,6 +5879,7 @@ Hatchdatacindy(nm,iostr,bdylistorg,options):=( tmp=Divoptions(options); Ltype=tmp_1; Noflg=tmp_2; + color=tmp_(length(tmp)-2); opstr=tmp_(length(tmp)-1); opcindy=tmp_(length(tmp)); reL=tmp_6; @@ -5863,7 +5946,9 @@ Hatchdatacindy(nm,iostr,bdylistorg,options):=( ); if(Noflg<2, if(isstring(Ltype), + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); Ltype=GetLinestyle(text(Noflg)+Ltype,name); + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")")); , if(Noflg==1,Ltype=0); ); @@ -5877,34 +5962,65 @@ Hatchdatacindy(nm,iostr,bdylistorg,options):=( tmp2; ); -/////////// end of new Hatchdata(cindy) /////////// - -Shade(plist):=Shade(plist,[]); -Shade(plist,options):=( -//help:Shade(["gr2","sg1"],[0.5]); -//help:Shade(["gr2","sg1"],["red" /pict2e]); -//help:Shade(["gr2","sg1"],[[0,0,0,0.5] /pict2e]); -//help:Shade(["gr2","sg1"],[[1,0,0] /pict2e]); -//help:Shade([pointlist]); - regional(tmp,tmp1,tmp2,opstr,opcindy,Str,G2,flg); +Shade(plist):=Shade("",plist,[]); //180613from +Shade(Arg1,Arg2):=( + if(isstring(Arg1), + Shade(Arg1,Arg2,[]); + , + Shade("",Arg1,Arg2); + ); +); +Shade(nm,plistorg,options):=( //180613to +//help:Shade(["gr"],[0.5]); +//help:Shade(["gr"],["Color=red"]); +//help:Shade(["gr2","sg1"],["Color=[0,0,0,0.5]"]); +//help:Shade(["gr2","sg1"],["Color=[1,0,0]"]); +// help:Shade([[A,B,C,A]]); + regional(name,plist,jj,tmp,tmp1,tmp2,opstr,opcindy,reL,Str,G2,flg,color,ctr); + name="shade"+nm; + plist=plistorg; if(isstring(plist_1), // 16.01.24 println("output Shade of "+plist); , println("output Shade of lists"); ); tmp=Divoptions(options); + color=tmp_(length(tmp)-2); opstr=tmp_(length(tmp)-1); opcindy=tmp_(length(tmp)); - flg=0; - forall(plist, + reL=tmp_6; //180603from + if(length(reL)>0, + color=reL_1*color; + );//180603to + if(length(color)==4, //180602from + tmp=colorCmyk2rgb(color); + ); + flg=0; ctr=1; + forall(1..(length(plist)),jj, //180613from if(flg==0, - if(isstring(#),tmp=parse(#),tmp=#); // from 16.01.24 - if(!islist(tmp),flg=1); until + tmp1=plist_jj; + if(isstring(tmp1),tmp=parse(tmp1),tmp=tmp1); + if(!islist(tmp), + flg=1; + , + if(!isstring(tmp1), + tmp2=[]; + forall(tmp1,if(ispoint(#),tmp=#.xy,tmp=#); + tmp2=append(tmp2,tmp); + ); + tmp1=Dqq("-"+name+text(ctr)); + tmp2=textformat(tmp2,6)+",["+Dqq("nodisp")+"]"; + tmp=name+text(ctr)+"=Listplot("+tmp1+","+tmp2+")"; + parse(tmp); + plist_jj=name+text(ctr); + ctr=ctr+1; + ); + ); ); - ); + );//180613to if(flg==1, -// err("some data not defined yet"); + println(" some data not defined properly"); , G2=Joincrvs("1",plist,["nodata"]); G2=apply(G2,Pcrd(#)); @@ -5925,8 +6041,15 @@ Shade(plist,options):=( ); // until 16.01.24 ); Str=Str+substring(tmp1,0,length(tmp1)-1)+")"+opstr+")"; - Com2nd(Str); + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")",["before"])); + Com2nd(Str,["before"]); + if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")",["before"])); ); +/////////// end of new Hatchdata(cindy) /////////// + + + + //help:end(); diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2logr.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2logr.txt index 6510040a896..afbbbad15a7 100644 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2logr.txt +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2logr.txt @@ -1,3 +1,34 @@ +// 20180610 +// WritetoRS changed ( \\ => /) +// 20180608 +// Setslide changed ( old style of setting title resupported ) +// 20180604 +// Mkslides,Mkslidesummary debugged ( to make kc.sh executable ) +// Changework changed (set to Dircdy if dir not found ) +// 20180603 +// Rotatedata,... changed (KCOLOR) +// Letter,Letterrot,Exprrot changed (color) +// Scaledata changed ( case where x,y is the same ratio) +// 20180602 +// divoptions ( 8,9 ->length(tmp)-1,length(tmp)) +// Rotatedata,... changed (color supported ) +// Rotataedata,... debugged ( level RSform =>1 ) +// Settitle debugged ( color option batted ) +//20180529 +// Presentation debugged (for repeat=1) +//20180526 +// Repeatsameslide debugged (for minipage with thin) +// Presentation changed ( page jump button ) +//20180524 +// Presentation changed ( pageend, \slidepage, pagestyle{empty}) +//20180515 +// Setpara changed ( "m" as default) +//20180514 +// WritetoRS,Makebat changed ( to execsrc.r) +//20180513 +// WritetoRS,Makebat changed ( UTF-8) +//20180412 +// Mksummary changed ( calcbyR, quit ) //20180409 // WritetoRS,Makebat changed ( "shell" used ) //20180408 diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2r.cs b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2r.cs index ae40d147f9b..859b46f749f 100644 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2r.cs +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2r.cs @@ -14,7 +14,7 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>
//
-println("ketcindybasic2(20180409) loaded");
+println("ketcindybasic2(20180610) loaded");
//help:start();
@@ -103,14 +103,16 @@ Reflectpoint(point,symL):=( Rotatedata(nm,plist,Theta):=Rotatedata(nm,plist,Theta,[]);
Rotatedata(nm,plist,angle,options):=(
-//help:Rotatedata("1","crAB",pi/3,[[1,5],"dr,2"]);
+//help:Rotatedata("1",["crAB","pt1"],pi/3,[[1,5],"dr,2"]);
+//help:Rotatedata("1",[[A.xy],[B.xy]],pi/3,[[1,5],"dr,2"]);
regional(tmp,tmp1,tmp2,pdata,Theta,Pt,Cx,Cy,PdLL,PdL,
- opcindy,Nj,Njj,Kj,Mj,X1,Y1,X2,Y2,Ltype,Noflg,name);
+ opcindy,Nj,Njj,Kj,Mj,X1,Y1,X2,Y2,Ltype,Noflg,name,color);
name="rt"+nm;
Pt=[0,0];
tmp=Divoptions(options);
Ltype=tmp_1;
Noflg=tmp_2;
+ color=tmp_(length(tmp)-2);
opcindy=tmp_(length(tmp));
tmp1=tmp_6;
if(length(tmp1)>0,Pt=Lcrd(tmp1_1));
@@ -152,14 +154,16 @@ Rotatedata(nm,plist,angle,options):=( tmp=name+"="+textformat(tmp1,5);
parse(tmp);
tmp1=text(plist);
- tmp1=RSform(tmp1);// 17.12.23(2lines)
+ tmp1=RSform(tmp1,1);// 180602
tmp=name+"=Rotatedata("+tmp1+","
+textformat(angle,5)+","+RSform(textformat(Pt,5))+")"; //17.12.23
GLIST=append(GLIST,tmp);
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -170,13 +174,14 @@ Rotatedata(nm,plist,angle,options):=( Translatedata(nm,plist,mov):=Translatedata(nm,plist,mov,[]);
Translatedata(nm,plist,mov,options):=(
-//help:Translatedata("1",["gr1"],[1,2]);
+//help:Translatedata("1",["gr1","pt1"],[1,2]);
regional(tmp,tmp1,tmp2,pdata,Cx,Cy,PdL,Nj,Njj,Kj,
- opcindy,X2,Y2,Ltype,Noflg,name);
+ opcindy,X2,Y2,Ltype,Noflg,name,color,leveL);
name="tr"+nm;
tmp=Divoptions(options);
Ltype=tmp_1;
Noflg=tmp_2;
+ color=tmp_(length(tmp)-2);
opcindy=tmp_(length(tmp));
pdata=plist;
if(isstring(pdata),pdata=[pdata]);
@@ -212,14 +217,16 @@ Translatedata(nm,plist,mov,options):=( if(length(tmp1)==1,tmp1=tmp1_1);
tmp=name+"="+textformat(tmp1,5);
parse(tmp);
- tmp1=text(plist);
- tmp1=RSform(tmp1);// 17.12.23
+ tmp1=text(plist);
+ tmp1=RSform(tmp1,1);// 180602
tmp=name+"=Translatedata("+tmp1+","+RSform(textformat(mov,5))+")";
GLIST=append(GLIST,tmp);
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -230,14 +237,19 @@ Translatedata(nm,plist,mov,options):=( Scaledata(nm,plist,ratioV):=(
regional(tmp);
- tmp=Lcrd(ratioV);
+ tmp=ratioV; //180603from
+ if(!islist(tmp),tmp=[tmp,tmp]);
+ tmp=Lcrd(tmp);//180603to
Scaledata(nm,plist,tmp_1,tmp_2,[]);
);
Scaledata(nm,plist,Arg1,Arg2):=(
-//help:Scaledata("1","crAB",3,2,[[0,0]]);
+//help:Scaledata("1",["crAB","pt1"],3,2,[[0,0]]);
+//help:Scaledata("1",["crAB","pt1"],2,[[0,0]]);
regional(tmp,options);
if(islist(Arg2),
- tmp=Lcrd(Arg1);
+ tmp=Arg1;//180603(2lines)
+ if(!islist(tmp),tmp=[tmp,tmp]);
+ tmp=Lcrd(tmp);
options=Arg2;
Scaledata(nm,plist,tmp_1,tmp_2,options);
,
@@ -246,12 +258,13 @@ Scaledata(nm,plist,Arg1,Arg2):=( );
Scaledata(nm,plist,rx,ry,options):=(
regional(tmp,tmp1,tmp2,pdata,Theta,Pt,Cx,Cy,PdL,
- opcindy,Nj,Njj,Kj,X2,Y2,Ltype,Noflg,name);
+ opcindy,Nj,Njj,Kj,X2,Y2,Ltype,Noflg,name,color);
name="sc"+nm;
Pt=[0,0];
tmp=Divoptions(options);
Ltype=tmp_1;
Noflg=tmp_2;
+ color=tmp_(length(tmp)-2);
opcindy=tmp_(length(tmp));
tmp1=tmp_6;
if(length(tmp1)>0,
@@ -291,14 +304,16 @@ Scaledata(nm,plist,rx,ry,options):=( tmp=name+"="+textformat(tmp1,5);
parse(tmp);
tmp1=text(plist);
- tmp1=RSform(tmp1); // 17.12.23
+ tmp1=RSform(tmp1,1); // 180602
tmp=name+"=Scaledata("+tmp1+","
+textformat(rx,5)+","+textformat(ry,5)+","+RSform(textformat(Pt,5))+")";
GLIST=append(GLIST,tmp);
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -309,14 +324,15 @@ Scaledata(nm,plist,rx,ry,options):=( Reflectdata(nm,plist,symL):=Reflectdata(nm,plist,symL,[]);
Reflectdata(nm,plist,symL,options):=(
-//help:Reflectdata("1","crAB",[C]);
+//help:Reflectdata("1",["crAB"],[C]);
regional(tmp,tmp1,tmp2,pdata,Us,Vs,Pt1,Pt2,Cx,Cy,PdL,
- opcindy,Nj,Njj,Kj,X1,Y1,X2,Y2,Ltype,Noflg,name);
+ opcindy,Nj,Njj,Kj,X1,Y1,X2,Y2,Ltype,Noflg,name,color);
name="re"+nm;
Pt=[0,0];
tmp=Divoptions(options);
Ltype=tmp_1;
Noflg=tmp_2;
+ color=tmp_(length(tmp)-2);
opcindy=tmp_(length(tmp));
pdata=plist;
if(isstring(pdata),pdata=[pdata]);
@@ -368,13 +384,15 @@ Reflectdata(nm,plist,symL,options):=( tmp=name+"="+textformat(tmp1,5);
parse(tmp);
tmp1=text(plist);
- tmp1=RSform(tmp1);// 17.12.23
+ tmp1=RSform(tmp1,1);// 180602
tmp=name+"=Reflectdata("+tmp1+","+RSform(textformat(symL,5))+")";//17.12.23
GLIST=append(GLIST,tmp);
);
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -538,6 +556,7 @@ Expr(Pt,Dr,St):=Expr([Pt,Dr,St]); Expr(list):=Expr(list,[]);
Expr(listorg,options):=( //16.10.09
//help:Expr([A,"e","f(x)=x^2"]);
+//help:Expr([A,"e","f(x)=x^2"],["size->24"]);
regional(list,str,tmp,tmp1,tmp2);
list=listorg;
forall(1..round(length(list)/3),
@@ -552,15 +571,16 @@ Expr(listorg,options):=( //16.10.09 Letter(Pt,Dr,St):=Letter([Pt,Dr,St]);
Letter(list):=Letter(list,[]);
Letter(list,options):=(
-//help:Letter([C,"c","Graph of f(x)"]);
+//help:Letter([C,"c","Graph of $f(x)$"]);
+//help:Letter([C,"c","xy"],["size->30"]);
regional(Nj,Pos,Dir,Str,Off,Dmv,Xmv,Ymv,Noflg,opcindy,
- opL,aln,sz,clr,bld,ita,tmp,tmp1,tmp2);
+ opL,aln,sz,clr,bld,ita,tmp,tmp1,tmp2,color);
tmp=Divoptions(options);
Noflg=tmp_2;
+ color=tmp_(length(tmp)-2);
opL=select(options,indexof(#,"->")>0); //16.10.09from
tmp=select(opL,indexof(#,"color"));
size=12;
- clr=[0,0,0];
bld=false;
ita=false;
aln="left";
@@ -596,7 +616,9 @@ Letter(list,options):=( Str=replace(Str,"`","'");//180303
tmp=Dq+","+Dq+Str+Dq+")";
if(Noflg==0,
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Com2nd("Letter("+Lcrd(Pos)+","+Dq+Dir+tmp);//16.10.10
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
);
if(Noflg<2,
Xmv=0;//16.10.13
@@ -625,18 +647,25 @@ Letter(list,options):=( );
Str=list_(Nj+2); //17.10.17
drawtext(Pcrd(Pos),Str,offset->[Off+Xmv,Off+Ymv],
- size->sz,color->clr,align->aln,bold->bld,italics->ita);//16.10.09
+ size->sz,color->color,align->aln,bold->bld,italics->ita);//16.10.09
);
Nj=Nj+3;
);
);
-Letterrot(pt,dir,str):=Letterrot(pt,dir,0,0,str);
-Letterrot(pt,dir,movstr,str):=(
+Letterrot(pt,dir,str):=Letterrot(pt,dir,0,0,str,[]);
+Letterrot(pt,dir,Arg1,Arg2):=(
+ if(islist(Arg2),
+ Letterrot(pt,dir,"t0n0",Arg1,Arg2);
+ ,
+ Letterrot(pt,dir,Arg1,Arg2,[]);
+ );
+);
+Letterrot(pt,dir,movstr,str,options):=(
//help:Letterrot(C,B-A,"AB"):
//help:Letterrot(C,B-A,0,5,"AB"):
//help:Letterrot(C,B-A,"t0n5","AB"):
- regional(tmov,nmov,tmp,tmp1,tmp2);
+ regional(tmov,nmov,tmp,tmp1,tmp2,color);
tmp1=indexof(movstr,"t");
tmp2=indexof(movstr,"n");
if(tmp1>0,
@@ -650,21 +679,32 @@ Letterrot(pt,dir,movstr,str):=( ,
nmov=0;
);
- Letterrot(pt,dir,tmov,nmov,str);
+ Letterrot(pt,dir,tmov,nmov,str,options);
);
-Letterrot(pt,dir,tmov,nmov,str):=(
- regional(tmp);
- Letter([pt,"c",str],["notex"]);
+Letterrot(pt,dir,tmov,nmov,str,options):=(
+ regional(tmp,color);
+ tmp=Divoptions(options);
+ color=tmp_(length(tmp)-2);
+ Letter([pt,"c",str],append(options,"notex"));
tmp=replace(str,"\","\\"); //17.10.18
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Com2nd("Letterrot("+pt+","+dir+","+tmov+","+nmov+",'"+tmp+"')");
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
);
-Exprrot(pt,dir,str):=Exprrot(pt,dir,0,0,str);
-Exprrot(pt,dir,movstr,str):=(
+Exprrot(pt,dir,str):=Exprrot(pt,dir,0,0,str,[]);
+Exprrot(pt,dir,Arg1,Arg2):=(
+ if(islist(Arg2),
+ Exprrot(pt,dir,"t0n0",Arg1,Arg2);
+ ,
+ Exprrot(pt,dir,Arg1,Arg2,[]);
+ );
+);
+Exprrot(pt,dir,movstr,str,options):=(
//help:Exprrot(C,B-A,"d"):
//help:Exprrot(C,B-A,0,5,"d"):
//help:Exprrot(C,B-A,"t0n5","d"):
- regional(tmov,nmov,tmp,tmp1,tmp2);
+ regional(tmov,nmov,tmp,tmp1,tmp2,color);
tmp1=indexof(movstr,"t");
tmp2=indexof(movstr,"n");
if(tmp1>0,
@@ -678,13 +718,17 @@ Exprrot(pt,dir,movstr,str):=( ,
nmov=0;
);
- Exprrot(pt,dir,tmov,nmov,str);
+ Exprrot(pt,dir,tmov,nmov,str,options);
);
-Exprrot(pt,dir,tmov,nmov,str):=(
- regional(tmp);
- Expr([pt,"c",str],["notex"]);
+Exprrot(pt,dir,tmov,nmov,str,options):=(
+ regional(tmp,color);
+ tmp=Divoptions(options);
+ color=tmp_(length(tmp)-2);
+ Expr([pt,"c",str],append(options,"notex"));
tmp=replace(str,"\","\\"); //17.10.18
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Com2nd("Exprrot("+pt+","+dir+","+tmov+","+nmov+",'"+tmp+"')");
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
);
Putslider(ptstr,p1,p2):=Slider(ptstr,p1,p2);
@@ -765,11 +809,12 @@ BezierCurve(nm,ptlistorg,ctrlistorg,options):=( //help:Bezier("1",[A,D],[B,C]);
//help:Bezier(options=["Num=10"]);
regional(name,Ltype,Noflg,opstr,opcindy,Num,
- ptlist,ctrlist,tmp,tmp1,tmp2,ii,st,out,list);
+ ptlist,ctrlist,tmp,tmp1,tmp2,ii,st,out,list,color);
name="bz"+nm;
tmp=Divoptions(options);
Ltype=tmp_1;
Noflg=tmp_2;
+ color=tmp_(length(tmp)-2);
opstr=tmp_(length(tmp)-1);
opcindy=tmp_(length(tmp));
Num=10;
@@ -822,7 +867,9 @@ BezierCurve(nm,ptlistorg,ctrlistorg,options):=( );
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -1731,7 +1778,6 @@ Tabledatalight(nm,xLst,yLst,rmvL,optionorg):=( Tabledata(nm,n,m,xsize,ysize,rmvL):=
Tabledata(nm,n,m,xsize,ysize,rmvL,[]);
Tabledata(nm,n,m,xsize,ysize,rmvL,options):=(
-//help:Tabledata("",xLst,yLst,rmvL,[2,"Rng=y"]);
regional(Tb,name,tmp,xLst,yLst);
name="tb"+nm;
xLst=apply(1..n,xsize/n);
@@ -2578,6 +2624,7 @@ WritetoRS(Arg):=( );
WritetoRS(filename,shchoice):=(
regional(Plist,Pos,GrL,str,tmp,tmp1,tmp2,cmd);
+ //help:WritetoRS(2);
println("Write to R "+filename);
Plist=[];
Pnamelist=[];
@@ -2592,7 +2639,7 @@ WritetoRS(filename,shchoice):=( SCEOUTPUT = openfile(filename);
tmp=Datetime();
println(SCEOUTPUT,"# date time="+tmp_1+" "+tmp_2);
- if(isstring(CindyPathName), // 16.12.25from
+ if(isstring(CindyName), // 16.12.25from
if(length(CindyPathName)>0,
println(SCEOUTPUT,
"# path file="+CindyPathName+" "+CindyFileName+".cdy");
@@ -2602,6 +2649,9 @@ WritetoRS(filename,shchoice):=( ,
println(SCEOUTPUT,"");
);
+ if(iswindows(),
+ println(SCEOUTPUT,"options(encoding='UTF-8')"); //180513
+ );
tmp1=replace(Dirwork,"\","/");
if((iswindows())&(indexof(tmp1,"Users")>0),
tmp=Indexall(tmp1,"/");
@@ -2613,6 +2663,7 @@ WritetoRS(filename,shchoice):=( println(SCEOUTPUT,"Hpath=Hpath[length(Hpath)]");
println(SCEOUTPUT,"Rest="+Dqq(tmp2));
println(SCEOUTPUT,"Path=paste(Drv,Hpath,Rest,sep='')");
+ println(SCEOUTPUT,"Path=gsub('\\','/',Path,fixed=TRUE)"); //180610
println(SCEOUTPUT,"setwd(Path)");
,
println(SCEOUTPUT,"setwd('"+tmp1+"')");
@@ -2705,6 +2756,13 @@ WritetoRS(filename,shchoice):=( tmp=tmp+",'Cdy="+Cindyname()+".cdy"; //180404
tmp=replace(tmp,"\","\\");
println(SCEOUTPUT,tmp+"')");
+ forall(COM2ndlistb, //180613from
+ if(indexof(#,"Texcom")==0,
+ println(SCEOUTPUT,RSform(#));
+ ,
+ println(SCEOUTPUT,#);
+ );
+ );//180613to
forall(COM2ndlist,
if(indexof(#,"Texcom")==0, //17.09.22
println(SCEOUTPUT,RSform(#));
@@ -2726,7 +2784,25 @@ WritetoRS(filename,shchoice):=( println(SCEOUTPUT,"#quit()");
);
closefile(SCEOUTPUT);
-); //17.09.17to
+ if(iswindows(), //180513from
+ SCEOUTPUT = openfile("execsrc.r");//180514
+ tmp1=replace(Dirwork,"\","/");
+ if(indexof(tmp1,"Users")>0,
+ tmp=Indexall(tmp1,"/");
+ tmp2=substring(tmp1,tmp_3-1,length(tmp1));
+ tmp1=substring(tmp1,0,tmp_3-1);
+ println(SCEOUTPUT,"Drv=shell('echo %HOMEDRIVE%',intern=TRUE)");
+ println(SCEOUTPUT,"Drv=Drv[length(Drv)]");
+ println(SCEOUTPUT,"Hpath=shell('echo %HOMEPATH%',intern=TRUE)");
+ println(SCEOUTPUT,"Hpath=Hpath[length(Hpath)]");
+ println(SCEOUTPUT,"Rest="+Dqq(tmp2));
+ println(SCEOUTPUT,"Path=paste(Drv,Hpath,Rest,sep='')");
+ println(SCEOUTPUT,"setwd(Path)");
+ println(SCEOUTPUT,"source('"+filename+"',encoding='UTF-8')");
+ );
+ closefile(SCEOUTPUT);
+ ); //180513to
+);
Extractdata(name):=Extractdata(1,name,[]);
Extractdata(Arg1,Arg2):=(
@@ -2739,10 +2815,11 @@ Extractdata(Arg1,Arg2):=( Extractdata(number,name,options):=(
//help:ExtractData("ha1");
//help:ExtractData(1,"ha1");
- regional(dlist,tmp,tmp1,tmp2,tmp3,File,Ltype,Noflg,opstr,opcindy);
+ regional(dlist,tmp,tmp1,tmp2,tmp3,File,Ltype,Noflg,opstr,opcindy,color);
tmp=Divoptions(options);
Ltype=tmp_1;
Noflg=tmp_2;
+ color=tmp_(length(tmp)-2);
opstr=tmp_(length(tmp)-1);
opcindy=tmp_(length(tmp));
tmp1=[];
@@ -2770,7 +2847,9 @@ Extractdata(number,name,options):=( );
if(Noflg<2,
if(isstring(Ltype),
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")"));
Ltype=GetLinestyle(text(Noflg)+Ltype,name);
+ if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+text(KCOLOR)+")"));
,
if(Noflg==1,Ltype=0);
);
@@ -3168,7 +3247,7 @@ Makebat(texmainfile,flow):=( path="";
);
if(indexof(flow,"r")>0,
- tmp=Dq+PathR+"\R"+Dq+" --vanilla --slave < "+Fhead+".r";
+ tmp=Dq+PathR+"\R"+Dq+" --vanilla --slave < execsrc.r";//180514
// 17.09.14
println(SCEOUTPUT,tmp);
);
@@ -3235,7 +3314,7 @@ Addpackage(packorg):=( packL_#="{"+tmp+"}";
);
);
- ADDPACK=concat(ADDPACK,packL); //17.06.25until
+ ADDPACK=concat(ADDPACK,packL); //17.06.25to
);
Viewtex():=(
@@ -3847,7 +3926,7 @@ Setslidehyper(Arg):=( );
Setslidehyper(driverorg,options):=(
//help:Setslidehyper();
-//help:Setslidehyper("dvipdfmx",["cl=true,lc=blue,fc=blue","Pos=[125,70]","Size=1"]);
+//help:Setslidehyper("dvipdfmx",["cl=true,lc=blue,fc=blue","Pos=[125,73]","Size=1"]);
regional(driver,eqL,reL,stL,,str,tmp,tmp1,tmp2);
driver=driverorg;
if(length(driver)==0,
@@ -3879,41 +3958,52 @@ Setslidehyper(driverorg,options):=( ADDPACK=select(ADDPACK,indexof(#,"hyperref")==0);
Addpackage(tmp1+"{hyperref}");
LinkPosH=125;
- LinkPosV=70;
+ LinkPosV=73;//180524
LinkSize=1;
- if(length(reL)>0,
- LinkPosH=reL_1;
- if(length(reL)>1,LinkPosV=reL_2);
- if(length(reL)>2,LinkSize=max(reL_3,0.1));
- );
+// if(length(reL)>0,
+// LinkPosH=reL_1;
+// if(length(reL)>1,LinkPosV=reL_2);
+// if(length(reL)>2,LinkSize=max(reL_3,0.1));
+// );
forall(eqL,
- tmp=indexof(#,"=");
- tmp1=Toupper(substring(#,0,1));
- tmp2=substring(#,tmp,length(#));
- tmp2=parse(tmp2);
- if(tmp1=="P",
- LinkPosH=tmp2_1;
- LinkPosV=tmp2_2;
- );
- if(tmp1=="S",
- LinkSize=max(tmp2,0.1);
- );
+ tmp=Indexall(#,"=");//180524from
+ if(length(tmp)==1,
+ tmp1=Toupper(substring(#,0,1));
+ tmp2=substring(#,tmp_1,length(#));
+ tmp2=parse(tmp2);
+ if(tmp1=="P",
+ LinkPosH=tmp2_1;
+ LinkPosV=tmp2_2;
+ );
+ if(tmp1=="S",
+ LinkSize=max(tmp2,0.1);
+ );
+ );//180524to
);
-); //17.12.16until
+); //17.12.16to
-Settitle(cmdL):=Settitle(cmdL,[]); // 180330changed
-Settitle(cmdL,options):=(
+Settitle(cmdL):=Settitle("",cmdL,[]); // 180608from
+Settitle(Arg1,Arg2):=(
+ if(isstring(Arg1),
+ Settitle(Arg1,Arg2,[]);
+ ,
+ Settitle("",Arg1,Arg2);
+ );
+); // 180608to
+Settitle(titleold,cmdL,options):=(
//help:Settitle(cmdL);
//help:Settitle(name,cmdL);
//help:Settitle(options=["Title=slide0","Layery=0","Color=blue"]);
regional(tmp,tmp1,tmp2,eqL,layery,color,size,font);
TitleName="slide0"; //180330
+ if(length(titleold)>0,TitleName=titleold);//180608
layery="0";
color="blue";
size="\Large";
font="\bf";
- tmp=Divoptions(options);
- eqL=tmp_5;
+// tmp=Divoptions(options);
+// eqL=tmp_5;
+ eqL=options; //180602
forall(eqL,
tmp1=Toupper(substring(#,0,1));
tmp=indexof(#,"=");
@@ -4039,7 +4129,7 @@ Maketitle(name):=( Repeatsameslide(repeatflg,sestr,addedL):=(
regional(seL,flg1,ss,nn,nrep,tmp,tmp1,tmp2,tmp3,str,j,k);
- // global RepeatList, SCEOUTPUT
+ // global RepeatList, SCEOUTPUT, NonThinFlg
nrep=length(RepeatList);
flg1=0;
forall(addedL,ss,
@@ -4081,6 +4171,7 @@ Repeatsameslide(repeatflg,sestr,addedL):=( if(flg1==1,seL=append(seL,1));
seL=remove(1..nrep,seL);
str=ss; // 17.05.28from
+ if(substring(str,0,16)=="\begin{minipage}",MiniFlg=1);//180526
repeat(10,
tmp1=Indexall(str,"{\color");
if(length(tmp1)>0,
@@ -4090,28 +4181,50 @@ Repeatsameslide(repeatflg,sestr,addedL):=( str=replace(str,tmp+" ","");
str=replace(str,tmp,"");
);
- );//17.05.28until
+ );//17.05.28to
if(contains(seL,1),
if(substring(str,0,1)!="%",
if(NonThinFlg==0,
if(!contains(["\begi","\end{"],substring(str,0,5)),//17.01.15
- println(SCEOUTPUT,"{\color[cmyk]{\thin,\thin,\thin,\thin}");//17.08.23
- println(SCEOUTPUT,str);
- println(SCEOUTPUT,"}%");
+ if(MiniFlg==0, //180526from
+ println(SCEOUTPUT,"{\color[cmyk]{\thin,\thin,\thin,\thin}");//17.08.23
+ println(SCEOUTPUT,str);
+ println(SCEOUTPUT,"}%");
+ ,
+ println(SCEOUTPUT,str);
+ if(indexof(str,"\end{minipage}")>0, //180526from
+ println(SCEOUTPUT,"}%");
+ );
+ ); //180526to
,
println(SCEOUTPUT,str);
+ if(indexof(str,"\end{minipage}")>0, //180526from
+ println(SCEOUTPUT,"}%");
+ MiniFlg=0;
+ );
);
);
if(NonThinFlg==1,
if(!contains(["\begi","\end{"],substring(str,0,5)),//17.01.15
println(SCEOUTPUT,"{\color[cmyk]{\thin,\thin,\thin,\thin}");//17.08.23
+ println(SCEOUTPUT,str);
+ ,
+ println(SCEOUTPUT,str);
+ if(indexof(str,"\end{minipage}")>0, //180526from
+ println(SCEOUTPUT,"}%");
+ MiniFlg=0;
+ );
);
- println(SCEOUTPUT,str);
);
if(NonThinFlg==2,
println(SCEOUTPUT,str);
if(!contains(["\begi","\end{"],substring(str,0,5)),//17.01.15
println(SCEOUTPUT,"}%");
+ , //180526from
+ if(indexof(str,"\end{minipage}")>0,
+ println(SCEOUTPUT,"}%");
+ MiniFlg=0;
+ ); //180526from
);
);
seL=remove(seL,[1]);
@@ -4119,24 +4232,56 @@ Repeatsameslide(repeatflg,sestr,addedL):=( );
if(substring(ss,0,1)!="%", //16.01.04
forall(1..(length(seL)),nn,
+ if(substring(str,0,16)=="\begin{minipage}",MiniFlg=1);//180526
tmp=seL_nn;
if(NonThinFlg==0,
- tmp1="{\color[cmyk]{\thin,\thin,\thin,\thin}";//17.08.23
- tmp1=[tmp1,str,"}%"];
+ if(!contains(["\begi","\end{"],substring(str,0,5)),//180526from
+ if(MiniFlg==0,
+ tmp1="{\color[cmyk]{\thin,\thin,\thin,\thin}";//17.08.23
+ tmp1=[tmp1,str,"}%"];
+ ,
+ tmp1=[str];
+ if(indexof(str,"\end{minipage}")>0, //180526from
+ tmp1=append(tmp1,"}%");
+ );
+ );
+ ,
+ tmp1=[str];
+ if(indexof(str,"\end{minipage}")>0,
+ tmp1=append(tmp1,"}%");
+ MiniFlg=0;
+ );
+ );
);
if(NonThinFlg==1,
- tmp1="{\color[cmyk]{\thin,\thin,\thin,\thin}";//17.08.23
- tmp1=[tmp1,str];//17.01.08until
+ if(!contains(["\begi","\end{"],substring(str,0,5)),//17.01.15
+ tmp1="{\color[cmyk]{\thin,\thin,\thin,\thin}";//17.08.23
+ tmp1=[tmp1,str];
+ ,
+ tmp1=[str];
+ if(indexof(str,"\end{minipage}")>0,
+ tmp1=append(tmp1,"}%");
+ MiniFlg=0;
+ );
+ );
);
if(NonThinFlg==2,
- tmp1=[str,"}%"];
+ tmp1=[str];
+ if(!contains(["\begi","\end{"],substring(str,0,5)),
+ tmp1=append(tmp1,"}%");
+ ,
+ if(indexof(str,"\end{minipage}")>0,
+ tmp1=append(tmp1,"}%");
+ MiniFlg=0;
+ );
+ );
);
RepeatList_tmp=concat( RepeatList_tmp,tmp1);
);
);
- );//16.01.05until
+ );//16.01.05to
);
- );//16.12.05until
+ );//16.12.05to
);
Presentation(texfile):=Presentation(texfile,texfile);
@@ -4146,6 +4291,7 @@ Presentation(texfile,txtfile):=( tmp2,tmp3,tmp4,tmp5,newoption,top,repeatflg,nrep,nrepprev,,repstr,
sestr,npara,paradt,parafiles,hyperflg,paractr,
letterc,boxc,shadowc,mboxc,sep);
+ MiniFlg=0;//180526
slidecmd=["\ketcletter","\ketcbox","\ketdbox","\ketcframe",
"\ketcshadow","\ketdshadow","\slidetitlex","\slidetitlesize",
"\mketcletter","\mketcbox","\mketdbox","\mketcframe",
@@ -4259,15 +4405,9 @@ Presentation(texfile,txtfile):=( ,
println(SCEOUTPUT,"\usepackage[dvipdfmx]{graphicx}");
);
-// println(SCEOUTPUT,"\usepackage[usenames]{color}");
-// println(SCEOUTPUT,"\usepackage{color}");//17.06.14
println(SCEOUTPUT,"\usepackage{xcolor}");//17.07.31
letterc=[0.98,0.13,0,0.43]; boxc=[0,0.32,0.52,0];
shadowc=[0,0,0,0.5]; mboxc="yellow";
-// if(!islist(SlideColorList), //17.03.02from
-// SlideColorList=[letterc,boxc,boxc,boxc,shadowc,shadowc,6,1.3,
-// letterc,mboxc,mboxc,mboxc,62,2,letterc];
-// , //17.03.02until
tmp4="abcdefghijklmno";
forall(1..15,
tmp=SlideColorList_#;
@@ -4283,16 +4423,18 @@ Presentation(texfile,txtfile):=( SlideColorList_#="slidecolor"+tmp4_#;
);
);
-// ); //17.03.02
println(SCEOUTPUT,"\def\setthin#1{\def\thin{#1}}");//17.08.23
println(SCEOUTPUT,"\setthin{"+text(ThinDense)+"}");//17.08.23
+ println(SCEOUTPUT,"\newcommand{\slidepage}[1][s]{%");//180524from
+ println(SCEOUTPUT,"\setcounter{ketpicctra}{18}%");
+ println(SCEOUTPUT,"\if#1m \setcounter{ketpicctra}{1}\fi");
+ println(SCEOUTPUT,"\hypersetup{linkcolor=black}%");
+ println(SCEOUTPUT,"\begin{layer}{118}{0}");
+ println(SCEOUTPUT,"\putnotee{122}{-\theketpicctra.05}{\small\thepage/\pageref{pageend}}");
+ println(SCEOUTPUT,"\end{layer}\hypersetup{linkcolor=blue}}");//189524to
forall(ADDPACK,// 16.06.09from
-// if(indexof(#,"[")==0, // 16.09.05from
-// println(SCEOUTPUT,"\usepackage{"+#+"}");
-// ,
- println(SCEOUTPUT,"\usepackage"+#); //17.07.10
-// );
- );// 16.06.09until
+ println(SCEOUTPUT,"\usepackage"+#);
+ );// 16.06.09to
tmp=select(ADDPACK,indexof(#,"{hyperref}")>0);//16.12.31from
if(length(tmp)>0,
hyperflg=1;
@@ -4309,8 +4451,9 @@ Presentation(texfile,txtfile):=( forall(tmp, // 15.07.21
if(substring(#,0,1)=="\", println(SCEOUTPUT,#));
);
- if(!isstring(PageStyle),PageStyle="headings");//17.04.09
- println(SCEOUTPUT,"\pagestyle{"+PageStyle+"}");//17.04.09
+// if(!isstring(PageStyle),PageStyle="headings");//180524from
+// println(SCEOUTPUT,"\pagestyle{"+PageStyle+"}");
+ println(SCEOUTPUT,"\pagestyle{empty}");//180524to
println(SCEOUTPUT,"");
println(SCEOUTPUT,"\begin{document}");
println(SCEOUTPUT,"");
@@ -4351,7 +4494,7 @@ Presentation(texfile,txtfile):=( println(SCEOUTPUT,"");
println(SCEOUTPUT,"\color{"+SlideColorList_(15)+"}");
println(SCEOUTPUT,BodyStyle);//17.01.07
- println(SCEOUTPUT,"\thispagestyle{empty}");//17.01.29
+// println(SCEOUTPUT,"\thispagestyle{empty}");//180524
println(SCEOUTPUT,"\addtocounter{page}{-1}");//17.01.29
println(SCEOUTPUT,"");
verbflg=0; //16.06.28
@@ -4374,7 +4517,9 @@ Presentation(texfile,txtfile):=( tmp=indexof(sld,"]::");
if(tmp>0,
if(substring(sld,1,2)!="%",//17.05.31
- if(substring(sld,1,5)=="thin", ThinFlg=1); // 17.05.28
+ if(substring(sld,1,5)=="thin",
+ ThinFlg=1;
+ );
sestr=substring(sld,1,tmp);
sld=substring(sld,tmp+2,length(sld));
tmp=indexof(sestr,"[");
@@ -4396,7 +4541,8 @@ Presentation(texfile,txtfile):=( if(length(wall)>0,
tmp=["","\input{fig/"+wall+".tex}"];
);
- tmp=concat(tmp,["","\sameslide"+NewSlideOption,"","\vspace*{18mm}",""]);
+ tmp=concat(tmp,
+ ["","\sameslide"+NewSlideOption,"","\vspace*{18mm}",""]);//180524
RepeatList=apply(1..nrep,if(#==1,[],tmp));
);
if(sestr=="",flg=1);
@@ -4441,7 +4587,8 @@ Presentation(texfile,txtfile):=( if(length(wall)>0,
tmp=["","\input{fig/"+wall+".tex}"];
);
- tmp=concat(tmp,["","\sameslide"+NewSlideOption,"","\vspace*{18mm}",""]);
+ tmp=concat(tmp,
+ ["","\sameslide"+NewSlideOption,"","\vspace*{18mm}",""]);//180524
RepeatList=apply(1..nrep,if(#==1,[],tmp));
);
);
@@ -4449,7 +4596,7 @@ Presentation(texfile,txtfile):=( tmp4=[]; //16.12.31from
if(hyperflg>0,
tmp4=["\hypertarget{para"+text(paractr)+"pg"+text(#)+"}{}"];
- );//16.12.31until
+ );//16.12.31to
if(npara>0, //17.01.03
tmp4=concat(tmp4,["","\begin{layer}{120}"+paradt_2]);
if(#<=npara, //16.12.28from
@@ -4474,43 +4621,47 @@ Presentation(texfile,txtfile):=( tmp="{"+text(LinkPosV)+"}{\hyperlink{para"; // 17.01.12from
tmp1=tmp+text(paractr)+"pg";
tmp2=tmp+text(paractr-1)+"pg"+text(nrepprev);
- if(#>1,tmp=tmp1+text(1),tmp=tmp2);
+ tmp=tmp2; //180526from
tmp3=[text(LinkPosH-29*LinkSize)+"}"+tmp+"}{\fbox{\Ctab{"
+text(2.5*LinkSize)+"mm}{\scalebox{"+text(LinkSize)
- +"}{\scriptsize $\mathstrut|\!\lhd$}}}}}"];
- if(#>1,tmp=tmp1+text(max(#-3,1)),tmp=tmp2);
- tmp3=append(tmp3,
- text(LinkPosH-24*LinkSize)+"}"+tmp+"}{\fbox{\Ctab{"
- +text(2.5*LinkSize)+"mm}{\scalebox{"+text(LinkSize)
- +"}{\scriptsize $\mathstrut\!\! \lhd\!\!\lhd\!$}}}}}");
- if(#>1,tmp=tmp1+text(#-1),tmp=tmp2);
- tmp3=append(tmp3,
- text(LinkPosH-17*LinkSize)+"}"+tmp+"}{\fbox{\Ctab{"
- +text(4.5*LinkSize)+"mm}{\scalebox{"+text(LinkSize)
- +"}{\scriptsize $\mathstrut\!\!\lhd\!\!$}}}}}");
- tmp="{"+text(LinkPosV)+"}{\hyperlink{para";
- tmp2=tmp+text(paractr+1)+"pg"+text(1);
- if(#<nrep,tmp=tmp1+text(#+1),tmp=tmp2);
- tmp3=append(tmp3,
- text(LinkPosH-10*LinkSize)+"}"+tmp+"}{\fbox{\Ctab{"
- +text(4.5*LinkSize)+"mm}{\scalebox{"+text(LinkSize)
- +"}{\scriptsize $\mathstrut\!\rhd\!$}}}}}");
- if(#<nrep,tmp=tmp1+text(min(#+3,nrep)),tmp=tmp2);
- tmp3=append(tmp3,
- text(LinkPosH-5*LinkSize)+"}"+tmp+"}{\fbox{\Ctab{"
+ +"}{\scriptsize $\mathstrut||\!\lhd$}}}}}"];
+ if(nrep>1,//180526
+ tmp="{"+text(LinkPosV)+"}{\hyperlink{para"; // 17.01.12from
+ tmp1=tmp+text(paractr)+"pg";
+ tmp2=tmp+text(paractr-1)+"pg"+text(nrepprev);
+ tmp=tmp1+text(1);
+ tmp3=append(tmp3,
+ text(LinkPosH-24*LinkSize)+"}"+tmp+"}{\fbox{\Ctab{"
+ +text(2.5*LinkSize)+"mm}{\scalebox{"+text(LinkSize)
+ +"}{\scriptsize $\mathstrut|\!\lhd$}}}}}"); //180526to
+ if(#>1,tmp=tmp1+text(#-1),tmp=tmp2);
+ tmp3=append(tmp3,
+ text(LinkPosH-17*LinkSize)+"}"+tmp+"}{\fbox{\Ctab{"
+ +text(4.5*LinkSize)+"mm}{\scalebox{"+text(LinkSize)
+ +"}{\scriptsize $\mathstrut\!\!\lhd\!\!$}}}}}");
+ if(#<nrep,tmp=tmp1+text(#+1),tmp=tmp1+text(nrep));
+ tmp3=append(tmp3,
+ text(LinkPosH-10*LinkSize)+"}"+tmp+"}{\fbox{\Ctab{"
+ +text(4.5*LinkSize)+"mm}{\scalebox{"+text(LinkSize)
+ +"}{\scriptsize $\mathstrut\!\rhd\!$}}}}}");
+ tmp=tmp1+text(nrep); //180526from
+ tmp3=append(tmp3,
+ text(LinkPosH-5*LinkSize)+"}"+tmp+"}{\fbox{\Ctab{" // 17.01.19
+text(2.5*LinkSize)+"mm}{\scalebox{"+text(LinkSize)
- +"}{\scriptsize $\mathstrut\!\!\rhd\!\!\rhd\!$}}}}}");
- if(#<nrep,tmp=tmp1+text(nrep),tmp=tmp2);
+ +"}{\scriptsize $\mathstrut \!\rhd\!\!|$}}}}}");
+ );
+ tmp="{"+text(LinkPosV)+"}{\hyperlink{para"; //180529(2lines)
+ tmp=tmp+text(paractr+1)+"pg"+text(1);
tmp3=append(tmp3,
text(LinkPosH)+"}"+tmp+"}{\fbox{\Ctab{" // 17.01.19
+text(2.5*LinkSize)+"mm}{\scalebox{"+text(LinkSize)
- +"}{\scriptsize $\mathstrut \!\rhd\!\!|$}}}}}");
- tmp3=apply(tmp3,tmp,"\putnotew{"+tmp);
- tmp4=concat(tmp4,tmp3);// 17.01.12untilr
- tmp="\putnotew{"+text(LinkPosH)+"}{"+text(LinkPosV+6)+"}";//17.10.21from
- tmp=tmp+"{\scriptsize\color{black} "+text(#)+"/"+text(nrep)+"}";
- tmp4=append(tmp4,tmp);//17.10.21until
+ +"}{\scriptsize $\mathstrut \!\rhd\!\!||$}}}}}"); //180526to
);
+ tmp3=apply(tmp3,tmp,"\putnotew{"+tmp);
+ tmp4=concat(tmp4,tmp3);// 17.01.12to
+ tmp="\putnotee{"+text(LinkPosH+1)+"}{"+text(LinkPosV)+"}";//180524
+ tmp=tmp+"{\scriptsize\color{blue} "+text(#)+"/"+text(nrep)+"}"; //180524(blue)
+ tmp4=append(tmp4,tmp);
tmp4=concat(tmp4,["\end{layer}",""]);//16.12.31until
Repeatsameslide(repeatflg,text([#]),tmp4);
);
@@ -4519,7 +4670,7 @@ Presentation(texfile,txtfile):=( if(substring(sld,0,2)=="%%", //17.06.23from
println(SCEOUTPUT,sld);
flg=1;
- ); //17.06.23until
+ ); //17.06.23to
if(flg==0,
if(indexof(sld,"\begin{verbatim}")==1, // 16.06.28from
Repeatsameslide(repeatflg,sestr,[slideL_ns]);
@@ -4573,6 +4724,7 @@ Presentation(texfile,txtfile):=( );
println(SCEOUTPUT,"\mainslide{"+tmp2+"}");
println(SCEOUTPUT,"");
+ println(SCEOUTPUT,"");
tmp2="";
flg=1;
);
@@ -4605,7 +4757,7 @@ Presentation(texfile,txtfile):=( tmp4=tmp5;
);
tmp=tmp+"{"+tmp2+"}";
- Repeatsameslide(repeatflg,sestr,[tmp,"","\vspace*{18mm}",""]);
+ Repeatsameslide(repeatflg,sestr,[tmp,"","\vspace*{18mm}",""]);//180524
tmp2="";
flg=1;
);
@@ -4635,7 +4787,7 @@ Presentation(texfile,txtfile):=( // tmp3=tmp4;
// );
println(SCEOUTPUT,tmp);
- println(SCEOUTPUT,"");
+ println(SCEOUTPUT,""); //180524
println(SCEOUTPUT,"\vspace*{18mm}");
println(SCEOUTPUT,"");
tmp4=tmp3;
@@ -4707,9 +4859,9 @@ Presentation(texfile,txtfile):=( tmp3="";
flg=1;
);
- if(flg==0&tmp1=="end",
+ if(flg==0&tmp1=="end"&(length(flgL)>0), //180526
tmp=flgL_(length(flgL));
- if(tmp=="i",
+ if(tmp=="i",
Repeatsameslide(repeatflg,sestr,["\end{itemize}"]);
);
if(tmp=="e",
@@ -4771,8 +4923,9 @@ Presentation(texfile,txtfile):=( );
);
);
- println(SCEOUTPUT,"");
+// println(SCEOUTPUT,"");
);
+ println(SCEOUTPUT,"\label{pageend}\mbox{}"); //180529
println(SCEOUTPUT,"");
println(SCEOUTPUT,"\end{document}");
closefile(SCEOUTPUT);
@@ -4789,8 +4942,12 @@ Mkslides():=( Dirwork=replace(Dirwork,"/",pathsep());
parent=replace(Dirwork+Batparent,"/",pathsep());// 16.05.29
);
- Dirwork=replace(Dirwork,pathsep()+"fig","");
+ tmp=replace(Dirwork,pathsep()+"fig","");//180604(2lines)
+ Changework(tmp);
Setdirectory(Dirwork);
+ if(!iswindows(), //180604from
+ println(setexec(Dirwork,Shellparent));
+ ); //180604to
if(length(Texmain)>0, // 15.08.14 from
Texparent=Texmain;
);
@@ -4802,7 +4959,7 @@ Mkslides():=( drawtext(mouse().xy,Texparent+".txt not exist in "+Dirwork,
size->24,color->[1,0,0]);
, // 17.04.12until
- Presentation(Texparent); // 15.08.14 until
+ Presentation(Texparent); // 15.08.14to
if(iswindows(),
tmp2=Batparent;
parent=replace(Dirwork+Batparent,sep+"fig","");// 16.05.29
@@ -4855,21 +5012,24 @@ Mkslidesummary(inputfile,outputfile,options):=( dirworkorg=Dirwork;//17.04.10from
dirtop=replace(Dirwork,pathsep()+"fig","");
Changework(dirtop);//17.04.10uptp
+ if(ismacosx(), //180604from
+ println(setexec(Dirwork,Shellparent));
+ ); //180604to
fin=inputfile;
if(indexof(fin,".")==0,fin=fin+".tex");
fout=outputfile;
if(indexof(fout,".")==0,fout=fout+".tex");
cmdL=[
- "Dt=readLines('"+fin+"')",[],
- "num=grep('\\hypertarget',Dt,fixed=TRUE)",[],
+ "Dt=readLines('"+fin+"',encoding='UTF-8')",[],
+ "num=grep('hypertarget',Dt,fixed=TRUE)",[], //180412
"Dt=Dt[setdiff(1:length(Dt),num)]",[],
"Smain=c();Snew=c();Ssame=c()",[],
"for(J in 1:length(Dt)){",[],
- " Tmp=length(grep('\\mainslide{',Dt[J],fixed=TRUE))",[],
+ " Tmp=length(grep('mainslide{',Dt[J],fixed=TRUE))",[], //180412
" if(Tmp>0){Smain=c(Smain,1)}else{Smain=c(Smain,0)}",[],
- " Tmp=length(grep('\\newslide{',Dt[J],fixed=TRUE))",[],
+ " Tmp=length(grep('newslide{',Dt[J],fixed=TRUE))",[], //180412
" if(Tmp>0){Snew=c(Snew,1)}else{Snew=c(Snew,0)}",[],
- " Tmp=length(grep('\\sameslide',Dt[J],fixed=TRUE))",[],
+ " Tmp=length(grep('sameslide',Dt[J],fixed=TRUE))",[], //180412
" if(Tmp>0){Ssame=c(Ssame,1)}else{Ssame=c(Ssame,0)}",[],
"}",[],
"Nnew=c();Nsame=c()",[],
@@ -4885,11 +5045,9 @@ Mkslidesummary(inputfile,outputfile,options):=( "}",[],
"Tmp=max(c(Nsame[-1],Nnew[-1]))+1",[],
"Out=c(Out,Dt[Tmp:length(Dt)])",[],
- "writeLines(Out,'"+fout+"',sep='\n')",[],
- "cat('////',file='resultR.txt',sep='')",[],
- "quit()",[]
+ "writeLines(Out,'"+fout+"',sep='\n')",[] //180412(2lines removed)
];
- CalcbyR("out",cmdL,append(options,"Cat=n"));
+ CalcbyR("",cmdL,append(options,"Cat=n"));//180412
wait(1000);
Changework(dirtop);//17.04.10
tmp=replace(fout,".tex","");
diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibhelpE.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibhelpE.txt index 0c89e3e75ed..0c89e3e75ed 100644..100755 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibhelpE.txt +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibhelpE.txt diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibhelpJ.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibhelpJ.txt index 93e5e323add..93e5e323add 100644..100755 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibhelpJ.txt +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibhelpJ.txt diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvhelpE.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvhelpE.txt index 9a7edb2e99f..9a7edb2e99f 100644..100755 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvhelpE.txt +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvhelpE.txt diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvhelpJ.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvhelpJ.txt index 354d6596a77..354d6596a77 100644..100755 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvhelpJ.txt +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvhelpJ.txt diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvlogr.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvlogr.txt index 70b42e5ad65..e79262aa42c 100644 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvlogr.txt +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvlogr.txt @@ -1,3 +1,22 @@ +// 20180614 +// Setpara changed (ReadOutData&Projpara removed fromGLISTbkup) +// Setpara changed (the above also removed from COM2ndlist) +// 20180611 +// Parafolder changed (path removed, Dirworkbkup&Dirworksubbkup used) +// 20180610 +// Parafolder debugged (files not removed, waiting time for R) +// Parafolder changed ( pause option adde ) +// 20180609 +// Parafolder changed (CommonMake) +// Mkflipanime,Animationfile changed ( length(ParaSL) ) +// 20180608 +// Parafolder changed (to "all.r", to delete file) +// 20180607 +// Parafolder debugged ( FnameR,.. => Setfiles) +// 20180606 +// Setpara,Parafolder renewed +// 20180602 +// divoptions ( 8,9 ->length(tmp)-1,length(tmp)) //2017.12.09 // Parafolder debugged (Viewtex ->WritetoRS) // Mkanimation debugged ( \ -> / for windows ) diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvr.cs b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvr.cs index e9978e7b653..a538afd1330 100644..100755 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvr.cs +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvr.cs @@ -14,12 +14,12 @@ // along with this program. If not, see <http://www.gnu.org/licenses/> // -println("ketcindymv(20171124) loaded"); +println("ketcindymv(20180614) loaded"); //help:start(); -Setpara(path,fstr,sL):=Setpara(path,fstr,sL,[],[]); // 16.12.27added -Setpara(pathorg,fstr,sL,options):= //17.11.25(3lines) +Setpara(path,fstr,sL):=Setpara(path,fstr,sL,[],[]); +Setpara(pathorg,fstr,sL,options):= Setpara(pathorg,fstr,sL,options,[]); Setpara(pathorg,fstr,sL,options,optionsanim):=( //help:Setpara("folder name","funstr","range",options,optionsanim); @@ -29,13 +29,31 @@ Setpara(pathorg,fstr,sL,options,optionsanim):=( //help:Setpara(options2anim2=["OpA=[loop,controls,buttonsize=3mm]"]); //help:Setpara(options2anim3=["OpA=+step"]); //help:Setpara(options2anim4=["Mag=1600","Title=folder"]); - regional(path);//17.04.10 + regional(path,tmp,tmp1,tmp2,tmp3,eqL,ndiv,gtmp,ctmp,nn,flg); if(length(pathorg)==0, path=Slidename,path=pathorg);//17.04.10 ParaPath=path; ParaFstr=fstr; ParaSL=sL; + if(isstring(sL), + ndiv=25; + tmp=Divoptions(options); + eqL=tmp_5; + forall(eqL, + tmp=Strsplit(#,"="); + tmp1=Toupper(tmp_1); + if(substring(tmp1,0,1)=="D", + ndiv=parse(tmp_2); + ); + ); + tmp=Strsplit(sL,"="); + tmp1=parse(tmp_2); + ParaSL=apply(0..ndiv,tmp1_1+#*(tmp1_2-tmp1_1)/ndiv); + ); ParaOp=options; - ParaOpAnim=optionsanim; //17.11.25 + if((!contains(Paraop,"r"))&(!contains(ParaOp,"m")), + ParaOp=append(ParaOp,"m");//180604 + ); + ParaOpAnim=optionsanim; GLISTback=GLIST; GCLISTback=GCLIST; GOUTLISTback=GOUTLIST; @@ -46,167 +64,207 @@ Setpara(pathorg,fstr,sL,options,optionsanim):=( COM0thlistback=COM0thlist; COM1stlistback=COM1stlist; COM2ndlistback=COM2ndlist; + Dirworkbkup=Dirwork; //0611from + Dirworksubbkup=Dirwork+pathsep()+ParaPath; + Changework(Dirworksubbkup); + Changework(Dirworkbkup); + Fheadbkup=Fhead; //0611to + gtmp=GLISTback; + tmp1=select(1..(length(gtmp)),indexof(gtmp_#,"ReadOutData")>0); //180614from + tmp2=[];tmp3=[]; + forall(tmp1,nn, + tmp2=append(tmp2,nn); + flg=0; + tmp=min([nn+40,length(gtmp)]); + forall((nn+1)..tmp, + if(flg==0, + if(indexof(gtmp_#,"Projpara")>0, + tmp2=append(tmp2,#); + tmp=indexof(gtmp_#,"="); + tmp=substring(gtmp_#,0,tmp-1); + tmp3=append(tmp3,tmp); + , + flg=1; + ); + ); + ); + ); + tmp1=remove(1..(length(gtmp)),tmp2); + GLISTback=apply(tmp1,GLIST_#); //180614to + ctmp=COM2ndlistback; //180614 + forall(tmp3,tmp2, + tmp=select(ctmp,indexof(#,tmp2)>0); + ctmp=remove(ctmp,tmp); + ); + COM2ndlistback=ctmp; ); -Parafolder():=Parafolder(ParaPath,ParaFstr,ParaSL,ParaOp); -Parafolder(path,fstr,sL):=Parafolder(path,fstr,sL,[]); -Parafolder(path,fstr,sLorg,optionorg):=( +Parafolder():=Parafolder(ParaFstr,ParaSL,ParaOp); +Parafolder(fstr,sL):=Parafolder(fstr,sL,[]); +Parafolder(fstr,sL,optionorg):=( //help:Parafolder(foldername,1..4); //help:Parafolder(foldername,"s=[0,1]"); //help:Parafolder("mf(s)",foldername,"s=[0,1]"); -//help:Parafolder(options=["m/r","Div=25","Wait=20"]); +//help:Parafolder(options=["m/r","Div=25","Wait=20"]); +//help:Parafolder(optionsadd=[""Outfile=n",Pause=10(ms)"]); //help:Paraslide(para=folder:layery:pos:input,scale); //help:Paraslide(para=folder:layery:pos:include:[width=100]); - regional(nn,sL,tmp,tmp1,tmp2,strL,eqL,waiting, - mkr,mktex,ndiv,options,sfL); - if(!isstring(ParaPath), - println("Setpara not executed"); - , - sL=sLorg;//16.12.24from - if(!isstring(sL), - tmp=indexof(fstr,"("); - tmp1=substring(fstr,tmp,length(fstr)); - tmp=indexof(tmp1,")"); - tmp1=substring(tmp1,0,tmp-1); - , - tmp=indexof(sL,"=");//16.12.21from - if(length(tmp)>0, - tmp1=substring(sL,0,tmp-1); - ); + regional(nn,tmp,tmp1,tmp2,strL,eqL,waiting,outflg,pause, + mkr,mktex,options,sfL,dirbkup,fbkup,pfile,ctr,flg,varL); + Changework(Dirworkbkup); + Setfiles(Fheadbkup); + tmp=indexof(fstr,"("); + tmp1=substring(fstr,tmp,length(fstr)); + tmp=indexof(tmp1,")"); + tmp1=substring(tmp1,0,tmp-1); + parse("Movieframe("+tmp1+"):="+fstr); + options=optionorg; + tmp=Divoptions(options); + eqL=tmp_5; + strL=tmp_7; + if(length(strL)==0,options=append(options,"m")); + mkr="A"; + mktex="A"; + waiting=20; + outflg=0; + pause=10; + forall(eqL, + tmp=Strsplit(#,"="); + tmp1=Toupper(substring(tmp_1,0,1)); + if(tmp1=="W", + waiting=parse(tmp_2); + options=remove(options,[#]); ); - parse("Movieframe("+tmp1+"):="+fstr); - options=optionorg; - tmp=Divoptions(options); - eqL=tmp_5; - strL=tmp_7; - if(length(strL)==0,options=append(options,"m"));//16.12.18 - mkr="A"; - mktex="A"; - ndiv=25; - waiting=20; - forall(eqL, - tmp=Indexof(#,"="); - tmp1=Toupper(substring(#,0,1)); - tmp2=substring(#,tmp,length(#)); - if(tmp1=="D", - ndiv=parse(tmp2); - options=remove(options,[#]); - ); - if(tmp1=="W", - waiting=parse(tmp2); - options=remove(options,[#]); - ); + if((tmp1=="O")%(tmp1=="R"), //180606from + tmp=Toupper(substring(tmp_2,0,1)); + if(tmp=="Y", outflg=1); + options=remove(options,[#]); ); - forall(strL, - tmp1=Toupper(substring(#,0,1)); - if(tmp1=="M", - mkr="Y"; mktex="Y"; - ); + if(tmp1=="P", //180610from + pause=parse(tmp_2); + options=remove(options,[#]); + ); // //180610to + ); + forall(strL, + tmp1=Toupper(substring(#,0,1)); + if(tmp1=="M", + mkr="Y"; mktex="Y"; ); - sL=sLorg; - if(isstring(sL), - tmp=indexof(sL,"="); - tmp1=parse(substring(sL,tmp,length(sL))); - sL=apply(0..ndiv,tmp1_1+#*(tmp1_2-tmp1_1)/ndiv); + ); + Changework(Dirworksubbkup); + SCEOUTPUT = openfile("all.r"); + println(SCEOUTPUT,""); + closefile(SCEOUTPUT);//180608to + if(outflg==1, //180606from + CommonMake=1;//180609 + ctr=1; + forall(sL, + tmp="000000"+text(ctr); + pfile="p"+substring(tmp,length(tmp)-3,length(tmp)); + Setfiles(pfile); + Changework(Dirworksubbkup); + Movieframe(#); + Changework(Dirworksubbkup);//180608 + ctr=ctr+1; ); - if(!isexists(Dirwork,path), - if(ErrFlag!=-1, - makedir(Dirwork,path) - , - println(" ==> Changework may not work properly"); - sL=[]; - ); + CommonMake=-1;//180609 + Setfiles(fbkup); + ); //180606to + wait(pause); //180610 +// Changework(Dirworkbkup); + sfL=[]; + ctr=1; + forall(1..(length(sL)),nn, + Changework(Dirworkbkup);//180611(2lines) + Setfiles(Fheadbkup); + GLIST=GLISTback; + GCLIST=GCLISTback; + GOUTLIST=GOUTLISTback; + POUTLIST=POUTLISTback; + VLIST=VLISTback; + FUNLIST=FUNLISTback; + LETTERlist=LETTERlistback; + COM0thlist=COM0thlistback; + COM1stlist=COM1stlistback; + COM2ndlist=COM2ndlistback; + tmp="000000"+text(nn); + pfile="p"+substring(tmp,length(tmp)-3,length(tmp)); + Setfiles(pfile); + Changework(Dirworksubbkup); + sfL=append(sfL,FnameR); + if(outflg==1, + Changework(Dirworksubbkup);//180606 + Setfiles(pfile); //180610(2lines) + wait(pause); + Movieframe(sL_nn); + Changework(Dirworksubbkup);//180606 + ctr=ctr+1; , - tmp=fileslist(Dirwork+pathsep()+path); //17.12.09(3lines); - tmp=length(tmp); - if((mkr=="Y") & (tmp>0), - tmp1=replace(Dirwork,"\","/");//17.10.13 - cmdL=[ - "setwd",[Dq+tmp1+"/"+path+Dq], - "fL=as.matrix(list.files())",[], - "apply",["fL",2,"file.remove"], - "setwd",[Dq+tmp1+Dq], - ]; - CalcbyR("rvf",cmdL,["Cat=n","m"]); - tmp=Dirwork+pathsep()+path; - repeat(1..30, - if(length(fileslist(tmp))>0,wait(10)); - ); - );//17.02.20until - ); - sfL=[]; - forall(1..(length(sL)),nn, - GLIST=GLISTback; - GCLIST=GCLISTback; - GOUTLIST=GOUTLISTback; - POUTLIST=POUTLISTback; - VLIST=VLISTback; - FUNLIST=FUNLISTback; - LETTERlist=LETTERlistback; - COM0thlist=COM0thlistback; - COM1stlist=COM1stlistback; - COM2ndlist=COM2ndlistback; - tmp1=Sprintf(nn/1000,3); - tmp=indexof(tmp1,"."); - tmp1=substring(tmp1,tmp,length(tmp1)); - FnameR=path+"/p"+tmp1+".r"; - sfL=append(sfL,FnameR); - Fnametex=replace(FnameR,".r",".tex"); - Movieframe(sL_nn); //17.10.13 - if(!isexists(Dirwork,FnameR) % mkr=="Y", - if(ErrFlag!=-1, - WritetoRS(2); //17.12.09 - ); + Movieframe(sL_nn); + ); + CommonMake=0;//180609 + Setfiles(pfile); //180608 + if(!isexists(Dirworksubbkup,FnameR) % mkr=="Y", + if(ErrFlag!=-1, + WritetoRS(2); ); - ); - tmp1=replace(Dirwork,"\","/"); //17.10.13 - cmdL=[ - "setwd",[Dq+tmp1+"/"+path+Dq], - "Mkallfile=function(fname){",[], - " Ctr<<- Ctr+1",[], - " tmp=readLines(fname)",[], - " first=1",[], - " if(Ctr>1){",[], - " first=7",[], - " cat('Ketinit()\n',file='all.r',append=TRUE)",[], + ); + ); + wait(pause); //180610 + Setfiles(fkbkup); + Changework(Dirworksubbkup); + GLIST=select(GLIST,indexof(#,"Projpara")==0); + tmp1=replace(Dirworksubbkup,"\\","/"); //180611 + tmp1=replace(tmp1,"\","/"); + cmdL=[ + "setwd("+Dqq(tmp1)+")",[], + "size="+text(length(sL)),[], + "cat('',file='all.r',sep='',append=FALSE)",[], //180614 + "for(n in Looprange(1,size)){",[], + " tmp=as.character(n)",[], + " tmp=paste('0000',tmp,sep='')",[], + " tmp=substring(tmp,nchar(tmp)-2,nchar(tmp))",[], + " fname=paste('p',tmp,'.r',sep='')",[], + " lines=readLines(fname)",[], + " if(n>1){",[], //180614from + " for(j in 1:length(lines)){",[], + " tmp=grep('source',lines[j],fixed=TRUE)",[], + " if(length(tmp)>0){",[], + " lines[j]=paste('#',lines[j],sep='')",[], + " lines[j+2]=paste('#',lines[j+2],sep='')",[], + " break",[], + " }",[], + " }",[], " }",[], - " for(J in first:(length(tmp)-1)){",[], - " cat(paste(tmp[J],'\n',sep=''),file='all.r',append=TRUE)",[], + " lines=lines[1:(length(lines)-1)]",[], //180614to + " tmp=paste('print(',as.character(n),')',sep='')",[], + " lines=c(tmp,lines)",[], + " for(j in Looprange(1,length(lines))){",[], + " cat(lines[j],file='all.r',sep='\n',append=TRUE)",[], " }",[], - " cat('print(',Ctr,')\n',file='all.r',append=TRUE)",[], - " Tmp=proc.time()-Tm",[], - " cat('print(',Tmp[3],')\n',file='all.r',append=TRUE)",[], - "}",[], - "if(file.exists('all.r')){file.remove('all.r')}",[], //17.10.24 - "fL=list.files()",[], - "Ctr=0",[], - "Tm<-invisible(proc.time())",[], - "for(fname in fL){",[], - " if(length(grep('.r',fname))>0){Mkallfile(fname)}",[], // 17.11.24 "}",[], - "source('all.r')",[], - "setwd",[Dq+tmp1+Dq] - ]; - if(ErrFlag!=-1, - if(!isexists(Dirwork,Fnametex) % mktex=="Y", - CalcbyR("all",cmdL,["Cat=n","m","Wait="+text(waiting)]); - , - println("Parafolder "+path+" finished");//16.12.20 - ); - if(length(after)>0, // 16.12.27 - parse(after); - ); - FnameR=Fhead+".r"; - Fnametex=Fhead+".tex"; + "source('all.r')",[] + ]; + if(ErrFlag!=-1, + waiting=min([waiting,8])*length(ParaSL); //180610 + if(!isexists(Dirworksubbkup,Fnametex) % mktex=="Y", + CalcbyR("",cmdL,["Cat=n","m","Wait="+text(waiting)]); + , + println("Parafolder finished"); + ); + if(length(after)>0, + parse(after); ); ); + Changework(Dirworkbkup); + Setfiles(Fheadbkup); ); Animatefile():=Animatefile(Dirwork,ParaPath); Animatefile(path,folder):=( //help:Animatefile(); //help:Animatefile(Dirwork,ParaPath); - regional(FRate, Scale, OpA, pa,fname,eqL,tmp,tmp1,tmp2); + regional(FRate, Scale, OpA, pa,fname,eqL,tmp,tmp1,tmp2,texfiles); tmp=divoptions(ParaOpAnim); //17.11.24 eqL=tmp_5; FRate="10"; @@ -244,11 +302,19 @@ Animatefile(path,folder):=( tmp1=fileslist(tmp); tmp1=tokenize(tmp1,","); tmp1=select(tmp1,indexof(#,".tex")>0); + texfiles=[];//180609from + forall(tmp1, + tmp=indexof(#,"."); + tmp=parse(substring(#,1,tmp-1)); + if(tmp<=length(ParaSL), + texfiles=append(texfiles,#); + ); + );//180609to SCEOUTPUT= openfile(fname); println(SCEOUTPUT,"\def\parapath{"+pa+"}%"); //17.06.22 println(SCEOUTPUT,"\def\figsize{"+Scale+"}%"); //17.12.07 println(SCEOUTPUT,"\begin{animateinline}"+OpA+"{"+FRate+"}%"); - forall(1..(length(tmp1)), + forall(1..(length(texfiles)), //180609 if(Scale==1, // 17.08.30from tmp="\input{\parapath/"; tmp=tmp+folder+"/"+tmp1_#+"}%"; @@ -511,7 +577,15 @@ Mkflipanime(path,folder):=( println(SCEOUTPUT,""); tmp=fileslist(Dirwork+pathsep()+folder); tmp=tokenize(tmp,","); - texfiles=select(tmp,indexof(#,".tex")>0); + tmp1=select(tmp,indexof(#,".tex")>0); //180609from + texfiles=[]; + forall(tmp1, + tmp=indexof(#,"."); + tmp=parse(substring(#,1,tmp-1)); + if(tmp<=length(ParaSL), + texfiles=append(texfiles,#); + ); + );//180609to forall(texfiles, println(SCEOUTPUT,"\vspace*{25mm}"); println(SCEOUTPUT,""); diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutlogr.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutlogr.txt index 94752a33760..77e7c8c8656 100644 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutlogr.txt +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutlogr.txt @@ -1,3 +1,78 @@ +// 20180612 +// Hatchdata renamed to HatchdataR +// kcC changed ( "gcc -lm" ) +// 20180611 +// StartsurfC changed ( "reset" of GLIST ) +// 20180610 +// StartsurfC debugged ( sizeL ) +// 20180609 +// StartsurfC changed ( multi type of setting constant) +// ExeccmdC changed (CommonMake) +// 20180608 +// StartsurfC changed ( FuncListC reset) +// ExeccmdC changed ( Fhead printed) +// ExeccmdC, Crvsfparadata,... changed (Projpara with "Msg=n" ) +// CalcbyR changed (Wait=30) +// 20180607 +// CrvsfparadataC,WireparadataC debugged ( "sprintf..." of CommandListC); +// SfbdparadataC changed (name: funnm =>nm ) +// 20180606 +// StartsurfC added +// SfbdparadataC changed (FuncListC) +// Setpara, Parafolder renewed +// 20180605 +// ExeccmdC changed ("Path=" option supported ) +// 20180602 +// divoptions ( 8,9 ->length(tmp)-1,length(tmp)) +// ExeccmdC changed ( optionsh (default="do"), varL ) +// Crv2onsfparadata,Crv3onsfparadata debugged +// 20180601 +// SfbdparadataC,... changed ( fbdy => sfbd) +// Ctopsurf changed (data[DsizeL][3],sfbd[DsizeL][3] added ) +// Ctosurf changed (CutFunList) +// SfbdparadataC changed ( "w" or "a" set according to CommandListC) +// Wireparadata,Sfcutdata changed (cmdflg) +// ExeccmdC changed ( EraseList ); +// 20180531 +// SfbdparadataC changed ( outputend added, readoutdata3 changed) +// 20180530 +// Ctopsurf changed ( stdlib.h, string.h) +// CrvsfparadataC,Crvonsfparadata,... changed (readoutdata3 used for fbdy) +// 20180523 +// Cheadsurf,Ctopsurf debugged (case => break added ) +// Cheadsurf debugged ( Dirname "\" => "/") +// CalcbyC debugged ( "////" ) +// 20180521 +// IntersectcrvsfC added +// 20180517 +// Cform debugged ( "=", tmp=0) +// SfbdparadataC,... changed ( "" removed from optionh ) +// CalcbyC changed ( "result" => "end" ) +// 20180516 +// Ctopsurf debugged ( : => ;) +// 20180510 +// CalcbyR changed ( for the last command ) +// Crv2sfparadataC added +// 20180508 +// MkprecommandR changed (PVOFG) +// CalcbyR changed (option Pre) +// 20180505 +// Ctopsurf changed ( for mult cutfun) +// 20180504 +// Ketinit debuggde (MARKLEN : ) +// 20180502 +// CostC removed +// SetconstantC added +// 20180428 +// CrvsfparadataC changed (Changestyle => "nodisp") +// Ctopsurf changed (data[DsizeLL][3] removed ) +// 20180426 +// CrvsfparadataC largely changed +// WritedataC changed ( \n removed at the last line ) +// 2018.04.12 +// CalcbyR changed ( for blank name ) +// 2018.04.11 +// Mkketcindyjs debugged // 2018.03.27 // functions of C changed // CalcbyC added diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutr.cs b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutr.cs index 1bb3e3439c6..ef6f151f6b3 100644 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutr.cs +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutr.cs @@ -14,7 +14,7 @@ // along with this program. If not, see <http://www.gnu.org/licenses/> // -println("ketcindyout(20180327) loaded"); +println("ketcindylibout(20180612 loaded"); //help:start(); @@ -646,6 +646,90 @@ Dataframe(nmL,dL,options):=( out=replace(out,"]",")"); ); +MkprecommandR():=MkprecommandR(6,"PVOFG"); //180508(9lines) +MkprecommandR(Arg):=( + regional(out,tmp1); + if(isstring(Arg), + MkprecommandR(6,Arg); + , + if(islist(Arg), + out=[]; + forall(Arg, + tmp1=Rform(#); + out=concat(out,[tmp1,[]]); + ); + out; + , + MkprecommandR(Arg,"PVOFG"); + ); + ); +); +MkprecommandR(prec,chstr):=( + regional(cmdL,Plist,tmp,tmp1,tmp2); + cmdL=[]; + if(indexof(chstr,"P")>0, + Plist=[]; + forall(remove(allpoints(),[SW,NE]), + tmp=textformat(re(Lcrd(#)),prec); + tmp=RSform(tmp); + tmp1=#.name; + tmp1=tmp1+"="+tmp+";Assignadd('"+tmp1+"',"+tmp1+")"; + Plist=append(Plist,tmp1); + ); + forall(1..(length(Plist)), + cmdL=concat(cmdL,[Plist_#,[]]); + ); + ); + if(indexof(chstr,"V")>0, + tmp2=sort(apply(VLIST,#_1)); // 16.02.03 from + tmp=apply(allpoints(),text(#));//18.02.11 + tmp2=remove(tmp2,tmp); + tmp1=[]; + forall(tmp2,tmp, + tmp1=concat(tmp1,select(VLIST,#_1==tmp)); + ); + VLIST=tmp1;// 17.09.24from + forall(VLIST, + tmp=#_1; + tmp1=#_2; + if(!isstring(tmp1), + if(islist(tmp1), + tmp2="["; + forall(tmp1, + tmp2=tmp2+textformat(#,prec)+","; + ); + tmp1=substring(tmp2,0,length(tmp2)-1)+"]"; + , + tmp1=format(tmp1,prec); + ); + ); + tmp1=RSform(tmp1); + tmp1=tmp+"="+tmp1+";"; + tmp1=tmp1+"Assignadd('"+tmp+"',"+tmp+")"; + cmdL=concat(cmdL,[tmp1,[]]);//17.09.24until + ); + ); + if(indexof(chstr,"O")>0, + forall(OutFileList, + cmdL=concat(cmdL,["tmp=ReadOutData",[Dq+#+Dq]]); + ); + ); + if(indexof(chstr,"F")>0, + forall(FUNLIST, + cmdL=concat(cmdL,[#,[]]); + ); + ); + if(indexof(chstr,"G")>0, + forall(GLIST, + if(indexof(#,"ReadOutData")==0, //18.02.12 + tmp1=Rform(#); + cmdL=concat(cmdL,[tmp1,[]]); + ); + ); + ); + cmdL; +); + CalcbyR(name,cmd):=CalcbyR(name,PathR,cmd,[]); CalcbyR(name,Arg1,Arg2):=( if(isstring(Arg1), @@ -656,9 +740,10 @@ CalcbyR(name,Arg1,Arg2):=( ); CalcbyR(name,path,cmd,optionorg):=( //help:CalcbyR(name,cmd); -//help:CalcbyR(options=["m/r","Wait=2","Out=yes","Pre=yes","Res=" ]); +//help:CalcbyR(options=["m/r","Wait=2","Out=yes","Pre=PVOFG","Res=" ]); +//help:CalcbyR(options2=["Pre=!G" ]); regional(options,tmp,tmp1,tmp2,tmp3,realL,strL,eqL, - cat,dig,preflg,flg,wflg,file,nc,arg,cmdR,cmdlist,wfile,waiting); + cat,dig,prestr,flg,wflg,file,nc,arg,cmdR,cmdlist,wfile,waiting); options=optionorg; tmp=divoptions(options); eqL=tmp_5; @@ -667,12 +752,12 @@ CalcbyR(name,path,cmd,optionorg):=( dig=5; cat="Y"; wfile=""; - preflg=1; - waiting=5; + prestr="PVOFG"; //180508 + waiting=30; //180608 forall(eqL, - tmp=indexof(#,"="); - tmp1=Toupper(substring(#,0,1)); - tmp2=substring(#,tmp,length(#)); + tmp=Strsplit(#,"="); + tmp1=Toupper(substring(tmp_1,0,1)); + tmp2=tmp_2; if((tmp1=="C")%(tmp1=="O"), cat=Toupper(substring(tmp2,0,1)); options=remove(options,[#]); @@ -681,10 +766,16 @@ CalcbyR(name,path,cmd,optionorg):=( waiting=parse(tmp2); options=remove(options,[#]); ); - if(tmp1=="P", //18.01.27 - tmp2=substring(Toupper(tmp2),0,1); - if(tmp2=="Y",preflg=1); - if(tmp2=="N",preflg=0); + if(tmp1=="P", //180508from + tmp2=Toupper(tmp2); + if(substring(tmp2,0,1)!="!", + prestr=tmp2; + , + tmp2=substring(tmp2,1,length(tmp2)); + forall(1..(length(tmp2)), + prestr=replace(prestr,substring(tmp2,#-1,#),""); + ); + );//180508to options=remove(options,[#]); ); if(tmp1=="D", @@ -704,7 +795,7 @@ CalcbyR(name,path,cmd,optionorg):=( if(cat=="Y", wfile=Fhead+name+".txt"; , - wfile="result.txt"; + wfile="resultR.txt"; ); ); wflg=0; @@ -725,12 +816,14 @@ CalcbyR(name,path,cmd,optionorg):=( if(length(tmp)==0,wflg=1); ); ); - file=Fhead+name; + if(length(name)>0,//180412from + file=Fhead+name; + , + file=Cindyname(); + );//180412to cmdR=[]; - if(preflg==1, //18.01.27from - cmdR=MkprecommandR(); - ); - cmdR=concat(cmdR,cmd); //18.01.27until + cmdR=MkprecommandR(6,prestr); + cmdR=concat(cmdR,cmd); //18.01.27to cmdlist=[]; if(dig>5, //16.10.28from cmdlist=append(cmdlist,"options(digits="+text(dig+2)+");"); @@ -738,9 +831,9 @@ CalcbyR(name,path,cmd,optionorg):=( forall(1..floor(length(cmdR)/2),nc, //17.05.18 tmp1=cmdR_(2*nc-1); tmp1=replace(tmp1,LFmark,""); // 16.06.12 - if(nc==length(cmdR)/2, //16.10.23from +// if(nc==length(cmdR)/2, //16.10.23from // if(indexof(tmp1,"=")==0,tmp1="="+tmp1);//16.12.20 - ); //16.10.23uptp +// ); //16.10.23uptp if(substring(tmp1,0,1)=="=", tmp1=name+tmp1; ); @@ -769,17 +862,23 @@ CalcbyR(name,path,cmd,optionorg):=( ); tmp1=cmdlist_(length(cmdlist)); if(indexof(tmp1,"=")==0, - tmp1=tokenize(tmp1,"::"); - if(length(tmp1)==1, - tmp2=name+"="+tmp1_1; - , - tmp2=name+"=list("; - forall(tmp1, - tmp2=tmp2+#+","; + if(length(name)>0, //180412 + tmp1=tokenize(tmp1,"::"); + if(length(tmp1)==1, + if(indexof(tmp1_1,"(")==0, //180510from + tmp2=name+"="+tmp1_1; + , + tmp2=tmp1_1; + ); //180510to + , + tmp2=name+"=list("; + forall(tmp1, + tmp2=tmp2+#+","; + ); + tmp2=substring(tmp2,0,length(tmp2)-1)+")"; //180510(moved) ); - tmp2=substring(tmp2,0,length(tmp2)-1)+")"; + cmdlist_(length(cmdlist))=tmp2; ); - cmdlist_(length(cmdlist))=tmp2; ); if(CONTINUED==1, ComOutList=concat(ComOutList,cmdlist); @@ -1197,10 +1296,10 @@ Writecsv(nmL,dataorg,file,optionorg):=( closefile(SCEOUTPUT); ); -Hatchdata(nm,iostr,pltlist):=Hatchdata(nm,iostr,pltlist,[]); -Hatchdata(nm,iostr,pltlist,optionorg):=( //17.09.18 -//help:Hatchdata("1","ii",[["gr1"],["gr2","n"]]); -//help:Hatchdata(options=["Wait=5"]); +HatchdataR(nm,iostr,pltlist):=HatchdataR(nm,iostr,pltlist,[]); +HatchdataR(nm,iostr,pltlist,optionorg):=( //17.09.18 +//help:HatchdataR("1","ii",[["gr1"],["gr2","n"]]); +//help:HatchdataR(options=["Wait=5"]); regional(options,name,eqL,reL,strL, plt,fname,options,tmp,tmp1,tmp2,tmp3,flg,wflg,waiting); name="ha"+nm; @@ -1896,66 +1995,6 @@ Rulerscale(pt,hscale,vscale,tick):=( ); ); -MkprecommandR():=MkprecommandR(6); -MkprecommandR(prec):=( - regional(cmdL,Plist,tmp,tmp1,tmp2); - Plist=[]; - Pnamelist=[]; - Pvaluelist=[]; - forall(remove(allpoints(),[SW,NE]), - tmp=textformat(re(Lcrd(#)),prec); - tmp=RSform(tmp); - tmp1=#.name; - tmp1=tmp1+"="+tmp+";Assignadd('"+tmp1+"',"+tmp1+")"; - Plist=append(Plist,tmp1); - ); - cmdL=[]; - forall(1..(length(Plist)), - cmdL=concat(cmdL,[Plist_#,[]]); - ); - tmp2=sort(apply(VLIST,#_1)); // 16.02.03 from - tmp=apply(allpoints(),text(#));//18.02.11 - tmp2=remove(tmp2,tmp); - tmp1=[]; - forall(tmp2,tmp, - tmp1=concat(tmp1,select(VLIST,#_1==tmp)); - ); - VLIST=tmp1;// 17.09.24from - forall(VLIST, - tmp=#_1; - tmp1=#_2; - if(!isstring(tmp1), - if(islist(tmp1), - tmp2="["; - forall(tmp1, - tmp2=tmp2+textformat(#,6)+","; - ); - tmp1=substring(tmp2,0,length(tmp2)-1)+"]"; - , - tmp1=format(tmp1,6); - ); - ); - tmp1=RSform(tmp1); - tmp1=tmp+"="+tmp1+";"; - tmp1=tmp1+"Assignadd('"+tmp+"',"+tmp+")"; - cmdL=concat(cmdL,[tmp1,[]]);//17.09.24until - ); - forall(OutFileList, - cmdL=concat(cmdL,["tmp=ReadOutData",[Dq+#+Dq]]); - ); - forall(FUNLIST, - cmdL=concat(cmdL,[#,[]]); - ); - forall(GLIST, - if(indexof(#,"ReadOutData")==0, //18.02.12 - tmp1=Rform(#); - cmdL=concat(cmdL,[tmp1,[]]); - ); - ); - cmdL; -); - - MkprecommandS():=MkprecommandS(6); MkprecommandS(prec):=( regional(cmdL,Plist,Pnamelist,Pvaluelist,tmp,tmp1,tmp2); @@ -2029,8 +2068,8 @@ MkprecommandS(prec):=( PlotdataS(name1,func,var):=PlotdataS(name1,func,var,[]); PlotdataS(nm,fun,variable,optionorg):=( -//help:PlotdataS("1","besselj(1,x)","x"); -//help:PlotdataS(options=["m/r","Num=50","Wait=5","Mx=no"]); +// help:PlotdataS("1","besselj(1,x)","x"); +// help:PlotdataS(options=["m/r","Num=50","Wait=5","Mx=no"]); regional(options,name,varstr,Num,waiting,mxcheck,outreg, eqL,strL,fname,tmp,tmp1,tmp2,tmp3,cmdL,flg,wflg); name="grsc"+nm; @@ -4542,8 +4581,17 @@ Mkketcindyjs(Arg):=( ); Mkketcindyjs(libname,options):=( //17.11.18 //help:Mkketcindyjs(); -//help:Mkketcindyjs(options="Tex=y","Net=y"]); - regional(texflg,netflg,tmp,tmp1,tmp2); +//help:Mkketcindyjs(options=["Tex=y","Net=y"]); + regional(texflg,netflg,tmp,tmp1,tmp2,dirfile,dirwork,dirketjs); + dirwork=replace(Dirwork,"\","/"); + tmp=replace(Dircdy,"\","/"); + if(substring(tmp,length(tmp)-1,length(tmp))=="/",//180411from + dirfile=substring(tmp,0,length(tmp)-1); + , + dirfile=tmp; + );//180411to + tmp=replace(Dirlib,"\","/"); + dirketjs=replace(tmp,"ketlib","ketcindyjs");//180411to texflg="Y"; netflg="Y"; forall(options, @@ -4557,15 +4605,15 @@ Mkketcindyjs(libname,options):=( //17.11.18 netflg=Toupper(substring(tmp1,tmp,tmp+1)); ); ); - if(isexists(Dirwork,Fhead+".html"), + if(isexists(dirfile,Fhead+".html"),//180411to SCEOUTPUT = openfile(Fhead+".r"); println(SCEOUTPUT,"Looprange<- function(a,b){"); println(SCEOUTPUT," if (a<=b) return(a:b)"); println(SCEOUTPUT," return(c())"); println(SCEOUTPUT,"}"); - println(SCEOUTPUT,"setwd('"+Dirfile+"/CindyJS')"); + println(SCEOUTPUT,"setwd('"+dirketjs+"')"); println(SCEOUTPUT,"Dtket=readLines('"+libname+".txt')"); - println(SCEOUTPUT,"setwd('"+Dirwork+"')"); + println(SCEOUTPUT,"setwd('"+dirfile+"')");//180411 println(SCEOUTPUT,"Dtjs=readLines('"+Fhead+".html')"); println(SCEOUTPUT,"Qt=rawToChar(as.raw(34))"); println(SCEOUTPUT, @@ -4579,7 +4627,7 @@ Mkketcindyjs(libname,options):=( //17.11.18 println(SCEOUTPUT, " if(length(grep('link rel=',Tmp,fixed=TRUE))>0){"); println(SCEOUTPUT, - " Tmp1='file:///"+Dirfile+"/CindyJS/CindyJS.css'"); + " Tmp1='file:///"+dirketjs+"/CindyJS.css'");//180411 println(SCEOUTPUT, " Tmp=paste(' <link rel=',Qt,'stylesheet',Qt,' href=',Qt,Tmp1,Qt,'>',sep='')"); println(SCEOUTPUT, @@ -4591,7 +4639,7 @@ Mkketcindyjs(libname,options):=( //17.11.18 println(SCEOUTPUT, " if(Tmp1>0){"); println(SCEOUTPUT, - " Tmp1='file:///"+Dirfile+"/CindyJS/Cindy.js'"); + " Tmp1='file:///"+dirketjs+"/Cindy.js'");//180411 println(SCEOUTPUT, " Tmp=paste(' <script type=',Qt,'text/javascript',Qt,' src=',Qt,Tmp1,Qt,'>',sep='')"); println(SCEOUTPUT, @@ -4633,7 +4681,7 @@ Mkketcindyjs(libname,options):=( //17.11.18 " if(length(grep(paste(Qt,'Parent',sep=''),Dtjs[I],fixed=TRUE))>0){next}"); println(SCEOUTPUT, " if(length(grep(paste(Qt,'KeTJS',sep=''),Dtjs[I],fixed=TRUE))>0){next}"); - println(SCEOUTPUT, + println(SCEOUTPUT, " }"); println(SCEOUTPUT," Dt=c(Dt,Dtjs[I])"); if(texflg=="Y", @@ -4645,12 +4693,14 @@ Mkketcindyjs(libname,options):=( //17.11.18 " }"); ); println(SCEOUTPUT,"}"); + println(SCEOUTPUT,"setwd('"+dirfile+"')");//180411 println(SCEOUTPUT,"writeLines(Dt,'"+Fhead+"ketcindy.html',sep='\n')"); println(SCEOUTPUT,"quit()"); closefile(SCEOUTPUT); kcR(PathR,Fhead+".r",["m"]); + println(Fhead+"ketcindy.html generated successfully"); , - drawtext(mouse().xy-[0,1],"First export to CindyJS",size->24,color->[1,0,0]); + drawtext(mouse().xy-[0,1],"use 'write to CindyJS' before that",size->24,color->[1,0,0]); wait(3000); ); ); @@ -4658,10 +4708,10 @@ Mkketcindyjs(libname,options):=( //17.11.18 ///////////////// C function ////////////////// Cform(strorg):=( -//help:Cform(str) +//help:Cform(str); regional(str,ter,out,hat,ns,ne,nn,jj,flg, lv,str1,str2,tmp,tmp1,tmp2); - ter=["+","-","*","/","(",")"]; + ter=["+","-","*","/","(",")","="]; //180517 str=replace(strorg,"pi","M_PI"); hat=Indexall(str,"^"); out=""; @@ -4677,6 +4727,7 @@ Cform(strorg):=( out=out+substring(str,ns,ns+tmp-1); str1=substring(str,ns+tmp,nn-2); , + tmp=0;//180517 flg=0; tmp2=reverse(ns..(nn-1)); forall(tmp2,jj, @@ -4769,31 +4820,46 @@ ConvertFdtoC(Fd,name):=( FdC=concat(FdC,[tmp1_6]); ); -ConstC(setlist):=( //180323 - regional(divL,sizeL,epsL); - //Mdv=50; Ndv=50; - //DsizeLL=5000; DsizeL=1500; DsizeM=500; DsizeS=200; - //Eps=0.00001; Eps1=0.01; Eps2=0.1; - forall(setlist, - if((#_1>1)&(#_1<=200), - divL=#; - if(length(divL)==0,divL=[50]); - if(length(divL)==1,divL=append(divL,divL_1)); +StartsurfC():=StartsurfC("",[50,50],[1500,500,200],[0.01,0.1]);//180611renewed +StartsurfC(Arg):=( + regional(tmp); + if(isstring(Arg), + StartsurfC(Toupper(Arg),[50,50],[1500,500,200],[0.01,0.1]); + , + tmp=max(Arg); + if(tmp>=500, + StartsurfC("",[50,50],Arg,[0.01,0.1]); , - if(#_1>=100, - sizeL=#; - if(length(sizeL)==0,sizeL=[5000]); - if(length(sizeL)==1,sizeL=append(sizeL,1500)); - if(length(sizeL)==2,sizeL=append(sizeL,500)); - if(length(sizeL)==3,sizeL=append(sizeL,200)); + if(tmp>1, + StartsurfC("",Arg,[1500,500,200],[0.01,0.1]); , - epsL=#; - if(length(epsL)==0,epsL=[0.01]); - if(length(epsL)==1,epsL=append(epsL,0.1)); - epsL=prepend(0.00001,epsL); + StartsurfC("",[50,50],[1500,500,200],Arg); ); ); ); +); +StartsurfC(restr,Nplist,Dsizelist,Epslist):=(//180501 +//help:StartsurfC(); +//help:StartsurfC("reset"); +//help::StartsurfC([0.01,0.1]); +//help:StartsurfC([50,50],[1500,500,200],[0.01,0.1]); +//help:StartsurfC([50],[1500,500],[0.01,0.1]); + regional(divL,sizeL,epsL); + CommandListC=[];//180608(2lines) + FuncListC=[]; + if(substring(restr,0,1)=="R", //180611(3lines) + GLIST=[]; + ); + divL=Nplist; sizeL=Dsizelist; epsL=Epslist; + if(length(divL)==0,divL=[50]); + if(length(divL)==1,divL=append(divL,divL_1)); + if(length(sizeL)==0,sizeL=[1500]); //180610from + if(length(sizeL)==1,sizeL=append(sizeL,500)); + if(length(sizeL)==2,sizeL=append(sizeL,200)); + sizeL=prepend(5000,sizeL); //180610to + if(length(epsL)==0,epsL=[0.01]); + if(length(epsL)==1,epsL=append(epsL,0.1)); + epsL=prepend(0.00001,epsL); ConstantListC=[divL,sizeL,epsL]; ); @@ -4978,7 +5044,7 @@ Cmain(fname,cmdLorg):=( tmp3=concat(tmp3,[ "double "+tmp2_1+"[DsizeL][3];",[], //17.06.09(6lines) "sfbdparadata",[tmp2_1], - "output3h",[var, varh,file,tmp2_1], + "output3h",["w",var, varh,file,tmp2_1], "dataindexd3",[3,tmp2_1,"din"], tmp2_2+"[0][0]=0;",[], "appendd3",[2,"din[1][0]","din[1][1]",tmp2_1,tmp2_2] @@ -5004,7 +5070,7 @@ Cmain(fname,cmdLorg):=( "crvsfparadata",[tmp2_1,tmp2_2,1,"Crvdata"], tmp2_1+"[0][0]=0;",[], //17.06.09(3lines) "appendd3",[0,1,"length3(Crvdata)","Crvdata",tmp2_1], - "output3h",[var, varh, file,tmp2_1] + "output3h",["w",var, varh, file,tmp2_1] ]); cmd=concat(cmd,tmp3); if(#<length(nL), @@ -5028,7 +5094,7 @@ Cmain(fname,cmdLorg):=( " crv3onsfparadata",[tmp2_1,tmp2_2,1,"Crvdata"], tmp2_1+"[0][0]=0;",[], "appendd3",[0,1,"length3(Crvdata)","Crvdata",tmp2_1], - "output3h",[var,varh, file ,tmp2_1] + "output3h",["w",var,varh, file ,tmp2_1] ]); cmd=concat(cmd,tmp3); if(#<length(nL), @@ -5058,7 +5124,7 @@ Cmain(fname,cmdLorg):=( "crv3onsfparadata",["out",tmp2_2,"Crvdata"], tmp2_1+"[0][0]=0;",[], "appendd3",[0,1,"length3(Crvdata)","Crvdata",tmp2_1], - "output3h",[var, varh, file, tmp2_1] + "output3h",["w",var, varh, file, tmp2_1] ]); cmd=concat(cmd,tmp3); if(#<length(nL), @@ -5114,7 +5180,7 @@ Cmain(fname,cmdLorg):=( "wireparadata",["Surf", "udv","vdv", num, "Wiredata"], tmp2_1+"[0][0]=0;",[], "appendd3",[0,1,"length3(Wiredata)","Wiredata",tmp2_1], - "output3h",[var, varh, file, tmp2_1] + "output3h",["w",var, varh, file, tmp2_1] ]); cmd=concat(cmd,tmp3); if(#<length(nL), @@ -5169,7 +5235,7 @@ Cmain(fname,cmdLorg):=( if(length(tmp2)<=3,tmp=1,tmp=tmp2_4); tmp3=concat(tmp3,[ "skeletondata3",["data", tmp, "Eps1","Eps2","sk"],//17.06.13 - "output3",[var, file, 2, "sk"] + "output3",["w",var, file, 2, "sk"] ]); cmd=concat(cmd,tmp3); if(nn<length(nL), @@ -5304,7 +5370,7 @@ Cmain(fname,cmdLorg):=( kcC():=kcC(FheadC); kcC(cname):=( regional(tmp, tmp1,flg,rfile); - rfile="resultC"+cname+".txt"; + rfile=cname+"end.txt"; //180517 if(iswindows(), SCEOUTPUT = openfile("kc.bat"); println(SCEOUTPUT,"set path="+Dirwork); @@ -5315,6 +5381,7 @@ kcC(cname):=( tmp=PathC+" %path%\"+cname+".c"; tmp=tmp+" -o %path%\main.exe"; println(SCEOUTPUT,tmp); + println(SCEOUTPUT,"cd "+Dq+Dirwork+Dq); println(SCEOUTPUT,"%path%\main.exe"); println(SCEOUTPUT,"echo //// > %path%\"+rfile); println(SCEOUTPUT,"exit"); @@ -5325,7 +5392,7 @@ kcC(cname):=( SCEOUTPUT = openfile("kc.sh"); println(SCEOUTPUT,"#!/bin/sh"); println(SCEOUTPUT,"cd "+Dq+Dirwork+Dq); - tmp=PathC+" "+cname+".c -o main.out"; + tmp=PathC+" -lm "+cname+".c -o main.out"; //180612 println(SCEOUTPUT,tmp); println(SCEOUTPUT,"./main.out"); println(SCEOUTPUT,"echo //// >"+rfile); @@ -5354,8 +5421,8 @@ kcC(cname):=( ); ); -ReadCdataold(var, fname):=ReadCdata(var, fname,[]); -ReadCdata(var, fname,options):=( +ReaddataCold(var, fname):=ReaddataC(var, fname,[]); +ReaddataC(var, fname,options):=( regional(file,dt,name,str,tmp,tmp1,opstr,gout, out3,out2); if(indexof(fname,".")==0, file=fname+".txt"; @@ -5366,7 +5433,7 @@ ReadCdata(var, fname,options):=( name=substring(fname,0,tmp-1); ); tmp=Divoptions(options); - opstr=tmp_8; + opstr=tmp_(length(tmp)-1); gout=ReadOutData(file); GLIST=Append(GLIST,"Tmpstr=ReadOutData("+Dq+file+Dq+")"); if(substring(var,length(var)-1,length(var))!="h", @@ -5380,7 +5447,7 @@ ReadCdata(var, fname,options):=( );//17.06.16until ); -ReadCdata(fnameorg):=( +ReaddataC(fnameorg):=( regional(tmp,tmp1,fname,data,out); fname=fnameorg; if(indexof(fname,".")==0, fname=fname+".txt"); @@ -5403,8 +5470,8 @@ ReadCdata(fnameorg):=( out; ); -WriteCdata(fnameorg,dataorg):=( -//help:WriteCdata(filename, 3ddata); +WritedataC(fnameorg,dataorg):=( +//help:WritedataC(filename, 3ddata); regional(tmp,fname,data,kk,nn,pt); data=dataorg; if(isstring(data),data=parse(data)); @@ -5416,9 +5483,13 @@ WriteCdata(fnameorg,dataorg):=( forall(1..(length(data_kk)),nn, pt=apply(1..3,Sprintf(data_kk_nn_#,5)); tmp=pt_1+" "+pt_2+" "+pt_3+" -99999"; - println(SCEOUTPUT,tmp); + print(SCEOUTPUT,tmp); + if(nn<length(data_kk), //180426from + println(SCEOUTPUT,""); + );//180426to ); if(kk<length(data), + println(SCEOUTPUT,"");//180426 println(SCEOUTPUT,"99999.00000 2.00000 0.00000 -99999"); ); ); @@ -5442,7 +5513,7 @@ DisplayC(dispc):=( cflg=0; tmp=Divoptions(options);//17.06.18from eqL=tmp_5; - opcindy=tmp_9; + opcindy=tmp_(length(tmp)); forall(eqL, if(Toupper(substring(#,0,2))=="CO", tmp=indexof(#,"="); @@ -5465,7 +5536,7 @@ DisplayC(dispc):=( Texcom("{"); Setcolor(color); ); - ReadCdata(var,file,options);// 17.05.24 + ReaddataC(var,file,options);// 17.05.24 if(cflg==1, Texcom("}"); ); @@ -5504,7 +5575,8 @@ Cheadsurf():=( tmp=tmp+", Eps1="+tmp1_2; tmp=tmp+", Eps2="+tmp1_3+";"; cmd=append(cmd,tmp); - tmp="const char dirname[]="+Dq+Dirwork+"/"+Dq+";"; + tmp=replace(Dirwork,"\","/"); //180523(2lines) + tmp="const char Dirname[]="+Dq+tmp+"/"+Dq+";"; cmd=append(cmd,tmp); cmd=append(cmd,"double Urng[2],Vrng[2];"); cmd=append(cmd, "int DrawE,DrawW,DrawS,DrawN;"); @@ -5519,6 +5591,7 @@ Cheadsurf():=( if(#==4,tmp="Urng",tmp="Vrng"); tmp2=tmp2+tmp+"[0]="+tmp1_1+";"+tmp+"[1]="+tmp1_2+";"; ); + tmp2=tmp2+"break;"; //180523 cmd=append(cmd,tmp2); ); cmd=append(cmd," }"); @@ -5536,6 +5609,7 @@ Cheadsurf():=( if(indexof(tmp,"s")>0,tmp2=tmp2+"1;",tmp2=tmp2+"0;"); tmp2=tmp2+"DrawN="; if(indexof(tmp,"n")>0,tmp2=tmp2+"1;",tmp2=tmp2+"0;"); + tmp2=tmp2+"break;"; //180523 cmd=append(cmd,tmp2); ); cmd=append(cmd," }"); @@ -5550,6 +5624,7 @@ Cheadsurf():=( tmp1=substring(tmp1,tmp,length(tmp1)); tmp2=tmp2+"p["+text(#-1)+"]="+tmp1+";"; ); + tmp2=tmp2+"break;"; //180523 cmd=append(cmd,tmp2); ); cmd=append(cmd," }"); @@ -5557,36 +5632,47 @@ Cheadsurf():=( cmd; ); -Ctopsurf(name):=Ctopsurf(name,[]); -Ctopsurf(name,cmdadd):=( - regional(path,cmd); +Ctopsurf(name):=Ctopsurf(name,CutFunList); +Ctopsurf(name,cutfunLorg):=( + regional(cutfunL,path,cmd,tmp,tmp1,tmp2); + cutfunL=cutfunLorg; //180601from + if(length(cutfunL)==0, + cutfunL=["1"]; + );//180601to path=DirlibC+"/"; path=replace(path,"\","/"); cmd=[ - "#include <stdio.h>", "#include <math.h>", + "#include <stdio.h>","#include <math.h>", + "#include <stdlib.h>","#include <string.h>", //180530 "#include "+Dqq(Fhead+name+"header.h"), "#include "+Dqq(path+"ketcommonhead.h"), "#include "+Dqq(path+"ketcommon.h"), "#include "+Dq+path+"surflibhead.h"+Dq, "#include "+Dq+path+"surflib.h"+Dq, - "double cutfun1(short ch,double u, double v){", + "double cutfun(short chfd, short chcut, double u, double v){", " double p[3],val;", - " surffun(ch,u,v,p);", - " val=1;", - " return val;", - "}", - "double cutfun(short ch, int chcut, double u, double v){", - " double p[3],val;", - " switch(chcut){", - " case 1: val=cutfun1(ch,u,v);", + " surffun(chfd,u,v,p);", + " switch(chcut){" + ]; + tmp1=[]; + forall(1..(length(cutfunL)), + tmp2=replace(cutfunL_#,"x","p[0]"); + tmp2=replace(tmp2,"y","p[1]"); + tmp2=replace(tmp2,"z","p[2]"); + tmp2=" case "+text(#)+": val="+tmp2+";"; + tmp2=tmp2+"break;"; //180523 + tmp1=append(tmp1,tmp2); + ); + cmd=concat(cmd,tmp1); + cmd=concat(cmd,[ " }", " return val;", "}", "int main(void){", - " double out[DsizeL][3], data[DsizeLL][3];", - " int i, j, nall, din[DsizeS][2];", + " double data[DsizeL][3],sfbd[DsizeL][3],out[DsizeL][3];", //180601 + " int i, j, nall;", " char dirfname[256] = {'\0'};" - ]; + ]); cmd; ); @@ -5630,15 +5716,23 @@ CalcbyC(name,path,cmd,optionorg):=( body=cmd_3; options=optionorg; tmp=divoptions(options); -// eqL=tmp_5; + eqL=tmp_5; strL=tmp_7; - waiting=30; - wfile="resultC"+Fhead+name+".txt"; + waiting=40; + wfile=Fhead+name+"end.txt"; //180517 hfile=Fhead+name+"header.h"; println(Dirwork); println(hfile); mfile=Fhead+name+".c"; wflg=0; + forall(eqL, + tmp=Strsplit(#,"="); + tmp1=Toupper(substring(tmp_1,0,1)); + if(tmp1=="W", + waiting=parse(tmp_2); + options=remove(options,[#]); + ); + ); forall(strL, tmp=Toupper(substring(#,0,1)); if(tmp=="M", @@ -5693,13 +5787,9 @@ CalcbyC(name,path,cmd,optionorg):=( repeat(tmp1, if(flg==0, tmp=load(wfile); - if(length(tmp)>=4, - tmp2=substring(tmp,length(tmp)-4,length(tmp)); - if(tmp2=="////", - tmp=substring(tmp,0,length(tmp)-4); - flg=1; - tmp2=#*WaitUnit/1000; - ); + if(indexof(tmp,"////")>0, //180523from + flg=1; + tmp2=#*WaitUnit/1000;//180523to , if(wflg==-1, flg=-1; @@ -5722,19 +5812,122 @@ CalcbyC(name,path,cmd,optionorg):=( ); ); +ExeccmdC(nm):=ExeccmdC(nm,[],["do"]); //180531 +ExeccmdC(nm,options):=ExeccmdC(nm,options,["do"]); +ExeccmdC(nm,optionorg,optionhorg):=( +//help:ExeccmdC("1",["m/r","Wait=30"],["do"]); + regional(options,optionsh,name2,name3,waiting,dirbkup, + eqL,reL,strL,fname,tmp,tmp1,tmp2,flg,wflg,varL); + fname=Fhead+nm+".txt"; + options=optionorg; + optionsh=optionhorg; + optionsh=select(optionsh,length(#)>0); + if(length(optionsh)==0,optionsh=["do"]); + tmp=Divoptions(options); + eqL=tmp_5; + reL=tmp_6; + strL=tmp_7; + waiting=30; + wflg=0; + cmdflg=0; + forall(strL, + tmp=Toupper(substring(#,0,1)); + if(tmp=="M", + wflg=1; + options=remove(options,[#]); + ); + if(tmp=="R", + wflg=-1; + options=remove(options,[#]); + ); + ); + forall(eqL, + tmp=Strsplit(#,"="); + if(Toupper(tmp_1)=="WAIT", + waiting=parse(tmp_2); + options=remove(options,[#]); + ); + ); + options=remove(options,reL); + options=select(options,length(#)>0); + if(CommonMake==1,//180609from + tmp1=append(options,"m"); + wflg=0; + ); + if(CommonMake==-1, + tmp1=append(options,"r"); + wflg=0; + );//180609to + if(wflg==1,tmp1=append(options,"m")); + if(wflg==-1,tmp1=append(options,"r")); + tmp1=append(tmp1,"Wait="+text(waiting)); + CommandListC=prepend(" char fnameall[]="+Dqq(fname)+";",CommandListC); + CommandListC=prepend(" printf("+Dqq("%s\n")+","+Dqq(Fhead)+");",CommandListC); //180608 + tmp=select(CommandListC,indexof(#,"outputend")>0); + if(length(tmp)==0, + CommandListC=append(CommandListC," outputend(dirfname);"); + ); + if(length(CommandListC)<=2,ErrFlag=1); + if(ErrFlag==0, + CalcbyC(nm,[Cheadsurf(),Ctopsurf(nm),CommandListC],tmp1); + ); + if(ErrFlag==1, + err("CommandListC is empty or execcmd is not completed"); + , + varL=ReadOutData(fname); + GLIST=append(GLIST,"ReadOutData("+Dqq(fname)+")"); + tmp1=select(varL,indexof(#,"h3d")==0); + tmp2=remove(varL,tmp1); + tmp1=select(tmp1,indexof(#,"3d")>0); + tmp=""; + if(length(options)>0, + forall(options, + tmp=tmp+Dqq(#)+","; + ); + tmp=substring(tmp,0,length(tmp)-1); + ); + if(length(tmp)>0,tmp=tmp+","); //180602 + tmp=tmp+Dqq("Msg=no"); //180602 + tmp1=apply(tmp1,replace(#,"3d","2d")+"=Projpara("+Dqq(#)+",["+tmp+"]);"); + forall(tmp1,parse(#)); + tmp=""; + if(length(optionsh)>0, + forall(optionsh, + tmp=tmp+Dqq(#)+","; + ); + tmp=substring(tmp,0,length(tmp)-1); + ); + tmp2=apply(tmp2,replace(#,"3d","2d")+"=Projpara("+Dqq(#)+",["+tmp+"]);"); + forall(tmp2,parse(#)); + Changestyle3d(EraseList,["nodisp"]);//180601 + ); + varL=select(varL,length(parse(#))>0); + if(length(addpath)>0,Changework(dirbkup,["Sub=n"])); //180605 + varL; +); + SfbdparadataC(nm,fd):= SfbdparadataC(nm,fd,[],["nodisp"]); SfbdparadataC(nm,fd,options):= SfbdparadataC(nm,fd,options,["nodisp"]); SfbdparadataC(nm,fdorg,optionorg,optionsh):=( //help:SfbdparadataC("1",Fd); -//help:SfbdparadataC(options2=["r/m"]); +//help:SfbdparadataC(options2=["c(default)/r/m"]); regional(funnm,fd,options,name2,name3,name2h,name3h,waiting, - eqL,reL,strL,fname,tmp,tmp1,tmp2,flg,wflg); + eqL,reL,strL,fname,tmp,tmp1,tmp2,flg,wflg,cmdflg); if(ChNumber==0,ChNumber=Ch); fd=ConvertFdtoC(fdorg); - FuncListC=append(FuncListC,fd); - funnm=text(length(FuncListC)); + tmp1=0; //180606from + forall(1..(length(FuncListC)), + if(FuncListC_#==fd, + funnm=#; + tmp1=1; + ); + ); + if(tmp1==0, + FuncListC=append(FuncListC,fd); + funnm=text(length(FuncListC)); + ); //180606to name2="sfbd2d"+nm; name3="sfbd3d"+nm; name2h="sfbdh2d"+nm; @@ -5745,80 +5938,100 @@ SfbdparadataC(nm,fdorg,optionorg,optionsh):=( eqL=tmp_5; reL=tmp_6; strL=tmp_7; - waiting=120; + waiting=60; wflg=0; + cmdflg=1; forall(strL, tmp=Toupper(substring(#,0,1)); if(tmp=="M", + cmdflg=0; wflg=1; options=remove(options,[#]); ); if(tmp=="R", + cmdflg=0; wflg=-1; options=remove(options,[#]); ); + if(tmp=="C", //180531 + cmdflg=1; + options=remove(options,[#]); + ); ); options=remove(options,eqL); options=remove(options,reL); options=select(options,length(#)>0); cmdL=[ - " double sfbd"+funnm+"[DsizeL][3];", - " char fname"+funnm+"[]="+Dqq(fname)+";", + " char fname"+nm+"[]="+Dqq(fname)+";", " rangeUV("+funnm+");", " boundary("+funnm+");", - " sfbdparadata("+funnm+",sfbd"+funnm+");", - " sprintf(dirfname,"+Dqq("%s%s")+",dirname,fname"+funnm+");", - " output3h("+Dqq("sfbd3d"+nm)+","+Dqq("sfbdh3d"+nm)+",dirfname,sfbd"+funnm+");"; + " sfbdparadata("+funnm+",sfbd);", + " sprintf(dirfname,"+Dqq("%s%s")+",Dirname,fname"+nm+");", + " output3h("+Dqq("w")+","+Dqq("sfbd3d"+nm)+","+Dqq("sfbdh3d"+nm)+",dirfname,sfbd);", + " outputend(dirfname);" ]; - if(wflg==1,tmp1=append(options,"m")); - if(wflg==-1,tmp1=append(options,"r")); - if(ErrFlag==0, - tmp="sfbd"+nm; - CalcbyC(tmp,[Cheadsurf(),Ctopsurf(tmp),cmdL],tmp1); - ); - if(ErrFlag==1, - err("Sfbdparadata not completed"); + if(cmdflg==1, //180531from + println(" ExeccmdC will generate "+ name3+","+name3h); + tmp=replace(cmdL_5,"fname"+funnm,"fnameall");cmdL_5=tmp; + tmp=select(CommandListC,indexof(#,"output3")>0); //180601from + if(length(tmp)>0, + tmp=replace(cmdL_6,Dqq("w"),Dqq("a"));cmdL_6=tmp; + ); //180601from + cmdL=remove(cmdL,[cmdL_1,cmdL_(length(cmdL))]); + CommandListC=concat(CommandListC,cmdL); //180531to , - ReadOutData(fname); - GLIST=append(GLIST,"ReadOutData("+Dqq(fname)+")"); - if(islist(parse(name3)), - tmp1=name2+"=Projpara("+Dqq(name3)+",["; - tmp2=""; - if(length(options)>0, - forall(options, - tmp2=tmp2+Dqq(#)+","; + if(wflg==1,tmp1=append(options,"m")); + if(wflg==-1,tmp1=append(options,"r")); + if(ErrFlag==0, + tmp="sfbd"+nm; + CalcbyC(tmp,[Cheadsurf(),Ctopsurf(tmp),cmdL],tmp1); + ); + if(ErrFlag==1, + err("Sfbdparadata not completed"); + , + ReadOutData(fname); + GLIST=append(GLIST,"ReadOutData("+Dqq(fname)+")"); + if(islist(parse(name3)), + tmp1=name2+"=Projpara("+Dqq(name3)+",["; + tmp2=""; + if(length(options)>0, + forall(options, + tmp2=tmp2+Dqq(#)+","; + ); + tmp2=substring(tmp2,0,length(tmp2)-1); ); - tmp2=substring(tmp2,0,length(tmp2)-1); - ); - tmp1=tmp1+tmp2+"]);"; - parse(tmp1); - if(length(optionsh)==0,tmp2=["nodisp"],tmp2=optionsh); - tmp1=name2h+"=Projpara("+Dqq(name3h)+",["; - forall(tmp2, - tmp1=tmp1+Dqq(#)+","; + tmp1=tmp1+tmp2+"]);"; + parse(tmp1); + tmp2=select(optionsh,length(#)>0); //180517(2lines) + if(length(tmp2)==0,tmp2=["nodisp"]); + tmp1=name2h+"=Projpara("+Dqq(name3h)+",["; + forall(tmp2, + tmp1=tmp1+Dqq(#)+","; + ); + tmp1=substring(tmp1,0,length(tmp1)-1)+"]);"; + parse(tmp1); + , + ErrFlag=1; ); - tmp1=substring(tmp1,0,length(tmp1)-1)+"]);"; - parse(tmp1); - , - ErrFlag=1; ); ); ); -CrvsfparadataC(nm,fk,fbdy,fd):= - CrvsfparadataC(nm,fk,fbdy,fd,[],["nodisp"]); -CrvsfparadataC(nm,fk,fbdy,fd,options):= - SfbdparadataC(nm,fk,fbdy,fd,options,["nodisp"]); -CrvsfparadataC(nm,Fk,Fbdy,fdorg,optionorg,optionsh):=( +CrvsfparadataC(nm,fk,sfbd,fd):= + CrvsfparadataC(nm,fk,sfbd,fd,[],["nodisp"]); +CrvsfparadataC(nm,fk,sfbd,fd,options):= + SfbdparadataC(nm,fk,sfbd,fd,options,["nodisp"]); +CrvsfparadataC(nm,Fk,sfbdorg,fdorg,optionorg,optionsh):=( //help:CrvsfparadataC("1","ax3d","sfbd3d1",Fd); -//help:CrvsfparadataC(options2=["r/m"]); +//help:CrvsfparadataC(options2=["c(default)/r/m"]); //help:CrvsfparadataC(optionsh=["nodisp"]); - regional(funnm,fd,options,name2,name3,name2h,name3h,waiting, - eqL,reL,strL,fname,tmp,tmp1,tmp2,flg,wflg,flg,ii,jj,eps); + regional(funnm,sfbd,fd,options,name2,name3,name2h,name3h,waiting, + eqL,reL,strL,fname,tmp,tmp1,tmp2,flg,wflg,flg,ii,jj,eps,cmdlfg); eps=10^(-5); + sfbd=replace(sfbdorg,"bdy","sfbd"); fd=ConvertFdtoC(fdorg); tmp=select(1..(length(FuncListC)),FuncListC_#==fd); - funcnum=tmp_1; + funnm=text(tmp_1); //180426 name2="crvsf2d"+nm; name3="crvsf3d"+nm; name2h="crvsfh2d"+nm; @@ -5829,30 +6042,35 @@ CrvsfparadataC(nm,Fk,Fbdy,fdorg,optionorg,optionsh):=( eqL=tmp_5; reL=tmp_6; strL=tmp_7; - waiting=120; + waiting=60; wflg=0; + cmdflg=1; forall(strL, tmp=Toupper(substring(#,0,1)); if(tmp=="M", + cmdflg=0; wflg=1; options=remove(options,[#]); ); if(tmp=="R", + cmdflg=0; wflg=-1; options=remove(options,[#]); ); + if(tmp=="C", //180531 + cmdflg=1; + options=remove(options,[#]); + ); ); options=remove(options,eqL); options=remove(options,reL); options=select(options,length(#)>0); -// tmp1=[Dqq(fname),Dqq(name3),name3,Dqq(name2),name2]; -// tmp1=concat(tmp1,[Dqq(name3h),name3h,Dqq(name2h),name2h]); - tmp2=parse(Fbdy); + tmp2=parse(Fk); flg=0; - tmp=Fhead+Fbdy+".dat"; + tmp=Fhead+Fk+".dat"; if(!isexists(Dirwork,tmp),flg=1); if(flg==0, - tmp1=ReadCdata(tmp); + tmp1=ReaddataC(tmp); if(length(tmp1)!=length(tmp2),flg=1); if(flg==0, forall(1..(length(tmp1)),ii, @@ -5865,13 +6083,131 @@ CrvsfparadataC(nm,Fk,Fbdy,fdorg,optionorg,optionsh):=( ); ); ); - if(flg==1,WriteCdata(tmp,Fbdy)); - tmp2=parse(Fk); + if(flg==1,WritedataC(tmp,Fk)); + if(cmdflg==1, + EraseList=append(EraseList,Fk); + , + Changestyle3d(Fk,["nodisp"]); + ); + cmdL=[ + " char fname"+nm+"[]="+Dqq(fname)+";", + " rangeUV("+funnm+");", + " boundary("+funnm+");", + " readdataC("+Dqq(Fhead+Fk+".dat")+",data);", + " readoutdata3("+Dqq(Fhead+replace(sfbd,"3d","")+".txt")+","+Dqq(sfbd)+",sfbd);", //180531 + " crvsfparadata("+funnm+",data,sfbd, 0, out);", + " sprintf(dirfname,"+Dqq("%s%s")+",Dirname,fname"+nm+");", + " output3h("+Dqq("w")+","+Dqq("crvsf3d"+nm)+","+Dqq("crvsfh3d"+nm)+",dirfname,out);", + " outputend(dirfname);" + ]; + if(cmdflg==1,//180531from + println(" ExeccmdC will generate "+ name3+","+name3h); + cmdL_5=" readoutdata3(fnameall,"+Dqq(sfbd)+",sfbd);"; + cmdL_7=" sprintf(dirfname,"+Dqq("%s%s")+",Dirname,fnameall);"; //180607 + tmp=replace(cmdL_(length(cmdL)-1),Dqq("w"),Dqq("a")); cmdL_(length(cmdL)-1)=tmp; + cmdL=remove(cmdL,[cmdL_(length(cmdL))]); + CommandListC=concat(CommandListC,cmdL); //180531to + , + if(wflg==1,tmp1=append(options,"m")); + if(wflg==-1,tmp1=append(options,"r")); + if(ErrFlag==0, + tmp="crvsf"+nm; + CalcbyC(tmp,[Cheadsurf(),Ctopsurf(tmp),cmdL],tmp1); + ); + if(ErrFlag==1, + err("Crvsfparadata not completed"); + , + ReadOutData(fname); + GLIST=append(GLIST,"ReadOutData("+Dqq(fname)+")"); + if(islist(parse(name3)), + tmp1=name2+"=Projpara("+Dqq(name3)+",["; + tmp2=""; + if(length(options)>0, + forall(options, + tmp2=tmp2+Dqq(#)+","; + ); + tmp2=substring(tmp2,0,length(tmp2)-1); + ); + tmp1=tmp1+tmp2+"]);"; + parse(tmp1); + tmp2=select(optionsh,length(#)>0); //180517(2lines) + if(length(tmp2)==0,tmp2=["nodisp"]); + tmp1=name2h+"=Projpara("+Dqq(name3h)+",["; + forall(tmp2, + tmp1=tmp1+Dqq(#)+","; + ); + tmp1=substring(tmp1,0,length(tmp1)-1)+"]);"; + parse(tmp1); + , + ErrFlag=1; + ); + ); + ); +); + +Crv3onsfparadataC(nm,crv3d,sfbd,fd):= + Crv3onsfparadataC(nm,crv3d,sfbd,fd,[],["nodisp"]); +Crv3onsfparadataC(nm,crv3d,sfbd,fd,options):= + Crv3onsfparadataC(nm,crv3d,sfbd,fd,options,["nodisp"]); +Crv3onsfparadataC(nm,crv3d,sfbdorg,fdorg,optionorg,optionsh):=( +//help:Crv3onsfparadataC("1","sc3","sfbd3d1",fd); + regional(funnm,sfbd,fd,options,name3,name3h,name2,name2h,waiting, + eqL,reL,strL,fname,tmp,tmp1,tmp2,flg,wflg,flg,ii,jj,eps,cmdflg); + tmp1=replace(crv3d,"3d","2d"); + tmp=apply(GCLIST,#_1); + if(contains(tmp,tmp1), + if(cmdflg==1, + EraseList=append(EraseList,tmp1); + , + Changestyle3d(tmp1,["nodisp"]);//180428 + ); + ); + eps=10^(-5); + sfbd=replace(sfbdorg,"bdy","sfbd"); + fd=ConvertFdtoC(fdorg); + tmp=select(1..(length(FuncListC)),FuncListC_#==fd); + funnm=text(tmp_1); //180426 + name3="crv3onsf3d"+nm; + name3h="crv3onsfh3d"+nm; + name2=replace(name3,"3d","2d"); + name2h=replace(name3h,"3d","2d"); + fname=Fhead+"crv3onsf"+nm+".txt"; + tmp=apply(fdorg,if(isstring(#),Dqq(#),#)); + tmp=text(tmp); + options=optionorg; + tmp=Divoptions(options); + eqL=tmp_5; + reL=tmp_6; + strL=tmp_7; + waiting=60; + wflg=0; + cmdflg=1; + forall(strL, + tmp=Toupper(substring(#,0,1)); + if(tmp=="M", + cmdflg=0; + wflg=1; + options=remove(options,[#]); + ); + if(tmp=="R", + cmdflg=0; + wflg=-1; + options=remove(options,[#]); + ); + if(tmp=="C", //180531 + cmdflg=1; + options=remove(options,[#]); + ); + ); + options=remove(options,eqL); + options=remove(options,reL); + options=select(options,length(#)>0); + tmp2=parse(crv3d); flg=0; - tmp=Fhead+Fk+".dat"; + tmp=Fhead+crv3d+".dat"; if(!isexists(Dirwork,tmp),flg=1); if(flg==0, - tmp1=ReadCdata(tmp); + tmp1=ReaddataC(tmp); if(length(tmp1)!=length(tmp2),flg=1); if(flg==0, forall(1..(length(tmp1)),ii, @@ -5883,50 +6219,432 @@ CrvsfparadataC(nm,Fk,Fbdy,fdorg,optionorg,optionsh):=( ); ); ); - ); - if(flg==1,WriteCdata(tmp,Fk)); + ); + if(flg==1,WritedataC(tmp,crv3d)); cmdL=[ - " double fbdy[DsizeL][3],fk[DsizeL][3];", - " char fname"+nm+"[]="+Dqq(fname)+";", + " char fname"+nm+"[]="+Dqq(fname)+";", " rangeUV("+funnm+");", " boundary("+funnm+");", - " readdata3("+Dqq(Fhead+Fbdy+".dat")+",fbdy);", - " readdata3("+Dqq(Fhead+Fk+".dat")+",fk);", - " crvsfparadata(fk,fbdy, 0, out);", - " sprintf(dirfname,"+Dqq("%s%s")+",dirname,fname"+nm+");", - " output3h("+Dqq("crvsf3d"+nm)+","+Dqq("crvsfh3d"+nm)+",dirfname,out);" + " readdataC("+Dqq(Fhead+crv3d+".dat")+",data);", + " readoutdata3("+Dqq(Fhead+replace(sfbd,"3d","")+".txt")+","+Dqq(sfbd)+",sfbd);", //180531 + " crv3onsfparadata("+funnm+",data,sfbd,out);", + " sprintf(dirfname,"+Dqq("%s%s")+",Dirname,fname"+nm+");", + " output3h("+Dqq("w")+","+Dqq("crv3onsf3d"+nm)+","+Dqq("crv3onsfh3d"+nm)+",dirfname,out);", + " outputend(dirfname);" ]; - if(wflg==1,tmp1=append(options,"m")); - if(wflg==-1,tmp1=append(options,"r")); - if(ErrFlag==0, - tmp="crvsf"+nm; - CalcbyC(tmp,[Cheadsurf(),Ctopsurf(tmp),cmdL],tmp1); + if(cmdflg==1,//180531from + println(" ExeccmdC will generate "+ name3+","+name3h); + cmdL_7=" sprintf(dirfname,"+Dqq("%s%s")+",Dirname,fnameall);"; //180607 + tmp=replace(cmdL_(length(cmdL)-1),Dqq("w"),Dqq("a")); cmdL_(length(cmdL)-1)=tmp; + cmdL_5=" readoutdata3(fnameall,"+Dqq(sfbd)+",sfbd);"; + cmdL=remove(cmdL,[cmdL_1,cmdL_(length(cmdL))]); + CommandListC=concat(CommandListC,cmdL); //180531to + , + if(wflg==1,tmp1=append(options,"m")); + if(wflg==-1,tmp1=append(options,"r")); + if(ErrFlag==0, + tmp="crv3onsf"+nm; + CalcbyC(tmp,[Cheadsurf(),Ctopsurf(tmp),cmdL],tmp1); + ); + if(ErrFlag==1, + err("Crvonsfparadata not completed"); + , + ReadOutData(fname); + GLIST=append(GLIST,"ReadOutData("+Dqq(fname)+")"); + if(islist(parse(name3)), + tmp1=name2+"=Projpara("+Dqq(name3)+",["; + tmp2=""; + if(length(options)>0, + forall(options, + tmp2=tmp2+Dqq(#)+","; + ); + tmp2=substring(tmp2,0,length(tmp2)-1); + ); + tmp1=tmp1+tmp2+"]);"; + parse(tmp1); + tmp2=select(optionsh,length(#)>0); //180517(2lines) + if(length(tmp2)==0,tmp2=["nodisp"]); + tmp1=name2h+"=Projpara("+Dqq(name3h)+",["; + forall(tmp2, + tmp1=tmp1+Dqq(#)+","; + ); + tmp1=substring(tmp1,0,length(tmp1)-1)+"]);"; + parse(tmp1); + , + ErrFlag=1; + ); + ); ); - if(ErrFlag==1, - err("Crvsfparadata not completed"); +); + +Crv2onsfparadataC(nm,crv2d,sfbd,fd):= + Crv2onsfparadataC(nm,crv2d,sfbd,fd,["c"],["do"]); +Crv2onsfparadataC(nm,crv2d,sfbd,fd,options):= + Crv2onsfparadataC(nm,crv2d,sfbd,fd,options,["do"]); +Crv2onsfparadataC(nm,crv2d,sfbd,fdorg,options,optionsh):=( +//help:Crv2onsfparadataC("1","gp1","sfbd3d1",fd); + regional(fd,uname,vname,str,tmpfun,ii,jj,crv3d,tmp,tmp1,tmp2); + Changestyle3d(crv2d,["nodisp"]); + crv3d=crv2d+"3d"; + fd=Fullformfunc(fdorg); + tmp=Strsplit(fd_5,"="); + uname=tmp_1; + tmp=Strsplit(fd_6,"="); + vname=tmp_1; + str="["+fd_2+","+fd_3+","+fd_4+"]"; + tmp="tmpfun("+uname+","+vname+"):="+str+";"; + parse(tmp); + tmp1=parse(crv2d); + tmp2=[]; + forall(tmp1, + tmp2=append(tmp2,tmpfun(#_1,#_2)); + ); + tmp=crv3d+"="+textformat(tmp2,6); + parse(tmp); + Crv3onsfparadataC(nm,crv3d,sfbd,fdorg,options,optionsh); +); + +WireparadataC(nm,sfbd,fd,wr1,wr2):= + WireparadataC(nm,sfbd,fd,wr1,wr2,[],["nodisp"]); +WireparadataC(nm,sfbd,fd,wr1,wr2,options):= + WireparadataC(nm,sfbd,fd,wr1,wr2,options,["nodisp"]); +WireparadataC(nm,sfbd,fdorg,wr1,wr2,optionorg,optionsh):=( +//help:WireparadataC("1","sfbd3d1",fd,5,5); + regional(funnm,fd,options,name2,name3,name2h,name3h,waiting, + eqL,reL,strL,fname,fnameh,tmp,tmp1,tmp2,flg,wflg,flg,ii,jj,eps,udata,vdata,cmdflg); + eps=10^(-5); + fd=ConvertFdtoC(fdorg); + tmp=select(1..(length(FuncListC)),FuncListC_#==fd); + funnm=text(tmp_1); + name2="wire2d"+nm; + name3="wire3d"+nm; + name2h="wireh2d"+nm; + name3h="wireh3d"+nm; + fname=Fhead+"wire"+nm+".txt"; + fnameh=replace(fname,".txt","h.txt"); + options=optionorg; + tmp=Divoptions(options); + eqL=tmp_5; + reL=tmp_6; + strL=tmp_7; + waiting=60; + wflg=0; + options=remove(options,reL); + wflg=0; + cmdflg=1; + forall(strL, + tmp=Toupper(substring(#,0,1)); + if(tmp=="M", + cmdflg=0; + wflg=1; + options=remove(options,[#]); + ); + if(tmp=="R", + cmdflg=0; + wflg=-1; + options=remove(options,[#]); + ); + if(tmp=="C", //180531 + cmdflg=1; + options=remove(options,[#]); + ); + ); + options=remove(options,eqL); + options=remove(options,reL); + options=select(options,length(#)>0); + if(islist(wr1), + udata=prepend(length(wr1),wr1); , - ReadOutData(fname); - GLIST=append(GLIST,"ReadOutData("+Dqq(fname)+")"); - if(islist(parse(name3)), - tmp1=name2+"=Projpara("+Dqq(name3)+",["; - tmp2=""; - if(length(options)>0, - forall(options, - tmp2=tmp2+Dqq(#)+","; + tmp=Fullformfunc(fdorg); + tmp1=tmp_5; + tmp=indexof(tmp1,"="); + tmp=substring(tmp1,tmp,length(tmp1)); + tmp=parse(tmp); + tmp1=tmp_1; tmp2=tmp_2; + udata=apply(1..wr1,tmp1+#*(tmp2-tmp1)/(wr1+1)); + udata=prepend(wr1,udata); + ); + udata=textformat(udata,6); + udata=substring(udata,1,length(udata)-1); + if(islist(wr2), + vdata=prepend(length(wr2),wr2); + , + tmp=Fullformfunc(fdorg); + tmp1=tmp_6; + tmp=indexof(tmp1,"="); + tmp=substring(tmp1,tmp,length(tmp1)); + tmp=parse(tmp); + tmp1=tmp_1; tmp2=tmp_2; + vdata=apply(1..wr2,tmp1+#*(tmp2-tmp1)/(wr2+1)); + vdata=prepend(wr2,vdata); + ); + vdata=textformat(vdata,6); + vdata=substring(vdata,1,length(vdata)-1); + cmdL=[ + " double wireu[]={"+udata+"};", + " double wirev[]={"+vdata+"};", + " char fname[]="+Dqq(fname)+";", + " char fnameh[]="+Dqq(fnameh)+";", + " rangeUV("+funnm+");", + " boundary("+funnm+");", + " readoutdata3("+Dqq(Fhead+replace(sfbd,"3d","")+".txt")+","+Dqq(sfbd)+",sfbd);", //180531 + " wireparadata("+funnm+",sfbd,wireu,wirev,fname,fnameh);" + ]; + if(cmdflg==1,//180531from + println(" ExeccmdC will generate "+ name3+","+name3h); + tmp=replace(cmdL_8,"fnameh",Dqq("")); + tmp=replace(tmp,"fname","fnameall"); cmdL_8=tmp; + cmdL_7=" readoutdata3(fnameall,"+Dqq(sfbd)+",sfbd);"; + cmdL=append(cmdL," outputend(dirfname);"); + CommandListC=concat(CommandListC,cmdL); //180531to + , + if(wflg==1,tmp1=append(options,"m")); + if(wflg==-1,tmp1=append(options,"r")); + if(ErrFlag==0, + tmp="wire"+nm; + CalcbyC(tmp,[Cheadsurf(),Ctopsurf(tmp),cmdL],tmp1); + ); + if(ErrFlag==1, + err("Wireparadata not completed"); + , + ReadOutData(fname); + GLIST=append(GLIST,"ReadOutData("+Dqq(fname)+")"); + ReadOutData(fnameh); + GLIST=append(GLIST,"ReadOutData("+Dqq(fnameh)+")"); + if(islist(parse(name3)), + tmp1=name2+"=Projpara("+Dqq(name3)+",["; + tmp2=""; + if(length(options)>0, + forall(options, + tmp2=tmp2+Dqq(#)+","; + ); + tmp2=substring(tmp2,0,length(tmp2)-1); + ); + tmp1=tmp1+tmp2+"]);"; + parse(tmp1); + tmp2=select(optionsh,length(#)>0); //180517(2lines) + if(length(tmp2)==0,tmp2=["nodisp"]); + tmp1=name2h+"=Projpara("+Dqq(name3h)+",["; + forall(tmp2, + tmp1=tmp1+Dqq(#)+","; ); - tmp2=substring(tmp2,0,length(tmp2)-1); + tmp1=substring(tmp1,0,length(tmp1)-1)+"]);"; + parse(tmp1); + , + ErrFlag=1; ); - tmp1=tmp1+tmp2+"]);"; - parse(tmp1); - if(length(optionsh)==0,tmp2=["nodisp"],tmp2=optionsh); - tmp1=name2h+"=Projpara("+Dqq(name3h)+",["; - forall(tmp2, - tmp1=tmp1+Dqq(#)+","; + ); + ); +); + +IntersectcrvsfC(nm,crv,fd):=IntersectcrvsfC(nm,crv,fd,"",[]); +IntersectcrvsfC(nm,crv,fd,Arg):=( + if(isstring(Arg), + IntersectcrvsfC(nm,crv,fd,Arg,[]); + , + IntersectcrvsfC(nm,crv,fd,"",Arg); + ); +); +IntersectcrvsfC(nm,crv3d,fdorg,bdyeq,optionorg):=( +//help:IntersectcrvsfC("1",curve,fd); + regional(fd,funnm,name,crv,fd,options,reL,fname,crvfname,argR, + waiting,tmp,tmp1,tmp2,flg,wflg,pts,cmdflg); + fd=ConvertFdtoC(fdorg); + tmp=select(1..(length(FuncListC)),FuncListC_#==fd); + funnm=text(tmp_1); //180426 + name="intercrvsf"+nm; + fname=Fhead+name+".txt"; + crvfname=Fhead+"crv"+nm+".txt"; + fd=apply(fdorg,if(isstring(#),Dqq(#),#)); + options=optionorg; + tmp=Divoptions(options); + eqL=tmp_5; + reL=tmp_6; + strL=tmp_7; + waiting=60; + wflg=0; + cmdflg=1; + forall(strL, + tmp=Toupper(substring(#,0,1)); + if(tmp=="M", + cmdflg=0; + wflg=1; + options=remove(options,[#]); + ); + if(tmp=="R", + cmdflg=0; + wflg=-1; + options=remove(options,[#]); + ); + if(tmp=="C", //180531 + cmdflg=1; + options=remove(options,[#]); + ); + ); + options=remove(options,eqL); + options=remove(options,reL); + options=select(options,length(#)>0); + tmp2=parse(crv3d); + flg=0; + tmp=Fhead+crv3d+".dat"; + if(!isexists(Dirwork,tmp),flg=1); + if(flg==0, + tmp1=ReaddataC(tmp); + if(length(tmp1)!=length(tmp2),flg=1); + if(flg==0, + forall(1..(length(tmp1)),ii, + if(length(tmp1_ii)!=length(tmp2_ii),flg=1); + forall(1..(length(tmp1_ii)),jj, + if(flg==0, + if(Norm(tmp1_ii_jj-tmp2_ii_jj)>eps,flg=1); + ); + ); ); - tmp1=substring(tmp1,0,length(tmp1)-1)+"]);"; - parse(tmp1); + ); + ); + if(flg==1,WritedataC(tmp,crv3d)); + cmdL=[ + " double crv3d[DsizeL][3];", + " char fname"+nm+"[]="+Dqq(fname)+";", + " rangeUV("+funnm+");", + " boundary("+funnm+");", + " readdataC("+Dqq(Fhead+crv3d+".dat")+",crv3d);", + " intersectcrvsf("+Dqq("w")+","+funnm+",crv3d,"+Dqq(fname)+");", + " sprintf(dirfname,"+Dqq("%s%s")+",Dirname,fname"+nm+");" + ]; + if(cmdflg==1,//180531from + cmdL_6=" intersectcrvsf("+Dqq("a")+","+funnm+",crv3d,fnameall);"; + cmdL=remove(cmdL,[cmdL_2]); + cmdL=remove(cmdL,[cmdL_(length(cmdL))]); + CommandListC=concat(CommandListC,cmdL); //180531to + , + if(wflg==1,tmp1=append(options,"m")); + if(wflg==-1,tmp1=append(options,"r")); + if(ErrFlag==0, + tmp="crv3onsf"+nm; + CalcbyC(tmp,[Cheadsurf(),Ctopsurf(tmp),cmdL],tmp1); + ); + if(ErrFlag==1, + err("Intersectcrvsf not completed"); , - ErrFlag=1; + ReadOutData(fname); + ); + println("generate "+name); + parse(name); + ); +); + +SfcutparadataC(nm,cutfunL,sfbd,fd):=(//180505 + SfcutparadataC(nm,cutfunL,sfbd,fd,[],["nodisp"]); +); +SfcutparadataC(nm,cutfunL,sfbd,fd,options):= + SfcutparadataC(nm,cutfunL,sfbd,fd,options,["nodisp"]); +SfcutparadataC(nm,cutfunLorg,sfbd,fdorg,optionorg,optionsh):=( +//help:SfcutparadataC("1","2*x+3*y+z=1","sfbd3d",fd); + regional(funnm,cutfunL,fd,options,name2,name3,name2h,name3h,waiting, + eqL,reL,strL,fname,fnameh,tmp,tmp1,tmp2,flg,wflg,flg,ii,jj,eps,cmdflg); + eps=10^(-5); + fd=ConvertFdtoC(fdorg); + tmp=select(1..(length(FuncListC)),FuncListC_#==fd); + funnm=text(tmp_1); + cutfunL=cutfunLorg; + if(!islist(cutfunL),cutfunL=[cutfunL]); + forall(1..(length(cutfunL)), + tmp1=Strsplit(cutfunL_#,"="); + if(length(tmp1)>1, + tmp2=tmp1_1+"-("+tmp1_2+")"; //180516 + cutfunL_#=Cform(tmp2); + ); + ); + CutFunList=cutfunL; //180601 + name2="sfcut2d"+nm; + name3="sfcut3d"+nm; + name2h="sfcuth2d"+nm; + name3h="sfcuth3d"+nm; + fname=Fhead+"sfcut"+nm+".txt"; + fnameh=replace(fname,".txt","h.txt"); + options=optionorg; + tmp=Divoptions(options); + eqL=tmp_5; + reL=tmp_6; + strL=tmp_7; + waiting=60; + wflg=0; + options=remove(options,reL); + wflg=0; + cmdflg=1; + forall(strL, + tmp=Toupper(substring(#,0,1)); + if(tmp=="M", + cmdflg=0; + wflg=1; + options=remove(options,[#]); + ); + if(tmp=="R", + cmdflg=0; + wflg=-1; + options=remove(options,[#]); + ); + if(tmp=="C", //180531 + cmdflg=1; + options=remove(options,[#]); + ); + ); + options=remove(options,eqL); + options=remove(options,reL); + options=select(options,length(#)>0); + tmp1=text(length(cutfunL)); + cmdL=[ + " char fname[]="+Dqq(fname)+";", + " char fnameh[]="+Dqq(fnameh)+";", + " rangeUV("+funnm+");", + " boundary("+funnm+");", + " readoutdata3("+Dqq(Fhead+replace(sfbd,"3d","")+".txt")+","+Dqq(sfbd)+",sfbd);", //180531 + " sfcutparadata("+funnm+","+tmp1+",sfbd,fname,fnameh);" + ]; + if(cmdflg==1,//180531from + println(" ExeccmdC will generate "+ name3+","+name3h); + tmp=replace(cmdL_6,"fnameh",Dqq("")); + tmp=replace(tmp,"fname","fnameall"); cmdL_6=tmp; + cmdL_5=" readoutdata3(fnameall,"+Dqq(sfbd)+",sfbd);"; + cmdL=append(cmdL," outputend(dirfname);"); + CommandListC=concat(CommandListC,cmdL); //180531to + , + if(wflg==1,tmp1=append(options,"m")); + if(wflg==-1,tmp1=append(options,"r")); + if(ErrFlag==0, + tmp="sfcut"+nm; + CalcbyC(tmp,[Cheadsurf(),Ctopsurf(tmp),cmdL],tmp1); //180601 + ); + if(ErrFlag==1, + err("Sfcutparadata not completed"); + , + ReadOutData(fname); + GLIST=append(GLIST,"ReadOutData("+Dqq(fname)+")"); + ReadOutData(fnameh); + GLIST=append(GLIST,"ReadOutData("+Dqq(fnameh)+")"); + if(islist(parse(name3)), + tmp1=name2+"=Projpara("+Dqq(name3)+",["; + tmp2=""; + if(length(options)>0, + forall(options, + tmp2=tmp2+Dqq(#)+","; + ); + tmp2=substring(tmp2,0,length(tmp2)-1); + ); + tmp1=tmp1+tmp2+"]);"; + parse(tmp1); + tmp2=select(optionsh,length(#)>0); //180517(2lines) + if(length(tmp2)==0,tmp2=["nodisp"]); + tmp1=name2h+"=Projpara("+Dqq(name3h)+",["; + forall(tmp2, + tmp1=tmp1+Dqq(#)+","; + ); + tmp1=substring(tmp1,0,length(tmp1)-1)+"]);"; + parse(tmp1); + , + ErrFlag=1; + ); ); ); ); diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketpiccurrent.r b/Master/texmf-dist/scripts/ketcindy/ketlib/ketpiccurrent.r index dc54682b443..84bfd5d0553 100644..100755 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketpiccurrent.r +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketpiccurrent.r @@ -16,12 +16,34 @@ ######################################### -ThisVersion<- "KeTpic for R v5_2_4(20180327)" +ThisVersion<- "KeTpic for R v5_2_4(20180603)" print(ThisVersion) +# 20180603 +# Setcolor debugged (length(Iro)) +# Scaledata,Reflectdata,Rotatedata,Translatedata changed ( for point list) +# 20180602 +# Setcolor changed (rgb supported) +# 20180523 +# Mkskeletondata debugged +# 20180517 +# Sfbdparadata debugged ( tmp2[]=>tmp[2]) +# 20180511 +# Arrowhead,Arrowheaddata debugged ( for closed curve) +# 20180510 +# Plotdata,Paramplot changed ( Assign added for KeTCindy ) +# Texsetctr debugged (grep, fixed=T) +# Anglemark debugged ( for PB,PA,angle) +# 20180509 +# Crvonsfparadata renamed to Crv2onsfparadata +# Makecurves debugged ( Looprange used ) +# 20180506 +# Anglemark changed ( PB,PA,angle) supported +# 20180501 +# Wireparadata changed and debugged ( is.numeric => length==1 ) # 20180402 -# Implicitplot greatly changed +# Implicitplot largely changed # 20180327 # Kyoukai debugged # 20180317 @@ -768,41 +790,62 @@ Integrate<- function(...) #-------------------------------------- ######################### +# 180506 (pB,pA,angle) supported Anglemark<- function(...) { varargin<- list(...) Nargs<- length(varargin) Eps<- 10^(-3) - PA<- varargin[[1]] - PB<- varargin[[2]] + PB<- varargin[[1]] + PA<- varargin[[2]] PC=varargin[[3]] r <- 0.5 if(Nargs>=4){ r<- varargin[[4]]*r } Out=c() - if(r>min(Norm(PA-PB),Norm(PC-PB))){ + if(length(PC)>1){ #180506from + Tmp=min(Norm(PB-PA),Norm(PC-PA)) + }else{ + Tmp=Norm(PB-PA) + } + if(r>Tmp){ #180506to return(Out) } - Cir<- Circledata(c(PB,r)) #17.11.29 + Cir<- Circledata(c(PA,r)) #17.11.29 Tmp<- IntersectcrvsPp(Cir,Listplot(PA,PB)) P1<- Op(2,Op(1,Tmp)) - Tmp<- IntersectcrvsPp(Cir,Listplot(PC,PB)) - P2<- Op(2,Op(1,Tmp)) - if(abs(P1-P2)<Eps){ - Out<-c() - return(Out) - } - if(P1<P2-Eps){ - Out<- Partcrv(P1,P2,Cir) - } - else{ - Tmp<- Numptcrv(Cir) - Tmp1<- Partcrv(P1,Tmp,Cir) - Tmp2<- Partcrv(1,P2,Cir) - Out<- Joincrvs(Tmp1,Tmp2) + if(length(PC)>1){ + Tmp<- IntersectcrvsPp(Cir,Listplot(PA,PC)) + P2<- Op(2,Op(1,Tmp)) + if(abs(P1-P2)<Eps){ + Out<-c() + return(Out) + } + if(P1<P2-Eps){ + Out<- Partcrv(P1,P2,Cir) + } + else{ + Tmp<- Numptcrv(Cir) + Tmp1<- Partcrv(P1,Tmp,Cir) + Tmp2<- Partcrv(1,P2,Cir) + Out<- Joincrvs(Tmp1,Tmp2) + } + }else{ + Tmp1=Pointoncurve(1,Cir)-PA + Tmp2=Pointoncurve(2,Cir)-PA + Tmp=Dotprod(Tmp1,Tmp2)/(Norm(Tmp1)*Norm(Tmp2)) + Tmp=PC/acos(Tmp) + if(P1+Tmp<Length(Cir)){ + Out<- Partcrv(P1,P1+Tmp,Cir) + }else{ + Tmp1= Partcrv(P1,Length(Cir),Cir) + Tmp2= Partcrv(1,P1+Tmp-Length(Cir)+1,Cir) + Out<- Joincrvs(Tmp1,Tmp2) + } } + Out } ############################################## @@ -876,6 +919,7 @@ Arrowdata<- function(...) Arrowhead<-function(...) { ## Scaling is implemented ## 12.01.08 Kirikomi + Eps=10^(-3) varargin<-list(...) Nargs<-length(varargin) P<-varargin[[1]] @@ -916,15 +960,20 @@ Arrowhead<-function(...) if(Nrow(Houkou)>1){ P<- Doscaling(P) Houkou<- Doscaling(Houkou) - Tmp<-Nearestpt(P,Houkou) + Tmp<-Nearestpt(P,Houkou) A<-Tmp[[1]] I<-floor(Tmp[[2]]) + if(I==1){# 180511 + if(Norm(Ptend(Houkou)-Ptstart(Houkou))<Eps){ + I=Numptcrv(Houkou) + } + } G<-Circledata(c(P,Ookisa*cos(Theta)),N=10) #17.11.29 Flg<- 0 # 13.11.13 JL<-seq(I,1,by=-1) for (J in JL){ B<-Ptcrv(J,Houkou) - Tmp<-IntersectcrvsPp(Listplot(list(A,B)),G) + Tmp<-IntersectcurvesPp(Listplot(list(A,B)),G) #180510 if(length(Tmp)>0){ Flg<- 1 break @@ -951,7 +1000,7 @@ Arrowhead<-function(...) } A<-P+Ookisa*cos(Theta)*Ev+Ookisa*sin(Theta)*Nv B<-P+Ookisa*cos(Theta)*Ev-Ookisa*sin(Theta)*Nv - if(length(grep("l",Str))>0){ + if(length(grep("l",Str,fixed=TRUE))>0){ Tmp<-Listplot(list(A,P,B)) Tmp1<- Unscaling(Tmp) Drwline(Tmp1,Futosa) @@ -973,6 +1022,7 @@ Arrowhead<-function(...) Arrowheaddata<- function(...) { ## Scaling is implemented + Eps=10^(-3) varargin<- list(...) Nargs<- length(varargin) P<- varargin[[1]] @@ -1012,6 +1062,11 @@ Arrowheaddata<- function(...) Tmp<-Nearestpt(P,Houkou) A<-Tmp[[1]] I<-floor(Tmp[[2]]) + if(I==1){# 180511 + if(Norm(Ptend(Houkou)-Ptstart(Houkou))<Eps){ + I=Numptcrv(Houkou) + } + } G<-Circledata(c(P,Ookisa*cos(Theta)),N=10) #17.11.29 Flg<- 0 # 13.11.13 JL<-seq(I,1,by=-1) @@ -4267,9 +4322,9 @@ MakeCurves<-function(...){ ## Scaling is implemented Eps<-10.0^(-6) IndM<-Dataindex(Figdata) Atos<-c() - for (Nd in 1:Nrow(IndM)){ + for (Nd in Looprange(1,Nrow(IndM))){ #180509 Tmp<-IndM[Nd,] - Motos<-Figdata[Tmp[1]:Tmp[2],] + Motos<- Figdata[Tmp[1]:Tmp[2],] All<-Nrow(Motos) if(Nrow(Motos)==1){ if(InWindow(Motos)=="o"){ @@ -5046,7 +5101,9 @@ Paramplot<- function(...) Nargs<- length(varargin) Fnflg<- 0 Fnstr<- varargin[[1]]; Is=2 + Fnstr=Assign(Fnstr) #180510(for KeTCindy) Rgstr<- varargin[[Is]]; Is<- Is+1 + Rgstr=Assign(Rgstr) #180510(for KeTCindy) Range<- c(0,2*pi) N<- 50 # Numpoints E<-c() # Exclusions @@ -5260,8 +5317,10 @@ Plotdata<- function(...) varargin<- list(...) Eps<- 10^(-5) Fnstr<- varargin[[1]]; Is<- 2 + Fnstr=Assign(Fnstr) #180510(for KeTCindy) Fnflg<- 0 Rgstr<- varargin[[Is]]; Is<- Is+1 + Rgstr=Assign(Rgstr) #180510(for KeTCindy) Tmp<- strsplit(Rgstr,"=") K<-Tmp[[1]] if(length(K)>1){ @@ -6129,17 +6188,14 @@ Reflectdata<- function(...) PtA<- Pts[1:2]; PtB<- Pts[3:4] } } + ML=Flattenlist(ML) #180603 OutL<- list() - for (N in Looprange(1,length(ML))){ + for (N in Looprange(1,Length(ML))){ GL<- Op(N,ML) + if(!is.matrix(GL)){GL=matrix(GL,ncol=2)} #180603 Out<- c() - for (I in Looprange(1,Nrow(GL))){ - if(is.matrix(GL)){ # 10.12.07 - Tmp<- GL[I,] - } - else{ - Tmp<- GL - } + for (I in Looprange(1,Length(GL))){ + Tmp<- GL[I,] X1<- Tmp[1] Y1<- Tmp[2] if(X1==Inf){ @@ -6389,18 +6445,15 @@ Rotatedata<- function(..., deg=FALSE) else{ Pt<- varargin[[3]] } + ML=Flattenlist(ML) #180603 Cx<- Pt[1]; Cy<- Pt[2] OutL<- c() - for (N in Looprange(1,length(ML))){ + for (N in Looprange(1,Length(ML))){ GL<- Op(N,ML) + if(!is.matrix(GL)){GL=matrix(GL,ncol=2)} #180603 Out<- c() - for (I in Looprange(1,Nrow(GL))){ - if(is.matrix(GL)){ - Tmp<- GL[I,] - } - else{ - Tmp<- GL - } + for (I in Looprange(1,Length(GL))){ + Tmp<- GL[I,] X1<- Tmp[1] Y1<- Tmp[2] if(X1==Inf){ @@ -6443,17 +6496,14 @@ Scaledata<- function(...) else{ Pt<- varargin[[4]] } + ML=Flattenlist(ML) #180603 OutL<- list() - for (N in Looprange(1,length(ML))){ + for (N in Looprange(1,Length(ML))){ GL<- Op(N,ML) + if(!is.matrix(GL)){GL=matrix(GL,ncol=2)} #180603 Out<- c() - for (I in Looprange(1,Nrow(GL))){ - if(is.matrix(GL)){ # 10.12.07 - Tmp<- GL[I,] - } - else{ - Tmp<- GL - } + for (I in Looprange(1,Length(GL))){ + Tmp<- GL[I,] X1<- Tmp[1] Y1<- Tmp[2] if(X1==Inf){ @@ -6624,10 +6674,14 @@ Setcolor<- function(...){ } Iro<- Ratiocmyk(Color) if(length(Iro)==0) return(c()) - Str<- "\\color[cmyk]{" #17.09.22 - for(J in 1:4){ + if(length(Iro)==4){ #180602from + Str<- "\\color[cmyk]{" + }else{ + Str<- "\\color[rgb]{" + } #180602to + for(J in 1:length(Iro)){ Str<- paste(Str,as.character(Kosa*Iro[J]),sep="") - if(J<4){ + if(J<length(Iro)){ #180603 Str<- paste(Str,",",sep="") } } @@ -7462,7 +7516,7 @@ Texsetctr<- function(Nctr,Opstr) Va<- paste(Va,Tmp,sep="") next } - if(length(grep(Tmp,OperL))==0){ + if(length(grep(Tmp,OperL,fixed=TRUE))==0){ #180510 Va<- paste(Va,Tmp,sep="") } else{ @@ -7609,17 +7663,14 @@ Translatedata<- function(...) B<- 0 } } + ML=Flattenlist(ML) #180603 OutL<- list() - for (N in Looprange(1,length(ML))){ + for (N in Looprange(1,Length(ML))){ GL<- Op(N,ML) + if(!is.matrix(GL)){GL=matrix(GL,ncol=2)} #180603 Out<- c() - for (I in Looprange(1,Nrow(GL))){ - if(is.matrix(GL)){ # 10.12.07 - Tmp<- GL[I,] - } - else{ - Tmp<- GL - } + for (I in Looprange(1,Length(GL))){ + Tmp<- GL[I,] #180603 X1<- Tmp[1] Y1<- Tmp[2] if(X1==Inf){ @@ -8441,7 +8492,7 @@ Kukannozoku<- function(Jokyo,KukanL){ ######################################## Makeskeletondata<- function(Obj2L,Plt2L,R0,Eps2){ - Eps<- 10.0^(-3) + Eps<- 10.0^(-3) Dmat<- c() Dind<- c() for (I in Looprange(1,Mixlength(Plt2L))){ @@ -8467,7 +8518,7 @@ Makeskeletondata<- function(Obj2L,Plt2L,R0,Eps2){ for (I in Looprange(1,Nrow(Dind))){ Tmp<- Dmat[Dind[I,1]:Dind[I,2],] P2<- Tmp[,1:2] - KC<- IntersectcrvsPp(P1,P2,Eps) + KC<- IntersectcrvsPp(P1,P2) if(Mixlength(KC)>0){ for (J in 1:Mixlength(KC)){ P<- Op(1,Op(J,KC)) @@ -8858,8 +8909,8 @@ MakeveLfaceL<- function(VfL){ } ########################### -#// 09.10.29 -#// 09.11.15 +# 09.10.29 +# 09.11.15 Menkakusi2<- function(Face,Nf,Ptype){ # global THETA PHI EyePoint FocusPoint VELNO VELHI @@ -8955,7 +9006,7 @@ Menkakusi2<- function(Face,Nf,Ptype){ Tmp1<- Invparapt(P,Spaceline(Face)) } P3<- Tmp[[1]]; Q3<- Tmp1[[1]] - if(Ts>1-Eps){# // P3, Q3 are necessary + if(Ts>1-Eps){# P3, Q3 are necessary Flg<- I break } @@ -9067,8 +9118,8 @@ Parapt<- function(Plist){ # 18.02.19 changed (for point list) Partcrv3<- function(T1,T2,Fk){ Eps0=10^(-4) -#// Tmp=Mixop(1,Fk) -#// new part from +# Tmp=Mixop(1,Fk) +# new part from if(T1>(T2+Eps0)){ Npt<- Nrow(Fk) Out1<- Partcrv3(T1,Npt,Fk) @@ -10464,7 +10515,7 @@ Xyzaxpersname<- function(...){ ######################### #100815 -Zparapt<- function(P){#function Out=Zparapt(P) +Zparapt<- function(P){ x<- P[1]; y<- P[2]; z<- P[3] Out<- x*cos(PHI)*sin(THETA)+y*sin(PHI)*sin(THETA)+z*cos(THETA) return(Out) @@ -12622,7 +12673,7 @@ IntersectcurvesPp<- function(...){ for(ii in Looprange(1,length(tmp2))){ tmp=Collectsameseg(tmp1) out=c(out,list(Op(1,tmp))) - if(length(Op(2,tmp))==0){ + if(length(Op(2,tmp))==0){ break }else{ tmp1=Op(2,tmp) @@ -13208,10 +13259,7 @@ Envelopedata<- function(...){ Eval11=Evlpfun(Uval1,Vval1) Eval12=Evlpfun(Uval1,Vval2) for(I in 1:(Mdv)){ -# Uval1=URNG[1]+(I-1)*Du Uval2=URNG[1]+I*Du -# Eval11=Evlpfun(Uval1,Vval1) -# Eval12=Evlpfun(Uval1,Vval2) Eval21=Evlpfun(Uval2,Vval1) Eval22=Evlpfun(Uval2,Vval2) a1=Uval1;b1=Vval1;c1=Eval11 @@ -13276,8 +13324,6 @@ Dropnumlistcrv<- function(QdL,Eps1){ if(Norm(P-Op(K,Pd))>Eps1){ #18.02.12 eps PtL=c(PtL,K) } -# if(length(PtL)==1){ #180306 -# } OutL=c(OutL,list(PtL)) } return(OutL) @@ -13460,12 +13506,8 @@ PthiddenQ<- function(PtA,Vec,Uveq,Np,Eps1,Eps2){ Uval1=URNG[1] #180306(3lines) Eval11=Eqfun(Uval1,Vval1) Eval12=Eqfun(Uval1,Vval2) - Uval1=URNG[1] #180305(3lines) for(I in Looprange(1,Np[1])){ #180227 -# Uval1=URNG[1]+(I-1)*Dx Uval2=URNG[1]+I*Dx -# Eval11=Eqfun(Uval1,Vval1) -# Eval12=Eqfun(Uval1,Vval2) Eval21=Eqfun(Uval2,Vval1) Eval22=Eqfun(Uval2,Vval2) a1=Uval1;b1=Vval1;c1=Eval11 @@ -13483,7 +13525,6 @@ PthiddenQ<- function(PtA,Vec,Uveq,Np,Eps1,Eps2){ next } if(abs(M2)<Eps0){ -# QL=Appendrow(QL,P2) next } if((M1> 0) && (M2> 0)){ @@ -13547,8 +13588,8 @@ PthiddenQ<- function(PtA,Vec,Uveq,Np,Eps1,Eps2){ } } Tmp1=Crossprod(Pt-PtA,Vec) - if(Norm(Tmp1)<Eps1){ #18.02.19 - if(Zparapt(Pt)>Zparapt(PtA)+Eps2){ + if(Norm(Tmp1)<Eps1){ #18.02.19 + if(Zparapt(Pt)>Zparapt(PtA)+Eps2){ return(list(1,Pt,Zparapt(Pt),Zparapt(PtA))) }else{ Out=Appendrow(Out,Pt) @@ -13599,14 +13640,14 @@ Nohiddenpara2<- function (Par,Fk,Uveq,Np,Eps1,Eps2){ PaL[length(PaL)]=tmp2 }else{ PaL=c(PaL,tmp2) - } #18.02.26until + } #18.02.26to SeL=c() for(N in Looprange(1,length(PaL)-1)){ S=(PaL[N]+PaL[N+1])/2 Tmp=Invparapt(S,Fh,Fk) - PtA=Op(1,Tmp) + PtA=Op(1,Tmp) PtAp=Parapt(PtA) - Vec=c(sin(THETA)*cos(PHI),sin(THETA)*sin(PHI),cos(THETA)) + Vec=c(sin(THETA)*cos(PHI),sin(THETA)*sin(PHI),cos(THETA)) Flg=PthiddenQ(PtA,Vec,Uveq,Np,Eps1,Eps2) if(Flg[[1]]==0){ SeL=c(SeL,N) @@ -13838,9 +13879,6 @@ Sfbdparadata<- function(...){ } } starttime=proc.time() -# tmp=Evlptablepara(Np) -# Zval=tmp[[1]]; Xval=tmp[[2]]; Yval=tmp[[3]] -# Out3=Implicitplot(Zval,Xval,Yval) Out3=Envelopedata(Fd) #180306 tmp3=list() pts=list() #180306 @@ -13857,7 +13895,6 @@ Sfbdparadata<- function(...){ tmp=Op(1,Nlist) tmp=Op(tmp,tmp1) pts=c(pts,list(tmp)) -# pts=c(pts,list(XYZfunc(tmp[1],tmp[2])))#180306until }else{ tmp=c() for(kk in Looprange(1,length(Nlist))){ @@ -13873,11 +13910,11 @@ Sfbdparadata<- function(...){ pts=list() for(ii in Looprange(1,length(tmp3))){ tmp=Op(ii,tmp3) - tmp1=XYZfunc(tmp[1],tmp2[]) + tmp1=XYZfunc(tmp[1],tmp[2]) flg=0 for(jj in Looprange(1,length(pts))){ tmp=Op(jj,pts) - tmp2=XYZfunc(tmp[1],tmp2[]) + tmp2=XYZfunc(tmp[1],tmp[2]) #180517 if(Norm(tmp1-tmp2)<Eps1){ flg=1; break } @@ -13908,7 +13945,7 @@ Sfbdparadata<- function(...){ next } } - } #180306until + } #180306to IMPLICITDATA<<- Out3 Tmp=proc.time()-starttime print(paste('ImplicitData obtained : Time =',sprintf("%6.3f",Tmp[1]),sep='')) @@ -13950,10 +13987,7 @@ Meetpoints<- function(PtA,PtB,Uveq,Np,Eps1){ Eval11=Eqfun(Uval1,Vval1) Eval12=Eqfun(Uval1,Vval2) for(I in Looprange(1,Np[1])){ -# Uval1=URNG[1]+(I-1)*Dx Uval2=URNG[1]+I*Dx -# Eval11=Eqfun(Uval1,Vval1) -# Eval12=Eqfun(Uval1,Vval2) Eval21=Eqfun(Uval2,Vval1) Eval22=Eqfun(Uval2,Vval2) a1=Uval1;b1=Vval1;c1=Eval11 @@ -13971,7 +14005,6 @@ Meetpoints<- function(PtA,PtB,Uveq,Np,Eps1){ next } if(abs(M2)<Eps0){ -# QL=Appendrow(QL,P2) next } if((M1> 0) && (M2> 0)){ @@ -14037,7 +14070,7 @@ Meetpoints<- function(PtA,PtB,Uveq,Np,Eps1){ Tmp1=Crossprod(Pt-PtA,Vec) if(Norm(Tmp1)<Eps1){ #18.02.19 Tmp1=Dotprod(Pt-PtA,Vec) #18.02.21 - if((Tmp1>-Eps0)&&(Tmp1<Norm(PtB-PtA)+Eps0)){ + if((Tmp1>-Eps0)&&(Norm(Pt-PtA)<Norm(PtB-PtA)+Eps0)){#180429 Out=c(Out,list(Pt)) } } @@ -14253,7 +14286,7 @@ Crv3onsfparadata<- function(...){ return(Out) } -Crvonsfparadata<- function(...){ +Crv2onsfparadata<- function(...){ starttime=proc.time() varargin=list(...) Nargs=length(varargin) @@ -14306,7 +14339,7 @@ Wireparadata<- function(...){ DvL=varargin[[4]] Np=c(50,50) Eps1=0.01 - Eps2=0.05 + Eps2=0.1 ctr=0 for(jj in Looprange(5,Nargs)){ tmp=varargin[[jj]] @@ -14321,7 +14354,7 @@ Wireparadata<- function(...){ if(ctr==2){Eps2=tmp} } } - if(is.numeric(DuL)){ + if(length(DuL)==1){ #180430 tmp1=DuL DuL=list() for(jj in Looprange(1,tmp1)){ @@ -14329,7 +14362,7 @@ Wireparadata<- function(...){ DuL=c(DuL,list(tmp)) } } - if(is.numeric(DvL)){ + if(length(DvL)==1){ #180430 tmp1=DvL DvL=list() for(jj in Looprange(1,tmp1)){ @@ -14519,10 +14552,7 @@ Sfcutparadata<- function(...){ Eval11=Eqfun(Uval1,Vval1) Eval12=Eqfun(Uval1,Vval2) for(I in Looprange(1,Np[1])){ -# Uval1=URNG[1]+(I-1)*Du Uval2=URNG[1]+I*Du -# Eval11=Eqfun(Uval1,Vval1) -# Eval12=Eqfun(Uval1,Vval2) Eval21=Eqfun(Uval2,Vval1) Eval22=Eqfun(Uval2,Vval2) a1=Uval1;b1=Vval1;c1=Eval11 @@ -14540,7 +14570,6 @@ Sfcutparadata<- function(...){ next } if(abs(M2)<Eps0){ -# QL=Appendrow(QL,P2) next } if((M1> 0) && (M2> 0)){ diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketpiccurrent_rep2e.r b/Master/texmf-dist/scripts/ketcindy/ketlib/ketpiccurrent_rep2e.r index 370339480ae..370339480ae 100644..100755 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketpiccurrent_rep2e.r +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketpiccurrent_rep2e.r |