BASIC

Author Topic: Inkscape SVG & DXF(2010) to POLYVECTOR Code or DATA  (Read 5696 times)

Offline pathfinder

  • Mc. Print
  • *
  • Posts: 10
    • View Profile
DXF import completed

Note DXF files coordinate origin is bottom left not top right, the Y coordinate is inversed so if you had a full screen graphic the Y coordinate would be the full screen depth.

DATA export completed
POLYVECTOR export completed

See readme attached on how to use Inkscape with SVGPOLY.

put files in the .app directory, you will have to make a dummy project, paste code below.

Change files names as required. The program will do DXF > SVG > POLYVECTOR. If you want data output, change datamode=1. Glbasic code is in the POLYVECTOR.txt file after it has run.

Code: GLBasic [Select]
// --------------------------------- //
// Project: SVGPOLY
// Start: Sunday, March 10, 2013
// IDE Version: 10.202
// FREE-VERSION:
// Need Premium for Features:
// 3D Graphics
// Network Commands
// INLINE C/C+++ code
// SETCURRENTDIR("Media") // go to media files
GLOBAL screenx%,screeny%,rd$,test$,pos#,rgb1%,rgb2%,rgb3%,spno%
GLOBAL prgb1%,prgb2%,prgb3%,cirx#,ciry#,cdi#,doch%
GLOBAL tempx#, tempy#,temp1$,temp2$,debug$,count%,mode%,isline%
GLOBAL polyvx#[],polyvy#[],tempa$[],tempb$[],dxfname$
GLOBAL datamode%


//change these to set file names
//read dxf
dxfname$ = "a.dxf"
//write svg
test$ = "a.SVG"
//write polyvector code
debug$ = "POLYVECT.TXT"
//polyvector or data mode 1= data 2= polyvector
datamode = 2



DIM tempa$[400]
DIM tempb$[400]
DIM polyvx#[400]
DIM polyvy#[400]

screenx%=640
screeny%=480
//document height, should take from svg!

doch=screeny%

isline=0
mode%=0
IF DOESFILEEXIST(dxfname$)
dxftosvg(dxfname$)
ENDIF

tempx=0.0
tempy=0.0
SETSCREEN screenx%,screeny%,1


OPENFILE(1, test$, TRUE)
OPENFILE(2, debug$, FALSE)
spno% = 0
IF datamode = 2
//write functions()
WRITELINE 2,"sprite_"+MID$(test$,0,INSTR(test$,"."))+"()"
WRITELINE 2,"draw_"+MID$(test$,0,INSTR(test$,"."))+"(0,0,1,1)"
WRITELINE 2,"SHOWSCREEN"
WRITELINE 2,"KEYWAIT"
WRITELINE 2,"END"
WRITELINE 2,"FUNCTION draw_"+MID$(test$,0,INSTR(test$,"."))+":xval#,yval#,scxval#,scyval#"
ENDIF

FOR i = 1 TO 400
IF ENDOFFILE(1)=TRUE THEN BREAK

isline=0
READLINE 1,rd$

IF INSTR(rd$, "pagecolor") > 0

