summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1r.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1r.cs')
-rw-r--r--Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1r.cs434
1 files changed, 321 insertions, 113 deletions
diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1r.cs b/Master/texmf-dist/scripts/ketcindy/ketlib/ketcindylibbasic1r.cs
index d466f9fe530..be7bd1adedf 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.2(20181030)");
+println("KeTCindy V.3.2.3(20181201)");
println(ketjavaversion());
-println("ketcindylibbasic1(20181030) loaded");
+println("ketcindylibbasic1(20181125) loaded");
//help:start();
@@ -132,7 +132,11 @@ Ketinit(work,sy,rangex,rangey):=(//181001to
if(iswindows(),
Batparent="\kc.bat";
,
- Shellparent="/kc.sh";
+ if(ismacosx(), //181125from
+ Shellparent="/kc.command";
+ ,
+ Shellparent="/kc.sh";
+ ); //181125to
if(!isexists(Dirwork,""),
println(Dirwork+" not exists");
,
@@ -174,6 +178,67 @@ Ketinit(work,sy,rangex,rangey):=(//181001to
);
////%Ketinit end////
+////%Fillstore start////
+Fillstore():=(
+ regional(tmp,tmp1,out);
+ tmp1=allelements();
+ tmp1=select(tmp1,indexof(#.name,"Text")>0);
+ out=apply(tmp1,[#.name,#.fillcolor]);
+ out;
+);
+////%Fillstore end////
+
+////%Fillblack start////
+Fillblack():=Fillblack("Running");
+Fillblack(str):=(
+ regional(tmp,tmp1,store);
+ tmp1=allelements();
+ tmp1=select(tmp1,indexof(#.name,"Text")>0);
+ store=apply(tmp1,[#.name,#.fillcolor,#.text]);
+ tmp=select(tmp1,#.name=="Text0");
+ if(length(tmp)==0,
+ forall(store,
+ tmp=parse(#_1);
+ tmp.fillcolor=[0,0,0];
+ );
+ ,
+ Text0.text=str;
+ );
+ store;
+);
+////%Fillblack end////
+
+////%Fillrestore start////
+Fillrestore(store):=(
+ regional(tmp);
+ tmp=select(store,#_1=="Text0");
+ if(length(tmp)==0,
+ forall(store,
+ tmp=parse(#_1);
+ tmp.fillcolor=#_2;
+ );
+ ,
+ tmp=tmp_1;
+ Text0.text=tmp_3;
+ );
+);
+////%Fillrestore end////
+
+////%Readlines start////
+Readlines(file):=Readlines(Dirwork,file); //181126
+Readlines(path,file):=(
+//help:Readlines(path,file);
+ regional(tmp,out);
+ out=readfile2str(path,file);
+ out=tokenize(out,"/LF/");
+ tmp=out_(length(out));
+ if(length(tmp)==0,
+ out=out_(1..(length(out)-1));
+ );
+ out;
+);
+////%Readlines end////
+
////%Changesetting start////
Changesetting(dir):=( //181017
regional(fname);
@@ -646,7 +711,8 @@ Changework(dirorg,options):=( //16.10.21
makesub=1;
forall(eqL,
tmp=Strsplit(#,"=");
- if(Toupper(tmp_1)=="SUB",
+ tmp1=Toupper(substring(#,0,1)); //181111
+ if(tmp1=="S",
tmp=Toupper(tmp_2);
if(substring(tmp,0,1)=="N",
makesub=0;
@@ -688,9 +754,9 @@ Changework(dirorg,options):=( //16.10.21
setdirectory(Dirwork);
if(!iswindows(), //17.04.11
if(!iskcexists(Dirwork),
- SCEOUTPUT = openfile("/kc.sh");
+ SCEOUTPUT = openfile("/kc.command"); //181125
closefile(SCEOUTPUT);
- println(setexec(Dirwork,"/kc.sh"));
+ println(setexec(Dirwork,"/kc.command")); //181125
);
);
);
@@ -4431,7 +4497,7 @@ Connectseg(Pdata):=(
);
);
if(flg==0,
- PlotL=concat(PlotL,Pdata_(vL_1));
+ PlotL=concat(PlotL,[Pdata_(vL_1)]); //181112
vL=remove(vL,[vL_1]);
);
);
@@ -4441,14 +4507,15 @@ Connectseg(Pdata):=(
////%Implicitplot start////
Implicitplot(name1,func,xrng,yrng):=Implicitplot(name1,func,xrng,yrng,[]);
-Implicitplot(name1,func,xrng,yrng,options):=(
+Implicitplot(name1,func,xrng,yrng,optionsorg):=(
//help:Implicitplot("1","x^2+x*y+y^2=1","x=[-3,3]","y=[-3,3]");
-//help:Implicitplot(options=["Num=[50,50]"]);
- regional(name,Fn,varx,vary,rngx,rngy,Mdv,Ndv,tmp,tmp1,tmp2,
- Eps,Ltype,Noflg,eqL,color,opsr,opcindy,dx,dy,out,jj,ii,kk,
+//help:Implicitplot(options=["Num=[50,50]","Msg=y(n)"]);
+ regional(name,options,Fn,varx,vary,rngx,rngy,Mdv,Ndv,tmp,tmp1,tmp2,
+ Eps,Ltype,Noflg,eqL,color,opsr,opcindy,dx,dy,out,jj,ii,kk,msg,
yval1,yval2,xval1,xval2,eval11,eva12,eval21,eval22,pL,vL,qL);
name="imp"+name1;
Eps=10^(-4);
+ options=optionsorg;
tmp=Divoptions(options);
Ltype=tmp_1;
Noflg=tmp_2;
@@ -4457,10 +4524,11 @@ Implicitplot(name1,func,xrng,yrng,options):=(
opstr=tmp_(length(tmp)-1);
opcindy=tmp_(length(tmp));
Mdv=50;Ndv=50;
+ msg="Y";
forall(eqL,
- tmp=indexof(#,"=");
- tmp1=Toupper(substring(#,0,tmp-1));
- tmp2=substring(#,tmp,length(#));
+ tmp=Strsplit(#,"=");
+ tmp1=Toupper(substring(tmp_1,0,1));
+ tmp2=tmp_2;
opstr=opstr+",'"+#+"'";
if(substring(#,0,1)=="N",
Mdv=parse(tmp2);
@@ -4471,6 +4539,10 @@ Implicitplot(name1,func,xrng,yrng,options):=(
Mdv=Mdv_1;
);
);
+ if(substring(#,0,1)=="M", //181112from
+ msg=Toupper(substring(tmp2,0,1));
+ options=remove(options,[#]);
+ ); //181112to
);
tmp=indexof(func,"=");
if(tmp==0,
@@ -4541,7 +4613,9 @@ Implicitplot(name1,func,xrng,yrng,options):=(
out=out_1;
);
if(Noflg<3,
- println("generate Implicitplotdata "+name);
+ if(msg=="Y", //181112
+ println("generate Implicitplotdata "+name);
+ );
if(MeasureDepth(out)==1,
tmp1=apply(out,Pcrd(#));
,
@@ -4922,14 +4996,14 @@ Drawsegmark(nm,ptlist,options):=(
tmp=indexof(#,"=");
tmp1=substring(#,tmp,length(#));
tmp1=parse(tmp1);
- tmp=substring(#,0,1);
- if(tmp=="S" % tmp=="s",
+ tmp=Toupper(substring(#,0,1));
+ if(tmp=="S",
size=size*tmp1;
);
- if(tmp=="W" % tmp=="w",
+ if(tmp=="W",
wid=wid*tmp1;
);
- if(tmp=="T" % tmp=="t",
+ if(tmp=="T",
tp=tmp1;
);
);
@@ -5209,13 +5283,15 @@ Putintersect(nm,pdata1,pdata2,ptno):=(
Arrowheaddata(point,direction):=Arrowheaddata(point,direction,[]);
Arrowheaddata(point,direction,options):=(
// help:Arrowheaddata(A,B);
-// help:Arrowheaddata(options=[1,18,"Coord=phy"]);
- regional(list,Ookisa,Hiraki,Futosa,Houkou,Str,Flg,Ev,Nv,pA,pB,
+// help:Arrowheaddata(options=[size(1),angle(18), "Coord=phy"]);
+ regional(list,ookisa,hiraki,Houkou,Str,Flg,Ev,Nv,pA,pB,
reL,eqL,coord,pP,rF,gG,Flg,Nj,Eps,scx,scy,tmp,tmp1,tmp2);
Eps=10^(-3);
coord="P";
- Ookisa=0.2*YaSize;
- Hiraki=YaAngle;
+ ookisa=0.2*YaSize;
+ hiraki=YaAngle;
+ iti=1;
+ kiri=0;
Futosa=0;
Str=YaStyle;
tmp=Divoptions(options);
@@ -5229,17 +5305,19 @@ Arrowheaddata(point,direction,options):=(
coord=Touppera(tmp2);
);
); //181018to
- if(length(reL)>0,Ookisa=Ookisa*reL_1);
- if(length(reL)>1,
- tmp=reL_2;
- if(tmp<5,
- Hiraki=Hiraki*tmp;
- ,
- Hiraki=tmp;
+ forall(1..(length(reL)), //181110from
+ tmp=reL_#;
+ if(#==1,ookisa=ookisa*tmp);
+ if(#==2,
+ if(tmp<5,
+ hiraki=hiraki*tmp;
+ ,
+ hiraki=tmp;
+ );
);
- );
+ ); //181110to
Flg=0;
- Hiraki=Hiraki*pi/180;
+ hiraki=hiraki*pi/180;
if(ispoint(direction),Houkou=direction.xy); //181018
if(isstring(direction),Houkou=parse(direction),Houkou=direction);
if(MeasureDepth(Houkou)==2,Houkou=Houkou_1);
@@ -5262,7 +5340,7 @@ Arrowheaddata(point,direction,options):=(
rF=Numptcrv(Houkou);
);
);
- gG=apply(0..10,pP+Ookisa*cos(Hiraki)*[cos(2*pi/10*#),sin(2*pi/10*#)]);
+ gG=apply(0..10,pP+ookisa*cos(hiraki)*[cos(2*pi/10*#),sin(2*pi/10*#)]);
Flg=0;
forall(1..rF,Nj,
if(Flg==0,
@@ -5285,13 +5363,13 @@ Arrowheaddata(point,direction,options):=(
Ev=-1/|Houkou|*Houkou;
Nv=[-Ev_2, Ev_1];
if(indexof(Str,"c")>0,
- pP=pP-0.5*Ookisa*cos(Hiraki)*Ev;
+ pP=pP-0.5*ookisa*cos(hiraki)*Ev;
);
if(indexof(Str,"b")>0,
- pP=pP-Ookisa*cos(Hiraki)*Ev;
+ pP=pP-ookisa*cos(hiraki)*Ev;
);
- pA=pP+Ookisa*cos(Hiraki)*Ev+Ookisa*sin(Hiraki)*Nv;
- pB=pP+Ookisa*cos(Hiraki)*Ev-Ookisa*sin(Hiraki)*Nv;
+ pA=pP+ookisa*cos(hiraki)*Ev+ookisa*sin(hiraki)*Nv;
+ pB=pP+ookisa*cos(hiraki)*Ev-ookisa*sin(hiraki)*Nv;
list=[pA,pP,pB];
list;
);
@@ -5309,10 +5387,10 @@ Arrowhead(Arg1,Arg2,Arg3):=(
);
Arrowhead(nm,point,direction,optionsorg):=(//181018from
//help:Arrowhead("1",B,B-A);
-//help:Arrowhead(options=[1.5,30,"Coor=P(L)"]);
+//help:Arrowhead(options=[size(1),angle(18),position(1),cut(0),"Coor=P(L)"]);
//help:Arrowhead(A,"gr1");
regional(name,Ltype,Noflg,reL,opstr,opcindy,color,eqL,coord,
- options,pP,Houkou,ptstr,hostr,tmp,tmp1,tmp2,list);
+ options,cut,pP,Houkou,ptstr,hostr,tmp,tmp1,tmp2,list);
name="arh"+nm; //181018
ArrowheadNumber=ArrowheadNumber+1;
options=optionsorg;
@@ -5328,10 +5406,17 @@ Arrowhead(nm,point,direction,optionsorg):=(//181018from
tmp1=substring(tmp_1,0,1);
tmp2=substring(tmp_2,0,1);
if(Toupper(tmp1)=="C",
- coord=Touppera(tmp2);
+ coord=Toupper(tmp2);
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
if(ispoint(direction),Houkou=direction.xy); //181018
if(isstring(direction),Houkou=parse(direction),Houkou=direction);
if(MeasureDepth(Houkou)==2,Houkou=Houkou_1);
@@ -5360,6 +5445,7 @@ Arrowhead(nm,point,direction,optionsorg):=(//181018from
if(Noflg==0,
tmp=Divoptions(options);
opstr=tmp_(length(tmp)-1);
+ opstr=opstr+","+Dqq("Cut="+format(cut,5));
ptstr=Textformat(LLcrd(pP),5);
if(isstring(direction), //181019
hostr=direction;
@@ -5382,13 +5468,27 @@ Arrowhead(nm,point,direction,optionsorg):=(//181018from
////%Arrowhead end////
////%Arrowdata start////
-Arrowdata(nm,ptlist):=Arrowdata(nm,ptlist,[]);
+Arrowdata(ptlist):=Arrowdata(ptlist,[]); //181110from
+Arrowdata(Arg1,Arg2):=(
+ regional(name);
+ if(isstring(Arg1),
+ Arrowdata(Arg1,Arg2,[]);
+ ,
+ name="";
+ forall(Arg1,
+ if(ispoint(#),
+ name=name+text(#);
+ );
+ );
+ Arrowdata(name,Arg1,Arg2);
+ );
+); //181110from
Arrowdata(nm,ptlist,optionsorg):=(
//help:Arrowdata("1",[A,B]);
//help:Arrowdata("1",[pt1,pt2]);
-//help:Arrowdata(options=[1,18,pos(1),cut(0),"Cutend=0,0","Coord=p/n"]);
+//help:Arrowdata(options=[size(1),angle(18),pos(1),cut(0),"Cutend=0,0","Coord=p/l"]);
regional(options,Ltype,Noflg,name,opstr,opcindy,eqL,reL,strL,color,size,coord,
- flg,lineflg,cutend,tmp,tmp1,tmp2,pA,pB,angle,segpos);
+ flg,lineflg,cutend,tmp,tmp1,tmp2,pA,pB,angle,segpos,cut);
name="ar"+nm;
options=optionsorg;
tmp=Divoptions(options);
@@ -5403,15 +5503,16 @@ Arrowdata(nm,ptlist,optionsorg):=(
size=1; // 15.06.11
angle=18;
segpos=1;
- if(length(reL)>0,
- size=relL_1;
- if(length(reL)>1, //180719from
- angle=reL_2;
- if(length(reL)>2,
- segpos=reL_3;
- );
- );//180719to
- );
+ cut=0; //181110from
+ forall(1..(length(reL)),
+ tmp=reL_#;
+ if(#==1,size=tmp);
+ if(#==2,angle=tmp);
+ if(#==3,
+ segpos=tmp;
+ );
+ if(#==4,cut=tmp);
+ ); //181110to
lineflg=0;
if(contains(strL,"l")%contains(strL,"L"),
lineflg=1;
@@ -5435,6 +5536,12 @@ Arrowdata(nm,ptlist,optionsorg):=(
options=remove(options,[#]);
);
);
+ if(|cutend|>0,//181110from
+ tmp=ptlist_2-ptlist_1;
+ tmp=tmp/|tmp|;
+ ptlist_1=ptlist_1+tmp*cutend_1;
+ ptlist_2=ptlist_2-tmp*cutend_2;
+ );//181110to
if(coord=="P",
pA=ptlist_1; pB=ptlist_2;
if(ispoint(pA),pA=pA.xy);
@@ -5444,12 +5551,6 @@ Arrowdata(nm,ptlist,optionsorg):=(
);//181018to
if(Noflg<3,
println("generate Arrowdata "+name);
- if(|cutend|>0,//180719from
- tmp=ptlist_2-ptlist_1;
- tmp=tmp/|tmp|;
- ptlist_1=ptlist_1+tmp*cutend_1;
- ptlist_2=ptlist_2-tmp*cutend_2;
- );//180719to
tmp=name+"="+Textformat([pA,pB],5);
parse(tmp);
if(lineflg==0, // 16.04.09 from
@@ -5461,15 +5562,8 @@ Arrowdata(nm,ptlist,optionsorg):=(
);
if(Noflg<2,
if(isstring(Ltype),
-// if((Noflg==0)&(color!=KCOLOR), //180904
-// Texcom("{");Com2nd("Setcolor("+color+")");//180722
-// );
Listplot("-ar"+nm,[LLcrd(pA),LLcrd(pB)],append(options,"Msg=n"));
- Arrowhead(nm,pB,pB-pA,options);
-// Ltype=GetLinestyle(text(Noflg)+Ltype,name);
-// if((Noflg==0)&(color!=KCOLOR), //180904
-// Texcom("}");//180722
-// );
+ Arrowhead(nm,pA+segpos*(pB-pA),pB-pA,options); //181110
,
if(Noflg==1,Ltype=0);
);
@@ -6524,10 +6618,22 @@ Makehatch(iolistorg,pt,vec,bdylist):=(
);
////%Makehatch end////
+////%Anyselected start////
+Anyselected(ptL):=(
+ regional(tmp,out);
+ out=false;
+ forall(ptL,
+ if(isstring(#),tmp=parse(#),tmp=#);
+ out=(out)%(isselected(tmp));
+ );
+ out;
+);
+////%Anyselected end////
+
////%Hatchdata start////
Hatchdata(nm,iostr,bdylist):=Hatchdatacindy(nm,iostr,bdylist,[]);//180619
Hatchdata(nm,iostr,bdylist,optionsorg):=( //181003from
- regional(options,tmp,tmp1,tmp2,eqL,strL,outflg);
+ regional(options,tmp,tmp1,tmp2,eqL,strL,chkL,outflg);
options=optionsorg;
tmp=Divoptions(options);
eqL=tmp_5;
@@ -6555,13 +6661,15 @@ Hatchdata(nm,iostr,bdylist,optionsorg):=( //181003from
);
); //181003to
Hatchdatacindy(nm,iostr,bdylist):=Hatchdata(nm,iostr,bdylist,[]);
-Hatchdatacindy(nm,iostr,bdylistorg,options):=(
+Hatchdatacindy(nm,iostr,bdylistorg,optionsorg):=(
//help:Hatchdata("1",["ii"],[["ln1","Invert(gr1)"],["gr2","n"]]);
-//help:Hatchdata(options=["Out=n(//m/r)","Maxnum=20",angle,width]);
+//help:Hatchdata(options=["Not=pointlist","File=y(/m/n)","Max=50","Check=",angle,width]);
regional(name,bdylist,bdynameL,bname,Ltype,Noflg,opstr,opcindy,reL,
- eqL,maxnum,startP,angle,interval,vec,nvec,ctr,pt,kk,delta,sha,AnsL,
- color,tmp,tmp1,tmp2,tmp3,namep,x1,y1,x2,y2,p1,p2); //180717
+ options,eqL,maxnum,startP,angle,interval,vec,nvec,ctr,pt,kk,delta,sha,AnsL,
+ color,tmp,tmp1,tmp2,tmp3,namep,x1,y1,x2,y2,p1,p2, //180717
+ fname,fileflg,mkflg,vaL,pL,nL,nn,str,is,ie); //181102
name="ha"+nm;
+ fname=Fhead+name+".txt";
bdylist=[];
bdynameL=[];
forall(1..(length(bdylistorg)),kk,
@@ -6625,6 +6733,7 @@ Hatchdatacindy(nm,iostr,bdylistorg,options):=(
bdylist=append(bdylist,parse(bname));
bdynameL=append(bdynameL,bname);
);
+ options=optionsorg;
tmp=Divoptions(options);
Ltype=tmp_1;
Noflg=tmp_2;
@@ -6637,17 +6746,36 @@ Hatchdatacindy(nm,iostr,bdylistorg,options):=(
// interval=0.125*1000/2.54/MilliIn;
interval=0.25*1000/2.54/MilliIn; //180706
startP=[(XMIN+XMAX)/2, (YMIN+YMAX)/2];
- maxnum=[30,0]; //181005 [first,second]
+ maxnum=[50,0]; //181109changed [first,second]
+ fileflg="N";//181102from
+ mkflg=1;
+ chkL=[]; //181109
forall(eqL,
tmp=Strsplit(#,"=");
- tmp1=Toupper(tmp_1);
- if(substring(tmp1,0,1)=="M",
+ tmp1=Toupper(substring(tmp_1,0,1));
+ if(tmp1=="M",
maxnum=parse(tmp_2);
if(!islist(maxnum),
maxnum=[maxnum,0];
);
+ options=remove(options,[#]);
);
- );//181003to
+ if(tmp1=="F", //181102from
+ fileflg=Toupper(substring(tmp_2,0,1));
+ options=remove(options,[#]);
+ ); //181102to
+ if(tmp1=="N", //181103from
+ tmp=parse(tmp_2);
+ if(Anyselected(tmp),
+ mkflg=-1;
+ );
+ options=remove(options,[#]);
+ );
+ if(tmp1=="C",
+ chkL=parse(tmp_2);
+ options=remove(options,[#]);
+ );
+ );//181102,03to
tmp1=1;
forall(reL,
if(islist(#),
@@ -6661,45 +6789,114 @@ Hatchdatacindy(nm,iostr,bdylistorg,options):=(
);
);
);
- angle=angle*pi/180;
- vec=[cos(angle),sin(angle)];
- nvec=[-sin(angle),cos(angle)];
- AnsL=[];
- ctr=0;//181005(2lines)
- forall(0..(maxnum_1), kk,
- pt=startP+kk*interval*nvec;
- sha=Makehatch(iostr,pt,vec,bdylist);
- if((sha!=-1)&(length(sha)>0),
- AnsL=concat(AnsL,sha);
- ctr=ctr+1; //181005
+ if((fileflg=="Y")%(fileflg=="M")&(mkflg>-1), //181102from
+ wflg=1;
+ varL=flatten(bdylistorg);
+ varL=select(varL,length(#)>1);
+ varL=sort(varL);
+ pL=[];
+ forall(1..(length(varL)),nn,
+ tmp1=varL_nn;
+ tmp=select(GLIST,substring(#,0,length(tmp1))==tmp1);
+ str=tmp_1;
+ varL_nn=str;
+ tmp1=Bracket(str,"()");
+ tmp2=max(apply(tmp1,#_2));
+ nL=select(1..(length(tmp1)),tmp1_#_2==tmp2);
+ forall(nL,nn,
+ is=tmp1_nn_1; ie=tmp1_(nn+1)_1;
+ tmp=substring(str,is,ie-1);
+ tmp=replace(tmp,"'",Dq);
+ tmp=parse("["+tmp+"]");
+ tmp2=flatten(tmp);
+ tmp2=flatten(tmp2);
+ tmp2=flatten(tmp2);
+ forall(tmp2,
+ if(ispoint(#),
+ if(!contains(pL,text(#)),
+ pL=append(pL,text(#));
+ );
+ );
+ );
+ );
);
- );
- maxnum_2=maxnum_2+(maxnum_1-ctr); //181005
- forall(1..(maxnum_2),kk, //181005
- pt=startP-kk*interval*nvec;
- sha=Makehatch(iostr,pt,vec,bdylist);
- if((sha!=-1)&(length(sha)>0),
- AnsL=concat(AnsL,sha);
+ forall(chkL,
+ if(!contains(pL,#),pL=append(pL,#));
+ );
+ forall(pL,
+ tmp=#+"="+Textformat(parse(#+".xy"),5);
+ varL=append(varL,tmp);
+ );
+ tmp="reL="+Textformat(reL,5);
+ varL=append(varL,tmp);
+ if(fileflg=="M",
+ fileflg="Y";
+ ,
+ tmp1="hatch"+nm+".txt";
+ if(isexists(Dirwork,tmp1),
+ tmp2=load(tmp1);
+ tmp2=tokenize(tmp2,"//");
+ tmp2=tmp2_(1..(length(tmp2)-1));
+ if(tmp2==varL,
+ wflg=0;
+ if(isexists(Dirwork,fname),
+ mkflg=0;
+ ReadOutData(fname);
+ tmp=name+"="+Textformat(parse(name),5);
+ parse(tmp);
+ );
+ );
+ );
);
);
- if(Noflg<3,
- println("generate Hatchdata "+name);
- tmp=name+"="+textformat(AnsL,5);
- parse(tmp);
- if(!islist(iostr),tmp1=[iostr],tmp1=iostr);
- tmp="c(";
- forall(tmp1,
- tmp=tmp+Dq+#+Dq+",";
+ if(mkflg==1, //181102to
+ angle=angle*pi/180;
+ vec=[cos(angle),sin(angle)];
+ nvec=[-sin(angle),cos(angle)];
+ AnsL=[];
+ ctr=0;//181005(2lines)
+ forall(0..(maxnum_1), kk,
+ pt=startP+kk*interval*nvec;
+ sha=Makehatch(iostr,pt,vec,bdylist);
+ if((sha!=-1)&(length(sha)>0),
+ AnsL=concat(AnsL,sha);
+ ctr=ctr+1; //181005
+ );
+ );
+ maxnum_2=maxnum_2+(maxnum_1-ctr); //181005
+ forall(1..(maxnum_2),kk, //181005
+ pt=startP-kk*interval*nvec;
+ sha=Makehatch(iostr,pt,vec,bdylist);
+ if((sha!=-1)&(length(sha)>0),
+ AnsL=concat(AnsL,sha);
+ );
);
- tmp=substring(tmp,0,length(tmp)-1)+")";
- tmp2=name+"=Hatchdata("+tmp;
- forall(bdynameL,
- tmp2=tmp2+",list("+#+")";
+ tmp1=apply(AnsL,textformat(#,5));
+ tmp=name+"="+tmp1;
+ parse(tmp);
+ );
+ if((Noflg<3)&(mkflg>-1),
+ if(fileflg!="Y", //181102
+ println("generate Hatchdata "+name);
+ tmp=name+"="+textformat(AnsL,5);
+ parse(tmp);
+ if(!islist(iostr),tmp1=[iostr],tmp1=iostr);
+ tmp="c(";
+ forall(tmp1,
+ tmp=tmp+Dq+#+Dq+",";
+ );
+ tmp=substring(tmp,0,length(tmp)-1)+")";
+ tmp2=name+"=Hatchdata("+tmp;
+ forall(bdynameL,
+ tmp2=tmp2+",list("+#+")";
+ );
+ tmp2=tmp2+opstr+")";
+ GLIST=append(GLIST,tmp2);
+ ,
+ GLIST=append(GLIST,"ReadOutData("+Dq+fname+Dq+")");//181102
);
- tmp2=tmp2+opstr+")";
- GLIST=append(GLIST,tmp2);
);
- if(Noflg<2,
+ if((Noflg<2)&(mkflg>-1),
if(isstring(Ltype),
if((Noflg==0)&(color!=KCOLOR), //180904
Texcom("{");Com2nd("Setcolor("+color+")");//180722
@@ -6713,12 +6910,23 @@ Hatchdatacindy(nm,iostr,bdylistorg,options):=(
);
GCLIST=append(GCLIST,[name,Ltype,opcindy]);
);
- tmp2=[];
- forall(AnsL,tmp1,
- tmp=apply(tmp1,LLcrd(#));
- tmp2=append(tmp2,tmp);
+ if(mkflg>-1,
+ if((fileflg=="Y")&(wflg==1), //181102from
+ tmp1="hatch"+nm+".txt";
+ SCEOUTPUT = openfile(tmp1);
+ forall(varL,
+ println(SCEOUTPUT,#+"//");
+ );
+ closefile(SCEOUTPUT);
+ WriteOutData(fname,[name,parse(name)]);
+ ); //181102to
+ tmp2=[];
+ forall(AnsL,tmp1,
+ tmp=apply(tmp1,LLcrd(#));
+ tmp2=append(tmp2,tmp);
+ );
+ tmp2;
);
- tmp2;
);
////%Hatchdata end////