summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/ketcindy/ketlib/ketpiccurrent.r
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/scripts/ketcindy/ketlib/ketpiccurrent.r')
-rwxr-xr-xMaster/texmf-dist/scripts/ketcindy/ketlib/ketpiccurrent.r115
1 files changed, 91 insertions, 24 deletions
diff --git a/Master/texmf-dist/scripts/ketcindy/ketlib/ketpiccurrent.r b/Master/texmf-dist/scripts/ketcindy/ketlib/ketpiccurrent.r
index b177e4245bb..0d7791d6fb0 100755
--- a/Master/texmf-dist/scripts/ketcindy/ketlib/ketpiccurrent.r
+++ b/Master/texmf-dist/scripts/ketcindy/ketlib/ketpiccurrent.r
@@ -16,10 +16,16 @@
#########################################
-ThisVersion<- "KeTpic for R v5_2_4(20181128)"
+ThisVersion<- "KeTpic for R v5_2_4(20190127)"
print(ThisVersion)
+# 20190127
+# Mvprod added
+# 20181231
+# Drwpt debugged/changed ( grep removed, N=8 set )
+# 20181230
+# Drwpt changed ( Same, Incolor )
# 20181128
# Objthicksurf debugged
# 20181031
@@ -621,6 +627,29 @@ Dotprod<-function(a,b){ # 18.02.05
return(out)
}
+Mvprod<- function(...){ # 190127
+ varargin<- list(...)
+ mat=varargin[[1]]
+ vec=varargin[[2]]
+ if(length(varargin)>2){
+ nn=varargin[[3]]
+ }else{
+ nn=1
+ }
+ mm=round(length(vec)/nn)
+ mat=matrix(mat,ncol=mm,byrow=TRUE)
+ vec=matrix(vec,nrow=nn,byrow=TRUE)
+ out=c()
+ for(jj in 1:nn){
+ tmp=mat%*%Op(jj,vec)
+ out=c(out,tmp)
+ }
+ if(nn>1){
+ out=matrix(out,nrow=nn,byrow=TRUE)
+ }
+ return(out)
+}
+
Dist<- function(...) # 17.09.17
{
varargin<- list(...)
@@ -2361,29 +2390,45 @@ Drwline<-function(...)
###########################################
-Drwpt<-function(...)
-{ ## Scaling is implemented
+Drwpt<-function(...){
varargin<-list(...)
Nargs<-length(varargin)
if(TenSize>TenSizeInit){
- N<- round(6*sqrt(TenSize/TenSizeInit))
+ N=round(10*sqrt(TenSize/TenSizeInit)) #181231
}
else{
- N<-4
+ if(TenSize==TenSizeInit){ #181231from
+ N=10
+ }else{
+ N=4
+ } #181231to
}
- Tmp<- varargin[[Nargs]]
- if(mode(Tmp)=="numeric"){
- if(length(Tmp)>1){
- Kosa<- 1; All<- Nargs
- }
- else{
- Kosa<- Tmp; All<- Nargs-1
+ All=Nargs #181230from
+ Same="y"
+ Incolor=""
+ Tmp=varargin[[All]]
+ if(is.numeric(Tmp)){
+ if(length(Tmp)==3){Tmp=c(Tmp,1)} #181231
+ if(length(Tmp)==4){
+ if(Tmp[4]<0){ #181231from
+ Same="nn"
+ }else{
+ Incolor=paste(" ",as.character(Tmp[4]),sep="")
+ } #181231to
+ }else{
+ Same="n"
+ Incolor="{"
+ for(J in 4:6){
+ Incolor=paste(Incolor,as.character(Tmp[J]),sep="")
+ if(J<6){
+ Incolor=paste(Incolor,",",sep="")
+ }
+ }
+ Incolor=paste(Incolor,"}",sep="")
}
- }
- else if(mode(Tmp)=="list"){
- Kosa<- 1; All<- Nargs
- }
- CL<-c()
+ All=Nargs-1
+ }#181230to
+ 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))
@@ -2405,9 +2450,29 @@ Drwpt<-function(...)
for (J in 0:N){
PL<- c(PL,P+CL[J+1,])
}
- PL<-matrix(PL,nrow=2)
- PL<-t(PL)
- Mojisu<-0
+ PL<- matrix(PL,nrow=2)
+ PL<- t(PL)
+ if(Same=="n"){ #181230from
+ Str1<- paste("{\\special{pn 0}\\color[rgb]",Incolor,"%\n",sep="")
+ cat(Str1,file=Wfile,append=TRUE)
+ Mojisu<-0
+ for (J in 1:Nrow(PL)){
+ Q<- PL[J,]
+ X<- as.character(round(MilliIn*Q[1]))
+ Y<- as.character(-round(MilliIn*Q[2]))
+ Str<- paste("\\special{pa ",X," ",Y,"}",sep="")
+ cat(Str,file=Wfile,append=TRUE)
+ Mojisu<- Mojisu+nchar(Str)
+ if(Mojisu>80){
+ cat("#\n",file=Wfile,append=TRUE)
+ }
+ Mojisu=0
+ }
+ Str1<- paste("\\special{sh}\\special{fp}}%\n",sep="")
+ cat(Str1,file=Wfile,append=TRUE)
+ }
+ cat("\\special{pn 4}",file=Wfile,append=TRUE) #181231
+ Mojisu=0
for (J in 1:Nrow(PL)){
Q<- PL[J,]
X<- as.character(round(MilliIn*Q[1]))
@@ -2420,10 +2485,12 @@ Drwpt<-function(...)
}
Mojisu=0
}
- Str1<- paste("\\special{sh ",as.character(Kosa),"}",sep="")
- Str2<- "\\special{fp}%\n"
- cat(Str1,file=Wfile,append=TRUE)
- cat(Str2,file=Wfile,append=TRUE)
+ if(Same=="y"){
+ Str1<- paste("\\special{sh",Incolor,"}\\special{fp}%\n",sep="")
+ }else{
+ Str1<- paste("\\special{fp}%\n",sep="")
+ }
+ cat(Str1,file=Wfile,append=TRUE) #181230to
}
}
}