pos# = INSTR(rd$, UCASE$("pagecolor"))
rd$ = LCASE$(MID$(rd$,pos#+12,6))
rgb1% = 0
rgb2% = 0
rgb3% = 0
FOR j = 1 TO 6
IF j = 1 THEN rgb1 = hextoint(MID$(rd$,0,1))*16
IF j = 2 THEN rgb1 = rgb1 +hextoint(MID$(rd$,1,1))
IF j = 3 THEN rgb2 = hextoint(MID$(rd$,2,1))*16
IF j = 4 THEN rgb2 = rgb2 +hextoint(MID$(rd$,3,1))
IF j = 5 THEN rgb3 = hextoint(MID$(rd$,4,1))*16
IF j = 6 THEN rgb3 = rgb3 +hextoint(MID$(rd$,5,1))
NEXT
prgb1%=rgb1%
prgb2%=rgb2%
prgb3%=rgb3%
WRITELINE 2,"DRAWRECT 0, 0, "+screenx%+", "+screeny%+",RGB("+prgb1%+","+prgb2%+","+prgb3%+")"

ENDIF



pos# = INSTR(rd$, "<path")

//draw and write a circle
IF INSTR(rd$, "arc") > 0
READLINE 1,rd$
pos# = INSTR(rd$, "fill:#")
rd$ = LCASE$(MID$(rd$,pos#+6,6))
rgb1% = 0
rgb2% = 0
rgb3% = 0
FOR j = 1 TO 6
IF j = 1 THEN rgb1 = hextoint(MID$(rd$,0,1))*16
IF j = 2 THEN rgb1 = rgb1 +hextoint(MID$(rd$,1,1))
IF j = 3 THEN rgb2 = hextoint(MID$(rd$,2,1))*16
IF j = 4 THEN rgb2 = rgb2 +hextoint(MID$(rd$,3,1))
IF j = 5 THEN rgb3 = hextoint(MID$(rd$,4,1))*16
IF j = 6 THEN rgb3 = rgb3 +hextoint(MID$(rd$,5,1))
NEXT


READLINE 1,rd$
READLINE 1,rd$

cirx=MID$(rd$,INSTR(rd$, "sodipodi:cx=")+13,LEN(rd$)-1)
READLINE 1,rd$
ciry=MID$(rd$,INSTR(rd$, "sodipodi:cy=")+13,LEN(rd$)-1)
READLINE 1,rd$
cdi=MID$(rd$,INSTR(rd$, "sodipodi:rx=")+13,LEN(rd$)-1)
FOR i=0 TO 359
DRAWLINE cirx,ciry, cdi*SIN(i) + cirx, cdi*COS(i)+ciry, RGB(rgb1%, rgb2%, rgb3%)
NEXT
SHOWSCREEN

//WRITELINE 2,"//CIRCLE"
WRITELINE 2,"FOR i=0 TO 359"
WRITELINE 2,"DRAWLINE "+cirx+"+xval,"+ciry+"+yval,"+cdi+"*SIN(i) + "+cirx+"+xval, "+cdi+"*COS(i)+"+(ciry)+"+yval,RGB("+rgb1%+","+rgb2%+","+rgb3%+")"
WRITELINE 2,"NEXT"
isline = 2
ENDIF


IF INSTR(rd$, "fill:#") > 0 OR INSTR(rd$, "fill:n") > 0
//colour

IF INSTR(rd$, "fill:#") > 0


pos# = INSTR(rd$, "fill:#")
rd$ = LCASE$(MID$(rd$,pos#+6,6))



ELSE
pos# = INSTR(rd$, "stroke:#")
rd$ = LCASE$(MID$(rd$,pos#+8,6))
IF isline<>2 THEN isline=1
ENDIF
rgb1% = 0
rgb2% = 0
rgb3% = 0
FOR j = 1 TO 6
IF j = 1 THEN rgb1 = hextoint(MID$(rd$,0,1))*16
IF j = 2 THEN rgb1 = rgb1 +hextoint(MID$(rd$,1,1))
IF j = 3 THEN rgb2 = hextoint(MID$(rd$,2,1))*16
IF j = 4 THEN rgb2 = rgb2 +hextoint(MID$(rd$,3,1))
IF j = 5 THEN rgb3 = hextoint(MID$(rd$,4,1))*16
IF j = 6 THEN rgb3 = rgb3 +hextoint(MID$(rd$,5,1))
NEXT
spno% = spno%+1


//clear screen TO match SVG background
DRAWRECT 0, 0, screenx%, screeny%,RGB(prgb1%,prgb2%,prgb3%)


IF isline=0
//SPRITE INFO
DRAWRECT spno%, 0, 32, 32, RGB(rgb1%, rgb2%, rgb3%)
GRABSPRITE spno%, 0, 0, 32, 32
tempa$[spno%]="DRAWRECT 0, 0, 32, 32, RGB("+rgb1%+","+rgb2%+","+rgb3%+")"

tempb$[spno%]="GRABSPRITE "+spno%+", 0, 0, 32, 32"


ENDIF

//drawpoly
mode%=0
READLINE 1,rd$
WHILE INSTR(rd$, "d=")<1
READLINE 1,rd$
WEND


//WRITELINE 2,"//"+rd$
//if M in svg made in Inkscape treat as absolute Coords
IF INSTR(rd$, "-")>0 THEN mode%=0
IF INSTR(rd$, "M")>0 THEN mode%=1
rd$=LCASE$(rd$)






//convert Inkscape svg L path standard
IF INSTR(rd$, "l")>1
mode%=1
rd$=REPLACE$(rd$,CHR$(32),",")
rd$=REPLACE$(rd$,"l"," ")
ENDIF
IF MID$(rd$,LEN(rd$)-2,1) <> " "
rd$=MID$(rd$,0,LEN(rd$)-2)+" z"
ENDIF


IF MID$(rd$,INSTR(rd$, "m")+1,1)=" "
pos# = INSTR(rd$, "m")+2
ELSE
pos# = INSTR(rd$, "m")+1
ENDIF


//WRITELINE 2,"//mode%="+mode%

count%=0
temp1$=""
temp2$=""
tempx=0.0
tempy=0.0

REDIM polyvx[400]
REDIM polyvy[400]
        WHILE pos# < LEN(rd$)-3



        rd$=MID$(rd$,pos#,LEN(rd$))
        IF INSTR(rd$," ")<1 THEN BREAK

IF count% = 0

        temp1$ =MID$(rd$,0,INSTR(rd$,","))
        temp2$ =MID$(rd$,INSTR(rd$,",")+1,(INSTR(rd$," ")-INSTR(rd$,",")-1))

        tempx = temp1$
        tempy = temp2$


polyvx[count%]=tempx
polyvy[count%]=tempy
count%=count%+1

ELSE



        temp1$ =MID$(rd$,0,INSTR(rd$,","))
        temp2$ =MID$(rd$,INSTR(rd$,",")+1,(INSTR(rd$," ")-INSTR(rd$,",")-1))
IF mode%=0


        tempx = tempx+temp1$
        tempy = tempy+temp2$

        ELSE

        tempx = temp1$
        tempy = temp2$

        ENDIF

polyvx[count%]=tempx
polyvy[count%]=tempy

                count%=count%+1
                ENDIF



        pos# = INSTR(rd$," ")+1
        IF pos# = INSTR(rd$,"z") THEN BREAK
        IF pos#+1 = INSTR(rd$,"z") THEN BREAK
        IF count% = 399 THEN BREAK

WEND

IF datamode = 2
IF isline=0 AND count%>2
//STARTPOLY spno%
WRITELINE 2,"STARTPOLY "+spno%
FOR m = count%-1 TO 0 STEP -1
//POLYVECTOR  polyvx[m], polyvy[m] ,0,0,RGB(rgb1%, rgb2%, rgb3%)
WRITELINE 2,"POLYVECTOR ("+polyvx[m] +"*scxval)+xval,("+polyvy[m]+"*scyval)+yval,0,0,rgb(255,255,255)"
NEXT
//ENDPOLY
WRITELINE 2,"ENDPOLY"
ENDIF
ELSE
//data
WRITELINE 2, "STARTDATA  poly_"+MID$(test$,0,LEN(test$)-4)+":"
WRITELINE 2, "//sprite number,xcoord,ycood"
//in loop
FOR m = count%-1 TO 0 STEP -1
WRITELINE 2, "DATA "+spno%+","+polyvx[m] +","+polyvy[m]
NEXT
ENDIF



IF datamode = 2
IF isline=1
DRAWLINE polyvx[0], polyvy[0],polyvx[1], polyvy[1],RGB(rgb1%, rgb2%, rgb3%)
WRITELINE 2,"DRAWLINE "+polyvx[0] +"+xval,"+polyvy[0]+"+yval,"+polyvx[1]+"+xval,"+polyvy[1]+"+yval, RGB("+rgb1%+","+rgb2%+","+rgb3%+")"
ENDIF
ELSE
//data
WRITELINE 2, "STARTDATA  poly_"+MID$(test$,0,LEN(test$)-4)+":"
WRITELINE 2, "//sprite number,xcoord,ycood"
//in loop
FOR m = count%-1 TO 0 STEP -1
WRITELINE 2, "DATA "+spno%+","+polyvx[m] +","+polyvy[m]
NEXT
ENDIF
WRITELINE 2, "ENDDATA"


SHOWSCREEN
SLEEP 40


ENDIF



NEXT


IF datamode = 2
WRITELINE 2,"ENDFUNCTION"
WRITELINE 2,""
WRITELINE 2,"FUNCTION sprite_"+MID$(test$,0,INSTR(test$,"."))+":"

FOR i = 1 TO spno%
WRITELINE 2,tempa$[i]
WRITELINE 2,tempb$[i]
NEXT
WRITELINE 2,"ENDFUNCTION"
ENDIF

CLOSEFILE 1
CLOSEFILE 2

FUNCTION dxftosvg:dxfin$
LOCAL idnum#, writepath$,svgout$,tempval#

OPENFILE(3,dxfin$, TRUE)
svgout$=MID$(dxfin$,0,LEN(dxfin$)-4)+".svg"
OPENFILE(4,svgout$,FALSE)
idnum = 1000
//header
WRITELINE 4, "<svg"
WRITELINE 4, "   inkscape:version=" + CHR$(34) + "0.48.4 r9939" + CHR$(34) + ">"
WRITELINE 4, "  <g"
WRITELINE 4, "     inkscape:label=" + CHR$(34) + "Layer 1" + CHR$(34)
WRITELINE 4, "     inkscape:groupmode= " + CHR$(34) + "layer" + CHR$(34)
WRITELINE 4, "     id=" + CHR$(34) + "layer1" + CHR$(34) + ">"
WHILE 1=1
IF ENDOFFILE(3) = 1 THEN BREAK
READLINE  3, rd$
IF rd$ = "LWPOLYLINE"
idnum=idnum+1
writepath$="       d=" + CHR$(34) + "M"
WHILE 1=1
READLINE  3, rd$
IF rd$ = " 10"
READLINE  3, rd$
writepath$=writepath$ + " " + rd$
ENDIF

IF rd$ = " 20"
READLINE  3, rd$
IF MID$(rd$,0,1) = "-"
 rd$=MID$(rd$,1,LEN(rd$)-1)
 ELSE
 tempval = rd$
 IF tempval <>0
 rd$="-" +rd$
 ELSE
 
 ENDIF
 ENDIF
writepath$=writepath$ + "," +rd$
ENDIF
IF rd$ = "  0" THEN BREAK
WEND
writepath$=writepath$ + " z" + CHR$(34)

WRITELINE 4, "    <path"
WRITELINE 4, "       style=" + CHR$(34) + "fill:#ffffff;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + CHR$(34)
WRITELINE 4, writepath$
WRITELINE 4, "       id=" + CHR$(34) + "path" + idnum + CHR$(34)
WRITELINE 4, "       inkscape:connector-curvature=" + CHR$(34) + "0" + CHR$(34) + " />"

ENDIF
WEND

WRITELINE 4, "  </g>"
WRITELINE 4, "</svg>"
CLOSEFILE 3
CLOSEFILE 4
ENDFUNCTION



FUNCTION hextoint:temp$

LOCAL r%
SELECT UCASE$(temp$)
CASE "0"
r%=0
CASE "1"
r%=1
CASE "2"
r%=2
CASE "3"
r%=3
CASE "4"
r%=4
CASE "5"
r%=5
CASE "6"
r%=6
CASE "7"
r%=7
CASE "8"
r%=8
CASE "9"
r%=9
CASE "A"
r%=10
CASE "B"
r%=11
CASE "C"
r%=12
CASE "D"
r%=13
CASE "E"
r%=14
CASE "F"
r%=15
ENDSELECT
RETURN r%
ENDFUNCTION
 
« Last Edit: 2013-Mar-22 by pathfinder »

Offline pathfinder

  • Mc. Print
  • *
  • Posts: 10
    • View Profile
Example Print Command using SVGPOLY output
« Reply #1 on: 2013-Mar-15 »
My first attempt at a print command is attached txt files.

I swapped out my rubbish plane to show my concept text print. My wide screen monitor at range is a nightmare with the print command. The numbers are drawn in Autocad, converted in VB to svg (i will put this into SVGPOLY in the end) then converted into polyvector.
Code: GLBasic [Select]
SETSCREEN 640,480,0
FOR j = 1 TO 70
FOR i = 1 TO 50
polytxt_colour(RND(55)+200,RND(200)+55,RND(200)+55)
SELECT RND(10)
CASE 0
draw_0(RND(640),RND(480),RND(20)+1,RND(20)+1)
CASE 1
draw_1(RND(640),RND(480),RND(20)+1,RND(20)+1)
CASE 2
draw_2(RND(640),RND(480),RND(20)+1,RND(20)+1)
CASE 3
draw_3(RND(640),RND(480),RND(20)+1,RND(20)+1)
CASE 4
draw_4(RND(640),RND(480),RND(20)+1,RND(20)+1)
CASE 5
draw_5(RND(640),RND(480),RND(20)+1,RND(20)+1)
CASE 6
draw_6(RND(640),RND(480),RND(20)+1,RND(20)+1)
CASE 7
draw_7(RND(480),RND(480),RND(20)+1,RND(20)+1)
CASE 8
draw_8(RND(480),RND(480),RND(20)+1,RND(20)+1)
CASE 9
draw_9(RND(480),RND(480),RND(20)+1,RND(20)+1)
ENDSELECT
SLEEP 10
NEXT
SHOWSCREEN
NEXT
END
FUNCTION polytxt_colour:rgb1%,rgb2%,rgb3%
FOR i=1 TO 10
DRAWRECT 0, 0, 32, 32, RGB(rgb1,rgb2,rgb3)
GRABSPRITE i, 0, 0, 32, 32
NEXT
ENDFUNCTION
FUNCTION draw_0:xval#,yval#,scxval#,scyval#
STARTPOLY 1
POLYVECTOR (2*scxval)+xval,(0*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (6*scxval)+xval,(0*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (7*scxval)+xval,(1*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (1*scxval)+xval,(1*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
//       d="M 1.0,8 2.0,9 6.0,9 7.0,8 z"
//mode%=1
STARTPOLY 2
POLYVECTOR (7*scxval)+xval,(8*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (6*scxval)+xval,(9*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (2*scxval)+xval,(9*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (1*scxval)+xval,(8*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 3
POLYVECTOR (7*scxval)+xval,(8*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (5*scxval)+xval,(8*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (5*scxval)+xval,(1*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (7*scxval)+xval,(1*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 4
POLYVECTOR (3*scxval)+xval,(8*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (1*scxval)+xval,(8*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (1*scxval)+xval,(1*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (3*scxval)+xval,(1*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 5
POLYVECTOR (5*scxval)+xval,(2*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (3*scxval)+xval,(5*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (3*scxval)+xval,(7*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (5*scxval)+xval,(4*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (5*scxval)+xval,(2*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
ENDFUNCTION

FUNCTION draw_1:xval#,yval#,scxval#,scyval#
STARTPOLY 1
POLYVECTOR (5*scxval)+xval,(9*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (3*scxval)+xval,(9*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (3*scxval)+xval,(0*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (5*scxval)+xval,(0*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
//       d="M 3.0,3 0.0,3 0.0,2 2.0,1 3.0,0 z"
//mode%=1
STARTPOLY 2
POLYVECTOR (3*scxval)+xval,(0*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (2*scxval)+xval,(1*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (0*scxval)+xval,(2*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (0*scxval)+xval,(3*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (3*scxval)+xval,(3*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
ENDFUNCTION


FUNCTION draw_2:xval#,yval#,scxval#,scyval#
STARTPOLY 1
POLYVECTOR (2*scxval)+xval,(1*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (0*scxval)+xval,(1*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (0*scxval)+xval,(3*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (2*scxval)+xval,(3*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 2
POLYVECTOR (2*scxval)+xval,(9*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (0*scxval)+xval,(9*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (0*scxval)+xval,(7*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (2*scxval)+xval,(7*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 3
POLYVECTOR (2*scxval)+xval,(9*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (6*scxval)+xval,(9*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (6*scxval)+xval,(8*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (2*scxval)+xval,(8*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 4
POLYVECTOR (6*scxval)+xval,(1*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (5*scxval)+xval,(0*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (1*scxval)+xval,(0*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (0*scxval)+xval,(1*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 5
POLYVECTOR (6*scxval)+xval,(4*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (4*scxval)+xval,(4*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (4*scxval)+xval,(1*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (6*scxval)+xval,(1*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 6
POLYVECTOR (4*scxval)+xval,(4*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (0*scxval)+xval,(7*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (2*scxval)+xval,(7*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (6*scxval)+xval,(4*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
ENDFUNCTION
FUNCTION draw_3:xval#,yval#,scxval#,scyval#
STARTPOLY 1
POLYVECTOR (2*scxval)+xval,(1*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (0*scxval)+xval,(1*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (0*scxval)+xval,(3*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (2*scxval)+xval,(3*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 2
POLYVECTOR (2*scxval)+xval,(8*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (0*scxval)+xval,(8*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (0*scxval)+xval,(6*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (2*scxval)+xval,(6*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 3
POLYVECTOR (4*scxval)+xval,(4*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (6*scxval)+xval,(4*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (6*scxval)+xval,(1*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (4*scxval)+xval,(1*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 4
POLYVECTOR (4*scxval)+xval,(8*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (6*scxval)+xval,(8*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (6*scxval)+xval,(5*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (4*scxval)+xval,(5*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 5
POLYVECTOR (6*scxval)+xval,(8*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (5*scxval)+xval,(9*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (1*scxval)+xval,(9*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (0*scxval)+xval,(8*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 6
POLYVECTOR (0*scxval)+xval,(1*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (1*scxval)+xval,(0*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (5*scxval)+xval,(0*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (6*scxval)+xval,(1*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 7
POLYVECTOR (5*scxval)+xval,(5*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (2*scxval)+xval,(5*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (2*scxval)+xval,(4*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (5*scxval)+xval,(4*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
ENDFUNCTION
FUNCTION draw_4:xval#,yval#,scxval#,scyval#
STARTPOLY 1
POLYVECTOR (3*scxval)+xval,(5*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (1*scxval)+xval,(5*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (1*scxval)+xval,(0*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (3*scxval)+xval,(0*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 2
POLYVECTOR (6*scxval)+xval,(9*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (4*scxval)+xval,(9*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (4*scxval)+xval,(2*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (6*scxval)+xval,(2*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 3
POLYVECTOR (7*scxval)+xval,(7*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (0*scxval)+xval,(7*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (0*scxval)+xval,(6*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (7*scxval)+xval,(6*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 4
POLYVECTOR (1*scxval)+xval,(5*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (0*scxval)+xval,(6*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (2*scxval)+xval,(6*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (3*scxval)+xval,(5*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
ENDFUNCTION
FUNCTION draw_5:xval#,yval#,scxval#,scyval#
STARTPOLY 1
POLYVECTOR (2*scxval)+xval,(5*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (0*scxval)+xval,(5*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (0*scxval)+xval,(0*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (2*scxval)+xval,(0*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 2
POLYVECTOR (6*scxval)+xval,(0*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (2*scxval)+xval,(0*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (2*scxval)+xval,(1*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (6*scxval)+xval,(1*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 3
POLYVECTOR (2*scxval)+xval,(4*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (4*scxval)+xval,(4*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (4*scxval)+xval,(5*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (2*scxval)+xval,(5*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 4
POLYVECTOR (5*scxval)+xval,(4*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (6*scxval)+xval,(5*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (6*scxval)+xval,(7*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (5*scxval)+xval,(8*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (4*scxval)+xval,(9*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (4*scxval)+xval,(4*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 5
POLYVECTOR (4*scxval)+xval,(9*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (0*scxval)+xval,(9*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (0*scxval)+xval,(8*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (4*scxval)+xval,(8*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 6
POLYVECTOR (4*scxval)+xval,(8*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (3*scxval)+xval,(8*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (4*scxval)+xval,(7*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
ENDFUNCTION
FUNCTION draw_6:xval#,yval#,scxval#,scyval#
STARTPOLY 1
POLYVECTOR (2*scxval)+xval,(8*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (0*scxval)+xval,(8*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (0*scxval)+xval,(3*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (2*scxval)+xval,(3*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 2
POLYVECTOR (6*scxval)+xval,(8*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (4*scxval)+xval,(8*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (4*scxval)+xval,(4*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (6*scxval)+xval,(4*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 3
POLYVECTOR (0*scxval)+xval,(8*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (1*scxval)+xval,(9*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (5*scxval)+xval,(9*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (6*scxval)+xval,(8*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 4
POLYVECTOR (2*scxval)+xval,(4*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (2*scxval)+xval,(3*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (5*scxval)+xval,(3*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (6*scxval)+xval,(4*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 5
POLYVECTOR (0*scxval)+xval,(3*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (0*scxval)+xval,(2*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (2*scxval)+xval,(0*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (4*scxval)+xval,(0*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (4*scxval)+xval,(1*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (2*scxval)+xval,(3*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 6
POLYVECTOR (4*scxval)+xval,(1*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (5*scxval)+xval,(1*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (5*scxval)+xval,(0*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (4*scxval)+xval,(0*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
ENDFUNCTION
FUNCTION draw_7:xval#,yval#,scxval#,scyval#
STARTPOLY 1
POLYVECTOR (2*scxval)+xval,(0*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (8*scxval)+xval,(0*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (8*scxval)+xval,(1*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (2*scxval)+xval,(1*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 2
POLYVECTOR (6*scxval)+xval,(1*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (3*scxval)+xval,(6*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (5*scxval)+xval,(6*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (8*scxval)+xval,(1*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 3
POLYVECTOR (5*scxval)+xval,(9*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (3*scxval)+xval,(9*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (3*scxval)+xval,(6*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (5*scxval)+xval,(6*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
ENDFUNCTION
FUNCTION draw_8:xval#,yval#,scxval#,scyval#
STARTPOLY 1
POLYVECTOR (3*scxval)+xval,(0*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (2*scxval)+xval,(1*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (2*scxval)+xval,(4*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (3*scxval)+xval,(5*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (4*scxval)+xval,(5*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (4*scxval)+xval,(0*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 2
POLYVECTOR (6*scxval)+xval,(1*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (4*scxval)+xval,(1*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (4*scxval)+xval,(0*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (6*scxval)+xval,(0*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 3
POLYVECTOR (6*scxval)+xval,(9*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (4*scxval)+xval,(9*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (4*scxval)+xval,(8*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (6*scxval)+xval,(8*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 4
POLYVECTOR (3*scxval)+xval,(5*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (2*scxval)+xval,(6*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (2*scxval)+xval,(8*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (3*scxval)+xval,(9*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (4*scxval)+xval,(9*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (4*scxval)+xval,(5*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 5
POLYVECTOR (7*scxval)+xval,(0*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (8*scxval)+xval,(1*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (8*scxval)+xval,(4*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (7*scxval)+xval,(5*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (6*scxval)+xval,(5*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (6*scxval)+xval,(0*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 6
POLYVECTOR (7*scxval)+xval,(5*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (8*scxval)+xval,(6*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (8*scxval)+xval,(8*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (7*scxval)+xval,(9*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (6*scxval)+xval,(9*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (6*scxval)+xval,(5*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 7
POLYVECTOR (6*scxval)+xval,(7*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (4*scxval)+xval,(5*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (4*scxval)+xval,(3*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (6*scxval)+xval,(5*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
ENDFUNCTION
FUNCTION draw_9:xval#,yval#,scxval#,scyval#
STARTPOLY 1
POLYVECTOR (3*scxval)+xval,(0*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (2*scxval)+xval,(1*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (2*scxval)+xval,(5*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (3*scxval)+xval,(6*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (4*scxval)+xval,(6*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (4*scxval)+xval,(0*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 2
POLYVECTOR (8*scxval)+xval,(6*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (6*scxval)+xval,(8*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (6*scxval)+xval,(6*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 3
POLYVECTOR (6*scxval)+xval,(6*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (6*scxval)+xval,(0*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (7*scxval)+xval,(0*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (8*scxval)+xval,(1*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (8*scxval)+xval,(6*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 4
POLYVECTOR (4*scxval)+xval,(6*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (6*scxval)+xval,(6*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (6*scxval)+xval,(5*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (4*scxval)+xval,(5*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 5
POLYVECTOR (4*scxval)+xval,(1*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (6*scxval)+xval,(1*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (6*scxval)+xval,(0*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (4*scxval)+xval,(0*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 6
POLYVECTOR (3*scxval)+xval,(8*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (3*scxval)+xval,(9*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (5*scxval)+xval,(9*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (6*scxval)+xval,(8*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
STARTPOLY 7
POLYVECTOR (6*scxval)+xval,(8*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (6*scxval)+xval,(6*scyval)+yval,0,0,RGB(255,255,255)
POLYVECTOR (4*scxval)+xval,(8*scyval)+yval,0,0,RGB(255,255,255)
ENDPOLY
ENDFUNCTION
 
« Last Edit: 2013-Mar-21 by pathfinder »

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 4146
    • View Profile
    • Portfolio
Re: Inkscape **PATHS** SVG to POLYVECTOR Code
« Reply #2 on: 2013-Mar-15 »
Looks great!

Drawing with inkscape is quite cool, altough I donĀ“t much have any proeficiency on vector programs.
But it is a good editor, and fast on knocking out vectors.

Great work! :good:

Offline pathfinder

  • Mc. Print
  • *
  • Posts: 10
    • View Profile
Re: Inkscape **PATHS** SVG to POLYVECTOR Code
« Reply #3 on: 2013-Mar-16 »
Thanks for the support. I am relaxing this project for now. The final code is in place above.

Here is a quick mario i did manually tracing it for 15 mins. The picture below is Inkscape, the thin lines do not appear in GLBasic.

Oops too long for /CODE, i'll txt the program below

Offline pathfinder

  • Mc. Print
  • *
  • Posts: 10
    • View Profile
Re: Inkscape **PATHS** SVG to POLYVECTOR Code
« Reply #4 on: 2013-Mar-16 »
UPDATED 17/03/13

now as 2 functions

Code is in txt file
« Last Edit: 2013-Mar-17 by pathfinder »

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1540
    • View Profile
Re: Inkscape **PATHS** SVG to POLYVECTOR Code
« Reply #5 on: 2013-Mar-18 »
It's real neat but but the plot data in DATA statements would be handy.  ;)

Offline pathfinder

  • Mc. Print
  • *
  • Posts: 10
    • View Profile
Re: Inkscape **PATHS** SVG to POLYVECTOR Code
« Reply #6 on: 2013-Mar-19 »
Thanks. Ill do data export option next then.

Its time for some kind of front end anyway, to let you you know what the heck is going on  :S

DXF (2010) import to SVG is working using VB, will convert to glbasic at some point. I want a scaleable/color print command So I am drawing the alphabet at work ^^.
« Last Edit: 2013-Mar-19 by pathfinder »

Offline pathfinder

  • Mc. Print
  • *
  • Posts: 10
    • View Profile
DXF Import for Polylines and Data export now implemented!

Time for me to go back to my other project  :booze:

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 4146
    • View Profile
    • Portfolio
That is great achievement! :good:
I see excellent use of such tool when you think about tracing sprites and so much more specific to a use.

On that specific use, I wonder, what is your primarily use that got into it in first place? :-[
I know it is a strange question, but maybe the answer can open up some directions?

Great work. :good:

Offline pathfinder

  • Mc. Print
  • *
  • Posts: 10
    • View Profile
I made it because I wanted to draw up filled areas and simple creatures for a microbe game. Also a card game I used to play when I was a kid. I started to code a concept for the card game, but I could not read the print output .. Then I thought hang on if I make my own print command with poly vectors I can get them too scale up to and size screen and save my poor old eyes. Why not draw letters and import them easy... 2 weeks later finally done, not so easy :D.

... That was the tipping point. I do alot of DXF / script stuff at work so I thought it would be quick. Inkscape file format is very um... flexible, the structure can change just by moving an object.

Now back to actually making my first game in glbasic lol.

Offline Marmor

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 908
  • 96A285CC
    • View Profile
    • my youtube channel
cool thx a lot !

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1540
    • View Profile
Vector fonts sounds cool and much needed and longed. Although I haven't tested it, I imagine the process of converting a funky true type font (to dxf?) would be very useful.

Offline pathfinder

  • Mc. Print
  • *
  • Posts: 10
    • View Profile
Yup I traced fixedsys font in cad using polylines, then imported them letter by letter to make my POLYTEXT.TXT program attached above (note will be adding usescreen and sprite number setup soon). Inkscape can explode fonts to paths (object to path, then use ungroup), the thing is the program uses curves and also boolean to cut holes. Not Polyvector friendly. Now you could use a cad package or vector conversion to triangulate the font

Also polyvector hates going back in on itself, so you have to break it into bits.

11111
111
11111

can look like

11111
11111
11111

so you need 3 paths

11111
222
33333

or

111122
1111
111133

Far easier to trace if you want a cool font you could make it from scratch. Just draw in the top left above the page.

Offline pathfinder

  • Mc. Print
  • *
  • Posts: 10
    • View Profile
Oh if your feeling a bit creative you could use a paint package, then trace bitmap in inkscape. There is a command

Extensions > Modify Path > Flatten Beziers

this converts curves into straight lines within your path.

There are tools like path fill so you can draw lines across the path then fill to help sort triangulation issues. Its just a question of if inkscape reorganizes the svg. it seems to love multiple ways of declaring things sometimes gaps some times commas etc. It can be a mare :D.

Hence why i did dxf polyline import :D

Offline Wampus

  • Prof. Inline
  • *****
  • Posts: 1004
    • View Profile
What a great bit of code. Vector sprites and fonts in GLBasic  :good:

It wouldn't be too much of a job to add scaling, rotation and other transformations. Good to know this is here.