|
※実行の際には別途、ビューワ等の外部アプリケーションが必要です。
INPUT PROMPT "LEVEL=":LEV
LET L=200
FILE GETSAVENAME F$,"DXFファイル|*.DXF"
IF F$="" THEN STOP
IF RIGHT$(F$,1)="!" THEN LET F$=F$(1:LEN(F$)-1) & "C曲線" & STR$(LEV)
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"
CALL RECURSIVE(LEV,L)
PRINT #1:"0"
PRINT #1:"ENDSEC"
PRINT #1:"0"
PRINT #1:"EOF"
CLOSE #1
SUB RECURSIVE(LEV,L)
IF LEV=0 THEN
CALL MOVE(L)
ELSE
CALL TURN(45)
CALL RECURSIVE(LEV-1,L/SQR(2))
CALL TURN(-90)
CALL RECURSIVE(LEV-1,L/SQR(2))
CALL TURN(45)
END IF
END SUB
SUB MOVE(L)
LET X1=X0+L*COS(ALPHA*PI/180)
LET Y1=Y0-L*SIN(ALPHA*PI/180)
LET Z0=0
LET Z1=50
PRINT #1:"0"
PRINT #1:"3DFACE"
PRINT #1:"8"
PRINT #1:"LAYER1"
PRINT #1:"62"
PRINT #1:"1"
PRINT #1:"10"
PRINT #1:X0
PRINT #1:"20"
PRINT #1:Y0
PRINT #1:"30"
PRINT #1:Z0
PRINT #1:"11"
PRINT #1:X1
PRINT #1:"21"
PRINT #1:Y1
PRINT #1:"31"
PRINT #1:Z0
PRINT #1:"12"
PRINT #1:X1
PRINT #1:"22"
PRINT #1:Y1
PRINT #1:"32"
PRINT #1:Z1
PRINT #1:"13"
PRINT #1:X0
PRINT #1:"23"
PRINT #1:Y0
PRINT #1:"33"
PRINT #1:Z1
LET X0=X1
LET Y0=Y1
END SUB
SUB TURN(R)
LET ALPHA=MOD(ALPHA+R+360,360)
END SUB
END
|
|