summaryrefslogtreecommitdiff
path: root/graphics/ketcindy/ketcindyfolder/scripts/ketlib/ketcindylibbasic1r.cs
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/ketcindy/ketcindyfolder/scripts/ketlib/ketcindylibbasic1r.cs')
-rw-r--r--graphics/ketcindy/ketcindyfolder/scripts/ketlib/ketcindylibbasic1r.cs98
1 files changed, 74 insertions, 24 deletions
diff --git a/graphics/ketcindy/ketcindyfolder/scripts/ketlib/ketcindylibbasic1r.cs b/graphics/ketcindy/ketcindyfolder/scripts/ketlib/ketcindylibbasic1r.cs
index 2dc633a782..e2178a919a 100644
--- a/graphics/ketcindy/ketcindyfolder/scripts/ketlib/ketcindylibbasic1r.cs
+++ b/graphics/ketcindy/ketcindyfolder/scripts/ketlib/ketcindylibbasic1r.cs
@@ -16,7 +16,7 @@
println("KeTCindy V.3.3.0");
println(ketjavaversion());
-println("ketcindylibbasic1[20190927] loaded");
+println("ketcindylibbasic1[20191203] loaded");
//help:start();
@@ -69,7 +69,8 @@ Ketinit(work,sy,rangex,rangey,strictsep):=(////190831to
TenSizeInit=0.02;
TenSize=TenSizeInit;
YaSize=1; YaAngle=18; YaPosition=1;
- YaCut=0; YasenStyle="dr,1"; Yajiristyle="tf";
+ YaCut=0.2; //191203
+ YasenStyle="dr,1"; Yajiristyle="tf";
KETPICCOUNT=1;
KCOLOR=[0,0,0];
GLIST=[]; // no ketjs
@@ -99,7 +100,7 @@ Ketinit(work,sy,rangex,rangey,strictsep):=(////190831to
FigPdfList=[]; // 16.04.08 //no ketjs off
Fillstore(); //181212
ADDPACK=[]; // 16.05.16 //no ketjs on
- GPACK="tpic"; //180817
+ if(!isstring(GPACK),GPACK="tpic",Usegraphics(GPACK)); //180817//191002
ErrFlag=0;
KETJSOP=[]; //190129
REMOVEPTJS=[]; SLIDEFLG="Y"; //190504
@@ -329,14 +330,22 @@ Setwindow(str):=(
tmp=indexof(str,"="); // 16.02.10
msg=Toupper(substring(str,tmp,tmp+1));
Strictmove("SW"); Strictmove("NE");//190927
- if((ispoint(SW) & ispoint(NE)),
+ if((ispoint(SW)) & (ispoint(NE)),
tmp1=LLcrd(Ptpos(SW));//190912[2lines]
tmp2=LLcrd(Ptpos(NE));
XMIN=tmp1_1; XMAX=tmp2_1;
YMIN=tmp1_2; YMAX=tmp2_2;
,
- Putpoint("SW",Pcrd([XMIN,YMIN]));
- Putpoint("NE", Pcrd([XMAX,YMAX]));
+ if(!ispoint(SW), //191005from
+ Putpoint("SW",Pcrd([-5,-5]));
+ XMIN=-5; YMIN=-5;
+ Ptpos(SW,SW.xy);
+ );
+ if(!ispoint(NE),
+ Putpoint("NE", Pcrd([5,5]));
+ XMAX=5; YMAX=5;
+ Ptpos(NE,NE.xy);
+ ); //191005to
);
if(msg=="Y", // no ketjs on
println("Setwindow(["+XMIN+","+XMAX+"],["+YMIN+","+YMAX+"])");
@@ -346,7 +355,8 @@ Setwindow(str):=(
drawpoly([Pcrd([XMIN,YMIN]), Pcrd([XMAX,YMIN]),
Pcrd([XMAX,YMAX]),Pcrd([XMIN,YMAX])],color->[1,1,1]); // no ketjs off
);
-Setwindow(xrange,yrange):=(
+Setwindow(xrange,yrange):=Setwindow(xrange,yrange,"Msg=y");
+Setwindow(xrange,yrange,msg):=(
//help:Setwindow([2,3],[-1,1]);
XMIN=xrange_1;
XMAX=xrange_2;
@@ -359,6 +369,9 @@ Setwindow(xrange,yrange):=(
autoclearlayer(KETPICLAYER,true);
drawpoly([Pcrd([XMIN,YMIN]), Pcrd([XMAX,YMIN]),
Pcrd([XMAX,YMAX]),Pcrd([XMIN,YMAX])],color->[1,1,1]); //190927to
+ if(Toupper(substring(msg,0,1))=="Y",
+ println("Setwindow(["+XMIN+","+XMAX+"],["+YMIN+","+YMAX+"])");
+ );
);
////%Setwindow end////
@@ -896,14 +909,35 @@ Changework(dirorg,options):=( //16.10.21
////%Changework end////
////%Changestyle start////
-Changestyle(nameL,style):=(
+Changestyle(nameL,styleorg):=(
//help:Changestyle(["sgAB"],["da"]);
- regional(nmL,name,Ltype,Ltypeorg,Noflg,color,opcindy,tmp);
+ regional(nmL,name,style,Ltype,Ltypeorg,Noflg,reL,color,opcindy,
+ tmp,tmp1,tmp2);
+ style=styleorg; //191203from
+ style=apply(style,
+ if(isstring(#),replace(#,",color->","Color="),#);
+ ); //191203to
tmp=Divoptions(style);
Ltypeorg=tmp_1;
Noflg=tmp_2;
color=tmp_(length(tmp)-2);
opcindy=tmp_(length(tmp));
+ reL=tmp_6; //191203from
+ if(length(reL)>0,
+ tmp1=reL_1;
+ if(islist(tmp1),
+ tmp=tmp1_1;
+ if(tmp==0,tmp2="dr");
+ if(tmp==1,tmp2="da");
+ if(tmp==2,tmp2="id");
+ if(tmp==3,tmp2="do");
+ if(tmp==-1,tmp2="nodisp");
+ forall(2..(length(tmp1)),
+ if(tmp1_# !=0,tmp2=tmp2+","+text(tmp1_#));
+ );
+ Ltypeorg=tmp2;
+ );
+ );
if(islist(nameL),nmL=nameL,nmL=[nameL]);
forall(nmL,name,
tmp=select(GCLIST,#_1==name);
@@ -3962,8 +3996,9 @@ Pointdata(nm,listorg,options):=(
inside=text(tmp);
,
if(contains(["0","1"],tmp2),
+ tmp2=tmp_2; //191025
tmp=[1,1,1]-color;
- tmp=parse(tmp_2)*tmp;
+ tmp=parse(tmp2)*tmp; //191025
inside=[1,1,1]-tmp;
,
if(tmp2=="N",
@@ -5043,22 +5078,37 @@ Framedata(nm,list,optionsorg):=( //190424modified
//help:Framedata();
//help:Framedata("1",[C,A]);
//help:Framedata("1",[C,dx,dy]);
+//help:Framedata("1",[p1,p2],["corner"]);
regional(name,options,Out,tmp,tmp1,x1,x2,y1,y2,dx,dy,
- opcindy,Ltype,Noflg,strL,cent,dx,dy,color);
+ opcindy,Ltype,Noflg,strL,cent,dx,dy,color,strL,corner);
name="fr"+nm;
options=optionsorg;
tmp=Divoptions(options);
Ltype=tmp_1;
Noflg=tmp_2;
+ strL=tmp_7; //191126
color=tmp_(length(tmp)-2);
opcindy=tmp_(length(tmp));
- if(length(list)==2, // 15.05.12
- cent=Lcrd(list_1); tmp=Lcrd(list_2);
- dx=abs(tmp_1-cent_1); dy=abs(tmp_2-cent_2);
- ,
- cent=Lcrd(list_1);
- dx=list_2; dy=list_3;
+ corner=0; //191126from
+ forall(strL,
+ tmp=substring(Toupper(#),0,1);
+ if(tmp=="C",
+ cent=(list_1+list_2)/2;
+ dx=abs(list_2_1-list_1_1)/2;
+ dy=abs(list_2_2-list_1_2)/2;
+ corner=1;
+ options=remove(options,[#]);
+ );
);
+ if(corner==0,
+ if(length(list)==2, // 15.05.12
+ cent=Lcrd(list_1); tmp=Lcrd(list_2);
+ dx=abs(tmp_1-cent_1); dy=abs(tmp_2-cent_2);
+ ,
+ cent=Lcrd(list_1);
+ dx=list_2; dy=list_3;
+ );
+ ); //191126to
x1=cent_1-dx; x2=cent_1+dx;
y1=cent_2-dy; y2=cent_2+dy;
Listplot("-"+name,[[x1,y1],[x2,y1],[x2,y2],[x1,y2],[x1,y1]],options);
@@ -5276,14 +5326,14 @@ Ellipseplot(nm,ptlist,Arg):=(
Ellipseplot(nm,ptlist,rng,options):=(
//help:Ellipseplot("1",[A,B,3]);
//help:Ellipseplot("1",[A,B,C],"[0,pi]",[options]);
- regional(pA,pB,d,angle,f,a,b,pM,tmp,tmp1,tmp2);
+ regional(pA,pB,dd,angle,f,a,b,pM,tmp,tmp1,tmp2);
pA=Lcrd(ptlist_1);
tmp1=Lcrd(ptlist_2);
- if(ispoint(ptlist_3),
+ if((ispoint(ptlist_3))%(length(ptlist_3)>1), //191027
tmp2=Lcrd(ptlist_3);
- d=|tmp2-pA|+|tmp2-tmp1|;
+ dd=|tmp2-pA|+|tmp2-tmp1|;
,
- d=ptlist_3;
+ dd=ptlist_3;
);
tmp=(tmp1-pA)/|tmp1-pA|;
if(tmp_2>=0,
@@ -5297,8 +5347,8 @@ Ellipseplot(nm,ptlist,rng,options):=(
);
pB=Rotatepoint(tmp1,-angle,pA);
f=|pB_1-pA_1|/2;
- a=d/2;
- b=sqrt(d^2/4-f^2);
+ a=dd/2;
+ b=sqrt(dd^2/4-f^2);
pM=(pA+pB)/2;
tmp="["+format(pM_1,5)+","+format(pM_2,5)+"]";
tmp=tmp+"+["+format(a,5)+"*cos(t),"+format(b,5)+"*sin(t)]";
@@ -5337,7 +5387,7 @@ Hyperbolaplot(nm,ptlist,rng,optionsorg):=(
);
pA=Lcrd(ptlist_1);
tmp1=Lcrd(ptlist_2);
- if(ispoint(ptlist_3),
+ if((ispoint(ptlist_3))%(length(ptlist_3)>1), //191027
tmp2=Lcrd(ptlist_3);
d=abs(|tmp2-pA|-|tmp2-tmp1|);
,