|
OPTION BASE 0
DIM X(100,100),Y(100,100),Z(100,100)
INPUT PROMPT "MODE(0 - 47)=":MODE
FOR I=0 TO MODE
READ N,M,S0,E0,S1,E1,FF$
NEXT I
DATA 20,20,0,360,0,360,"トーラス" !'0
DATA 20,20,0,360,0,360,"パイン" !'1
DATA 20,20,0,360,0,360,"円柱" !'2
DATA 20,20,0,360,-180,180,"一葉双曲面" !'3
DATA 20,20,0,360,0,360,"カクテルグラス" !'4
DATA 20,20,0,360,-57,160,"ワイングラス" !'5
DATA 20,20,0,360,0,360,"アステロイド回転" !'6
DATA 20,20,0,360,0,360,"とんがり帽子" !'7
DATA 20,20,0,360,0,360,"トーラス2" !'8
DATA 20,20,0,360,0,360,"トーラス3" !'9
DATA 20,20,0,360,0,360,"トーラス4" !'10
DATA 20,100,0,360,0,1800,"トーラス5" !'11
DATA 20,100,0,360,0,1800,"トーラス6" !'12
DATA 20,20,0,360,-54,90,"花瓶" !'13
DATA 20,20,0,360,116,486,"壷" !'14
DATA 20,20,0,360,0,360,"ワイングラス2" !'15
DATA 20,20,0,360,-51,68,"タンブラーグラス" !'16
DATA 20,20,0,360,0,360,"カクテルグラス2" !'17
DATA 20,100,0,360,0,1800,"螺旋" !'18
DATA 20,60,0,360,0,1080,"トーラス7" !'19
DATA 20,20,0,180,0,360,"球" !'20
DATA 20,20,90,360,0,360,"トーラス8" !'21
DATA 20,20,0,360,0,900,"トーラス9" !'22
DATA 20,20,0,360,0,360,"トーラス10" !'23
DATA 20,4,0,360,-17,17,"トーラス11" !'24
DATA 20,20,0,360,0,360,"超楕円面" !'25
DATA 20,20,0,360,0,360,"超1葉双曲面" !'26
DATA 20,20,0,180,0,360,"超2葉双曲面" !'27
DATA 20,20,0,360,0,360,"超トーラス面" !'28
DATA 20,20,-180,180,-180,180,"星芒形球面" !'29
DATA 20,20,-1,1,0,360,"カテノイド" !'30
DATA 20,20,-.8,.8,-2,2,"つばめの尾" !'31
DATA 20,20,0,360,0,360,"ボヘミアンドーム" !'32
DATA 20,20,-1,1,-1,1,"エヌバー曲面" !'33
DATA 20,20,0,360,0,360,"巻き貝" !'34
DATA 20,20,0,360,0,360,"ロマン曲面" !'35
DATA 20,20,-180,180,0,180,"ボーイ曲面" !'36
DATA 20,20,0,360,0,360,"クエン" !'37
DATA 20,20,0,4320,0,360,"トーラス結び目" !'38
DATA 20,20,-360,360,-2,2,"カタラン" !'39
DATA 20,20,0,720,.05,2,"ディニー" !'40
DATA 20,20,0,360,-2,2,"ヘリコイド" !'41
DATA 20,20,-1,1,0,360,"ヘンネベルク" !'42
DATA 20,20,0,360,0,360,"クラインの壷" !'43
DATA 20,20,0,360,0,360,"COS回転体" !'44
DATA 20,20,0,360,0,360,"COS回転体2" !'45
DATA 20,20,0,360,0,360,"立方体" !'46
DATA 20,20,0,360,0,360,"レムニスケート" !'47
FOR J=0 TO M
LET BETA=S1+J*(E1-S1)/M
FOR I=0 TO N
LET ALPHA=S0+I*(E0-S0)/N
CALL FUNC(MODE,ALPHA,BETA,X(J,I),Y(J,I),Z(J,I))
NEXT I
NEXT J
FILE GETSAVENAME F$,"dxfファイル|*.dxf"
IF F$="" THEN STOP
IF RIGHT$(F$,1)="!" THEN LET F$=F$(1:LEN(F$)-1) & FF$
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 M-1
FOR J=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:X(I,J)
PRINT #1:"20"
PRINT #1:Y(I,J)
PRINT #1:"30"
PRINT #1:Z(I,J)
PRINT #1:"11"
PRINT #1:X(I,J+1)
PRINT #1:"21"
PRINT #1:Y(I,J+1)
PRINT #1:"31"
PRINT #1:Z(I,J+1)
PRINT #1:"12"
PRINT #1:X(I+1,J+1)
PRINT #1:"22"
PRINT #1:Y(I+1,J+1)
PRINT #1:"32"
PRINT #1:Z(I+1,J+1)
PRINT #1:"13"
PRINT #1:X(I+1,J)
PRINT #1:"23"
PRINT #1:Y(I+1,J)
PRINT #1:"33"
PRINT #1:Z(I+1,J)
NEXT J
NEXT I
PRINT #1:"0"
PRINT #1:"ENDSEC"
PRINT #1:"0"
PRINT #1:"EOF"
CLOSE #1
END
EXTERNAL SUB FUNC(MODE,TT,SS,X,Y,Z)
LET S=SS*PI/180
LET T=TT*PI/180
SELECT CASE MODE
CASE 0
LET X=(2+0.5*COS(T))*COS(S)
LET Y=0.5*SIN(T)
LET Z=(2+0.5*COS(T))*SIN(S)
CASE 1
LET X=INT(2+0.5*COS(T))*COS(S)
LET Y=0.5*SIN(T)
LET Z=INT(2+0.5*COS(T))*SIN(S)
CASE 2
LET X=COS(T)
LET Y=S
LET Z=SIN(T)
CASE 3
LET X=COSH(S)*COS(T)
LET Y=SINH(S)
LET Z=COSH(S)*SIN(T)
CASE 4
LET X=(INT(S+1)+INT(S-1.5)-2.35)*COS(T)
LET Y=S
LET Z=(INT(S+1)+INT(S-1.5)-2.35)*SIN(T)
CASE 5
IF S=0 THEN
LET X=0
LET Z=0
ELSE
LET X=MAX(S^2*SIN(1/S^2),0.1)*COS(T)
LET Z=MAX(S^2*SIN(1/S^2),0.1)*SIN(T)
END IF
LET Y=S
CASE 6
LET X=4*COS(S)^3*COS(T)
LET Z=4*COS(S)^3*SIN(T)
LET Y=4*SIN(S)^3
CASE 7
LET X=S*COS(T)
LET Z=S*SIN(T)
LET Y=6*EXP(-S^(2/3))
CASE 8
LET X=(2+0.5*COS(T))*COS(S)
LET Y=0.5*SIN(T)+0.2*SIN(5*S)
LET Z=(2+0.5*COS(T))*SIN(S)
CASE 9
LET X=(2+0.3*COS(T)+COS(10*S))*COS(S)
LET Y=1.5*SIN(T)+1.2*SIN(10*S)
LET Z=(2+0.3*COS(T)+COS(10*S))*SIN(S)
CASE 10
LET X=(2+0.5*COS(T))*(1+0.4*COS(5*S))*COS(S)
LET Z=(2+0.5*COS(T))*(1+0.4*COS(5*S))*SIN(S)
LET Y=0.5*SIN(T)
CASE 11
LET X=(3-S/10+0.5*COS(T))*COS(S)
LET Z=(3-S/10+0.5*COS(T))*SIN(S)
LET Y=0.5*SIN(T)+S/6
CASE 12
LET X=(3-S/10+0.5*COS(T))*(1-S/10/PI)*COS(S)
LET Z=(3-S/10+0.5*COS(T))*(1-S/10/PI)*SIN(S)
LET Y=0.5*(1-S/10/PI)*SIN(T)+S/6
CASE 13
LET X=(3*COS(S)-3.5)*COS(T)
LET Y=2*SIN(S)-1
LET Z=(3*COS(S)-3.5)*SIN(T)
CASE 14
LET X=(2-INT(COS(T)))*COS(S)
LET Y=T
LET Z=(2-INT(COS(T)))*SIN(S)
CASE 15
LET Y=S
LET X=(ABS(1.1*SQR(S)-1)+ABS(1.1*SQR(S)-2)-.8)*COS(T)
LET Z=(ABS(1.1*SQR(S)-1)+ABS(1.1*SQR(S)-2)-.8)*SIN(T)
CASE 16
LET X=(0.5*SIN(PI*S)+0.5*S^2+.5)*COS(T)
LET Z=(0.5*SIN(PI*S)+0.5*S^2+.5)*SIN(T)
LET Y=S
CASE 17
LET X=(ABS(S^.7-1)+ABS(S^.7-4^.7)-1.5)*COS(T)
LET Z=(ABS(S^.7-1)+ABS(S^.7-4^.7)-1.5)*SIN(T)
LET Y=S
CASE 18
LET X=(2+0.5*COS(T))*COS(S)
LET Y=0.5*SIN(T)+S/5
LET Z=(2+0.5*COS(T))*SIN(S)
CASE 19
LET X=(2+2.2^(1-S/6/PI)*COS(T))*(1-S/6/PI)*COS(S)
LET Z=-(2+2.2^(1-S/6/PI)*COS(T))*(1-S/6/PI)*SIN(S)
LET Y=2.2^(1-S/6/PI)*(1-S/6/PI)*SIN(T)+10*S/6/PI
CASE 20
LET X=-S*SIN(T)*COS(S)
LET Z=S*SIN(T)*SIN(S)
LET Y=S*COS(T)
CASE 21
LET X=(3+5*COS(S))*COS(T)
LET Z=(3+5*COS(S))*SIN(T)
LET Y=5*SIN(S)
CASE 22
LET X=(2+EXP(-.1*T)*COS(S))*COS(T)
LET Z=(2+EXP(-.1*T)*COS(S))*SIN(T)
LET Y=EXP(-.1*T)*SIN(S)
CASE 23
LET X=(9+4*COS(S))*COS(7*T)
LET Z=(9+4*COS(S))*SIN(7*T)
LET Y=4*SIN(S)
CASE 24
LET X=(9+4*COS(S+11*T))*COS(T)
LET Z=(9+4*COS(S+11*T))*SIN(T)
LET Y=4*SIN(S+11*T)
CASE 25
LET X=.5*SGN(COS(S))*ABS(COS(S))^1.5*SGN(COS(T))*ABS(COS(T))^.5
LET Z=.7*SGN(SIN(S))*ABS(SIN(S))^1.5*SGN(COS(T))*ABS(COS(T))^.5
LET Y=SGN(SIN(T))*ABS(SIN(T))^.5
CASE 26
LET X=.5*SGN(COS(S))*ABS(COS(S))^1.7*SGN(COSH(T))*ABS(COSH(T))^1.2
LET Z=.7*SGN(SIN(S))*ABS(SIN(S))^1.7*SGN(COSH(T))*ABS(COSH(T))^1.2
LET Y=SGN(SINH(T))*ABS(SINH(T))^1.2
CASE 27
LET X=.5*SGN(COS(S))*ABS(COS(S))^2.7*SGN(SINH(T))*ABS(SINH(T))^2.3
LET Z=.7*SGN(SIN(S))*ABS(SIN(S))^2.7*SGN(SINH(T))*ABS(SINH(T))^2.3
LET Y=SGN(COSH(T))*ABS(COSH(T))^2.3
CASE 28
LET X=.5*SGN(COS(S))*ABS(COS(S))^2.5*(2+SGN(COS(T))*ABS(COS(T))^.4)
LET Z=.7*SGN(SIN(S))*ABS(SIN(S))^2.5*(2+SGN(COS(T))*ABS(COS(T))^.4)
LET Y=SGN(SIN(T))*ABS(SIN(T))^.4
CASE 29
LET X=(1.5*COS(S)*COS(T))^3
LET Y=(1.5*SIN(T))^3
LET Z=(1.5*SIN(S)*COS(T))^3
CASE 30
LET X=COSH(TT)*COS(S)
LET Y=TT
LET Z=COSH(TT)*SIN(S)
|
|