SVG Union of Shapes使用javascript或d3或Inkscape GUI这样的inkscape脚本 [英] SVG Union of Shapes using javascript or d3 or inkscape script like Inkscape GUI does

查看:94
本文介绍了SVG Union of Shapes使用javascript或d3或Inkscape GUI这样的inkscape脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做一个简单的网站,我放了一些图形。现在我使用Inkscape完成每个图表。我使用Inkscape在形状之间进行UNION操作。然后我保存新图表,做另一个联合,保存,等等。我需要重复这个约150次:(

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 :(

我想知道我是否可以使用javascript或D3库。或者至少有一种方法可以让Inkscape做到这一点自动。

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?

推荐答案

我用Python编写了一个脚本,它调用了Inkscape命令行,就像建议的网站一样ErikDahlström解释道。

I have done a script in Python and it calls Inkscape command line, like suggested website by Erik Dahlström explains.

command = "inkscape -f file.svg --verb=EditDeselect --select=shapeA --select=shapeB --verb=SelectionUnion --verb=FileSave --verb=FileClose" os.system(command)

这篇关于SVG Union of Shapes使用javascript或d3或Inkscape GUI这样的inkscape脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