DXFファイルを作る
ご注意
別途外部アプリケーション等必要です。
LET N=51 LET XS=-3 LET XE=3 LET ZS=-3 LET ZE=3 LET YS=-6 LET YE=6 LET MODE=0 INPUT PROMPT "SAVE FILENAME(.DXF)=":F$ IF POS(F$,".")=0 THEN LET F$=F$ & ".DXF" OPEN #1:NAME F$ PRINT #1:"0" PRINT #1:"SECTION" PRINT #1:"2" PRINT #1:"ENTITIES" FOR I=0 TO N-1 FOR J=0 TO N-1 LET Z=ZS+(ZE-ZS)/(N-1)*I LET X=XS+(XE-XS)/(N-1)*J LET Y=FUNC(MODE,X,Z) LET Y=MIN(YE,MAX(Y,YS)) PRINT #1:"0" PRINT #1:"3DFACE" PRINT #1:"8" PRINT #1:"LAYER1" PRINT #1:"62" PRINT #1:"1" PRINT #1:"10" PRINT #1:X PRINT #1:"20" PRINT #1:Y PRINT #1:"30" PRINT #1:Z LET Z=ZS+(ZE-ZS)/(N-1)*I LET X=XS+(XE-XS)/(N-1)*(J+1) LET Y=FUNC(MODE,X,Z) LET Y=MIN(YE,MAX(Y,YS)) PRINT #1:"11" PRINT #1:X PRINT #1:"21" PRINT #1:Y PRINT #1:"31" PRINT #1:Z LET Z=ZS+(ZE-ZS)/(N-1)*(I+1) LET X=XS+(XE-XS)/(N-1)*(J+1) LET Y=FUNC(MODE,X,Z) LET Y=MIN(YE,MAX(Y,YS)) PRINT #1:"12" PRINT #1:X PRINT #1:"22" PRINT #1:Y PRINT #1:"32" PRINT #1:Z LET Z=ZS+(ZE-ZS)/(N-1)*(I+1) LET X=XS+(XE-XS)/(N-1)*J LET Y=FUNC(MODE,X,Z) LET Y=MIN(YE,MAX(Y,YS)) PRINT #1:"13" PRINT #1:X PRINT #1:"23" PRINT #1:Y PRINT #1:"33" PRINT #1:Z NEXT J NEXT I PRINT #1:"0" PRINT #1:"ENDSEC" PRINT #1:"0" PRINT #1:"EOF" CLOSE #1 END
EXTERNAL FUNCTION FUNC(MODE,X,Y) SELECT CASE MODE CASE 0 LET FUNC=COS(5*SQR(X*X+Y*Y)) CASE 1 LET FUNC=X*Y*(X^2-Y^2) CASE 2 LET FUNC=(X^2-Y^2)/2 CASE 3 LET FUNC=EXP(-X^2-Y^2)*(X^2+Y^2) CASE 4 IF (X^2-1)*(X^2-9)*(Y^2-1)*(Y^2-9)>0 THEN LET FUNC=2 ELSE LET FUNC=0 END IF CASE 5 LET Z=4-X^2-Y^2 IF Z>0 THEN LET FUNC=SQR(Z) ELSE LET FUNC=0 END SELECT END FUNCTION
|