Post by xPsycHoWasPx on Jan 31, 2019 20:47:22 GMT
This is a really early stage of my java2lemur_canvas converter, so there will be limitations until more development.
Basically what it does is, taking all javascript canvas command created by the SVG 2 Java2D java app.
Then looks thru the file line by line, until it finds something that lemur needs extracts the X Y values and insert em in a new text(.cs) document with the propper lemur command.
So inserting the data into canvas is up to you, there won't be a direct JZML export feature in any near future. Since Apps like VSCode makes lemur scripting like a dream compared to standalone script editor.
Working Lemur commands are following:
SVG made with multiply layers will have a comment line inserted
////////// Next Obejct: ////////////
so u can easy see when a new layer begins incase u need to split the code into multi scripts due to Lemurs 3000(something like that) letters pr script limitation.
so far all the SVGs i have been doin tests with didn't involve canvas stroke, so no stroke commands are supported yet, since i haven't come across any java example of it, to write conversion line.
so until then u must manual insert the
setstrokestyle and stroke commands yourself at the end of script or before the next layer comment.
Required files to run the scripts:
Java:
www.java.com/en/download/
Python(only Windows users need this, Mac OSX comes with preinstalled Python 2.7):
64bit:
www.python.org/ftp/python/2.7.15/python-2.7.15.amd64.msi
32bit:
www.python.org/ftp/python/2.7.15/python-2.7.15.msi
Main Files:
SVG 2 Java2D(Converting SVG to Java2D canvas code):
svg2java2d.jnlp (1.77 KB)
For now it won't be a totally offline process, this file requires online access, hopefully later on, I will be able to compile an offline version of the source code, but for now this will have to do.
------------------------------------------------------------------
for Mac OSX users:
Java2Lemur_Canvas.workflow.zip (83.79 KB)
put extracted workflow file in the folder:
/Users/<Your User>/Library/Services/
so if your user is "my_name"
/Users/my_name/Library/Services/
Windows Users:
java2lemur_canvas.py (3.9 KB)
place where ever u feel is most suitable for easy drag n drop of the exported java file.
.....
Hmm all these files to download and run, but.. how do we run it then ?
as General Preview of how the method would work:
Made this quickly Screen Capture, showing SVG convertion of a Digital LCD number 3 made in Adobe illustrator.
Should be considered how todo for Mac user if u installed the Service file in the right folder.
Windows users:
for now you will have to do with Drag n drop of the Java onto the python script file.
else the process of editing the data with VSCode should be exactly the same on windows.
Basically what it does is, taking all javascript canvas command created by the SVG 2 Java2D java app.
Then looks thru the file line by line, until it finds something that lemur needs extracts the X Y values and insert em in a new text(.cs) document with the propper lemur command.
So inserting the data into canvas is up to you, there won't be a direct JZML export feature in any near future. Since Apps like VSCode makes lemur scripting like a dream compared to standalone script editor.
Working Lemur commands are following:
- canvas_beginPath(c)
- canvas_closePath(c)
- canvas_moveTo(c, x, y)
- canvas_lineTo(c, x, y)
- canvas_bezierCurveTo(c, x1, y1, x2, y2, x3, y3)
- canvas_setFillStyle(c, 1) - All canvas fill colors will be redone to basic white color, so colors have to be done manually for now.
- canvas_fill(c)
SVG made with multiply layers will have a comment line inserted
////////// Next Obejct: ////////////
so u can easy see when a new layer begins incase u need to split the code into multi scripts due to Lemurs 3000(something like that) letters pr script limitation.
so far all the SVGs i have been doin tests with didn't involve canvas stroke, so no stroke commands are supported yet, since i haven't come across any java example of it, to write conversion line.
so until then u must manual insert the
setstrokestyle and stroke commands yourself at the end of script or before the next layer comment.
Required files to run the scripts:
Java:
www.java.com/en/download/
Python(only Windows users need this, Mac OSX comes with preinstalled Python 2.7):
64bit:
www.python.org/ftp/python/2.7.15/python-2.7.15.amd64.msi
32bit:
www.python.org/ftp/python/2.7.15/python-2.7.15.msi
Main Files:
SVG 2 Java2D(Converting SVG to Java2D canvas code):
svg2java2d.jnlp (1.77 KB)
For now it won't be a totally offline process, this file requires online access, hopefully later on, I will be able to compile an offline version of the source code, but for now this will have to do.
------------------------------------------------------------------
for Mac OSX users:
Java2Lemur_Canvas.workflow.zip (83.79 KB)
put extracted workflow file in the folder:
/Users/<Your User>/Library/Services/
so if your user is "my_name"
/Users/my_name/Library/Services/
Windows Users:
java2lemur_canvas.py (3.9 KB)
place where ever u feel is most suitable for easy drag n drop of the exported java file.
.....
Hmm all these files to download and run, but.. how do we run it then ?
as General Preview of how the method would work:
Made this quickly Screen Capture, showing SVG convertion of a Digital LCD number 3 made in Adobe illustrator.
Should be considered how todo for Mac user if u installed the Service file in the right folder.
Windows users:
for now you will have to do with Drag n drop of the Java onto the python script file.
else the process of editing the data with VSCode should be exactly the same on windows.