From 5c25b51ce087f0f8464448ac3ad03f16c16b35be Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Thu, 14 Jun 2018 06:17:13 +0000 Subject: ketcindy 20180614.2 git-svn-id: svn://tug.org/texlive/trunk@48014 c570f23f-e606-0410-a88d-b1316a301751 --- .../Counter-etching convex polyhedron.pdf | Bin 0 -> 77577 bytes Master/texmf-dist/scripts/ketcindy/dirhead.txt | 7 - Master/texmf-dist/scripts/ketcindy/ketcindy.ini | 8 + Master/texmf-dist/scripts/ketcindy/ketcindy.sh | 13 +- .../scripts/ketcindy/ketjava/KetCindyPlugin.jar | Bin 156502 -> 157275 bytes .../scripts/ketcindy/ketlib/ketcindylib3dhelpE.txt | 0 .../scripts/ketcindy/ketlib/ketcindylib3dhelpJ.txt | 1 - .../scripts/ketcindy/ketlib/ketcindylib3dlogr.txt | 41 + .../scripts/ketcindy/ketlib/ketcindylib3dr.cs | 584 ++++--- .../ketcindy/ketlib/ketcindylibbasic1logr.txt | 45 + .../scripts/ketcindy/ketlib/ketcindylibbasic1r.cs | 531 ++++--- .../ketcindy/ketlib/ketcindylibbasic2logr.txt | 31 + .../scripts/ketcindy/ketlib/ketcindylibbasic2r.cs | 446 ++++-- .../scripts/ketcindy/ketlib/ketcindylibhelpE.txt | 0 .../scripts/ketcindy/ketlib/ketcindylibhelpJ.txt | 0 .../scripts/ketcindy/ketlib/ketcindylibmvhelpE.txt | 0 .../scripts/ketcindy/ketlib/ketcindylibmvhelpJ.txt | 0 .../scripts/ketcindy/ketlib/ketcindylibmvlogr.txt | 19 + .../scripts/ketcindy/ketlib/ketcindylibmvr.cs | 362 +++-- .../scripts/ketcindy/ketlib/ketcindyliboutlogr.txt | 75 + .../scripts/ketcindy/ketlib/ketcindyliboutr.cs | 1240 +++++++++++---- .../scripts/ketcindy/ketlib/ketpiccurrent.r | 239 +-- .../scripts/ketcindy/ketlib/ketpiccurrent_rep2e.r | 0 .../scripts/ketcindy/ketlibC/ketcommon.h | 431 ++++- .../scripts/ketcindy/ketlibC/ketcommonhead.h | 23 +- .../scripts/ketcindy/ketlibC/ketlibClog.txt | 18 + .../texmf-dist/scripts/ketcindy/ketlibC/surflib.h | 1641 ++++++++++---------- .../scripts/ketcindy/ketlibC/surflibhead.h | 46 +- Master/texmf-dist/scripts/ketcindy/ketoutset.txt | 52 +- .../texmf-dist/scripts/ketcindy/template1basic.cdy | Bin 4302 -> 5901 bytes .../scripts/ketcindy/template2advanced.cdy | Bin 5778 -> 7354 bytes 31 files changed, 3817 insertions(+), 2036 deletions(-) create mode 100644 Master/texmf-dist/scripts/ketcindy/data/polyhedrons_obj/Counter-etching convex polyhedron.pdf delete mode 100644 Master/texmf-dist/scripts/ketcindy/dirhead.txt create mode 100644 Master/texmf-dist/scripts/ketcindy/ketcindy.ini mode change 100644 => 100755 Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dhelpE.txt mode change 100644 => 100755 Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dhelpJ.txt mode change 100644 => 100755 Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibhelpE.txt mode change 100644 => 100755 Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibhelpJ.txt mode change 100644 => 100755 Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvhelpE.txt mode change 100644 => 100755 Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvhelpJ.txt mode change 100644 => 100755 Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvr.cs mode change 100644 => 100755 Master/texmf-dist/scripts/ketcindy/ketlib/ketpiccurrent.r mode change 100644 => 100755 Master/texmf-dist/scripts/ketcindy/ketlib/ketpiccurrent_rep2e.r create mode 100644 Master/texmf-dist/scripts/ketcindy/ketlibC/ketlibClog.txt mode change 100755 => 100644 Master/texmf-dist/scripts/ketcindy/template2advanced.cdy (limited to 'Master/texmf-dist/scripts/ketcindy') diff --git a/Master/texmf-dist/scripts/ketcindy/data/polyhedrons_obj/Counter-etching convex polyhedron.pdf b/Master/texmf-dist/scripts/ketcindy/data/polyhedrons_obj/Counter-etching convex polyhedron.pdf new file mode 100644 index 00000000000..e2b52ddd5ee Binary files /dev/null and b/Master/texmf-dist/scripts/ketcindy/data/polyhedrons_obj/Counter-etching convex polyhedron.pdf differ diff --git a/Master/texmf-dist/scripts/ketcindy/dirhead.txt b/Master/texmf-dist/scripts/ketcindy/dirhead.txt deleted file mode 100644 index e87a8005629..00000000000 --- a/Master/texmf-dist/scripts/ketcindy/dirhead.txt +++ /dev/null @@ -1,7 +0,0 @@ -Dirhead=Dircdy; -Dirwork=gethome()+pathsep()+"ketcindy"; -Dircdy=Dirwork; -setdirectory(Dirhead); -import("setketcindy.txt"); -import("ketoutset.txt"); -setdirectory(Dirwork); diff --git a/Master/texmf-dist/scripts/ketcindy/ketcindy.ini b/Master/texmf-dist/scripts/ketcindy/ketcindy.ini new file mode 100644 index 00000000000..10b9a05fc01 --- /dev/null +++ b/Master/texmf-dist/scripts/ketcindy/ketcindy.ini @@ -0,0 +1,8 @@ +Dirhead=Dircdy; +Dirwork=gethome()+pathsep()+"ketcindy"; +Dircdy=Dirwork; +Dirhead=gettexmfdist()+pathsep()+"scripts"+pathsep()+"ketcindy"; +setdirectory(Dirhead); +import("setketcindy.txt"); +import("ketoutset.txt"); +setdirectory(Dirwork); diff --git a/Master/texmf-dist/scripts/ketcindy/ketcindy.sh b/Master/texmf-dist/scripts/ketcindy/ketcindy.sh index 23465f4b927..7fecac2ff68 100755 --- a/Master/texmf-dist/scripts/ketcindy/ketcindy.sh +++ b/Master/texmf-dist/scripts/ketcindy/ketcindy.sh @@ -2,13 +2,14 @@ # # KETCindy starter script # -# (C) 2017 Norbert Preining +# (C) 2017-2018 Norbert Preining # Licensed under the same license terms as ketpic itself, that is GPLv3+ # BinaryName=Cinderella2 TemplateFile=template1basic.cdy systype=`uname` +workdir="$HOME/ketcindy" if [ "$1" = "-c" ] then @@ -52,11 +53,13 @@ case $systype in esac plugin="$plugindir/KetCindyPlugin.jar" +dirheadplugin="$plugindir/dirhead.txt" # find Jar KetCdyJar=`kpsewhich -format=texmfscripts KetCindyPlugin.jar` # search for template.cdy TempCdy=`kpsewhich -format=texmfscripts $TemplateFile` +DirHead=`kpsewhich -format=texmfscripts dirhead.txt` if [ -z "$TempCdy" -o -z "$KetCdyJar" ] then @@ -65,10 +68,11 @@ then fi -if [ ! -r "$plugin" ] ; then +if [ ! -r "$plugin" -o ! -r "$dirheadplugin" ] ; then echo "Cinderella is *NOT* set up for KETCindy!" echo "You need to copy" echo " $KetCdyJar" + echo " $DirHead" echo "into" echo " $plugindir" echo "" @@ -94,7 +98,8 @@ then fi -mkdir -p ~/ketcindy +mkdir -p "$workdir" +cp "$TempCdy" "$workdir" -exec "$cinderella" "$TempCdy" +exec "$cinderella" "$workdir/$TemplateFile" diff --git a/Master/texmf-dist/scripts/ketcindy/ketjava/KetCindyPlugin.jar b/Master/texmf-dist/scripts/ketcindy/ketjava/KetCindyPlugin.jar index 2ae7ceda3f5..3c150e58ddb 100644 Binary files a/Master/texmf-dist/scripts/ketcindy/ketjava/KetCindyPlugin.jar and b/Master/texmf-dist/scripts/ketcindy/ketjava/KetCindyPlugin.jar differ diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dhelpE.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dhelpE.txt old mode 100644 new mode 100755 diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dhelpJ.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dhelpJ.txt old mode 100644 new mode 100755 index bd29d25ff24..2d33176d4e7 --- 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 // -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 // -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_2min(|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 // -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(#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(#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 old mode 100644 new mode 100755 diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibhelpJ.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibhelpJ.txt old mode 100644 new mode 100755 diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvhelpE.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvhelpE.txt old mode 100644 new mode 100755 diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvhelpJ.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvhelpJ.txt old mode 100644 new mode 100755 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 old mode 100644 new mode 100755 index e9978e7b653..a538afd1330 --- 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 // -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 // -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(' ',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('