We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello everyone!
I am very new to Processing and I am evaluating it for our application. So my main question is if it is possible in any way to use Processing headlessly and export .svgs from a Processing drawing. For the latter I have seen that maybe there exists a bridge to Apache Batik via the basic awt.Graphics2D, but I am hoping that somebody maybe already did this before me and can give me guidance. Thanks!
Answers
Ok. It seems that I could make it work, although a bit hacky. I just replaced the g2 JavaGraphics2D canvas with an Apache Batik SVG generator (which inherits from JavaGraphics2D and is meant to be dropped into any awt compatible drawing method). The replacing however must take place after the beginDrawing() is called, as the beginDrawing() replaces the g2.
Please forgive my usage of Processing. I am very new to it. This code outputs the following on your commandline:
Any suggestions on how to improve this? Trim off the edges that I may have overlooked?
I could turn this into some pretty beautiful examples. Check it out:
Article: http://www.sleepy-robots.org/2017/07/how-to-export-your-processing.html
Git repo: https://github.com/benelot/Processing-2-SVG