10

This question is for someone with experience of Python coding of Inkscape extensions. Others need not waste their time, unless they really like a challenge!

I've written a Python extension that calculates the intersections between the line segments of different lines/polyline objects. I want to append new nodes to both objects at these intersection points (obviously in the correct node path order) but I have no idea how to approach this. The code in other extension scripts (e.g. "Modify Path\Add Nodes...") includes the use of node.set(), but I can't come close to figuring out how this is supposed to work. The script is available here if needed, but I don't see how that can help as there is no problem with it - it just produces intersection coordinates.

Grateful for any assistance.

geotheory
  • 22,624
  • 29
  • 119
  • 196

1 Answers1

2

I know this is a long time ago, but I've just written a little extension that allows you to type in a couple lines of python, and iterate it over selected objects. It comes with code examples and pointers to documentation (cos the inkscape python modules aren't the best documented!).

Downside is, it crashes inkscape badly if your script returns malformed document. But it's good for quick hacks and testing code fragments.

Maybe this will be useful to other people too.

Sanjay Manohar
  • 6,920
  • 3
  • 35
  • 58