SVG: simplify path to remove curves?

情到浓时终转凉″ 提交于 2019-12-03 11:26:22

In Inkscape:

  • Select the Edit Path By Nodes tool (F2).
  • Click on your path to select it
  • Ctrl-A to select all the nodes in that path
  • Click Make Selected Segments Lines (on the toolbar at the top - the icon is a straight diagonal line between two square nodes).

For automation, try the included Flatten Bezier extension in Inkscape. Description here.

There is more technical way to simplify SVG path - https://github.com/mattdesl/simplify-path

var path = [ [250, 150], [250, 150], [25, 25], [24, 25], [10, 10] ]
var tolerance = 10
path = simplify(path, tolerance)
//result:
//[ [ 250, 150 ], [ 25, 25 ], [ 10, 10 ] ]
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!