diff options
author | Karl Berry <karl@freefriends.org> | 2018-12-25 21:49:04 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-12-25 21:49:04 +0000 |
commit | 149bc3fbc5c7aac22d6f6439c5af590420f2b82d (patch) | |
tree | a7835e48b0e16a3a57e6078a85b81665ee404401 /Master/texmf-dist/scripts/ketcindy | |
parent | 9ddb2c44860e61a962778bcb5294315c3722db6b (diff) |
ketcindy (25dec18)
git-svn-id: svn://tug.org/texlive/trunk@49502 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/ketcindy')
14 files changed, 1110 insertions, 320 deletions
diff --git a/Master/texmf-dist/scripts/ketcindy/ketjava/KetCindyPlugin.jar b/Master/texmf-dist/scripts/ketcindy/ketjava/KetCindyPlugin.jar Binary files differindex da263da5cfb..b985d61540f 100644 --- a/Master/texmf-dist/scripts/ketcindy/ketjava/KetCindyPlugin.jar +++ b/Master/texmf-dist/scripts/ketcindy/ketjava/KetCindyPlugin.jar diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dlogr.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dlogr.txt index d793d2fb12d..9b60514ba5d 100644 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dlogr.txt +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dlogr.txt @@ -1,3 +1,7 @@ +// 20181218 +// Letter3d,Expr3d added +// 20181212 +// Vertexedgeface debugged ( Vname changed for multi 3d ) // 20181108 // Mkpointlist debugged (theta=90) // 20181107 diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dr.cs b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylib3dr.cs index dabd701c181..7f378e9cd87 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(20181108) loaded"); +println("ketcindylib3d(20181218) loaded"); //help:start(); @@ -2104,7 +2104,7 @@ Putpoint3d(Arg1,Arg2,Arg3):=( ////%Fixpoint3d start//// Fixpoint3d(ptlist):=( -// help:Fixpoint3d(["O",[0,0,0],"X",[1,0,0]]); +// help:Fixpoint3d(["O",[0,0,0],"X",[1,0,0]]); regional(name,pt3,pt2,tmp,tmp1,tmp2); forall(1..(length(ptlist)/2), name=ptlist_(2*#-1); @@ -2123,6 +2123,54 @@ Fixpoint3d(ptlist):=( ); ////%Fixpoint3d end//// +////%Letter3d start//// +Letter3d(dtlist):=Letter3d(dtlist,[]); //181218from +Letter3d(pt3d,dir,name):=Letter3d([pt3d,dir,name],[]); +Letter3d(pt3d,dir,name,options):=Letter3d([pt3d,dir,name],options); +Letter3d(dtlist,options):=( +//help:Letter3d(point3d,,direction,name); +//help:Letter3d([point3d,,direction,name],options]); + regional(dt,nall,jj); + dt=dtlist; + if(mod(length(dt),3)!=0, + println(" Improper data"); + , + nall=length(dt)/3; + forall(1..nall, + jj=#*3-2; + tmp=dt_jj; + if(ispoint(tmp),tmp=parse(text(tmp)+"3d")); + dt_jj=Parapt(tmp); + ); + Letter(dt,options); + ); +); //181218to +////%Letter3d end//// + +////%Expr3d start//// +Expr3d(dtlist):=Expr3d(dtlist,[]); //181218from +Expr3d(pt3d,dir,name):=Expr3d([pt3d,dir,name],[]); //181218from +Expr3d(pt3d,dir,name,options):=Expr3d([pt3d,dir,name],options); +Expr3d(dtlist,options):=( +//help:Expr3d(point3d,,direction,name); +//help:Expr3d([point3d,,direction,name],options]); + regional(dt,nall,jj); + dt=dtlist; + if(mod(length(dt),3)!=0, + println(" Improper data"); + , + nall=length(dt)/3; + forall(1..nall, + jj=#*3-2; + tmp=dt_jj; + if(ispoint(tmp),tmp=parse(text(tmp)+"3d")); + dt_jj=Parapt(tmp); + ); + Expr(dt,options); + ); +); //181218to +////%Expr3d end//// + ////%Perppt start//// Perppt(name,ptstr,pLstr):=Putperp(name,ptstr,pLstr,"draw"); Perppt(name,ptstr,pLstr,option):=Putperp(name,ptstr,pLstr,option); @@ -2870,7 +2918,7 @@ VertexEdgeFace(nm,vfnLorg,optionorg):=( tmp=parse(text(vtx)+"3d"); vname=text(vtx); , - vname="V"+text(#); //181107 + vname="V"+nm+text(#); //181212 if(vtxflg==1, //180905 if(fixflg==1, Putpoint3d([vname,vtx],"fix"); diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1logr.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1logr.txt index 6f0e1a2326e..813140039fd 100644 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1logr.txt +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1logr.txt @@ -1,3 +1,22 @@ +// 20181217 +// Drwxy debugged +// 20181216 +// Ketinit changed (AXSTYLE changed) +// 20181215 +// Ketinit changed (AXSTYLE added) +// Setarrow debugged +// 20181214 +// Acos, Asin, Atan, Sqr added +// Setarrow added +// Arrowhead changed (options) +// 20181212 +// Colorrgb2cmyk debugged +// Colorcode changed ( some have been deleted) +// Colorname2rgb added +// Divoptions changed (color name) +// Ketinit changed (Fillstore added) +/ 20181209 +// Fillstore changed ( The color of ketcindy buttons fixed) // 20181125 // Fillstore,Fillblack,Fillrestore added // 2018111 diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1r.cs b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1r.cs index be7bd1adedf..a3376741a8d 100644 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1r.cs +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1r.cs @@ -14,7 +14,7 @@ // along with this program. If not, see <http://www.gnu.org/licenses/> // -println("KeTCindy V.3.2.3(20181201)"); +println("KeTCindy V.3.2.3(20181216)"); println(ketjavaversion()); println("ketcindylibbasic1(20181125) loaded"); @@ -66,7 +66,7 @@ Ketinit(work,sy,rangex,rangey):=(//181001to TenSizeInit=0.02; TenSize=TenSizeInit; YaSize=1; YaAngle=18; YaPosition=1; - YaThick=1; YaStyle="tf"; + YaCut=0; YasenStyle="dr,1"; Yajiristyle="tf"; KETPICCOUNT=1; KCOLOR=[0,0,0]; GLIST=[]; @@ -82,6 +82,8 @@ Ketinit(work,sy,rangex,rangey):=(//181001to COM2ndlist=[]; COM2ndlistb=[]; //180612 ADDAXES="1"; + AXSTYLE=["l","x","e","y","n","O","sw","","",""]; //181216 + AXCOUNT=1; //181215 LFmark=unicode("000a"); CRmark=unicode("000d");//16.12.13 Dq=unicode("0022"); @@ -91,6 +93,7 @@ Ketinit(work,sy,rangex,rangey):=(//181001to OutComList=[]; OutFileLIst=[]; // 15.10.22 FigPdfList=[]; // 16.04.08 + Fillstore(); //181212 ADDPACK=[]; // 16.05.16 GPACK="tpic"; //180817 ErrFlag=0; @@ -167,11 +170,6 @@ Ketinit(work,sy,rangex,rangey):=(//181001to letterc,mboxc,mboxc,mboxc,62,2,letterc]; SlideMargin=[0,0]; //180908 ThinDense=0.1;//17.01.08 - if(indexof(PathS,"-5.")>0,//17.12.03from - LibnameS=Dirlib+pathsep()+"ketpicsciL5"; - , - LibnameS=Dirlib+pathsep()+"ketpicscifiles6"; - ); if(indexof(PathT,"pdflatex")+indexof(PathT,"lualatex")>0, LibnameS=replace(LibnameS,"ketpic","ketpic2e"); );//17.12.03until @@ -180,10 +178,34 @@ Ketinit(work,sy,rangex,rangey):=(//181001to ////%Fillstore start//// Fillstore():=( - regional(tmp,tmp1,out); + regional(tmp,tmp1,out,dtL,txtL,clrL,txt,clr,nn,jj); + dtL=[ //181209from + ["Figure",[1,0.29,0.29]],["Parent",[1,1,0]], + ["ParaF",[0,1,1]],["Flip",[0,0,1]],["Anime",[0.51,0.95,1]], + ["Title",[0,1,0]],["Slide",[0.47,0,0.72]],["Digest",[1,0.74,0.47]], + ["KeTJS",[0,1,1]],["KeTJSoff",[0,1,1]], + ["Objview",[0,1,0]] + ]; + txtL=apply(dtL,#_1); + clrL=apply(dtL,#_2); tmp1=allelements(); tmp1=select(tmp1,indexof(#.name,"Text")>0); - out=apply(tmp1,[#.name,#.fillcolor]); + out=[]; + forall(1..(length(tmp1)),nn, + tmp=tmp1_nn; + txt=tmp.text; + tmp=select(1..(length(txtL)),txtL_#==txt); + if(length(tmp)>0, + jj=tmp_1; + clr=clrL_jj; + tmp=tmp1_nn; + tmp.fillcolor=clr; + , + tmp=tmp1_nn; + clr=tmp.fillcolor; + ); + out=append(out,[tmp.name,clr,tmp.text]); + ); //181209to out; ); ////%Fillstore end//// @@ -192,9 +214,7 @@ Fillstore():=( Fillblack():=Fillblack("Running"); Fillblack(str):=( regional(tmp,tmp1,store); - tmp1=allelements(); - tmp1=select(tmp1,indexof(#.name,"Text")>0); - store=apply(tmp1,[#.name,#.fillcolor,#.text]); + store=Fillstore(); //181209 tmp=select(tmp1,#.name=="Text0"); if(length(tmp)==0, forall(store, @@ -474,6 +494,34 @@ Sep1000(va):=( //17.07.18 ); ////%Sep1000 end//// +////%Acos start//// +Acos(x):=( +//help:Acos(1.000001); + re(arccos(x)); +); +////%Acos end//// + +////%Asin start//// +Asin(x):=( +//help:Asin(1.000001); + re(arcsin(x)); +); +////%Asin end//// + +////%Atan start//// +Atan(x):=( +//help:Atan(1); + re(arctan(x)); +); +////%Atan end//// + +////%Sqr start//// +Sqr(x):=( +//help:Sqr(-0.00001); + if(x<0,0,sqrt(x)); +); +////%Sqr end//// + ////%Factorial start//// Factorial(n):=( //help:Factorial(5); @@ -1225,14 +1273,7 @@ Divoptions(options):=( tmp1=colorCmyk2Rgb(tmp1); ); , - if(tmp2=="red",tmp1=[1,0,0];color=tmp1); - if(tmp2=="green",tmp1=[0,1,0];color=tmp1); - if(tmp2=="blue",tmp1=[0,0,1];color=tmp1); - if(tmp2=="black",tmp1=[0,0,0];color=tmp1); - if(tmp2=="white",tmp1=[1,1,1];color=tmp1); - if(tmp2=="cyan",tmp1=[0,1,1];color=tmp1); - if(tmp2=="magenta",tmp1=[1,0,1];color=tmp1); - if(tmp2=="yellow",tmp1=[1,1,0];color=tmp1); + tmp1=Colorname2rgb(tmp2); color=tmp1; //181212 ); tmp="color->"+text(tmp1); opcindy=opcindy+","+tmp; @@ -3042,8 +3083,12 @@ ColorRgb2Cmyk(clr):=( regional(clrnew,tmp,black); tmp=apply(clr,1-#); black=min(tmp); - tmp=apply(clr,(1-#-black)/(1-black)); - clrnew=append(tmp,black); + if(black!=1, //181112from + tmp=apply(clr,(1-#-black)/(1-black)); + clrnew=append(tmp,black); + , + clrnew=[0,0,0,1]; + ); //181112to clrnew; ); ////%ColorRgb2Cmyk end//// @@ -3178,7 +3223,7 @@ Colorhslrgb(hsl):=( ); ////%Colorhslrgb end//// -////%hue2rgb start//// +////%Colorhue2rgb start//// hue2rgb(vv1,vv2,vh):=( regional(out); if ( vh < 0.0 ,vh =vh+1); @@ -3198,7 +3243,7 @@ hue2rgb(vv1,vv2,vh):=( ); out; ); -////%hue2rgb end//// +////%Colorhue2rgb end//// ////%Colorrgbhwb start//// Colorrgbhwb(sL):=( @@ -3239,160 +3284,74 @@ Colorhwbrgb(sLorg):=( ); ////%Colorhwbrgb end//// -////%Colorhslhsv start//// -Colorhslhsv(sL):=( - regional(dl1,dl2,dl3,dL); - dl1=sL_1; - if(sL_3 == 0, - // no need to do calc on black - // also avoids divide by 0 error - dL= [0, 0, 0]; - , - sL_3 = sL_3 * 2; - if(sL_3 <= 1,sL_2 = sL_2 * sL_3,sL_2 = sL_2 * (2 - sL_3)); - dl3 = (sL_3 + sL_2) / 2; - dl2 = (2 * sL_2) / (sL_3 + sL_2); - dL = [dl1, dl2, dl3]; - ); - dL; -); -////%Colorhslhsv end//// - ////%Colorcode start//// -Colorcode(src,dest,sL):=( +Colorcode(src,dest,sL):=( // 181212 some colorchange deleted //help:Colorcode("rgb","cmyk",[1,0.5,0]); regional(tmp,tmp1,tmp2,tmp3,mn,mx,delta,black,dL,flg); regional(dl1,dl2,dl3); + if(src=="rgb" & dest=="cmyk",dL=Colorrgb2cmyk(sL)); + if(src=="cmyk" & dest=="rgb",dL=Colorcmyk2rgb(sL)); if(src=="rgb" & dest=="hsv", dL=Colorrgbhsv(sL)); - if(src=="hsv" & dest=="rgb", dL=Colorhsvrgb(sL)); if(src=="rgb" & dest=="hsl", dL=Colorrgbhsl(sL)); - if(src=="hsl" & dest=="rgb", dL=Colorhslrgb(sL)); if(src=="rgb" & dest=="hwb", dL=Colorrgbhwb(sL)); + if(src=="hsv" & dest=="rgb", dL=Colorhsvrgb(sL)); + if(src=="hsl" & dest=="rgb", dL=Colorhslrgb(sL)); if(src=="hwb" & dest=="rgb", dL=Colorhwbrgb(sL)); - if(src=="hsl" & dest=="hsv", dL=Colorhslhsv(sL)); - if(src=="hsv" & dest=="hsl", - dl1 = sL_1; - dl3 = (2 - sL_2) * sL_3; - dl2 = sL_2 * sL_3; - if(dl3 <= 1,dl2 = dl2/dl3,dl2=dl2/(2 - dl3)); - dl3 =d l3/ 2; - dL = [dl1, dl2 , dl3 ]; - ); - - if(src=="rgb" & dest=="cmyk", - tmp=apply(sL,1-#); - black=min(tmp); - tmp=apply(sL,(1-#-black)/(1-black)); - dL=append(tmp,black); - ); - if(src=="cmyk" & dest=="rgb", - black=sL_4; - tmp=apply(sL,1-min(1,#*(1-black)+black)); - dL=tmp_(1..3); - ); - if(src=="hsv" & dest=="cmyk", - tmp=Colorcode("hsv","rgb",sL); - dL=Colorcode("rgb","cmyk",tmp); - ); - if(src=="cmyk" & dest=="hsv", - tmp=Colorcode("cmyk","rgb",sL); - dL=Colorcode("rgb","hsv",tmp); - ); - - if(src=="hsv" & dest=="hwb", - tmp = Colorcode("hsv","rgb",sL); - dL = Colorcode("rgb","hwb",tmp); - ); - if(src=="hwb" & dest=="hsv", - tmp = Colorcode("hwb","rgb",sL); - dL = Colorcode("rgb","hsv",tmp); - ); - if(src=="hsl" & dest=="hwb", - tmp = Colorcode("hsl","rgb",sL); - dL = Colorcode("rgb","hwb",tmp); - ); - if(src=="hwb" & dest=="hsl", - tmp = Colorcode("hwb","rgb",sL); - dL = Colorcode("rgb","hsl",tmp); - ); - if(src=="hsl" & dest=="cmyk", - tmp = Colorcode("hsl","rgb",sL); - dL = Colorcode("rgb","cmyk",tmp); - ); - if(src=="hwb" & dest=="cmyk", - tmp = Colorcode("hwb","rgb",sL); - dL = Colorcode("rgb","cmyk",tmp); - ); - if(src=="cmyk" & dest=="hsl", - tmp = Colorcode("cmyk","rgb",sL); - dL = Colorcode("rgb","hsl",tmp); - ); - if(src=="cmyk" & dest=="hwb", - tmp = Colorcode("cmyk","rgb",sL); - dL = Colorcode("rgb","hwb",tmp); - ); - if(src=="hsb" & dest=="rgb",dL=Colorcode("hsv","rgb",sL)); - if(src=="rgb" & dest=="hsb",dL=Colorcode("rgb","hsv",sL)); - - if(src=="hsb" & dest=="hsl",dL=Colorcode("hsv","hsl",sL)); - if(src=="hsl" & dest=="hsb",dL=Colorcode("hsl","hsv",sL)); - - if(src=="hsb" & dest=="hwb",dL=Colorcode("hsv","hwb",sL)); - if(src=="hwb" & dest=="hsb",dL=Colorcode("hwb","hsv",sL)); - - if(src=="hsb" & dest=="cmyk",dL=Colorcode("hsv","cmyk",sL)); - if(src=="cmyk" & dest=="hsb",dL=Colorcode("cmyk","hsv",sL)); - dL; ); ////%Colorcode end//// -////%Colorinfile start//// -Colorinfile(filename,clrf,clrt):=( - regional(tmp,tmp1,tmp2,head,cstrL,chstrL,head,body); - if(length(clrf_1)==3, - head="[rgb]{"; - , - head="[cmyk]{"; - ); - tmp=apply(clrf,text(#)); - cstrL=apply(tmp,head+substring(#,1,length(#)-1)+"}"); - if(length(clrt_1)==3, - head="[rgb]{"; +////%Colorname2rgb start//// +Colorname2rgb(name):=( //181212 +//help:Colorname2rgb("sepia"); + regional(dL,nameL,codeL,tmp); + dL=[ + ["greenyellow",[0.15,0,0.69,0]],["yellow",[0,0,1,0]], + ["goldenrod",[0,0.1,0.84,0]],["dandelion",[0,0.29,0.84,0]], + ["apricot",[0,0.32,0.52,0]],["peach",[0,0.5,0.7,0]], + ["melon",[0,0.46,0.5,0]],["yelloworange",[0,0.42,1,0]], + ["orange",[0,0.61,0.87,0]],["burntorange",[0,0.51,1,0]], + ["bittersweet",[0,0.75,1,0.24]],["redorange",[0,0.77,0.87,0]], + ["mahogany",[0,0.85,0.87,0.35]],["maroon",[0,0.87,0.68,0.32]], + ["brickred",[0,0.89,0.94,0.28]],["red",[0,1,1,0]], + ["orangered",[0,1,0.5,0]],["rubinered",[0,1,0.13,0]], + ["wildstrawberry",[0,0.96,0.39,0]],["salmon",[0,0.53,0.38,0]], + ["carnationpink",[0,0.63,0,0]],["magenta",[0,1,0,0]], + ["violetred",[0,0.81,0,0]],["rhodamine",[0,0.82,0,0]], + ["mulberry",[0.34,0.9,0,0.02]],["redviolet",[0.07,0.9,0,0.34]], + ["fuchsia",[0.47,0.91,0,0.08]],["lavender",[0,0.48,0,0]], + ["thistle",[0.12,0.59,0,0]],["orchid",[0.32,0.64,0,0]], + ["darkorchid",[0.4,0.8,0.2,0]],["purple",[0.45,0.86,0,0]], + ["plum",[0.5,1,0,0]],["violet",[0.79,0.88,0,0]], + ["royalpurple",[0.75,0.9,0,0]],["blueviolet",[0.86,0.91,0,0.04]], + ["periwinkle",[0.57,0.55,0,0]], ["cadetblue",[0.62,0.57,0.23,0]], + ["cornflowerblue",[0.65,0.13,0,0]],["midnightblue",[0.98,0.13,0,0.43]], + ["navyblue",[0.94,0.54,0,0]],["royalblue",[1,0.5,0,0]], + ["blue",[1,1,0,0]],["cerulean",[0.94,0.11,0,0]], + ["cyan",[1,0,0,0]],["processblue",[0.96,0,0,0]], + ["skyblue",[0.62,0,0.12,0]],["turquoise",[0.85,0,0.2,0]], + ["tealblue",[0.86,0,0.34,0.02]],["aquamarine",[0.82,0,0.3,0]], + ["bluegreen",[0.85,0,0.33,0]],["emerald",[1,0,0.5,0]], + ["junglegreen",[0.99,0,0.52,0]],["seagreen",[0.69,0,0.5,0]], + ["green",[1,0,1,0]],["forestgreen",[0.91,0,0.88,0.12]], + ["pinegreen",[0.92,0,0.59,0.25]],["limegreen",[0.5,0,1,0]], + ["yellowgreen",[0.44,0,0.74,0]],["springgreen",[0.26,0,0.76,0]], + ["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]], + ["black",[0,0,0,1]],["white",[0,0,0,0]] + ]; + tmp=select(dL,#_1==name); + if(length(tmp)>0, + tmp=tmp_1; + code=tmp_2; + code=Colorcmyk2rgb(code); , - head="[cmyk]{"; - ); - tmp=apply(clrt,text(#)); - chstrL=apply(tmp,head+substring(#,1,length(#)-1)+"}"); - tmp1=load(filename); - tmp=tokenize(tmp1,"{\unitlength"); - head=tokenize(tmp_1,"%%%"); - head=head_(2..(length(head))); - head=apply(head,"%%%"+#); - tmp2=tmp_2; - forall(1..5, - tmp2=replace(tmp2,cstrL_#,chstrL_#); - ); - body=tokenize(tmp2,"%"); - body_1="{\unitlength"+body_1; - body=apply(body,#+"%"); - body=body_(1..(length(body)-1)); - tmp=replace(filename,".tex","new.tex"); - SCEOUT=openfile(tmp); - forall(head, - println(SCEOUT,#); - ); - forall(1..(length(body)), - tmp=body_#; - if(#<length(body), - println(SCEOUT,tmp); - , - print(SCEOUT,tmp) - ); + println(" "+name+" not found"); + code=[0,0,0]; ); - closefile(SCEOUT); ); -////%Colorinfile end//// +////%Colorname2rgb end//// ////%GetLinestyle start//// GetLinestyle(str,name):=( @@ -5279,6 +5238,37 @@ Putintersect(nm,pdata1,pdata2,ptno):=( ); ////%Putintersect end//// +////%Setarrow start//// +Setarrow():=Setarrow([]); +Setarrow(arglist):=( +//help:Setarrow([-1,-1,-1,1,0.3]); +//help:Setarrow([size(1),angle(18),position(1),cut(0),segstyle("dr,1")]); + regional(tmp); + tmp=select(arglist,isreal(#)); + if(length(tmp)==0, + println([YaSize,YaAngle,YaPosition,YaCut,YasenStyle]); + ); + if(length(tmp)>=1, + if((tmp_1>0),YaSize=tmp_1); + ); + if(length(tmp)>=2, + if((tmp_2>0)&(tmp_2<90),YaAngle=tmp_2); + ); + if(length(tmp)>=3, + if((tmp_3>=0)&(tmp_3<=1),YaPosition=tmp_3); + ); + if(length(tmp)>=4, + if((tmp_4>=0)&(tmp_4<1),YaCut=tmp_4); + ); + tmp=select(arglist,isstring(#)); + if(length(tmp)>0, + YasenStyle=tmp_1; + ); + [YaSize,YaAngle,YaPosition,YaCut,YasenStyle]; +); +////%Setarrow start//// + + ////%Arrowheaddata start//// Arrowheaddata(point,direction):=Arrowheaddata(point,direction,[]); Arrowheaddata(point,direction,options):=( @@ -5387,7 +5377,8 @@ Arrowhead(Arg1,Arg2,Arg3):=( ); Arrowhead(nm,point,direction,optionsorg):=(//181018from //help:Arrowhead("1",B,B-A); -//help:Arrowhead(options=[size(1),angle(18),position(1),cut(0),"Coor=P(L)"]); +//help:Arrowhead(options=[size(1),angle(18),position(1),cut(0),"Coord=P(L)"]); +//help:Arrowhead(the default is -1 for numeric option); //help:Arrowhead(A,"gr1"); regional(name,Ltype,Noflg,reL,opstr,opcindy,color,eqL,coord, options,cut,pP,Houkou,ptstr,hostr,tmp,tmp1,tmp2,list); @@ -5410,13 +5401,17 @@ Arrowhead(nm,point,direction,optionsorg):=(//181018from options=remove(options,[#]); ); ); //181018to - cut=0; //181110from - if(length(reL)>3, - cut=reL_4; - tmp=reL_(1..3); - options=remove(options,reL); - options=concat(options,tmp); - ); //181110from + tmp1=[YaSize,YaAngle,YaPosition,YaCut]; //181214from + forall(1..(length(reL)), + if(reL_#<0, reL_#=tmp1_#); + ); + forall((length(reL)+1)..4, + reL=append(reL,tmp1_#); + ); + cut=reL_4; + tmp=reL_(1..3); + options=select(options,!isreal(#)); + options=concat(options,tmp); //181214to if(ispoint(direction),Houkou=direction.xy); //181018 if(isstring(direction),Houkou=parse(direction),Houkou=direction); if(MeasureDepth(Houkou)==2,Houkou=Houkou_1); @@ -5487,10 +5482,14 @@ Arrowdata(nm,ptlist,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); name="ar"+nm; options=optionsorg; + tmp=select(options,isstring(#)); //181214from + tmp1=select(tmp,contains(["dr","da","do","id"],substring(#,0,2))); + if(length(tmp1)==0,options=append(options,YasenStyle)); //181214to tmp=Divoptions(options); Ltype=tmp_1; Noflg=tmp_2; @@ -5500,19 +5499,17 @@ Arrowdata(nm,ptlist,optionsorg):=( color=tmp_(length(tmp)-2); opstr=tmp_(length(tmp)-1); opcindy=tmp_(length(tmp)); - size=1; // 15.06.11 - angle=18; - segpos=1; - cut=0; //181110from + tmp1=[YaSize,YaAngle,YaPosition,YaCut]; //181214from forall(1..(length(reL)), - tmp=reL_#; - if(#==1,size=tmp); - if(#==2,angle=tmp); - if(#==3, - segpos=tmp; - ); - if(#==4,cut=tmp); - ); //181110to + if(reL_#<0, reL_#=tmp1_#); + ); + forall((length(reL)+1)..4, + reL=append(reL,tmp1_#); + ); + size=reL_1; + angle=reL_2; + segpos=reL_3; + cut=reL_4; lineflg=0; if(contains(strL,"l")%contains(strL,"L"), lineflg=1; diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2logr.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2logr.txt index ab1ae5703e7..849afc3c4b7 100644 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2logr.txt +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2logr.txt @@ -1,3 +1,17 @@ +// 20181224 +// WritetoRS changed (Closefile("0")) +// 20181219 +// BBdata debugged (macosx => ismacosx ) +// 20181218 +// Letter, Expr changed (pt,dir,str,options added ) +// 20181216 +// Drwxy changed ( linestyle,colorax,colorla ) +// 20181215 +// Setax, Drwxy, Windispg changed ( Axstyle ) +// 20181214 +// WritetoRS changed ( Definition of Acos,Asin,Atan,Sqr,Factorial,Norm added ) +// 20181213 +// Usegraphics, WritetoRS changed ( tikz added) // 20181125 // Mkslides, Mksldesummary chanded (Fillblack added ) // Presentation changed ( load => readfile2str ) diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2r.cs b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2r.cs index e96e1d36cce..c904a1d0fae 100644 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2r.cs +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic2r.cs @@ -14,7 +14,7 @@ // along with this program. If not, see <http://www.gnu.org/licenses/> // -println("ketcindybasic2(20181125) loaded"); +println("ketcindybasic2(20181224) loaded"); //help:start(); @@ -499,16 +499,6 @@ MakeRarg(arglist):=( ); ////%MakeRarg end//// -////%Setax start//// -Setax(arglist):=( -//help:Setax(["l","x","e","y","n","O","sw"]); -//help:Setax([7,"nw"]); - regional(tmp); - tmp=MakeRarg(arglist); - Com1st("Setax("+tmp+")"); -); -////%Setax end//// - ////%Htickmark start//// Htickmark(arglist):=( //help:Htickmark([1,"1",2,"sw","2"]); @@ -589,22 +579,109 @@ Htick(px,lenorg,options):=( ); ////%Htick end//// +////%Setax start//// +Setax(arglist):=( +//help:Setax(["l","x","e","y","n","O","sw",]); +//help:Setax([7,"nw"]); +//help:Setax([8,linestyle,colorax,colorlabel]); + regional(st,nn,tmp); //181215from + 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); + nn=nn+1; + ); //181215from +// tmp=MakeRarg(arglist); +// Com1st("Setax("+tmp+")"); +); +////%Setax end//// + ////%Drwxy start//// -Drwxy():=Drwxy([]); //180820from -Drwxy(options):=( +Drwxy():=Drwxy([]); +Drwxy(optionsorg):=( //help:Drwxy(); //help:Drwxy(options=["Origin=[0,0]","Xrng=","Yrng=","Ax=l,x,e,..."]); - regional(tmp); - tmp=""; - forall(options, - if(length(tmp)>0, - tmp=tmp+","+Dqq(#); - , - tmp=Dqq(#); + regional(options,color,eqL,strL,org,xrng,yrng,ax,st,nn,size, + linesty,colorax,colorla,tmp,tmp1,tmp2); + options=optionsorg; + tmp=Divoptions(options); + color=tmp_(length(tmp)-2); + eqL=tmp_5; + org=[0,0]; + xrng=[XMIN,XMAX]; + yrng=[YMIN,YMAX]; + ax=AXSTYLE; + linesty=ax_8; + if(isstring(ax_9),colorax=ax_9,colorax=text(ax_9)); + if(length(colorax)>0, + colorax="Color="+colorax; + ); + if(isstring(ax_10),colorla=ax_10,colorla=text(ax_10)); + if(length(colorla)>0, //181217from + colorla="Color="+colorla; + , + if(length(colorax)>0, + colorla=colorax; + ); + ); //181217to + forall(eqL, + tmp=Strsplit(#,"="); + tmp1=Toupper(substring(tmp_1,0,1)); + if(tmp1=="O", + org=parse(tmp_2); + options=remove(options,[#]); + ); + if(tmp1=="X", + xrng=parse(tmp_2); + options=remove(options,[#]); + ); + if(tmp1=="Y", + yrng=parse(tmp_2); + options=remove(options,[#]); + ); + if(tmp1=="A", + tmp2=tokenize(tmp_2,","); + st=1; nn=1; + if(isreal(tmp2_1), + st=2; + nn=tmp2_1; + ); + forall(st..(length(tmp2)), + tmp=tmp2_#; + if(length(tmp)>0,ax_nn=tmp); + nn=nn+1; + ); + options=remove(options,[#]); ); ); - Com2nd("Drwxy("+tmp+")"); //180820to - Addax(0); // 16.01.21 + options=append(options,linesty); //181216 + if(substring(ax_1,0,1)=="a", + strL=select(options,isstring(#)); //181216 + tmp=select(strL,contains(["dr","da","do","id"],substring(#,0,2))); + if(length(tmp)==0,options=append(options,YasenStyle)); + tmp=substring(ax_1,1,length(ax_1)); //181216(2lines) + if(length(tmp)>0,size=parse(tmp),size=YaSize); + tmp1=concat(options,[size,YaAngle,YaPosition,YaCut,colorax]);//181216 + tmp=[[xrng_1,org_2],[xrng_2,org_2]]; + Arrowdata("axx"+text(AXCOUNT),tmp,tmp1); + tmp=[[org_1,yrng_1],[org_1,yrng_2]]; + Arrowdata("axy"+text(AXCOUNT),tmp,tmp1); + , + tmp=[[xrng_1,org_2],[xrng_2,org_2]]; + tmp1=append(options,colorax);//181216 + Listplot("axx"+text(AXCOUNT),tmp,tmp1); + tmp=[[org_1,yrng_1],[org_1,yrng_2]]; + 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]); + // Addax(0); // 16.01.21 ); ////%Drwxy end//// @@ -651,7 +728,7 @@ Drawpoint(ptlistorg,nn):=( ////%Addax start//// Addax(param):=( //help:Addax(0); - ADDAXES=textformat(param,5); + ADDAXES=text(param); ); ////%Addax end//// @@ -676,6 +753,7 @@ Expr(listorg,options):=( //16.10.09 ////%Letter start//// Letter(Pt,Dr,St):=Letter([Pt,Dr,St]); Letter(list):=Letter(list,[]); +Letter(Pt,Dr,St,options):=Letter([Pt,Dr,St],options);//181218 Letter(list,options):=( //help:Letter([C,"c","Graph of $f(x)$"]); //help:Letter([C,"c","xy"],["size->30"]); @@ -812,6 +890,7 @@ Letterrot(pt,dir,tmov,nmov,str,options):=( ////%Exprrot start//// Exprrot(pt,dir,str):=Exprrot(pt,dir,0,0,str,[]); +Expr(pt,dir,str,options):=Expr([pt,dir,str],options);//181218 Exprrot(pt,dir,Arg1,Arg2):=( if(islist(Arg2), Exprrot(pt,dir,"t0n0",Arg1,Arg2); @@ -2649,6 +2728,10 @@ Inwindow(point,xrng,yrng):=( ////%Windispg start//// Windispg():=( regional(Nj,Nk,Dt,Vj,tmp,tmp1,tmp2,opcindy); + if(ADDAXES=="1", //181215from + Drwxy(); +// ADDAXES="0"; + ); //181215to gsave(); layer(KETPIClayer); forall(GCLIST,Nj, @@ -2786,18 +2869,30 @@ WritetoRS(filename,shchoice):=( println(SCEOUTPUT,"setwd('"+tmp1+"')"); );//180409to tmp=replace(Libname,"\","/"); //17.09.24from - println(SCEOUTPUT,"source('"+tmp+".r')");//temporary - if((indexof(PathT,"pdflatex")>0)%(indexof(PathT,"lualatex")>0) - %(GPACK=="pict2e"), // 180817 + println(SCEOUTPUT,"source('"+tmp+".r')"); //181213 + if((indexof(PathT,"pdflatex")>0)%(indexof(PathT,"lualatex")>0), + if(GPACK=="tpic",GPACK="pict2e"); + ); + if(GPACK=="pict2e", // 180817 tmp=replace(tmp+"_rep2e","\","/"); println(SCEOUTPUT,"source('"+tmp+".r')"); ); + if(GPACK=="tikz", //181213from + tmp=replace(tmp+"_reptikz","\","/"); + println(SCEOUTPUT,"source('"+tmp+".r')"); + ); //181213to println(SCEOUTPUT,"Ketinit()"); println(SCEOUTPUT,"cat(ThisVersion,'\n')"); println(SCEOUTPUT,"Fnametex='"+Fnametex+"'"); println(SCEOUTPUT,"FnameR='"+FnameR+"'"); println(SCEOUTPUT,"Fnameout='"+Fnameout+"'"); println(SCEOUTPUT,"arccos=acos; arcsin=asin; arctan=atan"); + println(SCEOUTPUT,"Acos<- function(x){acos(max(-1,min(1,x)))}"); + println(SCEOUTPUT,"Asin<- function(x){asin(max(-1,min(1,x)))}"); + println(SCEOUTPUT,"Atan=atan"); + println(SCEOUTPUT,"Sqr<- function(x){if(x>=0){sqrt(x)}else{0}}"); + println(SCEOUTPUT,"Factorial=factorial"); + println(SCEOUTPUT,"Norm<- function(x){norm(matrix(x,nrow=1),"+Dqq("2")+")}"); println(SCEOUTPUT,""); forall(COM0thlist, if(indexof(#,"Texcom")==0, //17.09.22 @@ -2906,7 +3001,8 @@ WritetoRS(filename,shchoice):=( if(length(GrL)>0, println(SCEOUTPUT," Drwline(GrL)"); ); - println(SCEOUTPUT,"Closefile('"+ADDAXES+"')"); + // println(SCEOUTPUT,"Closefile('"+ADDAXES+"')"); //181224(2line) + println(SCEOUTPUT,"Closefile("+Dqq("0")+")"); println(SCEOUTPUT,""); println(SCEOUTPUT,"}"); if(shchoice=="sh", @@ -3498,9 +3594,13 @@ Addpackage(packorg):=( ////%Usegraphics start//// Usegraphics(gpack):=( //180817 -//help:Usegrapchics("pict2e"); +//help:Usegraphics("pict2e"); if(!contains(ADDPACK,gpack), - Addpackage([gpack]); + if(gpack =="tikz", //181213from + Addpackage(["pgf","tikz"]); + , + Addpackage([gpack]); + ); //181213to ); GPACK=gpack; ); @@ -3521,36 +3621,27 @@ Viewtex():=( );//17.08.13until ); // 16.06.09until println(SCEOUTPUT,tmp); - if((indexof(PathT,"pdflatex")>0)%(indexof(PathT,"lualatex")>0) - %(GPACK=="pict2e"), //16.11.23,12.16,180817 - if(indexof(PathT,"pdflatex")>0, - println(SCEOUTPUT,"\usepackage[pdftex]{pict2e}");//16.11.24 - , - println(SCEOUTPUT,"\usepackage{pict2e}");//16.12.16 - if(indexof(PathT,"lualatex")>0, //180817 - println(SCEOUTPUT,"\usepackage{luatexja}"); - ); - ); - tmp=replace(Dirhead,"\","/"); //17.10.30from - tmp=replace(tmp,"scripts","tex/latex"); - if(isexists(tmp,""), - println(SCEOUTPUT,"\usepackage{ketpic2e,ketlayer2e}"); - , - tmp=replace(Dirhead+"/ketpicstyle","\","/"); - println(SCEOUTPUT,"\usepackage{"+tmp+"/ketpic2e}"); - println(SCEOUTPUT,"\usepackage{"+tmp+"/ketlayer2e}"); - ); - , + if((indexof(PathT,"pdflatex")>0)%(indexof(PathT,"lualatex")>0), //181213from + if(GPACK=="tpic", GPACK="pict2e"); + ); + if(GPACK=="tpic", tmp=replace(Dirhead,"\","/"); - tmp=replace(tmp,"scripts","tex/latex"); - if(isexists(tmp,""), - println(SCEOUTPUT,"\usepackage{ketpic,ketlayer}"); - , - tmp=replace(Dirhead+"/ketpicstyle","\","/"); - println(SCEOUTPUT,"\usepackage{"+tmp+"/ketpic}"); - println(SCEOUTPUT,"\usepackage{"+tmp+"/ketlayer}"); + println(SCEOUTPUT,"\usepackage{ketpic,ketlayer}"); + ); + if(GPACK=="pict2e", + println(SCEOUTPUT,"\usepackage{pict2e}"); + println(SCEOUTPUT,"\usepackage{ketpic2e,ketlayer2e}"); + if(indexof(PathT,"lualatex")>0, + println(SCEOUTPUT,"\usepackage{luatexja}"); + ); + ); + if(GPACK=="tikz", + println(SCEOUTPUT,"\usepackage[pgf,tikz}");//16.11.24 + println(SCEOUTPUT,"\usepackage{ketpic,ketlayer}"); + if(indexof(PathT,"lualatex")>0, + println(SCEOUTPUT,"\usepackage{luatexja}"); ); - );//17.10.30until + );//181213to println(SCEOUTPUT,"\usepackage{amsmath,amssymb}"); println(SCEOUTPUT,"\usepackage{graphicx}"); println(SCEOUTPUT,"\usepackage{color}"); @@ -5448,7 +5539,7 @@ BBdata(fname,optionorg):=( if(iswindows(), kcfile="kc.bat"; , - if(macosx(), + if(ismacosx(), //181219 kcfile="kc.command"; , kcfile="kc.sh"; diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvlogr.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvlogr.txt index 5a8170e32c5..a0a087ca49b 100644 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvlogr.txt +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvlogr.txt @@ -1,3 +1,5 @@ +// 20181224 +// Setpara debugged ( ADDAXES=="1") // 20181128 // Mkviewobj changed (Fillblack added) // 20181125 diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvr.cs b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvr.cs index 2c297051bf2..3e43e80d55e 100755 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvr.cs +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibmvr.cs @@ -14,7 +14,7 @@ // along with this program. If not, see <http://www.gnu.org/licenses/> // -println("ketcindymv(20181125) loaded"); +println("ketcindymv(20181224) loaded"); //help:start(); @@ -56,6 +56,10 @@ Setpara(pathorg,fstr,sL,options,optionsanim):=( ParaOp=append(ParaOp,"m");//180604 ); ParaOpAnim=optionsanim; + if(ADDAXES=="1", //181224rom + Drwxy(); +// ADDAXES="0"; + ); //181224to GLISTback=GLIST; GCLISTback=GCLIST; GOUTLISTback=GOUTLIST; diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutlogr.txt b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutlogr.txt index e8d2d6fba0a..5760eda39a2 100644 --- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutlogr.txt +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindyliboutlogr.txt @@ -1,4 +1,16 @@ -// 201811230 +// 20181218 +// Help (Sfbdparadata ,,,, ) +// 20181217 +// Sfbdparadata debugged (replace fname+nm to fnameall ) +/// 20181209 +// MkprecommandR debugged (arc.. added ) +// Mkviewobj changed ( option "Zax=" added) +// 20181103 +// Mkviewobj changed ( change coord in case of "preview") +// Setobj changed ( option "preview" added ) +// 20181102 +// kcV3 changed ( "preview" for Mac ) +// 20181123 // Mkviewobj debugged ( Out=n ) // CalcbyR changed ( for cat ) // 201811225 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); diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketpiccurrent_reptikz.r b/Master/texmf-dist/scripts/ketcindy/ketlib/ketpiccurrent_reptikz.r new file mode 100644 index 00000000000..bce6137fea1 --- /dev/null +++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketpiccurrent_reptikz.r @@ -0,0 +1,562 @@ +# Copyright (C) 2014 Setsuo Takato, KETCindy Japan project team +# +#This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/> + + +######################################### + +ThisVersion<- "2ev5_2_4(180930)" + +# 20180930 +# Drwpt debugged ( the last newline added) +# 20180929 +# Shade changed (Kyoukai => Joincrvs) +# 2017.10.28 +# Drwpt debugged ( Flattenlist ) +# 2017.10.07 +# Dottedline,Drwline,Drwpt,Makehasen,Beginpicture,Setpen,Shade + +############################################# + +Dottedline<- function(...) +{ + varargin <- list(...) + Nall <- length(varargin) + Nagasa <- 0.1 + Ookisa <- PenThick*2 #17.10.07 + I <- Nall + Tmp <- varargin[[I]] + while (mode(Tmp)=="numeric" && length(Tmp)==1 ) { + I <- I-1 + Tmp <- varargin[[I]] + } + if (I==Nall-1) { + Nagasa<-Nagasa*varargin[[Nall]] + Nall <- Nall-1 + } + if (I==Nall-2) { + Nagasa <- Nagasa*varargin[[Nall-1]] + Ookisa <- round(Ookisa*varargin[[Nall]]) + Nall <- Nall-2 + } + Nagasa <- 1000/2.54/MilliIn*Nagasa + Ra=Ookisa/MilliIn + for (N in 1:Nall) { + Pdata <- varargin[[N]] + if (mode(Pdata)=="numeric") { + Pdata <- list(Pdata) + } + for (II in 1:length(Pdata)) { + Clist <- MakeCurves(Op(II,Pdata)) + DinM <- Dataindex(Clist) + Mojisu=0 + for (n in Looprange(1,Nrow(DinM))) { + Tmp <- DinM[n,] + Data <- Clist[Tmp[1]:Tmp[2],] + Len <- 0 + Lenlist <- c(0) + for (I in Looprange(2,Nrow(Data))) { + Len <- Len+Norm(Data[I,]-Data[I-1,]) + Lenlist <- c(Lenlist,Len) + } + Lenall <- Lenlist[length(Lenlist)] + if (Lenall==0) { + next + } + Naga <- Nagasa + Nten <- round(Lenall/Naga)+1 + if (Nten > 1) { + Seg <- Lenall/(Nten-1) + } + else { + Seg <- Lenall + } + Eps <- 10^(-6)*Seg + PPd<-c() + Hajime <- 1 + for (I in Looprange(0,Nten-1)) { + Len <- Seg*I + if (I>0) { + J <- Hajime + while( Len>=Lenlist[J]+Eps) { + J <- J+1 + } + Hajime <- J-1 + } + T <- (Len-Lenlist[Hajime])/ + (Lenlist[Hajime+1]-Lenlist[Hajime]) + P <- Data[Hajime,]+T*(Data[Hajime+1,]-Data[Hajime,]) + PPd<-Appendrow(PPd,P) + if (I==Nten-1) { + if (Norm(P-Data[1,])<Eps) { + next + } + } + } + for (I in Looprange(1,Nrow(PPd))){ + P<- Op(I,PPd) + if (Nrow(PPd)==1){ + V<- c(1,0) + } + else if (I==1){ + Tmp<- Op(I+1,PPd)-P + V<- 1/Norm(Tmp)*Tmp + } + else if (I==Nrow(PPd)){ + Tmp<- P-Op(I-1,PPd) + V<- 1/Norm(Tmp)*Tmp + } + else{ + Tmp1<- Op(I+1,PPd)-P + Tmp2<- P-Op(I-1,PPd) + Tmp3<-1/Norm(Tmp1)*Tmp1+1/Norm(Tmp2)*Tmp2 + V<- 1/Norm(Tmp3)*Tmp3 + } + X=sprintf('%5.5f',P[1]) + Y=sprintf('%5.5f',P[2]) + Str=paste('\\put(',X,',',Y,'){\\circle*{',sprintf('%6.6f',Ra),'}}',sep="") + cat(Str,file=Wfile,append=TRUE) + Mojisu=Mojisu+nchar(Str) + if(Mojisu>80){ + cat("\n",file=Wfile,append=TRUE) + Mojisu=0 + } + } + } + } + if(Mojisu>0){ + cat("\n",file=Wfile,append=TRUE) + } + } + Tmp<-PenThick/PenThickInit + Setpen(Tmp) +} + + +########################################### + +Drwline<-function(...) +{ + varargin<-list(...) + Nall<-length(varargin) + Thick<-0 + Tmp<-varargin[[Nall]] + if (mode(Tmp)=="numeric" && length(Tmp)==1){ + Setpen(Tmp) + Nall<-Nall-1 + } + for (N in 1:Nall){ + Pdata<-varargin[[N]] + if (length(Pdata)==0) next + if (mode(Pdata)!="list") Pdata<-list(Pdata) + while(Mixtype(Pdata)==3){ + Tmp1<- list() + for(II in Looprange(1,length(Pdata))){ + Tmp1<- Mixjoin(Tmp1,Pdata[[II]]) + } + Pdata<- Tmp1 + } + for (II in Looprange(1,length(Pdata))){ + Clist<-MakeCurves(Pdata[[II]]) + DinM<-Dataindex(Clist) + for (n in Looprange(1,Nrow(DinM))){ + Tmp<-DinM[n,] + Data<-Clist[Tmp[1]:Tmp[2],] + Mojisu<-0 + for (I in Looprange(1,Nrow(Data))){ + Tmp<-Data[I,] + X=sprintf('%5.5f',Tmp[1]) + Y=sprintf('%5.5f',Tmp[2]) + Pt=paste('(',X,',',Y,')',sep="") + if(I==1){ + Str=paste('\\polyline',Pt,sep="") + }else{ + Str=Pt + } + cat(Str,file=Wfile,append=TRUE) + Mojisu<-Mojisu+nchar(Str) + if (Mojisu>80){ + cat("%\n",file=Wfile,append=TRUE) + Mojisu<-0 + } + } + if (Mojisu!=0){ + cat("%\n",file=Wfile,append=TRUE) + } + cat("%\n",file=Wfile,append=TRUE) + } + } + } + if (Thick>0){ + Tmp<-PenThick/PenThickInit + Setpen(Tmp) + } +} + +########################################### + +Drwpt<-function(...) +{ + varargin<-list(...) + Nargs<-length(varargin) + All=Nargs + if (TenSize>TenSizeInit){ + N<- round(6*sqrt(TenSize/TenSizeInit)) + } + else{ + N<-4 + } + Tmp<- varargin[[All]] + Iro=c(0,0,0,1) + Iroflg=0 + if(is.character(Tmp)){ + Iro=Ratiocmyk(Tmp) + Iroflg=1 + All=All-1 + } + Tmp<- varargin[[All]] + if (mode(Tmp)=="numeric"){ + if (length(Tmp)>1){ + Kosa<- 1; All<- Nargs + } + else{ + Kosa<- Tmp; All<- All-1 + } + } + else if (mode(Tmp)=="list"){ + Kosa<- 1; All<- Nargs + } + Ra=TenSize*1000/2.54/MilliIn + if(Iroflg>0){ + Str='{\\color[cmyk]{' + for(J in 1:4){ + Str=paste(Str,as.character(Kosa*Iro[J]),sep="") + if(J<4){ + Str=paste(Str,',',sep="") + } + } + Str=paste(Str,'}%',sep="") + cat(Str,file=Wfile,append=TRUE) + } + +# CL<-c() +# for (J in 0:N){ +# Tmp<- TenSize*0.5*1000/2.54/MilliIn +# Tmp<- Tmp*c(cos(pi/4+J*2*pi/N),sin(pi/4+J*2*pi/N)) +# CL<- append(CL,Tmp) +# } +# CL<- matrix(CL,nrow=2) +# CL<- t(CL) + Mojisu=0 + for (II in Looprange(1,All)){ + MS<- varargin[[II]] + MS=Flattenlist(MS) #17.10.28 + if (mode(MS)=="numeric"){ + MS<- list(MS) + } + for (I in Looprange(1,length(MS))){ + P<- MS[[I]] + if (InWindow(P)!="i") next + P<- Doscaling(P) + X=sprintf('%5.5f',P[1]) + Y=sprintf('%5.5f',P[2]) + Str=paste('\\put(',X,',',Y,'){\\circle*{',sprintf('%6.6f',Ra),'}}',sep="") + cat(Str,file=Wfile,append=TRUE) + Mojisu=Mojisu+nchar(Str) + if(Mojisu>80){ + cat("\n",file=Wfile,append=TRUE) + Mojisu=0 + } + } + } + Str="%" + if(Iroflg>0){ + Str='}%' + } + if(Mojisu>0){ + Str=paste('\n',Str,'\n',sep="") + }else{ + Fmt=paste(Str,'\n',sep="") + } + cat(Str,file=Wfile,append=TRUE) + cat("\n",file=Wfile,append=TRUE) #180930 +} + + +###################################### + +Makehasen<- function(Figdata,Sen,Gap,Ptn) +{ + Eps<- 10.0^(-6) + Clist<- MakeCurves(Figdata) + DinM<- Dataindex(Clist) + for (N in Looprange(1,Nrow(DinM))){ + Tmp<- DinM[N,] + Data<- Clist[Tmp[1]:Tmp[2],] + Dtall<- Nrow(Data) + Len<- 0 + Lenlist<- c(0) + for (I in Looprange(2,Dtall)){ + Len<- Len+Norm(Data[I,]-Data[I-1,]) + Lenlist<- c(Lenlist,Len) + } + Lenall<- Lenlist[Dtall] + if (Lenall==0){ + next + } + Kari<- (Sen+Gap)*0.1 + Naga<- Sen*0.1 + Tobi<- Gap*0.1 + if (Norm(Data[1,]-Data[Dtall,])<Eps){ + Nsen<- max(ceiling(Lenall/Kari),3) + SegUnit<- Lenall/Nsen + Naga<- SegUnit*Sen/(Sen+Gap) + Tobi<- SegUnit*Gap/(Sen+Gap) + SegList<- c(seq(0,(Nsen-1)*SegUnit,by=SegUnit)) + } + else{ + if (Ptn==0){ + Nsen<- max(ceiling((Lenall+Tobi)/Kari),3) + SegUnit<- Lenall*(Sen+Gap)/(Nsen*Sen+(Nsen-1)*Gap) + Naga<- SegUnit*Sen/(Sen+Gap) + Tobi<- SegUnit*Gap/(Sen+Gap) + SegList<- c(seq(0,(Nsen-1)*SegUnit,by=SegUnit)) + } + else{ + Nsen<- max(ceiling((Lenall+Naga)/Kari),3) + SegUnit<- Lenall*(Sen+Gap)/((Nsen-1)*Sen+Nsen*Gap) + Naga<- SegUnit*Sen/(Sen+Gap) + Tobi<- SegUnit*Gap/(Sen+Gap) + SegList<- c(seq(Tobi,Tobi+(Nsen-2)*SegUnit,by=SegUnit)) + } + } + Hajime<- 1; Owari<- 1 + Mojisu<- 0 + for (I in Looprange(1,length(SegList))){ + Len<- SegList[I] + J<- Owari + while (Len>=Lenlist[J]-Eps){ + if (J==Dtall){ + break + } + J<- J+1 + } + Hajime<- J-1 + J<- Hajime + while (Len+Naga>Lenlist[J]-Eps){ + if (J==Dtall){ + break + } + J<- J+1 + } + Owari<- J-1 + T<- (Len-Lenlist[Hajime]) + T<- T/(Lenlist[Hajime+1]-Lenlist[Hajime]) + P<- Data[Hajime,]+T*(Data[Hajime+1,]-Data[Hajime,]) + X0=sprintf('%5.5f',P[1]) + Y0=sprintf('%5.5f',P[2]) + Pt0=paste('(',X0,',',Y0,')',sep="") + Str=paste('\\polyline',Pt0,sep="") + cat(Str,file=Wfile,append=TRUE) + Mojisu<- Mojisu+nchar(Str) + for (J in Looprange(Hajime+1,Owari)){ + P=Data[J,] + X=sprintf('%5.5f',P[1]) + Y=sprintf('%5.5f',P[2]) + Pt=paste('(',X,',',Y,')',sep="") + Str=Pt + cat(Str,file=Wfile,append=TRUE) + Pt0=Pt + Mojisu=Mojisu+nchar(Str) + } + T<- (Len+Naga-Lenlist[Owari]) + T<- T/(Lenlist[Owari+1]-Lenlist[Owari]) + P<- Data[Owari,]+T*(Data[Owari+1,]-Data[Owari,]) + X=sprintf('%5.5f',P[1]) + Y=sprintf('%5.5f',P[2]) + Pt=paste('(',X,',',Y,')',sep="") + Str=Pt + cat(Str,file=Wfile,append=TRUE) + Mojisu<- Mojisu+nchar(Str) + if (Mojisu>80){ + cat("%\n",file=Wfile,append=TRUE) + Mojisu<- 0 + } + } + } + cat("%\n%\n",file=Wfile,append=TRUE); +} + +######################################### + +Beginpicture<-function(ul) +{ ## Scaling is implemented + Tmp<- Doscaling(c(XMIN,YMIN)) + Xm<- Tmp[1] + Ym<- Tmp[2] + Tmp<- Doscaling(c(XMAX,YMAX)) + XM<- Tmp[1] + YM<- Tmp[2] + Dx<- XM-Xm + Dy<- YM-Ym + Sym<-".0123456789 +-*/" + SL<-Sym + OL<-"+-*/" + if (ul!=""){ + ULEN<<-ul; + } + Is<-1; + VL<-""; + Ucode<-ULEN + for (I in Looprange(1,nchar(Ucode))){ + C<-substring(Ucode,I,I); + if (length(grep(C,SL,fixed=TRUE))>0){ + if (length(grep(C,OL,fixed=TRUE))>0){ + Tmp<-substring(Ucode,Is,I-1); + Str<-paste(VL,Tmp,C,sep="") + VL<-Str + Is<-I+1; + } + } + else{ + Unit<-substring(Ucode,I,I+1); + Str<-substring(Ucode,Is,I-1); + VL<-paste(VL,Str,sep="") + break; + } + } + Valu<-eval(parse(text=VL)); + Str<-as.character(Valu); + ULEN<<- paste(Str,Unit,sep=""); + if (Unit=="cm") MilliIn<<-1000/2.54*Valu + if (Unit=="mm") MilliIn<<-1000/2.54*Valu/10 + if (Unit=="in") MilliIn<<-1000*Valu + if (Unit=="pt") MilliIn<<-1000/72.27*Valu + if (Unit=="pc") MilliIn<<-1000/6.022*Valu + if (Unit=="bp") MilliIn<<-1000/72*Valu + if (Unit=="dd2") MilliIn<<-1000/1238/1157/72.27*Valu + if (Unit=="cc") MilliIn<<-1000/1238/1157/72.27*12*Valu; + if (Unit=="sp") MilliIn<<-1000/72.27/65536*Valu/10 + MARKLEN<<- MARKLENNow*1000/2.54/MilliIn; + Str<-paste("{\\unitlength=",ULEN,"%\n",sep=""); + cat(Str,file=Wfile,append=TRUE); + cat("\\begin{picture}%\n",file=Wfile,append=TRUE); + Str<-"("; + Tmp<-as.character(round(Dx,digits=6)); + Str<-paste(Str,Tmp,",",sep=""); + Tmp<-as.character(round(Dy,digits=6)); + Str<-paste(Str,Tmp,")(",sep=""); + Tmp<-as.character(round(Xm,digits=6)); + Str<-paste(Str,Tmp,",",sep=""); + Tmp<-as.character(round(Ym,digits=6)); + Str<-paste(Str,Tmp,")%\n",sep=""); + cat(Str,file=Wfile,append=TRUE); + Str=paste('\\linethickness{',as.character(PenThickInit/1000),'in}%',sep="") + cat(Str,file=Wfile,append=TRUE) + cat("%\n",file=Wfile,append=TRUE) +} + +######################################### + +Setpen<-function(Width) +{ + PenThick<<-round(PenThickInit*Width) + Str=paste('\\linethickness{',as.character(PenThick/1000),'in}%',sep="") + cat(Str,file=Wfile,append=TRUE) + cat("%\n",file=Wfile,append=TRUE) +} + +######################################### + +Shade<- function(...) +{ ## Scaling is implemented + varargin<- list(...) + Nargs<- length(varargin) + Iroflg=0 + if(Nargs>1){ + Iro=varargin[[Nargs]] + if(is.character(Iro)){ + Iroflg=1 + if(length(grep("{",Iro,fixed=TRUE))>0){ + Str=paste("{\\color",Iro,sep="") + } + else{ + Str=paste("{\\color{",Iro,"}",sep="") + } + } + else{ + if(length(Iro)==1){ + Kosa=Iro + } + else{ + Iroflg=1 + if(length(Iro)==4){ + Str="{\\color[cmyk]{" + } + else{ + if(length(Iro)==3){ + Str="{\\color[rgb]{" + } + } + for(J in 1:length(Iro)){ + Str=paste(Str,as.character(Iro[J]),sep="") + if(J<length(Iro)){ + Str=paste(Str,",") + } + } + Str=paste(Str,"}") + } + } + if(Iroflg==1){ + Str=paste(Str,"%\n",sep="") + cat(Str,file=Wfile,append=TRUE) + } + } + Mojisu=0 + Tmp=varargin[[1]] +# Data=Kyoukai(Tmp) + Data= Joincrvs(Tmp) #180929from + Data=list(Data) #180929to + for (I in Looprange(1, length(Data))){ + PL<- Op(I,Data) + PL=Appendrow(PL,Op(1,PL)) #180929 + Mojisu<- 0 + for (J in 1:Nrow(PL)){ + P<- Doscaling(Op(J,PL)) + X=sprintf('%5.5f',P[1]) + Y=sprintf('%5.5f',P[2]) + Pt=paste('(',X,',',Y,')',sep="") + if(J==1){ + Str=paste('\\polygon*',Pt,sep="") + }else{ + Str=Pt + } + cat(Str,file=Wfile,append=TRUE) + Mojisu<- Mojisu+nchar(Str) + if (Mojisu>80){ + cat("%\n",file=Wfile,append=TRUE) + Mojisu<- 0 + } + } + } + if(Iroflg==1){ + Str='}%' + if(Mojisu>0){ + Str=paste('\n',Str,'\n',sep="") + }else{ + Str=paste(Str,'\n') + } + cat(Str,file=Wfile,append=TRUE) + } +} diff --git a/Master/texmf-dist/scripts/ketcindy/template2slide.cdy b/Master/texmf-dist/scripts/ketcindy/template2slide.cdy Binary files differindex b4e955f5dc6..223c67406b6 100644 --- a/Master/texmf-dist/scripts/ketcindy/template2slide.cdy +++ b/Master/texmf-dist/scripts/ketcindy/template2slide.cdy diff --git a/Master/texmf-dist/scripts/ketcindy/template3Dfigure.cdy b/Master/texmf-dist/scripts/ketcindy/template3Dfigure.cdy Binary files differindex 068aa2833f8..ec10c6f34e5 100644 --- a/Master/texmf-dist/scripts/ketcindy/template3Dfigure.cdy +++ b/Master/texmf-dist/scripts/ketcindy/template3Dfigure.cdy |