SVGファイルを作る
ご注意
別途プラグイン等が必要です。 http://www.adobe.com/jp/svg/
OPTION BASE 0 INPUT PROMPT "SAVE FILENAME(.SVG)=":F$ LET XSIZE=600 LET YSIZE=600 LET L=200 CALL GINIT(XSIZE,YSIZE) IF POS(F$,".")=0 THEN LET F$=F$ & ".SVG" OPEN #1:NAME F$ PRINT #1:"<?xml version=";CHR$(34);"1.0";CHR$(34);" standalone=";CHR$(34);"no";CHR$(34);"?>" PRINT #1:"<!DOCTYPE svg PUBLIC ";CHR$(34);"-//W3C//DTD SVG 20001102//EN";CHR$(34);" ";CHR$(34);"http://www.w3.org/TR/2000/CR-SVG-20001102/DTD/svg-20001102.dtd";chr$(34);">" PRINT #1:"<svg xml:space=";CHR$(34);"default";CHR$(34);" width=";CHR$(34);STR$(XSIZE);CHR$(34);" height=";CHR$(34);STR$(YSIZE);CHR$(34);">" 10 !'INPUT PROMPT "大きさ= ": L INPUT PROMPT "LEVEL(1-14)=": N 20 DIM XA(15), YA(15), LA(15) LET T = PI / 180 LET R = 90 LET X0 = INT(XSIZE/2) LET Y0 = INT(YSIZE/1.5) 30 GOSUB 40 PRINT #1:"</svg>" CLOSE #1 STOP 40 IF N = 0 THEN 90 50 GOSUB 100 60 LET XA(N) = X LET YA(N) = Y LET LA(N) = L 70 LET R = R + 45 LET L = L / SQR(2) LET N = N - 1 GOSUB 40 80 LET R = R - 90 LET L = L / SQR(2) LET N = N - 1 GOSUB 40 LET R = R + 45 90 LET N = N + 1 LET X = XA(N) LET Y = YA(N) LET L = LA(N) RETURN 100 IF N > 1 THEN RETURN 110 IF R >= 360 THEN LET R = MOD(R , 360) 120 IF R < 0 THEN LET R = R + 360 130 LET X = X0 + COS(R * T) * L LET Y = Y0 - SIN(R * T) * L 140 IF X < 0 OR X > XSIZE-1 OR Y > YSIZE-1 OR Y < 0 THEN LET X0 = X LET Y0 = Y RETURN END IF 150 CALL LINE (INT(X0),INT(Y0),INT(X),INT(Y), 7) PRINT #1:"<line x1=";CHR$(34);STR$(INT(X0));CHR$(34);" y1=";CHR$(34);STR$(INT(Y0));CHR$(34);" x2=";CHR$(34);STR$(INT(X));CHR$(34);" y2=";CHR$(34);STR$(INT(Y));CHR$(34);" stroke=";CHR$(34);"black";CHR$(34);" stroke-width=";CHR$(34);"1";CHR$(34);"/>" LET X0 = X LET Y0 = Y RETURN END EXTERNAL SUB GINIT(XSIZE,YSIZE) SET BITMAP SIZE XSIZE,YSIZE SET WINDOW 0 , XSIZE-1 , YSIZE-1, 0 SET POINT STYLE 1 SET COLOR MIX(0) 0,0,0 SET COLOR MIX(1) 0,0,1 SET COLOR MIX(2) 1,0,0 SET COLOR MIX(3) 1,0,1 SET COLOR MIX(4) 0,1,0 SET COLOR MIX(5) 0,1,1 SET COLOR MIX(6) 1,1,0 SET COLOR MIX(7) 1,1,1 CLEAR END SUB EXTERNAL SUB LINE(XS,YS,XE,YE,C) SET COLOR C PLOT LINES: XS,YS;XE,YE END SUB
|