Comment 5 for bug 202540

Revision history for this message
su_v (suv-lp) wrote :

patch tested with Inkscape 0.47 and 0.47+devel r9442 on OS X 10.5.8 with Python 2.5.1 and 2.6.2

1) 'Add Nodes…' now fails for closed paths (rectangle&star converted to path, closed path drawn with pen tool):

Traceback (most recent call last):
  File "addnodes.py", line 113, in <module>
    e.affect()
  File "/Volumes/blue/src/Inkscape/src/inkscape-repo/mp-x11/Build/share/inkscape/extensions/inkex.py", line 215, in affect
    self.effect()
  File "addnodes.py", line 109, in effect
    node.set('d',cubicsuperpath.formatPath(new))
  File "/Users/suv/.config/inkscape.extensions/LeWitt/cubicsuperpath.py", line 171, in formatPath
    return simplepath.formatPath(unCubicSuperPath(p))
  File "/Users/suv/.config/inkscape.extensions/LeWitt/cubicsuperpath.py", line 162, in unCubicSuperPath
    if (closed):
UnboundLocalError: local variable 'closed' referenced before assignment

2) 'Number Nodes…' still fails for paths created by converting an ellipse and adding nodes (e.g. with Number of segments: 2):

Traceback (most recent call last):
  File "dots.py", line 108, in <module>
    e.affect()
  File "/Volumes/blue/src/Inkscape/src/inkscape-repo/mp-x11/Build/share/inkscape/extensions/inkex.py", line 215, in affect
    self.effect()
  File "dots.py", line 73, in effect
    self.separateLastAndFirst(p)
  File "dots.py", line 48, in separateLastAndFirst
    x = dx/dist
ZeroDivisionError: float division

Ellipses converted to path appear to be a special case (i.e. differing from other shapes converted to path): they have both coinciding start and end nodes and a 'z' segment. 'Add Nodes…' inserts nodes to the 'z' segment too, in this special case producing 3 coinciding nodes (start, second to last, last node). Adding a 'Z' in 'cubicsuperpath.py' doesn't prevent 'Number Nodes…' to fail, because apparently it doesn't handle the doubled end nodes - with or without 'z'.