I am doing a simple website where I put some graphics. Now I do each diagram using Inkscape. I use Inkscape to make UNION operations between the shapes. Then I save the new diagram, do another union, save, and so on. I need repeat this about 150 times :(
I would like to know if I could do it using javascript or D3 library. Or at least a way that makes Inkscape do it automatically.
In the perfect case, there would be a function:
union(shapeA,shapeB): replace ShapeA and ShapeB by ShapeAunionB
Could you give me any tips about this problem? Any help?
I am doing a simple website where I put some graphics. Now I do each diagram using Inkscape. I use Inkscape to make UNION operations between the shapes. Then I save the new diagram, do another union, save, and so on. I need repeat this about 150 times :(
I would like to know if I could do it using javascript or D3 library. Or at least a way that makes Inkscape do it automatically.
In the perfect case, there would be a function:
union(shapeA,shapeB): replace ShapeA and ShapeB by ShapeAunionB
Could you give me any tips about this problem? Any help?
Share Improve this question edited Nov 6, 2012 at 13:30 halex 16.4k6 gold badges60 silver badges67 bronze badges asked Nov 6, 2012 at 13:27 HenryHenry 4214 silver badges14 bronze badges 3- 2 It's possible to script inkscape to do that. See tavmjong.free.fr/INKSCAPE/MANUAL/html/CommandLine.html for how to get started. – Erik Dahlström Commented Nov 6, 2012 at 14:59
-
5
Thank you Erik! :) I have done a script in Python and it calls Inkscape mand line, like your suggested website explains.
mand = "inkscape -f file.svg --verb=EditDeselect --select=shapeA --select=shapeB --verb=SelectionUnion --verb=FileSave --verb=FileClose" os.system(mand)
– Henry Commented Nov 8, 2012 at 13:50 - 2 It would be nice if you posted your solution as an answer I think. – Erik Dahlström Commented Nov 8, 2012 at 13:52
2 Answers
Reset to default 6There is an opensource library: Javascript Clipper
The Javascript Clipper library performs clipping and offsetting for both lines and polygons. All four boolean clipping operations are supported - intersection, union, difference and exclusive-or. Polygons can be of any shape including self-intersecting polygons.
features demo: http://jsclipper.sourceforge/5.0.2.2/main_demo.html
I have done a script in Python and it calls Inkscape mand line, like suggested website by Erik Dahlström explains.
mand = "inkscape -f file.svg --verb=EditDeselect --select=shapeA --select=shapeB --verb=SelectionUnion --verb=FileSave --verb=FileClose" os.system(mand)
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744230728a4564234.html
评论列表(0条)