diff options
author | Karl Berry <karl@freefriends.org> | 2019-09-27 21:24:30 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-09-27 21:24:30 +0000 |
commit | 7706488325e08b8a6855e0fd9177c94da72acae6 (patch) | |
tree | fdaf77b2a5bd22d2ac09b28cb205eddf1c9f18ba /Master/texmf-dist/scripts | |
parent | 58751f3663f58918a53bfa57291c4032c14b583f (diff) |
ketcindy (27sep19)
git-svn-id: svn://tug.org/texlive/trunk@52190 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts')
12 files changed, 949 insertions, 664 deletions
diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dlogr.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dlogr.txt index 169d22e7674..fba482f6266 100644 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dlogr.txt +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dlogr.txt @@ -1,3 +1,18 @@ +// 20190821 +// Start3d debugged ( isstring added ) +// 20190818 +// Projpara,Spaceline,Spacecurve,Joincrvs3d,Xyzax3data,Embed, +// Rotatedata3d,Translatedata3d,Reflectdata3d,Scaledata3d,Bezier3d, +// Vertexedgeface,Phparadata,Faceremovaldata,Skeletondatacindy, +// 20190714 +// Perpplane changed (option) +// Pointdata3d changed (option,Defvar) +// 20190713 +// Ketinit3d changed (TH,PHI copied from Start3d) +// 20190709 +// Rotatepoint3d,Scalepoint3d debugged (length(...)==1>!isstring()) +// Rotatepoint3d debugged ( w1,w2 ) +// VertexEdgeFace(label) debugged // 20190511 // Start3d changed (KetcindyDataList initialized) // 20190506 diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dr.cs b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dr.cs index 956e726b438..0f45dc6f61b 100644 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dr.cs +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dr.cs @@ -14,7 +14,7 @@ // along with this program. If not, see <http://www.gnu.org/licenses/> // -println("ketcindylib3d[20190511] loaded"); +println("ketcindylib3d[20190822] loaded"); //help:start(); @@ -47,6 +47,13 @@ Ketinit3d(subflg):=( TSIZE=10; TSIZEZ=10; ErrFlg=0; + xPos=-5; yTh=tmp-0.5; yPh=tmp-1; + Slider("TH",[xPos,yTh],[xPos+9,yTh],["Color=green"]); //190713from + Slider("FI",[xPos,yPh],[xPos+9,yPh],["Color=green"]); + drawtext([xPos-0.8,yTh-0.1],Sprintf((TH.x-xPos)*20,2),align->"right"); + drawtext([xPos-0.8,yPh-0.1],Sprintf((FI.x-xPos)*40,2),align->"right"); + THETA=(TH.x-xPos)*20*pi/180; + PHI=(FI.x-xPos)*40*pi/180; //190713to ); ////%Ketinit3d end//// @@ -54,7 +61,8 @@ Ketinit3d(subflg):=( Start3d():=Start3d([],[]); Start3d(Arg):=( //190503from regional(tmp); - tmp=select(Arg,indexof(#,"=")>0); + tmp=select(Arg,isstring(#)); //190822 + tmp=select(tmp,indexof(#,"=")>0); if(length(tmp)==0, Start3d(Arg,[]); , @@ -516,7 +524,7 @@ Projpara(ptdata,optionsorg):=( tmp=name2+"=Projpara("+name3+")"; GLIST=append(GLIST,tmp); ); - if(Noflg<2, + if(Noflg<3, //190818 if(isstring(Ltype), if(color!=KCOLOR, //180904 Texcom("{");Com2nd("Setcolor("+color+")");//180722 @@ -528,7 +536,7 @@ Projpara(ptdata,optionsorg):=( , if(Noflg==1,Ltype=0); ); - GCLIST=append(GCLIST,[name2,Ltype,opcindy]); + GCLIST=append(GCLIST,[name2,Ltype,opcindy]); ); ); if(length(Out)==1,Out=Out_1); @@ -706,7 +714,7 @@ Spaceline(nm,ptlistorg,optionorg):=( tmp=name2+"=Projpara("+name3+")"; GLIST=append(GLIST,tmp); ); - if(Noflg<2, + if(Noflg<3, //190818 if(isstring(Ltype), if(color!=KCOLOR, //180904 Texcom("{");Com2nd("Setcolor("+color+")");//180722 @@ -873,7 +881,7 @@ Spacecurve(nm,funstr,variable,optionorg):=( tmp=name2+"=Projpara("+name3+")"; GLIST=append(GLIST,tmp); ); - if(Noflg<2, + if(Noflg<3, //190818 if(isstring(Ltype), if(color!=KCOLOR, //180904 Texcom("{");Com2nd("Setcolor("+color+")");//180722 @@ -1012,7 +1020,7 @@ Joincrvs3d(nm,plotstrL,options):=( tmp=name2+"=Projpara("+name3+")"; GLIST=append(GLIST,tmp); ); - if(Noflg<2, + if(Noflg<3, //190818 if(isstring(Ltype), if(color!=KCOLOR, //180904 Texcom("{");Com2nd("Setcolor("+color+")");//180722 @@ -1131,7 +1139,7 @@ Xyzax3data(nm,Xrange,Yrange,Zrange,optionorg):=( tmp=name2+"=Projpara("+name3+")"; GLIST=append(GLIST,tmp); ); - if(Noflg<2, + if(Noflg<3, //190818 if(isstring(Ltype), if(color!=KCOLOR, //180904 Texcom("{");Com2nd("Setcolor("+color+")");//180722 @@ -1305,7 +1313,7 @@ Embed(nm,Pd2str,funstr,varstr,options):=( tmp=name2+"=Projpara("+name3+")"; GLIST=append(GLIST,tmp); ); - if(Noflg<2, + if(Noflg<3, //190818 if(isstring(Ltype), if(color!=KCOLOR, //180904 Texcom("{");Com2nd("Setcolor("+color+")");//180722 @@ -1328,18 +1336,21 @@ Embed(nm,Pd2str,funstr,varstr,options):=( ); ////%Embed end//// -////%Rotatepoint3d start//// +////%Rotate3pt start//// Rotate3pt(point,w1,w2):=Rotatepoint3d(point,w1,w2,[0,0,0]); Rotate3pt(point,w1,w2,center):=Rotatepoint3d(point,w1,w2,center); +////%Rotate3pt end//// +////%Rotatepoint3d start//// Rotatepoint3d(point,w1,w2):=Rotatepoint3d(point,w1,w2,[0,0,0]);//180809 -Rotatepoint3d(point,w1,w2,center):=( +Rotatepoint3d(point,w1org,w2org,center):=( //help:Rotatepoint3d(pt3d,[0,0,1],pi/2); //help:Rotatepoint3d(pt3d,[0,0,1],pi/2,[1,1,1]); - regional(Eps,ct,st,v3,v1,v2,Ans,ns,PtL,num, + regional(Eps,w1,w2,ct,st,v3,v1,v2,Ans,ns,PtL,num, pt,tmp,tmp1,tmp2,Retflg,x,y,z,xx,yy,zz,flg); Eps=10^(-4); + w1=w1org; w2=w2org; //190709 Retflg=0; - if(length(w2)==1, + if(!islist(w2), //190709 ct=cos(w2); st=sin(w2); v3=1/|w1|*w1; @@ -1471,7 +1482,7 @@ Rotatedata3d(nm,P3data,w1,w2,options):=( tmp=name2+"=Projpara("+name3+")"; GLIST=append(GLIST,tmp); ); - if(Noflg<2, + if(Noflg<3, //190818 if(isstring(Ltype), if(color!=KCOLOR, //180904 Texcom("{");Com2nd("Setcolor("+color+")");//180722 @@ -1568,7 +1579,7 @@ Translatedata3d(nm,P3data,w1,options):=( tmp=name2+"=Projpara("+name3+")"; GLIST=append(GLIST,tmp); ); - if(Noflg<2, + if(Noflg<3, //190818 if(isstring(Ltype), if(color!=KCOLOR, //180904 Texcom("{");Com2nd("Setcolor("+color+")");//180722 @@ -1665,7 +1676,7 @@ Reflectdata3d(nm,P3data,vecL,options):=( tmp=name2+"=Projpara("+name3+")"; GLIST=append(GLIST,tmp); ); - if(Noflg<2, + if(Noflg<3, //190818 if(isstring(Ltype), if(color!=KCOLOR, //180904 Texcom("{");Com2nd("Setcolor("+color+")");//180722 @@ -1695,7 +1706,7 @@ Scalepoint3d(point,ratio,center):=( //help:Scalepoint3d(A,[3,2,4],[1,2,3]); regional(ra1,ra2,ra3,X1,Y1,Z1,X2,Y2,Z2,Cx,Cy,Cz); X1=point_1; Y1=point_2; Z1=point_3; - if(length(ratio)==1, //1808from + if(!islist(ratio), //1808from.190709 ra1=ratio; ra2=ratio; ra3=ratio; , ra1=ratio_1; ra2=ratio_2; ra3=ratio_3; @@ -1761,7 +1772,7 @@ Scaledata3d(nm,P3data,ratio,options):=( tmp=name2+"=Projpara("+name3+")"; GLIST=append(GLIST,tmp); ); - if(Noflg<2, + if(Noflg<3, //190818 if(isstring(Ltype), if(color!=KCOLOR, //180904 Texcom("{");Com2nd("Setcolor("+color+")");//180722 @@ -2270,13 +2281,26 @@ Putperp(name,ptstr,pLstr,option):=( ////%Perpplane start//// Perpplane(name,ptstr,nvec):= Perpplane(name,ptstr,nvec,"draw"); -Perpplane(name,ptstr,nstr,option):=( +Perpplane(name,ptstr,nstr,optionorg):=( //help:Perpplane("A-B","P",[1,3,2]); //help:Perpplane("A-B","P",[1,3,2]); -//help:Perpplane(option=["Put/Draw"]); - regional(Eps,nvec,sgstr,pP,v1,v2,v3, - th,ph,pA,pB,tmp,tmp1,tmp2); +//help:Perpplane(options=["Put/Draw"]); + regional(Eps,options,eqL,strL,nvec,sgstr,pP,v1,v2,v3, + gptflg,th,ph,pA,pB,tmp,tmp1,tmp2); Eps=10^(-4); + options=optionorg; //190714from + if(!islist(options),options=[options]); + tmp=Divoptions(options); + eqL=tmp_5; + strL=tmp_7; + gptflg=0; + forall(strL, + tmp=Toupper(substring(#,0,1)); + if(tmp=="P", + gptflg=1; + options=remove(options,#); + ); + ); //190714to if(isstring(nstr),nvec=parse(nstr+"3d"),nvec=nstr); if(indexof(ptstr,"3d")==0, //181107from pP=parse(ptstr+"3d"); @@ -2296,17 +2320,13 @@ Perpplane(name,ptstr,nstr,option):=( tmp=indexof(pLstr,"-"); pA=pP+v1; pB=pP+v2; - if(islist(option),tmp=option_1,tmp=option); - tmp=Toupper(substring(tmp,0,1)); // 16.06.19 - if(tmp=="P", + if(gptflg==1, //190714from Putpoint3d([tmp1,pA,tmp2,pB],["fix"]); , - Defvar(tmp1+"3d",pA); //181107[2lines] + Defvar(tmp1+"3d",pA); //190714from Defvar(tmp2+"3d",pB); - ); - if(tmp=="D", - Drawpoint3d(pA); - Drawpoint3d(pB); + Pointdata3d(tmp1,pA,options); + Pointdata3d(tmp2,pB,options); //190714to ); [pA,pB]; ); @@ -2336,12 +2356,17 @@ Drawpoint3d(pt3,options):=( Pointdata3d(nm,pt3):=Pointdata3d(nm,pt3,[]);//181017from Pointdata3d(nm,pt3,options):=( //181017from //help:Pointdata3d("1",pt3dlist,options); - regional(pt3L,pt2L,tmp); - if(Measuredepth(pt3)==0,pt3L=[pt3],pt3L=pt3); - pt2L=apply(pt3L,Parapt(#)); + regional(pt2L,tmp); + if(Measuredepth(pt3)==0,tmp=[pt3],tmp=pt3); + pt2L=apply(tmp,Parapt(#)); Pointdata("2d"+nm,pt2L,append(options,"Disp=n")); - tmp="pt3d"+nm+"="+format(pt3L,6)+";"; //190415 - parse(tmp); + tmp=substring(nm,0,1); //190714from + if((tmp>="A")&(tmp<="Z"), + tmp=nm+"3d"; + , + tmp="pt3d"+nm; + ); + Defvar(tmp,pt3); //190714to ); //181017to ////%Pointdata3d end//// @@ -2565,7 +2590,7 @@ Bezier3(nm,ptlistorg,ctrlistorg,options):=( //17.10.08 greatly changed tmp=name2+"=Projpara("+name3+")"; GLIST=append(GLIST,tmp); ); - if(Noflg<2, + if(Noflg<3, //190818 if(isstring(Ltype), if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); Ltype=Getlinestyle(text(Noflg)+Ltype,name2); @@ -2898,7 +2923,7 @@ Mkobjfile(path,fnameorg,objL):=( ////%VertexEdgeFace start//// //190502 VertexEdgeFace(nm,vfnL):=Vertexedgeface(nm,vfnL,[]); VertexEdgeFace(nm,vfnLorg,optionorg):=Vertexedgeface(nm,vfnLorg,optionorg); -////%VertexEdgeFace start//// +////%VertexEdgeFace end//// ////%Vertexedgeface start//// Vertexedgeface(nm,vfnL):=Vertexedgeface(nm,vfnL,[]); // 16.02.10 @@ -3051,7 +3076,7 @@ Vertexedgeface(nm,vfnLorg,optionorg):=( enL=append(enL,tmp+"3d");//16.02.29 ); ); - if(Noflg<2, + if(Noflg<3, //190818 if(msgflg=="Y", println("generate "+namev+","+namee+","+namef); ); @@ -3163,7 +3188,7 @@ Phparadata(nm,nmvf,vfL,options):=( GLIST=append(GLIST,tmp); ); ); - if(Noflg<2, + if(Noflg<3, //190818 if(isstring(Ltype), if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); Ltype=Getlinestyle(text(Noflg)+Ltype,name2); @@ -3568,7 +3593,7 @@ Faceremovaldata(nm,vfdata,crvdata,options):=( GLIST=append(GLIST,tmp); ); ); - if(Noflg<2, + if(Noflg<3, //190818 if(isstring(Ltype), if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); Ltype=Getlinestyle(text(Noflg)+Ltype,name2); @@ -4694,7 +4719,7 @@ Skeletondatacindy(nm,pltdata1org,pltdata2org,optionsorg):=( GLIST=append(GLIST,"ReadOutData("+Dq+fname+Dq+")");//181102 ); ); //no ketjs off - if((Noflg<2)&(mkflg>-1), //181103 + if((Noflg<3)&(mkflg>-1), //181103,190818 if(isstring(Ltype), if(!contains([[0,0,0],[0,0,0,1]],color),Com2nd("Setcolor("+color+")")); Ltype=Getlinestyle(text(Noflg)+Ltype,name2); diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1logr.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1logr.txt index d77763598c8..a232cdc7be6 100644 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1logr.txt +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1logr.txt @@ -1,3 +1,47 @@ +// 20190927 +// Setwindow debugged ( for Strictmove) +// 20190917 +// Ketinit changed (Strictmove moved from windispg) +// Intersectcurves debugged (op => pp) +// 20190916 +// Ketinit changed (JSBODY moved from Setketincyjs, KETJSOP=[] added) +// 20190912 +// Setwindow changed ( Ptpos used ) +// 20190909 +// Setwindow debugged ( Strictmove added to another place ) +// 20190901 +// Ketinit changed (AXSTYLE) +// 20190831 +// Ketinit changed (StrictSep added) +// 20190829 +// Setwindow changed (Strictmove(SW,NE)) +// 20190818 +// Getlinestyle changed ( to register "nodisp"(2) dat to GCLIST ) +// Chanestyle,AddGraph,Joincrvs,Partcrv,Pointdata,Listplot,Lineplot,Plotdata, +// Paramplot,Implicitplot,Circledata,Ovaldata +// changed (Nflg<2 => Nflg<3 ) +// 20190813 +// Assign debugged +// 20190811 +// Assign changed ( precise options added (def=6)) +// 20190809 +// lightgray 0.17=>0.15 +// offwhite added +// 20190805 +// Ptselected change (Isptselected removed) +// 20190803 +// Reparse added +// 20190802 +// Ketinit() changed (MOVETOLIST commented out) +// Initglist changed (GCLISTadd + Ketinit); +// Koutenseg changed ( re(out) for JS) +// 20190719 +// Initglist debugged (GCLISTadd) +// Setglist changed (GLIST (//no ketjs) +// 20190704 +// Ketinit changed (MOVETOJSLIST added) +// 20190628 +// Pointdata debugged ( Inside ) // 20190622 // Implicitplot changed ("x","y" supported) // 20190603 @@ -96,6 +140,8 @@ // Divoptions changed ("dr,thickness" ) // 20190116 // Ketinit() debuggded ( Mackc for Linux) +// 20190801 +// Ketinit changed (KetcindyjsDataList=[] removed) // 20190115 // Plotdata debugged( ( => [ ) // Pointdata change( colorcode => colorcmyk2rgb) diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1r.cs b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1r.cs index c68a550dd11..2dc633a782e 100644 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1r.cs +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1r.cs @@ -14,9 +14,9 @@ // along with this program. If not, see <http://www.gnu.org/licenses/> // -println("KeTCindy V.3.2.9"); +println("KeTCindy V.3.3.0"); println(ketjavaversion()); -println("ketcindylibbasic1[20190622] loaded"); +println("ketcindylibbasic1[20190927] loaded"); //help:start(); @@ -38,17 +38,19 @@ println("ketcindylibbasic1[20190622] loaded"); Ch=[0]; ChNum=1; ////%Ketinit start//// -Ketinit():=Ketinit("fig",1,[-5,5],[-5,5]); //181001 +Ketinit():=Ketinit("fig",1,[-5,5],[-5,5],0.3); //190831from Ketinit(Arg):=(//181001from if(isstring(Arg), - Ketinit(Arg,1,[-5,5],[-5,5]); + Ketinit(Arg,1,[-5,5],[-5,5],0.3); , - Ketinit("fig",Arg,[-5,5],[-5,5]); + Ketinit("fig",1,[-5,5],[-5,5],Arg); ); ); -Ketinit(work,sy,rangex,rangey):=(//181001to +Ketinit(Arg1,Arg2):=Ketinit(Arg1,1,[-5,5],[-5,5],Arg2); +Ketinit(work,sy,rangex,rangey,strictsep):=(////190831to //help:Ketinit(); //help:Ketinit(""); + //help:Ketinit(0.3); //190831 regional(pt,tmp,tmp1,tmp2,letterc,boxc,shadowc,mboxc); PenThickInit=8; ULEN="1cm"; @@ -83,25 +85,26 @@ Ketinit(work,sy,rangex,rangey):=(//181001to COM2ndlist=[]; // no ketjs off // COM2ndlistb=[]; //180612 ADDAXES="1"; - AXSTYLE=["l","x","e","y","n","O","sw","","",""]; //181216 + AXSTYLE=[["l","x","e","y","n","O","sw","","",""],[]]; //190901 AXCOUNT=1; //181215 SHADECTR=1; //190222 LFmark=unicode("000a"); CRmark=unicode("000d");//16.12.13 Dq=unicode("0022"); - CommonMake=0;//180610 + CommonMake=0;//180610 //no ketjs on WaitUnit=10; CONTINUED=0; OutComList=[]; OutFileLIst=[]; // 15.10.22 - FigPdfList=[]; // 16.04.08 + FigPdfList=[]; // 16.04.08 //no ketjs off Fillstore(); //181212 - ADDPACK=[]; // 16.05.16 + ADDPACK=[]; // 16.05.16 //no ketjs on GPACK="tpic"; //180817 ErrFlag=0; KETJSOP=[]; //190129 REMOVEPTJS=[]; SLIDEFLG="Y"; //190504 - KetcindyjsDataList=[]; +// MOVETOJSLIST=[]; //190802 +// KetcindyjsDataList=[]; //190801 // setdirectory(Dirwork); if(!isstring(Fhead), // 17.10.13from, 17.11.12 Fhead=text(curkernel()); @@ -151,12 +154,15 @@ Ketinit(work,sy,rangex,rangey):=(//181001to BezierNumber=1; //15.01.03 SCALEX=1; SCALEY=sy; -// Setscaling(sy); XMIN=rangex_1/SCALEX; XMAX=rangex_2/SCALEX; YMIN=rangey_1/SCALEY; YMAX=rangey_2/SCALEY; + StrictSep=strictsep; //190831 Setwindow("Msg=n"); // 16.05.31 + forall(remove(allpoints(),[SW,NE]),Strictmove(#.name)); //190917 + KETJSOP=[]; //190916 + JSBODY=[[],[]]; //190916 // no ketjs on 190122 // for Presentation letterc=[0.98,0.13,0,0.43]; boxc=[0.2,0,0,0];//190307 [0,0.32,0.52,0]; @@ -172,24 +178,16 @@ Ketinit(work,sy,rangex,rangey):=(//181001to ); ////%Ketinit end//// -////%Initglist start//// 190530 +////%Initglist start//// 190802 Initglist():=( - GLIST=[]; // no ketjs - GCLIST=[]; - COM0thlist=[]; // no ketjs on - COM1stlist=[]; - COM2ndlist=[]; // no ketjs off - KCOLOR=[0,0,0]; - SCALEX=1; - SCALEY=1; - XMIN=SW.x; XMAX=NE.x; //190603[2lines] - YMIN=SW.y; YMAX=NE.y; + GCLISTadd=[]; //190719 + Ketinit(); //190802 ); ////%Initglist end//// ////%Setglist start//// 190530 Setglist():=( - GLISTadd=GLIST; + GLISTadd=GLIST; // no ketjs GCLISTadd=GCLIST; COM0thlistadd=COM0thlist; // no ketjs on COM1stlistadd=COM1stlist; @@ -199,7 +197,7 @@ Setglist():=( ////%Addglist start//// 190530 Addglist():=( - GLIST=GLISTadd; + GLIST=GLISTadd; // no ketjs GCLIST=GCLISTadd; COM0thlist=COM0thlist; // no ketjs on COM1stlist=COM1stlistadd; @@ -324,27 +322,23 @@ Getcdyname():=( //17.12.27 ////%Cindyname end//// ////%Setwindow start//// -Setwindow():=Setwindow("Msg=yes"); +Setwindow():=Setwindow("Msg=y"); Setwindow(str):=( regional(tmp,tmp1,tmp2,msg); - msg="y"; + msg="Y"; tmp=indexof(str,"="); // 16.02.10 - tmp1=Toupper(substring(str,tmp,tmp+1)); - if(tmp1=="N",msg="n"); + msg=Toupper(substring(str,tmp,tmp+1)); + Strictmove("SW"); Strictmove("NE");//190927 if((ispoint(SW) & ispoint(NE)), - tmp1=Lcrd(SW); - tmp2=Lcrd(NE); + tmp1=LLcrd(Ptpos(SW));//190912[2lines] + tmp2=LLcrd(Ptpos(NE)); XMIN=tmp1_1; XMAX=tmp2_1; YMIN=tmp1_2; YMAX=tmp2_2; , -// XMIN=-5; XMAX=5; -// YMIN=Lcrdy(-5); YMAX=Lcrdy(5); -// createpoint("SW",Pcrd([XMIN,YMIN])); -// createpoint("NE", Pcrd([XMAX,YMAX])); Putpoint("SW",Pcrd([XMIN,YMIN])); - Putpoint("NE", Pcrd([XMAX,YMAX])); + Putpoint("NE", Pcrd([XMAX,YMAX])); ); - if(msg=="y", // no ketjs on + if(msg=="Y", // no ketjs on println("Setwindow(["+XMIN+","+XMAX+"],["+YMIN+","+YMAX+"])"); ); layer(KETPICLAYER); @@ -358,9 +352,13 @@ Setwindow(xrange,yrange):=( XMAX=xrange_2; YMIN=yrange_1; YMAX=yrange_2; - Putpoint("SW",[XMIN,YMIN]);//181016 - Putpoint("NE",[XMAX,YMAX]);//181016 -// Ketinit(); + Ptpos(SW,Pcrd([XMIN,YMIN])); //190927from + Ptpos(NE,Pcrd([XMAX,YMAX])); + Strictmove("SW"); Strictmove("NE"); + layer(KETPICLAYER); + autoclearlayer(KETPICLAYER,true); + drawpoly([Pcrd([XMIN,YMIN]), Pcrd([XMAX,YMIN]), + Pcrd([XMAX,YMAX]),Pcrd([XMIN,YMAX])],color->[1,1,1]); //190927to ); ////%Setwindow end//// @@ -397,6 +395,20 @@ Setparent(file):=( // 17.11.27 ); ////%Setparent end//// +////%Reparse start//// +Reparse(str):=( //190803 +//help:Reparse(str); +//help:Reparse(strlist); + regional(out); + if(islist(str), + out=apply(str,re(parse(#))); + , + out=re(parse(str)); + ); + out; +); +////%Reparse end//// + ////%Dqq start//// Dqq(str):=DqDq(str); //18.02.11 ////%Dqq end//// @@ -899,8 +911,8 @@ Changestyle(nameL,style):=( Ltype=Ltypeorg; GCLIST=select(GCLIST,#_1!=name); COM2ndlist=select(COM2ndlist, //no ketjs - (indexof(#,"("+name)==0)%(indexof(#,"Shade")>0)); // 15.05.23,16.12.13 //no ketjs - if(Noflg<2, + (indexof(#,"("+name)==0)%(indexof(#,"Shade")>0)); // 15.05.23,16.12.13 //no ketjs + if(Noflg<3, if(isstring(Ltype), if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 @@ -912,8 +924,8 @@ Changestyle(nameL,style):=( , if(Noflg==1,Ltype=0); ); - GCLIST=append(GCLIST,[name,Ltype,opcindy]); - ); + GCLIST=append(GCLIST,[name,Ltype,opcindy]); + ); ); ); ); @@ -936,7 +948,7 @@ Op(n,object):=( // 16.05.25 ////%Op end//// ////%Ptselected start//// -Ptselected():=Isptselected(allpoints()); //180706 +Ptselected():=Ptselected(allpoints()); //190805 Ptselected(ptlistorg):=( //help:Ptselected(); //help:Ptselected(geopoint); @@ -1212,20 +1224,26 @@ Assign(str):=( //190125from forall(VLIST,tmp=concat(tmp,[#_1,#_2])); Assign(str,tmp); ); //190125to -Assign(funstr,vrL):=( - regional(nn,out); - nn=length(vrL)/2; - out=funstr; - forall(1..nn, - out=Assign(out,vrL_(2*#-1),vrL_(2*#)); +Assign(funstr,vrL):=Assign(funstr,vrL,6); +Assign(funstr,Arg1,Arg2):=( //190813from + regional(vrL,precise,nn,out,tmp); + if(islist(Arg1), + vrL=Arg1; precise=Arg2; + nn=length(vrL)/2; + out=funstr; + forall(1..nn, + out=Assign(out,vrL_(2*#-1),vrL_(2*#),precise); + ); + , + out=Assign(funstr,Arg1,Arg2,6); ); out; -); -Assign(funstr,varname,rep):=( -//help:Assign("x^2+a*x","a",1.3); +); //190813to +Assign(funstr,varname,rep,precise):=( //help:Assign("a*x^2+b*x",["a",1,"b",2]); +//help:Assign("a*x^2+b*x",["a",aa,"b",bb],10(def=6)); regional(repstr,ii,jj,tmp,tmp1,tmp2,Notvar,Flg); - if(isstring(rep),repstr=rep,repstr="("+Textformat(rep,6)+")"); + if(isstring(rep),repstr=rep,repstr="("+Textformat(rep,precise)+")"); //190811to // 15.02.09, 07.06,17.08.24 tmp=[46]; // 12.20 tmp=concat(tmp,48..57); @@ -1708,7 +1726,8 @@ Koutenseg(pA,pB,pC,pD,options):=( Tmp1=pA+rT*pV; Out=[Tmp1,rT,1]; ); - Out; + if(!isstring(Out_1),Out=apply(Out,re(#))); //190802 + Out; ); ////%Koutenseg end//// @@ -2294,7 +2313,7 @@ Intersectcurves(crv1org,crv2org,options):=( //help:Intersectcurves(crv1,crv2); //help:Intersectcurves(options=[Eps1(0.1),Dist(2)]) regional(tmp); - tmp=Intersectcurvesop(crv1org,crv2org,options); + tmp=Intersectcurvespp(crv1org,crv2org,options); //190917(debugged) tmp=apply(tmp,#_1); ); ////%Intersectcurves end//// @@ -3465,9 +3484,9 @@ Colorname2rgb(name):=( //181212 ["olivegreen",[0.64,0,0.95,0.4]],["rawsienna",[0,0.72,1,0.45]], ["sepia",[0,0.83,1,0.7]],["brown",[0,0.81,1,0.6]], ["tan",[0.14,0.42,0.56,0]],["gray",[0,0,0,0.5]], - ["lightgray",[0,0,0,0.17]], //190429 + ["lightgray",[0,0,0,0.15]], //190429,0809 ["cindycolor",[0.66,0,69,0.71]], //190504 - ["black",[0,0,0,1]],["white",[0,0,0,0]] + ["black",[0,0,0,1]],["white",[0,0,0,0]],["offwhite",[0,0,0,0.03]] //190809 ]; tmp=select(dL,#_1==name); if(length(tmp)>0, @@ -3492,46 +3511,45 @@ Getlinestyle(str,name):=( ); noflg=parse(substring(str,0,1)); if(substring(name,0,3)=="sub",subflg=1,subflg=0); // 16.02.29 - tmp1=substring(str,1,3); + if(noflg<=1, //1900818from + tmp1=Toupper(substring(str,1,3)); + , + tmp1="NO"; + ); //1900818to tmp2=""; //190119from tmp=indexof(str,","); if(tmp>0, tmp2=substring(str,tmp,length(str)); ); //190119to - if(tmp1=="dr" % tmp1=="Dr", -// Ltype=0; + if(tmp1=="DR", if(length(tmp2)==0,tmp2="1"); //190125 Ltype=[0,tmp2]; //190119 if(noflg==0 & subflg==0, // 16.02.29 Drwline(name+Dop); ); ); - if(tmp1=="da" % tmp1=="Da", -// Ltype=1; + if(tmp1=="DA", if(length(tmp2)==0,tmp2="1,1"); //190125 Ltype=[1,tmp2]; //190119 if(noflg==0 & subflg==0, // 16.02.29 Dashline(name+Dop); ); ); - if(tmp1=="id" % tmp1=="Id", -// Ltype=2; // 15.11.09 - if(length(tmp2)==0,tmp2="1,1"); //190125 - Ltype=[2,tmp2]; //190119 + if(tmp1=="ID", + if(length(tmp2)==0,tmp2="1,1"); //190125 + Ltype=[2,tmp2]; //190119 if(noflg==0 & subflg==0, // 16.02.29 Invdashline(name+Dop); ); ); - if(tmp1=="do" % tmp1=="Do", -// Ltype=3; + if(tmp1=="DO", if(length(tmp2)==0,tmp2="1,1"); //190125 Ltype=[3,tmp2]; //190119 if(noflg==0 & subflg==0, // 16.02.29 Dottedline(name+Dop); ); ); - if(tmp1=="dp" % tmp1=="Dp", -// Ltype=0; + if(tmp1=="DP", if(length(tmp2)==0,tmp2="1"); //190125 Ltype=[0,tmp2]; //190119 tmp1=parse(name); @@ -3544,9 +3562,9 @@ Getlinestyle(str,name):=( Drwpt(tmp2+Dop); ); ); - if(tmp1=="no" % tmp1=="No", - Ltype=10; - ); + if(tmp1=="NO", //190818from + Ltype=[-1,"0"]; + ); //190818to Ltype; ); ////%Getlinestyle end//// @@ -3677,7 +3695,7 @@ AddGraph(nm,pltdata,options):=( GLIST=append(GLIST,tmp1); //no ketjs ); ); // 16.04.04 until - if(Noflg<2, + if(Noflg<3, //190818 if(isstring(Ltype), if((Noflg==0)&(color!=KCOLOR), //181020 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 @@ -3776,7 +3794,7 @@ Joincrvs(nm,plotstrL,options):=( tmp1=substring(tmp1,0,length(tmp1)-1); GLIST=append(GLIST,name+"=Joincrvs("+tmp1+")"); //no ketjs ); - if(Noflg<2, + if(Noflg<3, //190818 if(isstring(Ltype), if((Noflg==0)&(color!=KCOLOR), //181020 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 @@ -3869,7 +3887,7 @@ Partcrv(nm,pA,pB,PkLstr,options):=( +","+Textformat(Lcrd(pB),5)+","+tmp+")"; // 16.04.03 GLIST=append(GLIST,tmp1); //no ketjs ); - if(Noflg<2, + if(Noflg<3, //190818 if(isstring(Ltype), if((Noflg==0)&(color!=KCOLOR), //181020 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 @@ -3904,11 +3922,11 @@ Pointdata(nm,list):=Pointdata(nm,list,[]); Pointdata(nm,listorg,options):=( //help:Pointdata("1",[2,4],["Size=5"]); //help:Pointdata("2",[[2,3],[4,1]]); -//help:Pointdata(options=["Size=(1)","Disp=(y)","Msg=(y)","Inside=","Color="]); -//help:Pointdata("Inside=color/ratio/no"]); +//help:Pointdata(options=["Size=(1)","Msg=(y)","Color="]); +//help:Pointdata("Inside=color/ratio/no","Border=y(n)"]); regional(list,name,nameL,ptlist,opstr,opcindy,Msg, eqL,dispflg,size,thick,tmp,tmp1,tmp2,tmp3, - Ltype,Noflg,color,inside); + Ltype,Noflg,color,inside,border); name="pt"+nm; nameL=name+"L"; tmp=Divoptions(options); @@ -3921,6 +3939,7 @@ Pointdata(nm,listorg,options):=( size=""; dispflg="Y"; inside=color; + border="Y"; Msg="Y"; forall(eqL, tmp=Strsplit(#,"="); @@ -3933,20 +3952,39 @@ Pointdata(nm,listorg,options):=( if(tmp1=="D", //181030from dispflg=Toupper(substring(tmp_2,0,1)); ); - if(tmp1=="I", //190405from - if(Toupper(substring(tmp_2,0,1))=="N", - inside=[-1,-1,-1]; + if(tmp1=="I", //190628from + tmp2=Toupper(substring(tmp_2,0,1)); + if(tmp2=="[", + tmp=parse(tmp_2); + if(length(tmp)==4, + tmp=Colorcmyk2rgb(tmp); + ); + inside=text(tmp); , - tmp3=["0","1","2","3","4","5","6","7","8","9"]; - if(contains(tmp3,substring(tmp_2,0,1)), - inside=parse(tmp_2)*color; + if(contains(["0","1"],tmp2), + tmp=[1,1,1]-color; + tmp=parse(tmp_2)*tmp; + inside=[1,1,1]-tmp; , - tmp3=Divoptions(["Color="+text(tmp_2)]); - inside=tmp3_(length(tmp3)-2); + if(tmp2=="N", + inside=[1,1,1]; + , + inside=Colorname2rgb(tmp_2); + ); ); - opcindy=opcindy+",pointcolor->"+text(inside); + tmp1=indexof(opcindy,"color->"); + tmp=substring(opcindy,tmp1,length(opcindy)); + tmp2=indexof(tmp,"]"); + tmp=substring(tmp,tmp2,length(tmp)); + opcindy=substring(opcindy,0,tmp1-1)+"color->"+text(inside)+tmp; + ); + ); //190628to + if(tmp1=="B", //1810628from + border=Toupper(substring(tmp_2,0,1)); + if(border=="N", + opcindy=opcindy+",border->false"; ); - ); //100405to + ); //1810628to if(tmp1=="M", //190206from Msg=Toupper(substring(tmp_2,0,1)); ); //190206to @@ -3999,8 +4037,9 @@ Pointdata(nm,listorg,options):=( ); GLIST=append(GLIST,name+"=Pointdata("+tmp2+")"); //no ketjs ); - if(Noflg<2, - tmp=[nameL,[0,1],opcindy]; //190126 + if(Noflg<3, //190818 + if(Noflg<2,tmp=[0,1],tmp=[-1,1]); //190819 + tmp=[nameL,tmp,opcindy]; //190126 GCLIST=append(GCLIST,tmp); if(Noflg==0, if(length(size)>0, @@ -4092,7 +4131,7 @@ Listplot(nm,list,options):=( parse(tmp); GLIST=append(GLIST,name+"=Listplot("+Textformat(ptlist,5)+")"); // 180719 //no ketjs ); - if(Noflg<2, + if(Noflg<3, //190818 if(isstring(Ltype), if((Noflg==0)&(color!=KCOLOR), //181020 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180711 @@ -4163,7 +4202,7 @@ Lineplot(nm,list,optionorg):=( parse(tmp); GLIST=append(GLIST,name+"=Lineplot("+Textformat(list,5)+opstr+")"); //no ketjs ); - if(Noflg<2, + if(Noflg<3, //190818 if(isstring(Ltype), if((Noflg==0)&(color!=KCOLOR), //181020 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 @@ -4371,7 +4410,7 @@ Plotdata(name1,func,variable,options):=( tmp=name+"=Plotdata('"+tmp1+"','"+tmp2+"'"+opstr+")"; GLIST=append(GLIST,tmp); //no ketjs off ); - if(Noflg<2, + if(Noflg<3, //190818 if(isstring(Ltype), if((Noflg==0)&(color!=KCOLOR), //181020 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 @@ -4387,7 +4426,7 @@ Plotdata(name1,func,variable,options):=( ); PdL; , - if(Noflg<2, + if(Noflg<3, //190818 if(isstring(Ltype), if((Noflg==0)&(color!=KCOLOR), //181020 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 @@ -4547,7 +4586,7 @@ Paramplot(nm,funstr,variable,options):=( tmp=name+"=Paramplot('"+tmp1+"','"+tmp2+"'"+opstr+")"; GLIST=append(GLIST,tmp); //no ketjs off ); - if(Noflg<2, + if(Noflg<3, //190818 if(isstring(Ltype), if((Noflg==0)&(color!=KCOLOR), //181020 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 @@ -4563,7 +4602,7 @@ Paramplot(nm,funstr,variable,options):=( ); Out; , - if(Noflg<2, + if(Noflg<3, //190818 if(isstring(Ltype), if((Noflg==0)&(color!=KCOLOR), //181020 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 @@ -4831,7 +4870,7 @@ Implicitplot(name1,func,xrngorg,yrngorg,optionsorg):=( GLIST=append(GLIST,tmp); //no ketjs // Drawfigures(name,[name],[options]); //190508 ); - if(Noflg<2, + if(Noflg<3, //190818 if(isstring(Ltype), if((Noflg==0)&(color!=KCOLOR), //181020 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 @@ -4954,7 +4993,7 @@ Circledata(nm,cenrad,options):=( ); GLIST=append(GLIST,tmp); //no ketjs off ); - if(Noflg<2, + if(Noflg<3, //190818 if(isstring(Ltype), if((Noflg==0)&(color!=KCOLOR), //181020 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 @@ -5091,7 +5130,7 @@ Ovaldata(nm,Pdata,options):=( GLIST=append(GLIST, //no ketjs name+"=Ovaldata("+Ctr+","+Dx+","+Dy+opstr+")");//16.01.30 //no ketjs ); - if(Noflg<2, + if(Noflg<3, //190818 if(isstring(Ltype), if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2logr.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2logr.txt index 35a48c5d4d9..90dd67b9954 100644 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2logr.txt +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2logr.txt @@ -1,3 +1,43 @@ +// 20190921 +// Enclosing debugged/changed ( in case of length(KL)==1, epspara removed) +// 20190917 +// Windispg changed (Strictmove moved to ketinit) +// Slider changed (Strictmove removed) +// 20190905 +// Ptpos added ( <= Setpintxy renamed/changed ) +// 20190902 +// Setax debugged (AXSTYLE) +// 20190901 +// Drwxy changed ("Size" supported for labels) +// Setpointxy added (Ptposition arrange ) +// Setax, Drwxy changed ( "Size=" option ) +// 20190831 +// Strictmove changed (StrictSep used) +// 20190829 +// Windispg changed (remove SW,NE from Stricstmove) +// 20190827 +// Strictmove added +// Windispg changed (Stricstmove added) +// Slider changed ( A-C-B) +// 20190826 +// Slider changed ( for pA-pC-pB, initial position) +// 20190824 +// Slider changed ( for ketcindyjs, separation controlable) +// 20190818 +// Windispg changed ( to remove "nodisp" data ) +// Arrowhead,Lightarrowdata,Anglemark,Paramark,Bowdata,Deqplot, +// Enclosing,Hatchdata,Rotatedata,Translatedata,Scaledata,Reflectdata, +// Beziercurve,Extractdata, +// changed +// 20190814 +// Fourier debugged/changed (Num>num, deffun) +// 20190727 +// Lightarrowdata => Arrowdata, Arrowdata => OldArrowdata +// Lightarrowdata debugged ( arrowhead option ) +// 20190704 +// Bowdata changed (BOWMIDDLE message) +// 20190627 +// Letter changed ( resize font size with Ketcindyjsscale ) // 20190531 // Drawfigures (Drwfigs) changed // 20190524 @@ -358,4 +398,4 @@ //2017.09.16 // RSform, Deffun, IftoR, FortoR changed( added ) //2017.09.14 -// Makeshell, Makebat changed
\ No newline at end of file +// Makeshell, Makebat changed diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2r.cs b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2r.cs index c1e21281ede..5f65ad6c50d 100644 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2r.cs +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2r.cs @@ -14,7 +14,7 @@ // along with this program. If not, see <http://www.gnu.org/licenses/> // -println("ketcindylibbasic2[20190531] loaded"); +println("ketcindylibbasic2[20190921] loaded"); //help:start(); @@ -28,9 +28,9 @@ Drwfigs(nm,figlist,optionlist,commonops):=Drawfigures(nm,figlist,optionlist,comm Drawfigures(nm,figlist):=Drawfigures(nm,figlist,[]); Drawfigures(nm,figlist,optionlist):=Drawfigures(nm,figlist,optionlist,[]); Drawfigures(nm,figlistorg,optionlistorg,commonops):=( -//help:Drawfigures(["pt1","cr1"], [["Size=3"],[]],["Msg=n"]); +//help:Drawfigures("1",["pt1","cr1"], [["Size=3"],[]],["Msg=n"]); +//help:Drawfigures("","re1",[["Size=3"],[]],["Msg=n"]); regional(figlist,name,figL,optionlist,nn,kk,fig,eqL,msg,tmp,tmp1,tmp2); - name="figs"+nm; tmp=Divoptions(commonops); eqL=tmp_5; msg="Y"; @@ -42,7 +42,12 @@ Drawfigures(nm,figlistorg,optionlistorg,commonops):=( ); ); figlist=figlistorg; - if(isstring(figlist),figlist=parse(figlist)); + if(isstring(figlist), //190818from + name=figlist+nm; + figlist=parse(figlist); + , + name="figs"+nm; + ); //190818to nn=length(figlist); optionlist=optionlistorg; if(length(optionlist)==0, //190531from @@ -62,26 +67,40 @@ Drawfigures(nm,figlistorg,optionlistorg,commonops):=( fig=figlist_kk; if(isstring(fig),fig=parse(fig)); if(length(fig)>0, - if(Measuredepth(fig)==0,fig=[fig]); //190531from - if(Measuredepth(fig)==1,fig=[fig]); - forall(1..(length(fig)), - tmp1=fig_#; - tmp2=name+"n"+text(kk)+"p"+text(#); - if(length(tmp1)==1, - Pointdata(tmp2,tmp1,optionlist_kk); - figL=append(figL,"pt"+tmp2); + if(isstring(figlistorg), + tmp1=Measuredepth(fig); + tmp2=append(optionlist_kk,"Msg=n"); + tmp=fig; + if(tmp1==2,tmp=tmp_1); + if(length(tmp)>1, + Listplot("-"+name+"n"+text(kk),fig,tmp2); , - Listplot("-"+tmp2,tmp1,optionlist_kk); - figL=append(figL,tmp2); //190427 + if(tmp1==2,fig=apply(fig,#_1)); + Pointdata("-"+name+"n"+text(kk),fig,tmp2); ); - ); //190531to + figL=append(figL,name+"n"+text(kk)); + , + if(Measuredepth(fig)==0,fig=[fig]); //190531from + if(Measuredepth(fig)==1,fig=[fig]); + forall(1..(length(fig)), + tmp1=fig_#; + tmp2=name+"n"+text(kk)+"p"+text(#); + if(length(tmp1)==1, + Pointdata(tmp2,tmp1,optionlist_kk); + figL=append(figL,"pt"+tmp2); + , + Listplot("-"+tmp2,tmp1,optionlist_kk); + figL=append(figL,tmp2); //190427 + ); + ); //190531to + tmp=apply(figL,Dqq(#)); + tmp=name+"="+text(tmp)+";"; + parse(tmp); + ); + ); + if(msg=="Y", + println("generate "+name+"="+text(figL)); ); - ); - tmp=apply(figL,Dqq(#)); - tmp=name+"="+text(tmp)+";"; - parse(tmp); - if(msg=="Y", - println("generate "+name+"="+text(figL)); ); figL; ); @@ -280,7 +299,7 @@ Arrowhead(nm,point,direction,optionsorg):=(//181018from tmp=name+"="+Textformat(tmp1,5)+";"; //190415 parse(tmp); ); - if(Noflg<2, + if(Noflg<3, //190818 if(isstring(Ltype), Listplot("-arh"+nm,apply(list,LLcrd(#)),concat(options,["notex","Msg=n"])); ); @@ -310,12 +329,18 @@ Arrowhead(nm,point,direction,optionsorg):=(//181018from ); ////%Arrowhead end//// -////%Arrowdata start//// -Arrowdata(ptlist):=Arrowdata(ptlist,[]); //181110from -Arrowdata(Arg1,Arg2):=( +////%Arrowdata start//// 190727 (<= Lightarrowdata) +Arrowdata(ptlist):=Lightarrowdata(ptlist,[]); +Arrowdata(Arg1,Arg2):=Lightarrowdata(Arg1,Arg2); +Arrowdata(nm,ptlistorg,optionsorg):=Lightarrowdata(nm,ptlistorg,optionsorg); +////%Arrowdata end//// + +////%OldArrowdata start//// +Arrowdata(ptlist):=OldArrowdata(ptlist,[]); //181110from +OldArrowdata(Arg1,Arg2):=( regional(name); if(isstring(Arg1), - Arrowdata(Arg1,Arg2,[]); + OldArrowdata(Arg1,Arg2,[]); , name=""; forall(Arg1, @@ -323,14 +348,14 @@ Arrowdata(Arg1,Arg2):=( name=name+#.name; //190505 ); ); - Arrowdata(name,Arg1,Arg2); + OldArrowdata(name,Arg1,Arg2); ); ); //181110from -Arrowdata(nm,ptlistorg,optionsorg):=( -//help:Arrowdata("1",[A,B]); -//help:Arrowdata("1",[pt1,pt2]); -//help:Arrowdata(options=[size(1),angle(18),pos(1),cut(0),"Cutend=0,0","Coord=p/l"]); -//help:Arrowdata(optionsadded=["line"]); +OldArrowdata(nm,ptlistorg,optionsorg):=( +// help:Arrowdata("1",[A,B]); +// help:Arrowdata("1",[pt1,pt2]); +// help:Arrowdata(options=[size(1),angle(18),pos(1),cut(0),"Cutend=0,0","Coord=p/l"]); +// help:Arrowdata(optionsadded=["line"]); regional(options,Ltype,Noflg,name,opstr,opcindy,eqL,reL,strL,color,size,coord, flg,lineflg,cutend,tmp,tmp1,tmp2,pA,pB,angle,segpos,cut,scaley,ptlist); name="ar"+nm; @@ -426,7 +451,7 @@ Arrowdata(nm,ptlistorg,optionsorg):=( Setscaling(scaley); //190412 [Lcrd(pA),Lcrd(pB)]; ); -////%Arrowdata end//// +////%OldArrowdata end//// ////%Lightarrowdata start//// Lightarrowdata(ptlist):=Lightarrowdata(ptlist,[]); //181110from @@ -445,8 +470,8 @@ Lightarrowdata(Arg1,Arg2):=( ); ); //181110from Lightarrowdata(nm,ptlist,optionsorg):=( -//help:Lightarrowdata("1",[pt1,pt2]); -//help:Lightarrowdata(options=[size(1),angle(18),pos(1),cut(0),"Cutend=0,0","Line=y(n)"]); +//help:Arrowdata("1",[pt1,pt2]); +//help:Arrowdata(options=[size(1),angle(18),pos(1),cut(0),"Cutend=0,0","Line=y(n)"]); regional(options,Ltype,Noflg,opstr,opcindy,eqL,reL,strL,color,size,coord,lineflg, flg,lineflg,cutend,tmp,tmp1,tmp2,pA,pB,angle,segpos,cut,scaley,Ev,Nv,pP); pA=Pcrd(ptlist_1); pB=Pcrd(ptlist_2); @@ -510,7 +535,7 @@ Lightarrowdata(nm,ptlist,optionsorg):=( tmp="ar"+nm+"="+Textformat([pA,pB],5)+";"; parse(tmp); ); - if(Noflg<2, + if(Noflg<3, //190818 if(isstring(Ltype), if(lineflg==1, //190504from Listplot("-ar"+nm,[LLcrd(pA),LLcrd(pB)],append(options,"Msg=n")); @@ -532,10 +557,16 @@ Lightarrowdata(nm,ptlist,optionsorg):=( Texcom("{");Com2nd("Setcolor("+color+")");//180722 ); //no ketjs off Setscaling(scaley); - tmp1=Textformat(LLcrd(pP),5); + tmp1=Textformat(LLcrd(pP),5); //no ketjs on tmp2=Textformat(LLcrd(pB-pA),5); + if(cut>0, //190727from //no ketjs on + tmp=Indexall(opstr,","); + tmp=tmp_(length(tmp)); + opstr=substring(opstr,0,tmp-1); + opstr=opstr+","+Dqq("Cut="+text(cut)); + ); //190727to Com2nd("Arrowhead("+tmp1+","+tmp2+opstr+")"); - if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on + if((Noflg==0)&(color!=KCOLOR), //180904 Texcom("}");//180722 ); //no ketjs off , @@ -665,7 +696,7 @@ Anglemark(nm,plist,options):=( tmp=name+"=Anglemark("+tmp1+opstr+")"; GLIST=append(GLIST,tmp); //no ketjs off ); - if(Noflg<2, + if(Noflg<3, //190818 if(isstring(Ltype), if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 @@ -780,7 +811,7 @@ Paramark(nm,plist,options):=( tmp=name+"=Paramark("+tmp1+opstr+")"; GLIST=append(GLIST,tmp); //no ketjs off ); - if(Noflg<2, + if(Noflg<3, //190818 if(isstring(Ltype), if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 @@ -959,7 +990,7 @@ Bowdata(nm,plist,options):=( ); if(Noflg<3, if(Msg=="Y", //190206 - println("generate bowdata "+name+" and "+Bpos);//16.10.31 + println("generate bowdata "+name+" and BOWMIDDLE="+Bpos);//16.10.31,190704 ); if(Measuredepth(Out)==1,Out=[Out]); tmp1=[]; @@ -973,7 +1004,7 @@ Bowdata(nm,plist,options):=( tmp=name+"=Bowdata("+tmp1+opstr+")"; GLIST=append(GLIST,tmp); //no ketjs off ); - if(Noflg<2, + if(Noflg<3, //190818 if(isstring(Ltype), if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 @@ -1208,7 +1239,7 @@ Deqplot(nm,deqorg,rngorg,initt,initf,options):=( //17.10.06 tmp=RSform(tmp); GLIST=append(GLIST,tmp); ); //no ketjs off - if((nn>0)&(Noflg<2), //190211 + if((nn>0)&(Noflg<3), //190211 if(isstring(Ltype), if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 @@ -1225,170 +1256,6 @@ Deqplot(nm,deqorg,rngorg,initt,initf,options):=( //17.10.06 ); ////%Deqplot end//// -////////// old enclosing /////////////// - -Enclosing(nm,plist):=EnclosingS(nm,plist); -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,color - t1,t2,t3,ii,nn,tmp,tmp1,tmp2,Ltype,Noflg,realL,eqL,opstr,opcindy); - name="en"+nm; - tmp=Divoptions(options); - Ltype=tmp_1; - 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 - EEps=0.05; - Start=[]; - Flg=0; - forall(realL, - if(islist(#) % ispoint(#), - Start=Lcrd(#); // 15.09.12 - , - Flg=Flg+1; - if(Flg==1,Eps=#); - if(Flg==2,EEps=#); - ); - ); -// tmp1=concat([Eps,EEps],eqL); // 15.04.06 - Fdata=plist_1; - Gdata=plist_(length(plist)); - KL=Intersectcrvspp(Fdata,Gdata); - if(length(KL)==1, - pt=KL_1_1; - t1=KL_1_2; - ); - if(length(KL)==0, - if(Numptcrv(Fdata)>Numptcrv(Gdata), - tmp=Nearestpt(Fdata,Gdata); - pt=tmp_1; - t1=tmp_2; - , - tmp=Nearestpt(Gdata,Fdata); - pt=tmp_3; - t1=tmp_4; - ); - ); - if(length(KL)>1, - if(Start==[], - err("No Start Point"); - , - pt=KL_1_1; - t1=KL_1_2; - tmp=Norm(pt-Start); - forall(2..(length(KL)),ii, // 15.04.20 - tmp1=KL_ii_1; - tmp2=Norm(tmp1-Start); // 15.04.20 - if(tmp2<tmp, - pt=tmp1; - t1=KL_ii_2; - tmp=tmp2; - ); - ); - ); - ); -// pt=Pcrd(pt); // 15.09.12 - Start=pt; - AnsL=[]; - forall(1..(length(plist)),nn, - Fdata=plist_nn; - if(nn>1, pt=qt); - if(nn==length(plist), - qt=Start; - , - Flg=0; - Gdata=plist_(nn+1); -// tmp1=concat([Eps,EEps],eqL); // 15.04.06 - KL=Intersectcrvspp(Gdata,Fdata); - if(length(KL)==1, - tmp=KL_1; - qt=KL_1_1; - t3=KL_1_2; - Flg=10; - ); - if(length(KL)==0,Flg=1); - if(length(KL)>1, - tmp1=KL_1_1; - tmp2=KL_2_1; - tmp=|tmp1-tmp2|; - if(tmp<Eps*10, Flg=1); - ); - if(Flg==1, - if(Numptcrv(Fdata)>Numptcrv(Gdata), - tmp=Nearestpt(Fdata,Gdata); - qt=tmp_1; - t3=tmp_4; - Flg=10; - , - tmp=Nearestpt(Gdata,Fdata); - qt=tmp_3; - t3=tmp_2; - Flg=10; - ); - ); - if(Flg<10, - t2=10^6; //%inf; - forall(1..(length(KL)),ii, - tmp1=KL_ii_1; - tmp=KL_ii_3; - tmp2=Paramoncurve(tmp1,tmp,Fdata); - tmp3=KL_ii_2; - if(tmp2>t1+Eps & tmp2<t2+Eps, - qt=tmp1; - t2=tmp2; - t3=tmp3; - ); - ); - ); - ); - tmp=Partcrv("",pt,qt,Fdata,["nodata"]); - t1=t3; - if(nn==1, - AnsL=tmp; - , - AnsL=concat(AnsL,tmp_(2..(length(tmp)))); - ); - ); - AnsL=apply(AnsL,Pcrd(#)); // 15.09.12 - AnsL_(length(AnsL))=AnsL_1;//16.10.20 - if(Noflg<3, - println("generate Enclosing "+name); - tmp=name+"="+Textformat(AnsL,5)+";"; - parse(tmp); - tmp=name+"=Enclosing(";//16.11.07from //no ketjs on - tmp1="list"+PaO(); - forall(plist, - tmp1=tmp1+#+","; - ); - tmp=tmp+substring(tmp1,0,length(tmp1)-1)+")"+opstr+")"; - GLIST=append(GLIST,tmp);//16.11.07to //no ketjs off - ); - if(Noflg<2, - if(isstring(Ltype), - if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on - Texcom("{");Com2nd("Setcolor("+color+")");//180722 - ); //no ketjs off - Ltype=Getlinestyle(text(Noflg)+Ltype,name); - if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on - Texcom("}");//180722 - ); //no ketjs off - , - if(Noflg==1,Ltype=0); - ); - GCLIST=append(GCLIST,[name,Ltype,opcindy]); - ); - tmp=apply(AnsL,LLcrd(#));//16.10.20 - tmp; -); - -/////////// new enclosing /////////// - ////%Enclosing start//// Enclosing(nm,plist):=Enclosing2(nm,plist,[]);//180706[2lines] Enclosing(nm,plistorg,options):=Enclosing2(nm,plistorg,options); @@ -1398,7 +1265,7 @@ Enclosing2(nm,plistorg,options):=( //help:Enclosing(options=[startpoint,epspara(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,color,epspara,p1,p2); + tmp,tmp1,tmp2,color,p1,p2); name="en"+nm; plist=plistorg; tmp=Divoptions(options); @@ -1410,7 +1277,6 @@ Enclosing2(nm,plistorg,options):=( opstr=tmp_(length(tmp)-1); opcindy=tmp_(length(tmp)); Eps=10^(-5); // 16.12.05 - epspara=1; //180707 Eps1=0.01; Eps2=0.1; Start=[]; @@ -1419,7 +1285,6 @@ Enclosing2(nm,plistorg,options):=( if(isList(#) % ispoint(#), Start=Lcrd(#); // 18.02.02 , - if(flg==0,epspara=#);//180707 if(flg==1,Eps1=#); if(flg==2,Eps2=#); flg=flg+1; @@ -1496,8 +1361,7 @@ Enclosing2(nm,plistorg,options):=( , KL=sort(KL,[#_2]);//180706 tmp=parse(Fdata); - tmp1=t1+epspara/50*length(tmp); -// KL=select(KL,#_2>t1+epspara/50*length(tmp)); //180707 + tmp1=t1+Eps; KL=select(KL,(#_2>tmp1)%((#_2>t1)&(|#_1-p1|>Eps1))); //180713,16 t2=KL_1_2; ss=KL_1_3; @@ -1537,10 +1401,10 @@ Enclosing2(nm,plistorg,options):=( ); tmp=tmp+substring(tmp1,0,length(tmp1)-1)+")";//18.0706from //no ketjs on if(length(Start)>0,tmp=tmp+","+Textformat(Start,6)); - tmp=tmp+","+text(epspara)+")";//18.0706to,180707 + tmp=tmp+","+text(Eps1)+")";//18.0706to,180707 GLIST=append(GLIST,tmp);//16.11.07to //no ketjs off ); - if(Noflg<2, + if(Noflg<3, //190818 if(isstring(Ltype), if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 @@ -1559,8 +1423,6 @@ Enclosing2(nm,plistorg,options):=( ); ////%Enclosing end//// -/////////// end of new enclosing /////////// - /////////// new Hatchdata(cindy) /////////// ////%Makehatch start//// @@ -1947,7 +1809,7 @@ Hatchdatacindy(nm,iostr,bdylistorg,optionsorg):=( GLIST=append(GLIST,"ReadOutData("+Dq+fname+Dq+")");//181102 //no ketjs ); ); - if((Noflg<2)&(mkflg>-1), + if((Noflg<3)&(mkflg>-1), //190818 if(isstring(Ltype), if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 @@ -2349,7 +2211,7 @@ Rotatedata(nm,plist,angle,optionorg):=( +Textformat(angle,5)+","+RSform(Textformat(Pt,5))+")"; //17.12.23 GLIST=append(GLIST,tmp); //no ketjs off ); - if(Noflg<2, + if(Noflg<3, //190818 if(isstring(Ltype), if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 @@ -2431,7 +2293,7 @@ Translatedata(nm,plist,mov,optionorg):=( tmp=name+"=Translatedata("+tmp1+","+RSform(Textformat(mov,5))+")"; GLIST=append(GLIST,tmp); //no ketjs off ); - if(Noflg<2, + if(Noflg<3, //190818 if(isstring(Ltype), if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 @@ -2537,7 +2399,7 @@ Scaledata(nm,plist,rx,ry,optionorg):=( +Textformat(rx,5)+","+Textformat(ry,5)+","+RSform(Textformat(Pt,5))+")"; GLIST=append(GLIST,tmp); //no ketjs off ); - if(Noflg<2, + if(Noflg<3, //190818 if(isstring(Ltype), if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 @@ -2635,7 +2497,7 @@ Reflectdata(nm,plist,symL,optionorg):=( tmp=name+"=Reflectdata("+tmp1+","+RSform(Textformat(symL,5))+")";//17.12.23 GLIST=append(GLIST,tmp); //no ketjs off ); - if(Noflg<2, + if(Noflg<3, //190818 if(isstring(Ltype), if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 @@ -2798,38 +2660,48 @@ Htick(px,lenorg,options):=( ////%Htick end//// ////%Setax start//// -Setax(arglist):=( -//help:Setax(["l","x","e","y","n","O","sw"]); +Setax(arglistorg):=( +//help:Setax(["l","x","e","y","n","O","sw","Size=1.5"]); //help:Setax([7,"nw"]); //help:Setax([8,linestyle,colorax,colorlabel]); - regional(st,nn,tmp); //181215from - st=1; nn=1; + regional(arglist,st,nn,tmp,eqL); + tmp=Divoptions(arglistorg); //190901from + eqL=tmp_5; + arglist=remove(arglistorg,eqL); + if(length(arglist)==0, + arglist=["l","x","e","y","n","O","sw"]; + ); //190901to + st=1; nn=1; if(isreal(arglist_1), st=2; nn=arglist_1; ); forall(st..(length(arglist)), tmp=arglist_#; - if(length(tmp)>0,AXSTYLE_nn=tmp); + if(length(tmp)>0,AXSTYLE_1_nn=tmp); nn=nn+1; - ); //181215from + ); + AXSTYLE=[AXSTYLE_1,eqL]; //190901,02 // tmp=MakeRarg(arglist); // Com1st("Setax("+tmp+")"); ); ////%Setax end//// ////%Drwxy start//// -Drwxy():=Drwxy(0,[]); //190103from -Drwxy(Arg):=( - if(islist(Arg),Drwxy(0,Arg); Drwxy(Arg,[])); +Drwxy():=Drwxy(0,[]); +Drwxy(Arg):=( //190901from + if(islist(Arg), + Drwxy(0,Arg); + , + Drwxy(Arg,[]); + ); //190901to ); -Drwxy(add):=Drwxy(add,[]); -Drwxy(add,optionsorg):=( //190103to +Drwxy(add,optionsorg):=( //help:Drwxy(); //help:Drwxy(1[the last axis will be drawn],oprions); //help:Drwxy(options); -//help:Drwxy(options=["Xrng=","Yrng=","Ax=l,x,e,..."]); - regional(options,color,eqL,strL,org,xrng,yrng,ax,st,nn,size, +//help:Drwxy(options=["Xrng=","Yrng=","Ax=l,x,e,...","Size="]); + regional(options,color,eqL,strL,org,xrng,yrng,ax,st,nn,size,labelsize, linesty,colorax,colorla,tmp,tmp1,tmp2); options=optionsorg; tmp=Divoptions(options); @@ -2842,7 +2714,16 @@ Drwxy(add,optionsorg):=( //190103to //tmp1=max([org_2+YMIN,YMIN]); //tmp2=min([org_2+YMAX,YMAX]); yrng=[YMIN,YMAX]; //190103 - ax=AXSTYLE; + ax=AXSTYLE_1; //190901from + labelsize="Size=1"; + forall(AXSTYLE_2, + tmp=Strsplit(#,"="); + tmp1=Toupper(substring(tmp_1,0,1)); + if(contains(["S","L"],tmp1), + labelsize="Size="+tmp_2; + options=remove(options,[#]); + ); + ); //190901to linesty=ax_8; if(length(ax_9)>0, //190427 if(isstring(ax_9),colorax=ax_9,colorax=text(ax_9)); @@ -2859,8 +2740,6 @@ Drwxy(add,optionsorg):=( //190103to ); ); //181217to forall(eqL, - tmp=Strsplit(#,"="); - tmp1=Toupper(substring(tmp_1,0,1)); if(tmp1=="O", //190103from org=parse(tmp_2); options=remove(options,[#]); @@ -2908,9 +2787,10 @@ Drwxy(add,optionsorg):=( //190103to Listplot("-axy"+text(AXCOUNT),tmp,tmp1); ); AXCOUNT=AXCOUNT+1; - Expr([[xrng_2,org_2],ax_3,ax_2],[colorla]);//181216[3lines] - Expr([[org_1,yrng_2],ax_5,ax_4],[colorla]); - Letter([org,ax_7,ax_6],[colorla]); + tmp=[colorla,labelsize]; //190901from + Expr([[xrng_2,org_2],ax_3,ax_2],tmp); + Expr([[org_1,yrng_2],ax_5,ax_4],tmp); + Letter([org,ax_7,ax_6],tmp); //190901to if(add==0, //190103 Addax(0); ); @@ -3025,6 +2905,7 @@ Letter(list,options):=( Off=-4; Dmv=8; Nj=1; +// if(Ketcindyjsfigure>0,sz=round(sz*Ketcindyjsscale) ); // only ketjs while(Nj+2<=length(list), Pos=list_Nj; Dir=list_(Nj+1); @@ -3077,6 +2958,11 @@ Letter(list,options):=( if(Ymv==0,Ymv=-4);//16.10.08 aln="mid"; // 16.09.30until ); +// if(Ketcindyjsfigure>0, // only ketjs on +// Off=round(Off*Ketcindyjsscale); +// Xmv=round(Xmv*Ketcindyjsscale); +// Ymv=round(Ymv*Ketcindyjsscale); +// ); // only ketjs off Str=list_(Nj+2); //17.10.17 drawtext(Pcrd(Pos),Str,offset->[Off+Xmv,Off+Ymv], size->sz,color->color,align->aln,bold->bld,italics->ita);//16.10.09 @@ -3179,54 +3065,102 @@ Exprrot(pt,dir,tmov,nmov,str,options):=( ); ////%Exprrot end//// +////%Ptpos start//// 190906 +Ptpos(pt):=Ptpos(pt,[]); +Ptpos(ptorg,pos):=( +//help:Ptpos(A); +//help:Ptpos(A, [3,2]); + regional(pt,out,tmp); + if(ispoint(ptorg),pt=ptorg,pt=parse(ptorg)); + if(length(pos)==0, + tmp=pt.name+"position"; + out=parse(tmp); + if(!islist(out), + tmp=tmp+"="+Textformat(pt.xy,6)+";"; + parse(tmp); + ); + , + pt.xy=pos; + tmp=pt.name+"position="+Textformat(pt.xy,6)+";"; + parse(tmp); + out=pt.xy; + ); + out; +); +////%Ptpos end//// + +////%Strictmove start//// +Strictmove(pC):=Strictmove(pC,StrictSep); //190831 +Strictmove(pCorg,sep):=( + regional(pC,tmp,tmp1,tmp2); + pC=pCorg; + if(ispoint(pC),pC=pC.name); + tmp1=pC+"position"; + if(!islist(parse(tmp1)), + tmp=tmp1+"="+textformat(parse(pC).xy,6)+";"; + parse(tmp); + , + tmp=parse(pC).xy; + tmp2=mouse().xy; + if(|tmp-tmp2|>sep, + tmp=pC+".xy="+pC+"position"; + parse(pC).xy=parse(pC+"position"); + , + tmp=tmp1+"="+Textformat(parse(pC).xy,6)+";"; + parse(tmp); + ); + ); +); +////%Strictmove end//// + ////%Slider start//// Slider(ptstr,p1,p2):=Slider(ptstr,p1,p2,[]); Slider(ptstr,p1,p2,options):=(//190120 //help:Slider("A-C-B",[-3,0],[3,0]); //help:Slider("C",[-3,0],[3,0]); -//help:Slider(options=["Color=0.6*[0,0,1]","Size=2"]); - regional(pA,pB,pC,seg,sname,Alpha,color,size,tmp,tmp1); +//help:Slider(options=["Color=[0,0,0.6]","Thick=2"]); +//help:Slider(options2=["Sep=0.3"]); //190824 + regional(pA,pB,pC,color,thick,sep,tmp,tmp1,tmp2); color="Color=0.6*[0,0,1]"; //190120from - size="size->2"; + thick="size->2"; + sep=0.3; //190824 forall(options, tmp=Toupper(substring(#,0,1)); if(tmp=="C", color=#; ); - if(tmp=="S", + if(tmp=="T", tmp=Strsplit(#,"="); - size="size->"+tmp_2; + thick="size->"+tmp_2; ); - ); //190120to + if(tmp=="S",//190824from + tmp=Strsplit(#,"="); + sep=parse(tmp_2); + ); //190824to + ); tmp=Indexall(ptstr,"-"); - if(length(tmp)>0, //190209from - pA=substring(ptstr,0,tmp_1-1); + if(length(tmp)>0, + pA=substring(ptstr,0,tmp_1-1); //190824from pC=substring(ptstr,tmp_1,tmp_2-1); pB=substring(ptstr,tmp_2,length(ptstr)); - seg=pA+pB; - Alpha="ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - sname=""; - forall(1..(length(seg)), - tmp=substring(seg,#-1,#); - tmp1=indexof(Alpha,tmp); - if(tmp1>0, - sname=sname+unicode(text(tmp1+96),base->10); - , - sname=sname+tmp; - ); - ); - Putpoint(pA,p1); - Putpoint(pB,p2); - Listplot([parse(pA),parse(pB)],["Msg=n","notex",color,size]); - Putonseg(pC,parse("sg"+pA+pB)); + parse(pA).xy=p1; + parse(pB).xy=p2; //190824to + tmp1=pC+"position"; //190827from + if(!islist(parse(tmp1)), + tmp2=parse(pC).xy; + if(|tmp2-p1|<0.1,tmp2=p1+0.1*(p2-p1)/|p2-p1|); + if(|tmp2-p2|<0.1,tmp2=p2+0.1*(p1-p2)/|p1-p2|); + tmp=tmp1+"="+textformat(tmp2,6)+";"; + parse(tmp); + parse(pC).xy=tmp2; + ); //190827to PTEXCEPTION=concat(TEXCEPTION,[pA,pC,pB]); , - pA=""; pB=""; pC=ptstr; - tmp=pC+"l"+pC+pC+"r"; - Listplot(tmp,[p1,p2],["Msg=n","notex",color,size]); - Putonseg(pC,parse("sg"+tmp)); - PTEXCEPTION=concat(PTEXCEPTION,[pC]); //190329 - ); //190209to + pC=ptstr; pA=pC+"l"; pB=pC+"r"; + PTEXCEPTION=concat(PTEXCEPTION,[pC]); + ); + Listplot(pA+pB,[p1,p2],["Msg=n","notex",color,thick]); + Putonseg(pC,parse("sg"+pA+pB)); ); ////%Slider end//// @@ -3245,21 +3179,6 @@ Putpoint(name,Ptinit,Pt):=( ); ////%Putpoint end//// -////%Putpoint start//// -Putpoint(name,Pt):=Putpoint(name,Pt,Pt); -Putpoint(name,Ptinit,Pt):=( -//help:Putpoint("A",[1,2],[1,A.y]); - regional(ptstr); - ptstr=apply(allpoints(),#.name);//16.10.06 - if(!contains(ptstr,name), - createpoint(name,Pcrd([Ptinit_1,Ptinit_2])); - , - ptstr=name+".xy="+Textformat(Pcrd(Pt),5)+";"; - parse(ptstr); - ); -); -////%Putpoint end//// - ////%Bezierpt start//// Bezierpt(t,ptlist,ctrlist):=( regional(flg3,p0,p1,p2,p3,p4,p5,p6,p7,p8,p9); @@ -3367,7 +3286,7 @@ Beziercurve(nm,ptlistorg,ctrlistorg,options):=( tmp2=RSform(tmp2,3); //17.12.23 GLIST=append(GLIST,name+"=Bezier("+tmp1+","+tmp2+opstr+")"); //no ketjs off ); - if(Noflg<2, + if(Noflg<3, //190818 if(isstring(Ltype), if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 @@ -4150,17 +4069,14 @@ Fourierseries(nm,coefforg,per,nterm,range,optionorg):=( cn=coeff_2; sn=coeff_3; fs=c0; + fn="(cn)*cos(n*2*pi/per*x)+(sn)*sin(n*2*pi/per*x)"; + fn=Assign(fn,["cn",cn,"sn",sn,"per",per]); if(tbflg=="N", //190523 forall(1..nterm, - tmp=parse(Assign(cn,["n",#])); - tmp1=Assign("("+format(tmp,5)+")*cos(n*2*pi/per*x)", - ["n",#,"per",per]); - tmp=parse(Assign(sn,["n",#])); - tmp2=Assign("("+format(tmp,5)+")*sin(n*2*pi/per*x)", - ["n",#,"per",per]); - fs=fs+"+"+tmp1+"+"+tmp2; - ); - Plotdata("-four"+nm,fs,range,append(options,"Num="+Num)); + fs=fs+"+"+Assign(fn,["n",#]); + ); + Deffun("four(x)",[fs]); + Plotdata("-four"+nm,"four(x)",range,append(options,"Num="+num)); , c0=parse(c0); //190523from cn=apply(1..nterm,parse(Assign(cn,["n",#]))); @@ -4814,6 +4730,7 @@ Windispg(gcLorg):=( //190125 if(length(gcL)>0, if(!islist(gcL_1),gcL=[gcL]); ); //190125to + gcL=select(gcL,#_2_1>=0); //190818 gsave(); layer(KETPIClayer); forall(gcL,Nj, @@ -4856,7 +4773,7 @@ Windispg(gcLorg):=( //190125 ); , if(indexof(opcindy,"size")==0, //190425from - opcindy=opciny+",size->"+text(TenSize/TenSizeInit); + opcindy=opcindy+",size->"+text(TenSize/TenSizeInit); ); //190425to tmp="draw("+text(Nk_1)+opcindy+");"; parse(tmp); @@ -4913,7 +4830,7 @@ Extractdata(number,name,options):=( ]; GLIST=concat(GLIST,tmp3); //no ketjs off ); - if(Noflg<2, + if(Noflg<3, //190818 if(isstring(Ltype), if((Noflg==0)&(color!=KCOLOR), //180904 //no ketjs on Texcom("{");Com2nd("Setcolor("+color+")");//180722 diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic3logr.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic3logr.txt index 439a6342477..0d2b2ac394a 100644 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic3logr.txt +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic3logr.txt @@ -1,3 +1,49 @@ +// 201908918 +// Defvar changed ( precision 5 -> 16) +// 201908916 +// Setketcindyjs changed ( JSBODY moved to Ketinit) +// 201908915 +// Tocindyform,Totexform debugged ( ^ ) +// Totexform change ( "*" to "\cdot " or "" ) +// 201908914 +// Fracform changed ( numer, denom added to output) +// 201908911 +// Mketcindyjs debugged (JSBODY, ` => ') +// 201908910 +// Ketcindyjsbody added (JSBODY) +// Setketcindyjs,Mkketcindyjs changed (JSBODY) +// 201908905 +// Mkketcindyjs debugged (multi-initialization) +// 20190827 +// Mkketcindyjs debugged (case of no "axes:" ) +// 20190816 +// Deffun debugged (return ) +// 20190814 +// Deffun changed( for ketcindyjs ) +// 20190808 +// Setplaybuttons changed ( space option added ) +// 20190802 +// Movetojs debugged ( MOVETOJSLIST initialized ) +// Ketcindyjsdata debugged ( set() used to remove identical elements ) +// 20190801 +// Ketcindyjsdata debugged ( KetcindyjsDataList initialized ) +// Mkketcindyjs debugged ( position of KetcindyjsDataList) +// 20190731 +// Setplaybuttons added +// 20190729 +// Mkketcindyjs changed (Axes option) +// Movetojs changed (number of text available) +// 20190715 +// Totexform debugged ( for pi ) +// 20190712 +// Totexformpart changed (double spaces replaced with \;) +// Tocindyformpart changed (single space replaced with *) +// 20190704 +// Parsejson,Resizetextsize,Movetojs,Movetojsexe added +// 20190629 +// Fracform changed +// 20190627 +// Mkketcindyjs ( Axes and Figure options added ) // 20190623 // Fracform,Gcd added // 20190618 diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic3r.cs b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic3r.cs index 8a953f20a95..b5308c171bf 100644 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic3r.cs +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic3r.cs @@ -14,7 +14,7 @@ // along with this program. If not, see <http://www.gnu.org/licenses/> // -println("ketcindylibbasic3[20190623] loaded"); +println("ketcindylibbasic3[20190918] loaded"); //help:start(); @@ -356,7 +356,7 @@ Defvar(name,value):=( if(isstring(#), // 16.11.14 tmp1=tmp1+Dq+#+Dq+","; // 16.11.14 , - tmp1=tmp1+format(#,5)+","; + tmp1=tmp1+format(#,16)+","; //190918 ); ); tmp1=substring(tmp1,0,length(tmp1)-1)+"]"; @@ -452,11 +452,15 @@ Deffun(name,bodylist):=( regional(funstr,str,Pos,nbody,bdy,ppL,bpL,excma,tmp,tmp1,tmp2); funstr=name+":=("; forall(bodylist, - funstr=funstr+#+";"; + tmp1=Removespace(#); //190816from +// tmp=substring(tmp1,length(tmp1)-1,length(tmp1)); +// if(tmp!=",", tmp1=tmp1+";"); + tmp1=tmp1+";"; + funstr=funstr+tmp1; //190816to ); funstr=funstr+");"; parse(funstr); - tmp=indexof(name,"("); + tmp=indexof(name,"("); // no ketjs on //190814 str=substring(name,0,tmp-1)+"<-function"+PaO(); str=str+substring(name,tmp,length(name))+"{"; forall(1..(length(bodylist)-1),nbody, @@ -492,8 +496,10 @@ Deffun(name,bodylist):=( str=str+bdy+";"; ); ); - str=str+"return"+PaO()+bodylist_(length(bodylist))+")}"; - FUNLIST=append(FUNLIST,str); + tmp1=bodylist_(length(bodylist)); //190816from + tmp1=RSform(tmp1,2); + str=str+"return"+PaO()+tmp1+")}"; //190816to + FUNLIST=append(FUNLIST,str); // no ketjs off ); ////%Deffun end//// @@ -2963,12 +2969,14 @@ Gcd(xL,nmx):=( ); ////%Gcd end//// -////%Fracform start//// //190623 +////%Fracform start//// //190623,29 Fracform(x):=Fracform(x,5); -Fracform(x,denorg):=( +Fracform(x,den):=Fracform(x,den,5); +Fracform(x,denorg,deg):=( //help:Fracform(1.3); -//help:Fracform(1.3,[denomlist]); - regional(den,fL,tmp,nn,mm,err); +//help:Fracform(1.3,[denomlist],5); + regional(Eps,den,fL,flg,tmp,nn,mm,err); + Eps=10^(-deg); den=denorg; if(islist(den), if(!contains(den,1), den=prepend(1,den)); @@ -2976,19 +2984,29 @@ Fracform(x,denorg):=( den=1..den; ); fL=[]; + flg=0; forall(den, - tmp=round(x*#); - fL=append(fL,[tmp,#,abs(tmp/#-x)]); + if(flg==0, + tmp=round(x*#); + tmp=[tmp,#,abs(tmp/#-x)]; + if(tmp_3<Eps, + flg=1; + , + fL=append(fL,tmp); + ); + ); + ); + if(flg==0, + fL=sort(fL,#_3); + tmp=fL_1; ); - fL=sort(fL,#_3); - tmp=fL_1; mm=tmp_1; nn=tmp_2; err=tmp_3; if(nn>1, out="fr("+text(mm)+","+text(nn)+")"; , out=text(mm); ); - [out,"err="+format(err,6)]; + [out,"err="+format(err,6),mm,nn]; //190914 ); ////%Fracform end//// @@ -3067,9 +3085,21 @@ Totexformpart(str):=( //190514 ////%Totexform start//// Totexform(str):=( //190514 //help:Totexform("frac(2,3)"); - regional(out,plv,flg,nn,tmp,tmp1); - out=replace(str," ","\ "); - out=replace(str,"*"," "); + regional(out,plv,flg,nn,tmp,tmp1,tmp2); + out=replace(str,"pi","\pi"); //190715 + tmp1=apply(0..9,text(#)); //190915from + tmp2=Indexall(out,"*"); + forall(tmp2, + tmp=substring(out,#,#+1); + if(contains(tmp1,tmp), + out=substring(out,0,#-1)+"$"+substring(out,#,length(out)); + , + out=substring(out,0,#-1)+"%"+substring(out,#,length(out)); + ); + ); + out=replace(out,"$","\cdot "); + out=replace(out,"%",""); //190915to + out=replace(out," ","\;"); plv=Bracket(out,"()"); //190515from flg=0; //190521from if(length(plv)==0, @@ -3102,7 +3132,6 @@ Totexform(str):=( //190514 out=replace(out,"-+","\mp "); out=replace(out,"<=","\leq "); out=replace(out,">=","\geq "); - out=Assign(out,["pi","\pi"]); //190521 tmp1=Indexall(out,"^"); forall(tmp1,nn, if(substring(out,nn,nn+1)=="(", @@ -3110,8 +3139,9 @@ Totexform(str):=( //190514 tmp2=select(tmp2,#_2==-1); tmp2=tmp2_1_1+nn; tmp=substring(out,nn+1,tmp2-1); + tmp2=substring(out,tmp2,length(out));//190915 out=substring(out,0,nn)+"{"+tmp+"}"; - out=out+substring(out,tmp2,length(out)); + out=out+tmp2; ); ); ); @@ -3196,6 +3226,10 @@ Tocindyform(str):=( //190521 //help:Tocindyform("frac(2,3)"); regional(out,plv,flg,nn,tmp,tmp1); out=str; + out=replace(out,"\",""); //190712[4lines] + out=replace(out," "," "); + out=replace(out," "," "); + out=replace(out," ","*"); plv=Bracket(out,"()"); flg=0; if(length(plv)==0, @@ -3223,19 +3257,6 @@ Tocindyform(str):=( //190521 ); ); ); - if(flg<=1, - tmp1=Indexall(out,"^"); - forall(tmp1,nn, - if(substring(out,nn,nn+1)=="(", - tmp2=Bracket(substring(out,nn,length(out)),"()"); - tmp2=select(tmp2,#_2==-1); - tmp2=tmp2_1_1+nn; - tmp=substring(out,nn+1,tmp2-1); - out=substring(out,0,nn)+"{"+tmp+"}"; - out=out+substring(out,tmp2,length(out)); - ); - ); - ); out=replace(out,"{","("); out=replace(out,"}",")"); out; @@ -3352,10 +3373,19 @@ Setketcindyjs(list):=( ); ////%Setketcindyjs end//// +////%Ketcindyjsbody start//// 190909 +Ketcindyjsbody(list1,list2):=( +//help:Ketcindyjsbody(listfront,listrear); + JSBODY=[list1,list2]; + JSBODY; +); +////%Ketcindyjsbody end//// + ////%Ketcindyjsdata start//// //190421 Ketcindyjsdata(datalistorg):=( //help:Ketcindyjsdata(["ans",ans,"pea[parse]",pea]); regional(nn,func,tmp,tmp1,tmp2); + if(!islist(KetcindyjsDataList),KetcindyjsDataList=[]); //190801 datalist=datalistorg; forall(1..(length(datalist)/2), nn, //190423from tmp1=datalist_(2*nn-1); @@ -3383,11 +3413,12 @@ Ketcindyjsdata(datalistorg):=( ); tmp2=substring(tmp,0,length(tmp)-1)+"]"; , - tmp2=Dqq(tmp2); + if(isstring(tmp2),tmp2=Dqq(tmp2)); ); tmp=tmp1+"="+tmp2; KetcindyjsDataList=append(KetcindyjsDataList,tmp); - ); //190423to + KetcindyjsDataList=set(KetcindyjsDataList); //190802 + ); ); Ketcindyjsdata(name,vaL):=( Ketcindyjsdata([name,vaL]); @@ -3595,15 +3626,163 @@ Textedit2value(no,options):=( ); ////%Textedit2value end//// +////%Parsejson start//// +Parsejson(json):=( +//help:Parsejson("{a:[1,2,[3,4],5],b:{1,2,3}}"); + regional(outL,symbolleftL,symbolrightL,symbolstack,stacksize,leftpos,rightpos,breakflg,strflg,flg); + outL=[]; + symbolleftL =["[","{"]; + symbolrightL=["]","}"]; + leftpos=1; + while(leftpos<=length(json), + while( ( json_leftpos==" " % json_leftpos=="{" ) & leftpos<=length(json), leftpos=leftpos+1); + rightpos=leftpos; + symbolstack=" "; + stacksize=0; + breakflg=0; + strflg=0; + while(breakflg==0 & rightpos<=length(json), + flg=0; + if(strflg==0 & json_rightpos==unicode("0022"), // unicode("0022")='"' + strflg=1; + flg=1; + ); + if(flg==0 & strflg==1 & json_rightpos==unicode("0022"), + strflg=0; + flg=1; + ); + if(strflg==0, + repeat(length(symbolleftL), + if(flg==0 & stacksize>0, + if(symbolstack_stacksize==symbolleftL_# & json_rightpos==symbolrightL_#, + stacksize=stacksize-1; + flg=1; + ); + ); + if(flg==0 & json_rightpos==symbolleftL_#, + stacksize=stacksize+1; + symbolstack_stacksize=symbolleftL_#+" "; + flg=1; + ); + ); + if(flg==0 & json_rightpos==",", + if(stacksize==0, breakflg=1); + flg=1; + ); + if(flg==0 & json_rightpos=="}", + if(stacksize==0, breakflg=1); + flg=1; + ); + ); + if(breakflg==0,rightpos=rightpos+1); + ); + if(leftpos<rightpos,outL=append(outL,substring(json,leftpos-1,rightpos-1))); + leftpos=rightpos+1; + ); + outL; +); +////%Parsejson end//// + +////%Resizetextsize start//// +Resizetextsize(json,defaultsize,scale):=( +//help:Resizetextsize("{textsize: 10}",12,4); +//help:Resizetextsize("{aaa: bbb}",12,4); + regional(out,propertiesL,textsize,existflg,breakflg); + out=json; + propertiesL=Parsejson(out); + existflg=indexof(out,"textsize"); + if(existflg==0, + if(length(propertiesL)>0, + textsize="textsize: "+round(scale*defaultsize); + out=replace(out,propertiesL_length(propertiesL),propertiesL_length(propertiesL)+", "+textsize); + ); + ); + if(existflg>0, + breakflg=0; + forall(propertiesL, + if(breakflg==0 & indexof(#,"textsize")>0, + textsize="textsize: "+round(scale*parse(substring(#,indexof(#,":"),length(#)))); + out=replace(out,#,textsize); + breakflg=1; + ); + ); + ); + out; +); +////%Resizetextsize end//// + +////%Movetojs start//// +Movetojs(geoorg,pos,textsize):=( +//help:Movetojs(Text51,[1,2],12); + regional(geo); //190729from + geo=geoorg; + if(isreal(geo),geo=parse("Text"+text(geo))); //190729to + inspect(geo,"textsize",textsize); + if(!islist(MOVETOJSLIST), MOVETOJSLIST=[]); //190802 + MOVETOJSLIST=append(MOVETOJSLIST,[geo.name,[pos_1,pos_2]]); +); +////%Movetojs end//// + +////%Movetojsexe start//// +Movetojsexe(json):=( + regional(out,geo,propertiesL,breakflg); + out=json; + geo=select(MOVETOJSLIST,indexof(json,"name: "+Dqq(#_1))>0); + if(length(geo)>0, + geo=geo_1; + propertiesL=Parsejson(out); + forall(propertiesL, + breakflg=0; + if(breakflg==0 & ( indexof(#,"pos:")>0 % indexof(#,"dock:")>0 ), + out=replace(out,#,"pos: ["+geo_2_1+","+geo_2_2+",1]"); + breakflg=1; + ); + ); + ); + out; +); +////%Movetojsexe end//// + +////%Setplaybuttons start//// +Setplaybuttons(pt,font):=Setplaybuttons(pt_1,pt_2,font,[]); +Setplaybuttons(Arg1,Arg2,Arg3):=( + if(islist(Arg1), + Setplaybuttons(Arg1_1,Arg1_2,Arg2,Arg3); + , + Setplaybuttons(Arg1,Arg2,Arg3,[]); + ); +); +Setplaybuttons(x,y,font,sporg):=( +//help:Setplaybuttons(-2,-6,14); +//help:Setplaybuttons([-2,-6],14,[1,1,1]); + regional(x1,sp,tmp,tmp1); + sp=sporg; + tmp=length(sp); + if(tmp==0,tmp1=0,tmp1=sp_tmp); + tmp=apply(1..(3-tmp),tmp1); + sp=concat(sp,tmp); + x1=x; + Movetojs(71,[x1,y],font); + x1=x1+(0.84*font+sp_1)/10; + Movetojs(72,[x1,y],font); + x1=x1+(1.06*font+sp_2)/10; + Movetojs(73,[x1,y],font); + x1=x1+(0.76*font+sp_3)/10; + Movetojs(74,[x1,y],font); +); +////%Setplaybuttons end//// + ////%Mkketcindyjs start//// 190115 Mkketcindyjs():=Mkketcindyjs(KETJSOP); //190129 Mkketcindyjs(options):=( //17.11.18 //help:Mkketcindyjs(); //help:Mkketcindyjs(options=["Local=(y)","Scale=(1)","Nolabel=[]","Color=","Grid="]); -//help:Mkketcindyjs(optionsadd=["Web=(y)","Path=Dircdy","Ignore=","Equal="]); +//help:Mkketcindyjs(optionsadd=["Web=(y)","Path=Dircdy","Ignore=","Remove=(list)"]); +//help:Mkketcindyjs(optionsadd2=["Equal=","Axes=","Figure=(n)"]); regional(webflg,localflg,htm,htmorg,from,upto,flg,fL,fun,jj,tmp,tmp1,tmp2,tmp3, libnameL,libL,lib,jc,nn,name,partL,toppart,lastpart,path,ketflg,flg,cmdL,scale, - nolabel,color,grid,out,Out,igno,onlyflg,rmptL,colorrgb,ptname,eqflg,eqrep); + nolabel,color,grid,axes,out,Out,igno,onlyflg,rmptL,colorrgb,ptname,eqflg,eqrep, + figure,dpi,margin,defaultbuttonsize,defaulteditsize); libnameL=["basic1","basic2","basic3","3d"]; //190416,190428 webflg="Y"; //190128 texflg removed localflg="Y"; //190209,0215 @@ -3611,7 +3790,13 @@ Mkketcindyjs(options):=( //17.11.18 nolabel=["SW","NE"]; //190129 color="lightgray"; //190503 eqflg=0; //190603 + figure=0; + dpi=86.4; // 12px/10pt = 12px/(10/72)in = 86.4dpi + margin=5; // mm + defaultbuttonsize=12; // px + defaulteditsize=12; // px grid=""; + axes=""; path=Dircdy; igno=[]; rmptL=REMOVEPTJS; @@ -3658,6 +3843,12 @@ Mkketcindyjs(options):=( //17.11.18 grid=tmp2; ); ); + if(tmp1=="A", + if(length(tmp2)>0, + tmp2=Toupper(substring(tmp2,0,1)); //190729[2lines] + if(contains(["N","F"],tmp2),axes="false"); + ); + ); if(tmp1=="E", //190603from eqflg=1; if(length(tmp2)>0, @@ -3684,6 +3875,11 @@ Mkketcindyjs(options):=( //17.11.18 rmptL=concat(rmptL,tmp2); ); //190503to ); //190503to + if(tmp1=="F", + if(length(tmp2)>0, + if(Toupper(substring(tmp2,0,1))=="Y",figure=1,figure=0); + ); + ); ); if(substring(color,0,1)=="[", tmp=parse(color); @@ -3911,12 +4107,25 @@ Mkketcindyjs(options):=( //17.11.18 ); ); ); + Ketcindyjsdata(["Ketcindyjsfigure",figure,"Ketcindyjsscale",scale]);//190801from[moved] + forall(KetcindyjsDataList, + println(SCEOUTPUT,#+";"); + ); //190801to[moved] tmp=select(partL,#_1=="csinit"); if(length(tmp)>0, tmp=tmp_1; - from=tmp_2+5; //190206 + from=tmp_2; //190905from + flg=0; + forall(1..6, + if(flg==0, + if(indexof(htmorg_from,"ketcindy.ini")>0, + flg=1; + ); + from=from+1; + ); + );//190905to upto=tmp_3; - tmp1=htmorg_((from+1)..(upto-1)); //190119 + tmp1=htmorg_((from)..(upto-1)); //190905 ketflg="off"; //190206from onlyflg="off"; //190502 forall(tmp1, @@ -3945,9 +4154,6 @@ Mkketcindyjs(options):=( //17.11.18 ); ); ); - forall(KetcindyjsDataList, //190422from - println(SCEOUTPUT,#+";"); - ); //190422to println(SCEOUTPUT,"</script>"); tmp=select(partL,#_1=="csdraw"); tmp=tmp_1; @@ -4001,6 +4207,8 @@ Mkketcindyjs(options):=( //17.11.18 nn=Indexall(tmp,Dq); tmp=substring(tmp,nn_1,nn_2-1); if(!contains(tmp2,tmp), + tmp1_jj=Movetojsexe(tmp1_jj); + if(figure>0,tmp1_jj=Resizetextsize(tmp1_jj,defaultbuttonsize,scale)); out=append(out,tmp1_jj); //190129 ); flg=1; @@ -4009,6 +4217,8 @@ Mkketcindyjs(options):=( //17.11.18 if(indexof(tmp1_jj,"Evaluate")>0, tmp=replace(tmp1_jj,Dqq("Evaluate"),Dqq("EditableText")); if(eqflg==1,tmp=replace(tmp,"=",eqrep)); //190604 + tmp=Movetojsexe(tmp); + if(figure>0,tmp=Resizetextsize(tmp,defaulteditsize,scale)); out=append(out,tmp); flg=1; ); @@ -4016,8 +4226,10 @@ Mkketcindyjs(options):=( //17.11.18 if(flg==0, if(indexof(tmp1_jj,"Calculation")>0, tmp=replace(tmp1_jj,Dqq("Calculation"),Dqq("EditableText")); + tmp=Movetojsexe(tmp); if(eqflg==1,tmp=replace(tmp,"=",eqrep)); //190604 - out=append(out,tmp); + if(figure>0,tmp=Resizetextsize(tmp,defaulteditsize,scale)); + out=append(out,tmp); flg=1; ); ); @@ -4100,6 +4312,7 @@ Mkketcindyjs(options):=( //17.11.18 if(substring(tmp1,length(tmp1)-1,length(tmp1))==",", //190201from out_(tmp-1)=substring(tmp1,0,length(tmp1)-1); ); //190201to + if(figure==0, tmp=select(1..(length(out)),indexof(out_#,"width:")>0); jj=tmp_1; tmp1=out_jj; @@ -4110,7 +4323,7 @@ Mkketcindyjs(options):=( //17.11.18 if(tmp==":", tmp2=substring(tmp1,#+1,length(tmp1)-1); flg=1; - ); + );d ); ); tmp=round(scale*parse(tmp2)); @@ -4130,6 +4343,21 @@ Mkketcindyjs(options):=( //17.11.18 ); tmp=round(scale*parse(tmp2)); out_jj=" height: "+text(tmp)+","; + ); + if(figure>0, + tmp=select(1..(length(out)),indexof(out_#,"width:")>0); + jj=tmp_1; + tmp=round(dpi*scale*(XMAX-XMIN+margin/10*2)*10/25.4); + out_jj=" width: "+text(tmp)+","; + tmp=select(1..(length(out)),indexof(out_#,"height:")>0); + jj=tmp_1; + tmp=round(dpi*scale*(YMAX-YMIN+margin/10*2)*10/25.4); + out_jj=" height: "+text(tmp)+","; + tmp=select(1..(length(out)),indexof(out_#,"transform:")>0); + jj=tmp_1; + tmp=" transform: [{visibleRect: ["+text(XMIN-margin/10)+","+text(YMAX+margin/10); + out_jj=tmp+","+text(XMAX+margin/10)+","+text(YMIN-margin/10)+"]}],"; + ); if(length(color)>0, tmp=select(1..(length(out)),indexof(out_#,"background: ")>0); jj=tmp_1; @@ -4146,9 +4374,71 @@ Mkketcindyjs(options):=( //17.11.18 ); out_jj=tmp1; ); - forall(out, - println(SCEOUTPUT,#); - ); //190129to + if(length(axes)>0, + tmp=select(1..(length(out)),indexof(out_#,"axes:")>0); + if(length(tmp)>0, + jj=tmp_1; + tmp1=" axes: "+axes; + if(indexof(out_jj,",")>0, + tmp1=tmp1+","; + ); + out_jj=tmp1; + ); + ); + forall(out,tmp1, //190910from + if(indexof(tmp1,"</body>")==0, + println(SCEOUTPUT,tmp1); + if(indexof(tmp1,"<body>")>0, + forall(JSBODY_1, + tmp2=replace(#,"_;"," "); + tmp2=Removespace(tmp2); + tmp=indexof(tmp2,">"); + tmp3=substring(tmp2,1,tmp-1); + if(indexof(tmp3,"p")>0, + tmp2=substring(tmp2,tmp,length(tmp2)); + ); + tmp3=Strsplit(tmp3,","); + forall(reverse(1..(length(tmp3))),nn, + tmp=tmp3_nn; + if(substring(tmp,0,1)=="f", + tmp="<font size="+Dqq(substring(tmp,1,length(tmp)))+">"; + tmp2=tmp+tmp2+"</font>"; + ); + if(substring(tmp,0,1)=="p", + tmp2="<p>"+tmp2+"</p>"; + ); + ); + tmp2=replace(tmp2,"''",Dq); + tmp2=" "+replace(tmp2,"`","'"); + println(SCEOUTPUT,tmp2); + ); + ); + , + forall(JSBODY_2, + tmp2=replace(#,"_;"," "); + tmp2=Removespace(tmp2); + tmp=indexof(tmp2,">"); + tmp3=substring(tmp2,1,tmp-1); + if(indexof(tmp3,"p")>0, + tmp2=substring(tmp2,tmp,length(tmp2)); + ); + tmp3=Strsplit(tmp3,","); + forall(reverse(1..(length(tmp3))),nn, + tmp=tmp3_nn; + if(substring(tmp,0,1)=="f", + tmp="<font size="+Dqq(substring(tmp,1,length(tmp)))+">"; + tmp2=tmp+tmp2+"</font>"; + ); + if(substring(tmp,0,1)=="p", + tmp2="<p>"+tmp2+"</p>"; + ); + ); + tmp2=replace(tmp2,"''",Dq); + tmp2=" "+replace(tmp2,"`","'"); + println(SCEOUTPUT,tmp2); + ); + ); + ); //190910to closefile(SCEOUTPUT); setdirectory(Dirwork); if(webflg=="Y",tmp="json",tmp="jsoff"); diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutlogr.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutlogr.txt index ddfac03553f..738591b8afd 100644 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutlogr.txt +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutlogr.txt @@ -1,3 +1,7 @@ +// 20190821 +// CalcbyR changed ( pre->dig, 6->8) +// 20190818 +// Readcsv changed (Head=y as default, old def removed) // 20190424 // PlotdiscR changed ( "-" added to Listplot ) // Mxfun debugged (options) diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutr.cs b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutr.cs index 7de07986f3f..7e4a4e5ba86 100644 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutr.cs +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutr.cs @@ -14,7 +14,7 @@ // along with this program. If not, see <http://www.gnu.org/licenses/> // -println("ketcindylibout[20190424] loaded"); +println("ketcindylibout[20190821] loaded"); //help:start(); @@ -679,7 +679,7 @@ MkprecommandR():=MkprecommandR(6,"PVOFG"); //180508(9lines) MkprecommandR(Arg):=( regional(out,tmp1); if(isstring(Arg), - MkprecommandR(6,Arg); + MkprecommandR(8,Arg); //190921 , if(islist(Arg), out=[]; @@ -693,14 +693,14 @@ MkprecommandR(Arg):=( ); ); ); -MkprecommandR(prec,chstr):=( +MkprecommandR(dig,chstr):=( //190921 pre->dig 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]), - tmp=textformat(re(Lcrd(#)),prec); + tmp=textformat(re(Lcrd(#)),dig); tmp=RSform(tmp); tmp1=#.name; tmp1=tmp1+"="+tmp+";Assignadd('"+tmp1+"',"+tmp1+")"; @@ -726,11 +726,11 @@ MkprecommandR(prec,chstr):=( if(islist(tmp1), tmp2="["; forall(tmp1, - tmp2=tmp2+textformat(#,prec)+","; + tmp2=tmp2+textformat(#,dig)+","; ); tmp1=substring(tmp2,0,length(tmp2)-1)+"]"; , - tmp1=format(tmp1,prec); + tmp1=format(tmp1,dig); ); ); tmp1=RSform(tmp1); @@ -772,7 +772,7 @@ CalcbyR(name,Arg1,Arg2):=( ); CalcbyR(name,path,cmd,optionorg):=( //help:CalcbyR(name,cmd); -//help:CalcbyR(options=["m/r","Wait=2","Out=y/n","Pre=PVFG"]); +//help:CalcbyR(options=["m/r","Wait=2","Out=y/n","Dig=8","Pre=PVFG"]); //help:CalcbyR(options2=["Pre=!G" ]); regional(options,tmp,tmp1,tmp2,tmp3,realL,strL,eqL, cat,dig,prestr,flg,wflg,file,nc,arg,cmdR,cmdlist,wfile,waiting); @@ -781,7 +781,7 @@ CalcbyR(name,path,cmd,optionorg):=( eqL=tmp_5; realL=tmp_6; strL=tmp_7; - dig=5; + dig=8; //190921 tmp=cmd_(length(cmd)-1); //181130from if(!isstring(tmp),tmp=text(tmp)); //190109 if(indexof(tmp,"=")+indexof(tmp,"::")>0, @@ -866,7 +866,7 @@ CalcbyR(name,path,cmd,optionorg):=( file=Cindyname(); );//180412to cmdR=[]; - cmdR=MkprecommandR(6,prestr); + cmdR=MkprecommandR(dig,prestr); //190921 cmdR=concat(cmdR,cmd); //18.01.27to cmdlist=[]; if(dig>5, //16.10.28from @@ -1148,143 +1148,6 @@ Rfun(name,fun,argL,optionorg):=( ////%Rfun end//// ////%Readcsv start//// -Readcsv(file):=Readcsv(Dirwork,file,[]); -Readcsv(Arg1,Arg2):=( - if(isstring(Arg2), - Readcsv(Arg1,Arg2,[]); - , - Readcsv(Dirwork,Arg1,Arg2); - ); -); -Readcsv(pathorg,file,optionorg):=( -// help:Readcsv("ex.csv"); -// help:Readcsv(directory,"ex.csv"); -// help:Readcsv(options=["Head=yes","Sep=-999","Flat=no","Use=R"]); - regional(path,fname,fout,options,eqL,header,cmdL,sep, - dt,nrow,tmp,tmp1,tmp2,csv,use,flat); - options=optionorg; - tmp=divoptions(options); - eqL=tmp_5; - header=1; - sep="-999"; - csv="Y"; // 16.12.12 - use="R"; - flat="N"; - forall(eqL, - tmp=indexof(#,"="); - tmp1=substring(#,0,tmp-1); - tmp2=substring(#,tmp,length(#)); - tmp=Toupper(substring(tmp1,0,1)); //181111 - if(tmp=="H", - tmp=Toupper(substring(tmp2,0,1)); - if(tmp=="F" % tmp=="N", - header=0; - options=remove(options,[#]); - ); - ); - if(tmp=="S", - sep=tmp2; - options=remove(options,[#]); - ); - if(tmp=="C", - csv=Toupper(substring(tmp2,0,1)); - options=remove(options,[#]); - ); - if(tmp=="U", - use=Toupper(substring(tmp2,0,1)); - options=remove(options,[#]); - ); - if(tmp=="F", - flat=Toupper(substring(tmp2,0,1)); - options=remove(options,[#]); - ); - ); - if(flat=="Y",csv="N"); - sep=","+sep; - tmp=indexof(file,"."); - if(tmp==0, - fname=file+".csv"; - fout=file+"sep.csv"; - , - fname=file; - tmp1=substring(file,0,tmp-1); - tmp2=substring(file,tmp-1,length(file)); - fout=tmp1+"sep"+tmp2; - ); - path=pathorg; - if(!isexists(path,fname), - println(path+" "+fname+" not found"); - , - path=replace(path,"\","/"); - if(use=="S", - cmdL=[ // 16.12.20from - "cd('"+path+"')",[], - "Dt=mgetl('"+fname+"');",[], - "cd('"+Dirwork+"')",[], - "Dt2=[]",[], - "for I=1:size(Dt,1), - Tmp=Dt(I,:)+'"+sep+"'; - Dt2=[Dt2;Tmp]; - end",[], - "mputl(Dt2,'"+fout+"')",[] - ]; - CalcbyS("sep",cmdL,options); - , - cmdL=[ - "setwd",[Dq+path+Dq], - "tmp1=readLines",[Dq+fname+Dq,"warn=FALSE"], - "fun=function(s) paste(s,"+Dq+sep+Dq+",sep="+Dq+Dq+")",[], - "tmp2=sapply(tmp1,fun)",[], - "writeLines",["tmp2",Dq+fout+Dq] - ]; - CalcbyR("sep",cmdL,concat(options,["Cat=n"])); - ); // 16.12.20until - if(ErrFlag==1, - println("Readcsv not completed"); - , - dt=load(fout); - dt=tokenize(dt,sep); - dt=dt_(1..(length(dt)-1));//16.12.20 - if(isstring(dt_1),// 17.02.10from - if(indexof(dt_1,",")==0,csv="N"); - , - csv="N"; - );// 17.02.10until - if(csv=="Y", - dt=apply(dt,tokenize(#,",")); - , - dt=apply(dt,[#]); - ); - forall(1..(length(dt)),nrow, - tmp1=dt_nrow; - tmp2=[]; - forall(tmp1, - if(!isstring(#), - tmp=#; - , - if(substring(#,0,1)==Dq, - tmp=parse(#); - , - tmp=#; - ); - ); - tmp2=append(tmp2,tmp); - ); - dt_nrow=tmp2; - ); - if(header==0,dt=dt_(2..(length(dt)))); - if(length(dt)==1, - dt=dt_1 - , - if(length(dt_1)==1, - dt=apply(dt,#_1); - ); - ); - dt; - ); - ); -); -// New readcsv [181125] Readcsv(file):=Readcsv(Dirwork,file); Readcsv(Arg1,Arg2):=( //190301from if(islist(Arg2), @@ -1300,16 +1163,17 @@ Readcsv(path,file,options):=( regional(dt,eqL,head,from,end,tmp); tmp=Divoptions(options); eqL=tmp_5; - head="n"; from=1; //190125from + head="Y"; from=1; //190125from,190818 + from=2; forall(eqL, tmp=Strsplit(#,"="); if(Toupper(substring(tmp_1,0,1))=="H", - head=substring(tmp_2,0,1); + head=Toupper(substring(tmp_2,0,1));//190818 ); ); - if(Toupper(head)=="Y", - from=2; - ); //190125to + if(head=="N",//190818from + from=1; + ); //190125,190818to tmp=file; if(indexof(tmp,".csv")==0,tmp=tmp+".csv"); //190301 dt=readfile2str(path,tmp); @@ -1968,7 +1832,7 @@ Scatterplot(nm,file,optionorg,optionsreg):=( , tmp=file; ); - parse("rc"+nm+"="+tmp+";"); //181013to //190415 + parse("rc"+nm+"="+Textformat(tmp,5)+";"); //181013to //190415 Pointdata(name,parse("rc"+nm),options); tmp=parse("rc"+nm); dtx=apply(tmp,#_1); diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketpiccurrent.r b/Master/texmf-dist/scripts/ketcindy/ketlib/ketpiccurrent.r index be7bba6346f..76998cc41d6 100755 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketpiccurrent.r +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketpiccurrent.r @@ -16,10 +16,14 @@ ######################################### -ThisVersion<- "KeTpic for R v5_2_4(20190511)" +ThisVersion<- "KeTpic for R v5_2_4(20190921)" print(ThisVersion) +# 20190921 +# Enclosing2 debugged/changed (epspara removed) +# 20190627 +# Plotdata, Paramplot debugged (Exc) # 20190511 # Implicitplot changed (Eps=> 10^(-6)) # 20190508 @@ -5411,10 +5415,14 @@ Paramplot<- function(...) } } } + Tmp<- Nrow(P) #190627from + Tmp1<- Op(1,P) + if(Tmp1[1]==Inf){ + P<- P[2:Tmp,] + } #190627to Tmp<- Nrow(P) Tmp1<- Op(Tmp,P) - if(Tmp1[1]==Inf) - { + if(Tmp1[1]==Inf){ P<- P[1:(Tmp-1),] } return(P) @@ -5611,10 +5619,14 @@ Plotdata<- function(...) } } } + Tmp<- Nrow(P) #190627from + Tmp1<- P[1,] + if(Tmp1[1]==Inf){ + P<- P[2:Tmp,] + } #190627to Tmp<- Nrow(P) - Tmp1<-P[Tmp,] - if(Tmp1[1]==Inf) - { + Tmp1<- P[Tmp,] + if(Tmp1[1]==Inf){ P<- P[1:(Tmp-1),] } return(P) @@ -13009,7 +13021,6 @@ Enclosing2<- function(...){ Nargs=length(varargin) plist=varargin[[1]] Eps0=10^(-5) - epspara=1; #180707 Eps1=0.01 Eps2=0.1 Start=c() @@ -13019,9 +13030,8 @@ Enclosing2<- function(...){ if(length(tmp)>1){ Start=tmp }else{ - if(flg==0){epspara=tmp} - if(flg==1){Eps1=tmp} - if(flg==2){Eps2=tmp} + if(flg==0){Eps1=tmp} + if(flg==1){Eps2=tmp} flg=flg+1 } } @@ -13105,19 +13115,8 @@ Enclosing2<- function(...){ t2=Length(Fdata) ss=1 #18.02.02to }else{ -# KL=Quicksort(KL,2); #180706from -# for(j in Looprange(1,length(KL))){ -# tmp1=t1+epspara/50*Length(Fdata)#180713(2lines) -# tmp2=Op(2,KL[[j]]) -# if((tmp2>tmp1)||((tmp2>t1)&&(Norm(Op(3,KL[[j]])-p1)>Eps1))){ -# break -# } #180711,16 -# } -# t2=Op(2,KL[[j]]) -# p2=Pointoncurve(t2,Fdata)#180713 -# ss=Op(3,KL[[j]])# 180706to - tmp=c() #180711from - for(j in Looprange(1,length(KL))){ + tmp=c(Op(2,KL[[1]])) #180711from #190921 + for(j in Looprange(2,length(KL))){ tmp=c(tmp,Op(2,KL[[j]])) } tmp1=order(tmp) @@ -13125,7 +13124,7 @@ Enclosing2<- function(...){ KL=list() for(j in tmp1){ tmp=tmp2[[j]] - tmp3=t1+epspara/50*Length(Fdata) + tmp3=t1+Eps0 tmp4=Op(2,tmp) if((tmp4>tmp3)||((tmp4>t1)&&(Norm(Op(1,tmp)-p1)>Eps1))){ KL=c(KL,list(tmp)) diff --git a/Master/texmf-dist/scripts/ketcindy/template4ketcindyjs.cdy b/Master/texmf-dist/scripts/ketcindy/template4ketcindyjs.cdy Binary files differindex eb7ee2d1c41..c11df4d48a6 100644 --- a/Master/texmf-dist/scripts/ketcindy/template4ketcindyjs.cdy +++ b/Master/texmf-dist/scripts/ketcindy/template4ketcindyjs.cdy |