summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutr.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutr.cs')
-rw-r--r--Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutr.cs185
1 files changed, 111 insertions, 74 deletions
diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutr.cs b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutr.cs
index 904f5dfd369..946743bed6f 100644
--- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutr.cs
+++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutr.cs
@@ -14,10 +14,11 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>
//
-println("ketcindylibout(20181130 loaded");
+println("ketcindylibout(20181218 loaded");
//help:start();
+////%WritetoS start////
WritetoS(fname,cmdL):=(
// help:WritetoS("outdata",cmdL);
regional(tmp,tmp1,tmp2,filename);
@@ -47,6 +48,7 @@ WritetoS(fname,cmdL):=(
);
closefile(SCEOUTPUT);
);
+////%WritetoS end////
////%kcS start////
kcS(path,fname):=kcS(path,fname,[]);
@@ -134,6 +136,7 @@ kcS(path,fname,optionorg):=(
);
////%kcS end////
+////%SetpathS start////
SetpathS():=(
regional(tmp,tmp1);
if(!isstring(PathS), // 15.12.11
@@ -151,7 +154,9 @@ SetpathS():=(
);
PathS;
);
+////%SetpathS end////
+////%ErrhandleS start////
ErrhandleS(fname):=( // 2016.02.28
regional(str); //17.04.14
if(indexof(PathS,"-6.")==0,
@@ -167,7 +172,9 @@ ErrhandleS(fname):=( // 2016.02.28
str=[]; //17.04.14
);
);
+////%ErrhandleS end////
+////%Testfunstr start////
Testfunstr(funstr,varx,vary):=(
regional(var,val,fun,tmp,tmp1,tmp2);
fun=replace(funstr,".x","(1)"); // 16.05.19
@@ -186,7 +193,9 @@ Testfunstr(funstr,varx,vary):=(
tmp1=replace(tmp1,var,"("+val+")");
tmp1;
);
+////%Testfunstr end////
+////%CalcbyS start////
CalcbyS(name,cmd):=CalcbyS(name,SetpathS(),cmd,[]);
CalcbyS(name,Arg1,Arg2):=(
if(isstring(Arg1),
@@ -429,7 +438,9 @@ CalcbyS(name,path,cmd,optionorg):=(
// wait(WaitUnit);
);
);
+////%CalcbyS end////
+////%Scifun start////
Scifun(name,fun,argL):=Scifun(name,fun,argL,[]);//16.10.22
Scifun(name,fun,argL,optionorg):=(
//help:Scifun("1","date()",[]);
@@ -486,7 +497,9 @@ Scifun(name,fun,argL,optionorg):=(
);
parse(nm);
);
+////%Scifun end////
+////%WritetoR start////
WritetoR(fname,cmdL):=WritetoR(fname,cmdL,[]);
WritetoR(fname,cmdL,options):=(
// help:WritetoR("outdata",cmdL);
@@ -536,7 +549,9 @@ WritetoR(fname,cmdL,options):=(
// );
// );
);
+////%WritetoR end////
+////%kcR start////
kcR(path,fname):=kcR(path,fname,[]);
kcR(path,fname,optionorg):=(
//help:kcR(PathR,"boxdata");
@@ -626,7 +641,9 @@ kcR(path,fname,optionorg):=(
setdirectory(Dirwork);
);
);
+////%kcR end////
+////%Dataframe start////
Dataframe(nmL,dL):=Dataframe(nmL,dL,[]);
Dataframe(nmL,dL,options):=(
//help:Dataframe(["name","no1","no2"],dtL);
@@ -655,7 +672,9 @@ Dataframe(nmL,dL,options):=(
out=replace(out,"[","c(");
out=replace(out,"]",")");
);
+////%Dataframe end////
+////%MkprecommandR start////
MkprecommandR():=MkprecommandR(6,"PVOFG"); //180508(9lines)
MkprecommandR(Arg):=(
regional(out,tmp1);
@@ -677,6 +696,7 @@ MkprecommandR(Arg):=(
MkprecommandR(prec,chstr):=(
regional(cmdL,Plist,tmp,tmp1,tmp2);
cmdL=[];
+ cmdL=concat(cmdL,["arccos=acos; arcsin=asin; arctan=atan",[]]); //181209
if(indexof(chstr,"P")>0,
Plist=[];
forall(remove(allpoints(),[SW,NE]),
@@ -739,6 +759,7 @@ MkprecommandR(prec,chstr):=(
);
cmdL;
);
+////%MkprecommandR end////
////%CalcbyR start////
CalcbyR(name,cmd):=CalcbyR(name,PathR,cmd,[]);
@@ -1079,6 +1100,7 @@ CalcbyR(name,path,cmd,optionorg):=(
);
////%CalcbyR end////
+////%Rfun start////
Rfun(name,fun,argL):=Rfun(name,fun,argL,[]);//16.10.22
Rfun(name,fun,argL,optionorg):=(
//help:Rfun("1","rnorm",[10]);
@@ -1120,6 +1142,7 @@ Rfun(name,fun,argL,optionorg):=(
);
parse(nm);
);
+////%Rfun end////
////%Readcsv start////
Readcsv(file):=Readcsv(Dirwork,file,[]);
@@ -1279,6 +1302,7 @@ Readcsv(path,file):=(
);
////%Readcsv end////
+////%Writecsv start////
Writecsv(nmL,data,file):=Writecsv(nmL,data,file,[]);
Writecsv(nmL,dataorg,file,optionorg):=(
//help:Writecsv([],data,"ex.csv");
@@ -1334,6 +1358,7 @@ Writecsv(nmL,dataorg,file,optionorg):=(
);
closefile(SCEOUTPUT);
);
+////%Writecsv end////
////%HatchdataR start////
HatchdataR(nm,iostr,pltlist):=HatchdataR(nm,iostr,pltlist,[]);
@@ -3429,7 +3454,7 @@ kcV3(path,fname):=(
if(iswindows(),
SCEOUTPUT = openfile("kc.bat");
println(SCEOUTPUT,"cd "+Dq+Dirwork+Dq);
- tmp=Dq+PathV3+Dq+" "+tmp1+filename;
+ tmp=Dqq(PathV3)+" "+Dqq(tmp1+filename);
println(SCEOUTPUT,tmp);
println(SCEOUTPUT,"exit");
closefile(SCEOUTPUT);
@@ -3442,7 +3467,12 @@ kcV3(path,fname):=(
); //181125to
println(SCEOUTPUT,"#!/bin/sh");
println(SCEOUTPUT,"cd "+Dq+Dirwork+Dq);
- tmp=Dq+PathV3+Dq+" "+tmp1+filename;
+ if(PathV3=="preview", //181202from
+ tmp="open -a "+Dqq("preview");
+ ,
+ tmp=Dqq(PathV3);
+ );
+ tmp=tmp+" "+Dqq(tmp1+filename); //181202to
println(SCEOUTPUT,tmp);
println(SCEOUTPUT,"exit 0");
closefile(SCEOUTPUT);
@@ -3557,7 +3587,45 @@ Changeobjscale(unitlen,fnameorg,foutorg,optionorg):=(
);
////%Changeobjscale end////
+////%Setobj start////
+//Objname(str):=Objname(str,["m","v"]); //180906from
+//Objname(str,options):=Setobj(str,options);
+Setobj():=Setobj(Fhead,["m","v"]); //180901
+Setobj(Arg1):=(
+ if(isstring(Arg1),
+ Setobj(Arg1,["m","v"]); //17.01.12
+ ,
+ Setobj(Fhead,Arg1); //180902
+ );
+);
+Setobj(str,optionsorg):=( //180906to
+//help:Setobj();
+//help:Setobj(["v"]);
+//help:Setobj(options=["m","v","preview","Zax=y(/n)"]);
+ regional(options,tmp,strL);
+ options=select(optionsorg,length(#)>0); //17.12.23from
+ tmp=Divoptions(options); //181203from
+ strL=tmp_7;
+ forall(strL,
+ if(Toupper(substring(#,0,1))=="P",
+ PathV3="preview";
+ options=remove(options,[#]);
+ );
+ ); //181203to
+ if(length(str)>0,
+ OCNAME=str;
+ );
+ if(length(options)>0,
+ OCOPTION=options;
+ ,
+ OCOPTION=["m","v"];
+ ); //17.12.23until
+ println("generate OBJCMD. name="+OCNAME+", option="+OCOPTION);
+);
+////%Setobj end////
+
////%Mkviewobj start////
+Mkviewobj():=Mkviewobj(OCNAME,OBJCMD,OCOPTION); //181209
Mkviewobj(fname,cmdL):=Mkviewobj(Dirwork,fname,cmdL,[]);
Mkviewobj(Arg1,Arg2,Arg3):=(
if(!isstring(OCNAME), //17.04.13from
@@ -3572,13 +3640,11 @@ Mkviewobj(Arg1,Arg2,Arg3):=(
);
);
Mkviewobj(pathorg,fnameorg,cmdLorg,optionorg):=(
-//help:Mkviewobj(fname,cmdlist);
-//help:Mkviewobj(fname,[]);
-//help:Mkviewobj(path,fname,cmdlist);
-//help:Mkviewobj(options=["M/R","V","Unit=in","Wait=(10)"]);
+//help:Mkviewobj();
regional(path,cmdL,eqL,strL,flg,fname,options,make,view,cmdlist,
- vtx,face,unit,tmp,tmp1,tmp2,store);
+ vtx,face,unit,tmp,tmp1,tmp2,store,dt,nn,zax);
store=Fillblack(); //181128
+println([3647,store]);
path=replace(pathorg,"\","/");
if(substring(path,length(path)-1,length(path))!="/",path=path+"/");
fname=fnameorg;
@@ -3591,38 +3657,28 @@ Mkviewobj(pathorg,fnameorg,cmdLorg,optionorg):=(
make=-1;
view=0;
unit="";
+ zax="Y";
forall(eqL,
- tmp=indexof(#,"=");
- tmp1=Toupper(substring(#,0,1));
- tmp2=substring(#,tmp,length(#));
- if(tmp1=="M",
- tmp2=Toupper(substring(tmp2,0,1));
- if(tmp2=="N" % tmp2=="F",
- make=0;
- );
- options=remove(options,[#]);
- );
- if(tmp1=="V",
- tmp2=Toupper(substring(tmp2,0,1));
- if(tmp2=="N" % tmp2=="F",
- view=0;
- );
- options=remove(options,[#]);
- );
+ tmp=Strsplit(#,"=");
+ tmp1=Toupper(substring(tmp_1,0,1));
if(tmp1=="U", // 16.06.30from
- unit=tmp2;
+ unit=tmp2;
+ options=remove(options,[#]);
+ ); // 16.06.30to
+ if(tmp1=="Z", // 16.06.30from
+ zax=Toupper(substring(tmp_2,0,1));
options=remove(options,[#]);
- ); // 16.06.30until
+ ); // 16.06.30to
);
forall(strL,
tmp=Toupper(substring(#,0,1));
if(tmp=="M",
make=1;
- options=remove(options,[#]);
+// options=remove(options,[#]); //181203
);
if(tmp=="R",
make=0;
- options=remove(options,[#]);
+// options=remove(options,[#]); //181203
);
if(tmp=="V",
view=1;
@@ -3687,49 +3743,31 @@ Mkviewobj(pathorg,fnameorg,cmdLorg,optionorg):=(
Changeobjscale(fname,["Unit="+unit]);//16.10.04
); // 16.06.30until
if(view==1,
- flg=0; // 16.03.14 from
- if(isstring(ViewFile),
- if(ViewFile==fname,flg=1);
+ if((PathV3=="preview")%(zax=="Y"), //181209
+ dt=Readlines(fname);
+ forall(1..(length(dt)),nn,
+ tmp1=dt_nn;
+ if(substring(tmp1,0,2)=="v ",
+ tmp=replace(tmp1," "," ");
+ tmp=tokenize(tmp," ");
+ tmp=Sprintf(tmp_(2..4),4);
+ tmp2="v "+tmp_2+" "+tmp_3+" "+tmp_1;
+ dt_nn=tmp2;
+ );
+ );
+ fname=replace(fname,".","prv.");
+ SCEOUTPUT = openfile(fname);
+ forall(dt,
+ println(SCEOUTPUT,#);
+ );
+ closefile(SCEOUTPUT);
);
- if(flg==0,
- kcV3(path,fname);
- ViewFile=fname;
- ); // 16.03.14 until
+ kcV3(path,fname);
);
Fillrestore(store); //181128
);
////%Mkviewobj end////
-////%Setobj start////
-//Objname(str):=Objname(str,["m","v"]); //180906from
-//Objname(str,options):=Setobj(str,options);
-Setobj():=Setobj(Fhead,["m","v"]); //180901
-Setobj(Arg1):=(
- if(isstring(Arg1),
- Setobj(Arg1,["m","v"]); //17.01.12
- ,
- Setobj(Fhead,Arg1); //180902
- );
-);
-Setobj(str,optionsorg):=( //180906to
-//help:Setobj(["m","v"]);
-//help:Setobj("sample");
-//help:Setobj("sample",options);
-//help:Setobj(options=["m","v"]);
- regional(options);
- if(length(str)>0,
- OCNAME=str;
- );
- options=select(optionsorg,length(#)>0); //17.12.23from
- if(length(options)>0,
- OCOPTION=options;
- ,
- OCOPTION=["m","v"];
- ); //17.12.23until
- println("generate OBJCMD. name="+OCNAME+", option="+OCOPTION);
-);
-////%Setobj end////
-
////%Mkobjcmd start////
Mkobjcmd(nm,fd):=Mkobjcmd(nm,fd,[40,40,"+"]);
Mkobjcmd(nm,fd,options):=(
@@ -5735,7 +5773,7 @@ SfbdparadataC(nm,fd):=(
SfbdparadataC(nm,fd,options):=
SfbdparadataC(nm,fd,options,["do"]);
SfbdparadataC(nm,fdorg,optionorg,optionshorg):=(
-//help:Sfbdparadata("1",Fd);
+//help:Sfbdparadata("1",Fd,nohiddenoptions,hiddenoptions);
regional(funnm,fd,options,optionsh,name2,name3,name2h,name3h,waiting,
eqL,reL,strL,fname,tmp,tmp1,tmp2,flg,wflg,cmdflg);
if(ChNumber==0,ChNumber=Ch);
@@ -5811,7 +5849,7 @@ SfbdparadataC(nm,fdorg,optionorg,optionshorg):=(
];
if(cmdflg==1, //180531from
println(" ExeccmdC will generate "+ name3+","+name3h);
- tmp=replace(cmdL_5,"fname"+funnm,"fnameall");cmdL_5=tmp;
+ tmp=replace(cmdL_5,"fname"+nm,"fnameall");cmdL_5=tmp; //181217
tmp=select(CommandListC,indexof(#,"output3")>0); //180601from
if(length(tmp)>0,
tmp=replace(cmdL_6,Dqq("w"),Dqq("a"));cmdL_6=tmp;
@@ -5867,8 +5905,7 @@ CrvsfparadataC(nm,fk,sfbd,fd):=
CrvsfparadataC(nm,fk,sfbd,fd,options):=
CrvsfparadataC(nm,fk,sfbd,fd,options,["do"]);
CrvsfparadataC(nm,Fk,sfbdorg,fdorg,optionorg,optionshorg):=(
-//help:Crvsfparadata("1","ax3d","sfbd3d1",Fd);
-//help:Crvsfparadata(options=["Use=y(/n)"];
+//help:Crvsfparadata("1","ax3d","sfbd3d1",Fd,,nohiddenoptions,hiddenoptions);
regional(funnm,sfbd,fd,options,optionsh,name2,name3,name2h,name3h,waiting,
eqL,reL,strL,fname,tmp,tmp1,tmp2,flg,wflg,useflg,cmdlfg,ii,jj,eps);
eps=10^(-5);
@@ -6042,7 +6079,7 @@ Crv3onsfparadataC(nm,crv3d,sfbd,fd):=
Crv3onsfparadataC(nm,crv3d,sfbd,fd,options):=
Crv3onsfparadataC(nm,crv3d,sfbd,fd,options,["do"]);
Crv3onsfparadataC(nm,crv3d,sfbdorg,fdorg,optionorg,optionshorg):=(
-//help:Crv3onsfparadata("1","sc3","sfbd3d1",fd);
+//help:Crv3onsfparadata("1","sc3","sfbd3d1",fd,,nohiddenoptions,hiddenoptions);
regional(funnm,sfbd,fd,options,optionsh,name3,name3h,name2,name2h,waiting,
eqL,reL,strL,fname,tmp,tmp1,tmp2,flg,wflg,flg,ii,jj,eps,cmdflg);
tmp1=replace(crv3d,"3d","2d");
@@ -6197,7 +6234,7 @@ Crv2onsfparadataC(nm,crv2d,sfbd,fd):=
Crv2onsfparadataC(nm,crv2d,sfbd,fd,options):=
Crv2onsfparadataC(nm,crv2d,sfbd,fd,options,["do"]);
Crv2onsfparadataC(nm,crv2d,sfbd,fdorg,options,optionsh):=(
-//help:Crv2onsfparadata("1","gp1","sfbd3d1",fd);
+//help:Crv2onsfparadata("1","gp1","sfbd3d1",fd,nohiddenoptions,hiddenoptions);
regional(fd,uname,vname,str,tmpfun,ii,jj,crv3d,tmp,tmp1,tmp2);
Changestyle3d(crv2d,["nodisp"]);
crv3d=crv2d+"3d";
@@ -6230,7 +6267,7 @@ WireparadataC(nm,sfbd,fd,wr1,wr2):=
WireparadataC(nm,sfbd,fd,wr1,wr2,options):=
WireparadataC(nm,sfbd,fd,wr1,wr2,options,["do"]);
WireparadataC(nm,sfbd,fdorg,wr1,wr2,optionorg,optionshorg):=(
-//help:Wireparadata("1","sfbd3d1",fd,5,5);
+//help:Wireparadata("1","sfbd3d1",fd,5,5,nohiddenoptions,hiddenoptions);
regional(funnm,fd,options,optionsh,name2,name3,name2h,name3h,waiting,
eqL,reL,strL,fname,fnameh,tmp,tmp1,tmp2,flg,wflg,flg,ii,jj,eps,udata,vdata,cmdflg);
eps=10^(-5);
@@ -6544,7 +6581,7 @@ SfcutparadataC(nm,cutfunL,sfbd,fd):=(//180505
SfcutparadataC(nm,cutfunL,sfbd,fd,options):=
SfcutparadataC(nm,cutfunL,sfbd,fd,options,["nodisp"]);
SfcutparadataC(nm,cutfunLorg,sfbd,fdorg,optionorg,optionshorg):=(
-//help:Sfcutparadata("1","2*x+3*y+z=1","sfbd3d",fd);
+//help:Sfcutparadata("1","2*x+3*y+z=1","sfbd3d",fd,nohiddenoptions,hiddenoptions);
regional(funnm,cutfunL,fd,options,optionsh,name2,name3,name2h,name3h,
waiting,eqL,reL,strL,fname,fnameh,tmp,tmp1,tmp2,flg,wflg,flg,ii,jj,eps,cmdflg);
eps=10^(-5);