summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/ketcindy/ketlibC/surflib.h
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/scripts/ketcindy/ketlibC/surflib.h')
-rw-r--r--Master/texmf-dist/scripts/ketcindy/ketlibC/surflib.h80
1 files changed, 34 insertions, 46 deletions
diff --git a/Master/texmf-dist/scripts/ketcindy/ketlibC/surflib.h b/Master/texmf-dist/scripts/ketcindy/ketlibC/surflib.h
index 7f5d9923c9a..d502a2b15c3 100644
--- a/Master/texmf-dist/scripts/ketcindy/ketlibC/surflib.h
+++ b/Master/texmf-dist/scripts/ketcindy/ketlibC/surflib.h
@@ -1,3 +1,7 @@
+// 181025
+// crv3onsfparadata debugged (case of out=NULL )
+// 181023
+// pthiddenQ changed ( int flg, double out[4] )
// 180430
// crv2sfparadata,wireparadata added
// output3h,output3 chanded
@@ -626,10 +630,10 @@ double funpthiddenQ(short ch,double u, double v,double pa[3]){
return out;
}
-double pthiddenQ(short ch,double pta[3], int uveq){
+int pthiddenQ(short ch,double pta[3], int uveq,double out[4]){
int i, j, k;
double Vec[3]={sin(THETA)*cos(PHI),sin(THETA)*sin(PHI),cos(THETA)};
- double v1,v2,v3,out=-Inf;
+ double v1,v2,v3;
double du=(Urng[1]-Urng[0])/Mdv, dv=(Vrng[1]-Vrng[0])/Ndv;
double uval1,uval2,vval1,vval2,eval11,eval12,eval21,eval22;
double pl[5][2], vl[5], ql[11][2],p1[2],p2[2],m1,m2;
@@ -637,6 +641,7 @@ double pthiddenQ(short ch,double pta[3], int uveq){
double tmpd1, tmpd2[2],tmpd3[3],tmp1d3[3];
// Out=1 : hidden
// SL : List of segments near PtA+Vec
+ out[3]=-Inf;
for(j=0; j<=Ndv-1; j++){
vval1=Vrng[0]+j*dv;
vval2=Vrng[0]+(j+1)*dv;
@@ -718,23 +723,27 @@ double pthiddenQ(short ch,double pta[3], int uveq){
if(norm(3,tmp1d3)<Eps1){
tmpd1=zparapt(ptd3)-zparapt(pta)-Eps2;
if(tmpd1>0){
- return tmpd1;
+ copyd(0,2,ptd3,out); out[3]=tmpd1;
+ return 1;
}else{
- out=fmax(out,tmpd1);
+ if(tmpd1>out[3]){
+ copyd(0,2,ptd3,out); out[3]=tmpd1;
+ }
}
}
}
}
}
- return out;
+ return 0;
}
int nohiddenpara2(short ch,double par[], double fk[][3], int uveq, double figkL[][3]){
double eps0=pow(10,-4.0), s, p1[2], p2[2], q[2],tmpd1, tmpd2[2],tmp1,tmp2;
- double paL[DsizeM], fh[DsizeM][2], pta[3], ptap[2], vec[3],flgd;
+ double paL[DsizeM], fh[DsizeM][2], pta[3], ptap[2], vec[3];
double figL[DsizeM][2], tmpmd2[DsizeM][2], tmpmd3[DsizeM][3];
double tmp1d2[2], tmp2d2[2], tmp3d2[2], tmpd3[3],tmpd4[4];
double pd2[2], qd2[2], pd3[3], qd3[3], sp, sq, tp, tq, dtmp, dtmp1, dtmp2;
+ int flg;
int ncusp=floor(Cusppt[0][0]+0.5), seL[DsizeM];
int i,j,n, nfh, nfk, cspflg,tmpi1[DsizeM];
vec[0]=sin(THETA)*cos(PHI);
@@ -787,41 +796,17 @@ int nohiddenpara2(short ch,double par[], double fk[][3], int uveq, double figkL[
s=(paL[n]+paL[n+1])/2.0;
invparapt(s,fh,fk, pta);
parapt(pta,ptap);
- flgd=pthiddenQ(ch,pta, uveq);
- if(flgd<=0){ //180518
+ flg=pthiddenQ(ch,pta, uveq, tmpd4);
+ if(flg==0){ //180518
appendi1(n,seL);
}
}
figL[0][0]=0;figkL[0][0]=0;
for(i=1; i<=seL[0]; i++){
- pointoncurve(paL[seL[i]], fh, Eps, tmp1d2);
- pointoncurve(paL[seL[i]+1], fh, Eps, tmp2d2);
- if(i==1){
- copyd(0,1,tmp1d2,pd2);
- sp=paL[seL[i]];
- copyd(0,1,tmp2d2,qd2);
- sq=paL[seL[i]+1];
- }
- else{
- if(memberi(seL[i]-1,seL)==1){
- copyd(0,1,tmp2d2,qd2);
- sq=paL[seL[i]+1];
- }
- else{
- partcrv(sp,sq,fh,tmpmd2);
- appendd2(2,1,length2(tmpmd2),tmpmd2,figL);
- tp=invparapt(sp,fh,fk, tmpd3);
- tq=invparapt(sq,fh,fk,tmpd3);
- partcrv3(tp,tq,fk,tmpmd3);
- appendd3(2,1,length3(tmpmd3),tmpmd3,figkL);
- copyd(0,1,tmp1d2,pd2);
- sp=paL[seL[i]];
- copyd(0,1,tmp2d2,qd2);
- sq=paL[seL[i]+1];
- }
- }
- }
- if(seL[0]>0){
+ sp=paL[seL[i]]; //180616from
+ sq=paL[seL[i]+1];
+ pointoncurve(sp, fh, Eps, pd2);
+ pointoncurve(sq, fh, Eps, qd2);
if(dist(2,pd2,qd2)>Eps1){
nearestptpt(pd2,fh,tmpd4);
dtmp1=tmpd4[2];
@@ -833,11 +818,13 @@ int nohiddenpara2(short ch,double par[], double fk[][3], int uveq, double figkL[
tq=invparapt(sq,fh,fk,tmpd3);
partcrv3(tp,tq,fk,tmpmd3);
appendd3(2,1,length3(tmpmd3), tmpmd3, figkL);
- }
- else{
- appendd2(2,1,nfh, fh, figL);
- appendd3(2,1,nfk,fk,figkL);
- }
+ }//180616to
+ else{//180705from
+ if(fabs(sp-sq)>1){
+ appendd2(2,1,length2(fh),fh,figL);
+ appendd3(2,1,length3(fk),fk,figkL);
+ }
+ }//180705to
}
tmpi1[0]=0;
for(i=1; i<=length1(paL)-1; i++){
@@ -1338,7 +1325,7 @@ void crv3onsfparadata(short ch,double fk[][3], double fbdyd3[][3], double out[][
dataindexd2(2,fh,din);
for(i=1;i<=din[0][0];i++){
fhs[0][0]=0; fks[0][0]=0;
- appendd2(0,din[i][0],din[i][1],fh,fhs);
+ appendd2(0,din[i][0],din[i][1],fh,fhs);
appendd3(0,din[i][0],din[i][1],fk,fks);
tmpmd3[0][0]=0;
if(length2(fhs)>1){
@@ -1353,8 +1340,9 @@ void crv3onsfparadata(short ch,double fk[][3], double fbdyd3[][3], double out[][
connectseg3(out, Eps1,tmpmd3);
out[0][0]=0;
appendd3(0,1,length3(tmpmd3),tmpmd3,out);
+ push3(Inf,3,0,out); //181025
connectseg3(outh, Eps1,tmpmd3);
- appendd3(3,1,length3(tmpmd3),tmpmd3,out);
+ appendd3(0,1,length3(tmpmd3),tmpmd3,out);//181025
}
void crv2onsfparadata(short ch,double fh[][2], double fbdyd3[][3], double out[][3]){
@@ -1368,9 +1356,9 @@ void wireparadata(short ch,double bdyk[][3], double udata[], double vdata[],cons
double du=(Urng[1]-Urng[0])/Mdv;
double dv=(Vrng[1]-Vrng[0])/Ndv;
int i,j,din[DsizeS][2];
- short allflg=0;
- if(strlen(fnameh)==0){
- allflg=1;
+ short allflg=1;
+ if(strlen(fnameh)>0){
+ allflg=0;
}
char var[20]="wire3d";
char varh[20]="wireh3d";