|
OPTION BASE 0
RANDOMIZE
LET N=360
DIM X1(N),Y1(N),Z1(N),X2(N),Y2(N),Z2(N)
!'----------------------------------------------------------------
LET A=INT(RND*7)+1
LET B=INT(RND*7)+1
LET R=INT(RND*10)+3
FOR I=0 TO N
LET ALPHA=I*720/N
LET X1(I)=(A+R*SIN(ALPHA/2*PI/180))*COS(ALPHA*PI/180)
LET Z1(I)=(A+R*SIN(ALPHA/2*PI/180))*SIN(ALPHA*PI/180)
LET Y1(I)=A+R*COS(ALPHA/2*PI/180)
LET X2(I)=(B+R*SIN(ALPHA/2*PI/180))*COS(ALPHA*PI/180)
LET Z2(I)=(B+R*SIN(ALPHA/2*PI/180))*SIN(ALPHA*PI/180)
LET Y2(I)=B+R*COS(ALPHA/2*PI/180)
NEXT I
!'----------------------------------------------------------------
!'LET A1=INT(RND*5)+1
!'LET B1=INT(RND*5)+1
!'LET C1=INT(RND*5)+1
!'LET A2=INT(RND*5)+1
!'LET B2=INT(RND*5)+1
!'LET C2=INT(RND*5)+1
!'LET R1=INT(RND*30)+5
!'LET R2=INT(RND*30)+5
!'LET RR1=INT(RND*30)+5
!'LET RR2=INT(RND*30)+5
!'LET N1=INT(RND*10)+1
!'LET N2=INT(RND*10)+1
!'FOR I=0 TO N
!' LET T=I*PI/180
!' LET X1(I)=A1*COS(T)*(R1+RR1*COS(N1*T))
!' LET Y1(I)=B1*SIN(T)*(R1+RR1*SIN(N1*T))
!' LET Z1(I)=C1*SIN(T)*(R1+RR1*COS(N1*T))
!' LET X2(I)=A2*COS(T)*(R2+RR2*COS(N2*T))
!' LET Y2(I)=B2*SIN(T)*(R2+RR2*SIN(N2*T))
!' LET Z2(I)=C2*SIN(T)*(R2+RR2*COS(N2*T))
!'NEXT I
FILE GETSAVENAME F$,"dxfファイル|*.dxf"
IF F$="" THEN STOP
IF RIGHT$(F$,1)="!" THEN LET F$=F$(1:LEN(F$)-1) & "メビウスの帯" & STR$(A) & "_"&STR$(B) & "_" & STR$(R)
IF POS(UCASE$(F$),".DXF")=0 THEN LET F$=F$ & ".dxf"
OPEN #1:NAME F$
ERASE #1
PRINT #1:"0"
PRINT #1:"SECTION"
PRINT #1:"2"
PRINT #1:"ENTITIES"
FOR I=0 TO N-1
PRINT #1:"0"
PRINT #1:"3DFACE"
PRINT #1:"8"
PRINT #1:"LAYER1"
PRINT #1:"62"
PRINT #1:"1"
PRINT #1:"10"
PRINT #1:X1(I)
PRINT #1:"20"
PRINT #1:Y1(I)
PRINT #1:"30"
PRINT #1:Z1(I)
PRINT #1:"11"
PRINT #1:X2(I)
PRINT #1:"21"
PRINT #1:Y2(I)
PRINT #1:"31"
PRINT #1:Z2(I)
PRINT #1:"12"
PRINT #1:X2(I+1)
PRINT #1:"22"
PRINT #1:Y2(I+1)
PRINT #1:"32"
PRINT #1:Z2(I+1)
PRINT #1:"13"
PRINT #1:X1(I+1)
PRINT #1:"23"
PRINT #1:Y1(I+1)
PRINT #1:"33"
PRINT #1:Z1(I+1)
NEXT I
PRINT #1:"0"
PRINT #1:"ENDSEC"
PRINT #1:"0"
PRINT #1:"EOF"
CLOSE #1
END
|
|