From: Justin B. <jus...@gm...> - 2020-07-24 14:55:26
|
Hey devs, I'm currently developing a node.js application (Electron) that needs to perform boolean operations on svg path d-values. There does not seem to be any native js libraries that perform these operations. I managed to perform the operation by writing an svg file with the input paths to disk and using Inkscape's batch actions to write the results of an intersection to disk, then parsing the XML for the resultant path. I was delighted by the fact that this is possible (wow Inkscape developers, bravo). However, spawning the process requires opening the Inkscape GUI and this is a slow process with a jarring redirection of attention away from the application's GUI. I took another tack and tried applying a clipPath, converting to PNG data, tracing the svg with https://github.com/jankovicsandras/imagetracerjs but this results in multiple paths and that is not acceptable for this application. Using lib2geom in my application seems to be the only possible solution to my problem. I've made a considerable effort to scrape the Inkscape codebase for calls to lib2geom's boolean operations and also looked at the lib2geom codebase in hopes of discovering the API for boolean operations but I'm rather unfamiliar with C++ and can't find even the vaguest reference. Are there any code references I should have a look at? There seem to be a couple of possible approaches to use lib2geom in node.js: 1) develop a node.js addon using N-API 2) install python bindings and spawn a python process. Am I on the right track? Could anyone on this list nudge me forward on this? It might be prudent to hire a more experienced developer in order to achieve this requirement. Is anyone here looking for paid work? If so, might you be able to offer a quote for this job? I would like to make SVG boolean operations available to other javascript developers too. Thanks so much for working to make lib2geom available outside the purview of Inkscape. Sincerely, Justin |