summaryrefslogtreecommitdiff
path: root/graphics/ketcindy/ketcindyfolder/scripts/ketlib/ketcindylib3dr.cs
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/ketcindy/ketcindyfolder/scripts/ketlib/ketcindylib3dr.cs')
-rw-r--r--graphics/ketcindy/ketcindyfolder/scripts/ketlib/ketcindylib3dr.cs107
1 files changed, 66 insertions, 41 deletions
diff --git a/graphics/ketcindy/ketcindyfolder/scripts/ketlib/ketcindylib3dr.cs b/graphics/ketcindy/ketcindyfolder/scripts/ketlib/ketcindylib3dr.cs
index 956e726b43..0f45dc6f61 100644
--- a/graphics/ketcindy/ketcindyfolder/scripts/ketlib/ketcindylib3dr.cs
+++ b/graphics/ketcindy/ketcindyfolder/scripts/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);