Inkscape: A Vector Drawing Tool

Pattern along Path errors out

Reported by Jack Colfer on 2010-07-10
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Medium
Alvin Penner
inkscape (Ubuntu)
Low
Unassigned

Bug Description

Binary package hint: inkscape

My particulars:

inkscape:
  Installed: 0.47.0-2ubuntu2
  Candidate: 0.47.0-2ubuntu2
  Version table:
 *** 0.47.0-2ubuntu2 0
        500 http://us.archive.ubuntu.com/ubuntu/ lucid/main Packages
        100 /var/lib/dpkg/status
------------------------------------
Ubuntu 10.04
------------------------------------

When trying to generate text along a curve via:

1. Select path of curve
2. Select path of text
3. Extensions > Generate from Path > Pattern along Path

And attempting to preview or apply with any or no settings at all, Inkscape informs me that:

Inkscape has received additional data from the script executed. The script did not return an error, but this may indicate the results will not be as expected.

Traceback (most recent call last):
  File "/usr/share/inkscape/extensions/pathalongpath.py", line 278, in <module>
    e.affect()
  File "/usr/share/inkscape/extensions/inkex.py", line 207, in affect
    self.effect()
  File "/usr/share/inkscape/extensions/pathalongpath.py", line 268, in effect
    self.applyDiffeo(ctlpt[1],(ctlpt[0],ctlpt[2]))
  File "/usr/share/inkscape/extensions/pathalongpath.py", line 166, in applyDiffeo
    i,t=self.lengthtotime(s)
  File "/usr/share/inkscape/extensions/pathalongpath.py", line 150, in lengthtotime
    l=l % sum(self.lengths)
ZeroDivisionError: float modulo

------------------------------------

And then nothing happens.

Related branches

~suv (suv-lp) wrote :

Not reproduced with Inkscape 0.47 and 0.47+devel r9602 on OS X 10.5.8

Could you attach a sample SVG file here with a path (curve) and text (converted to path) which cause the extension 'Pattern along Path' to fail with 'ZeroDivisionError: float modulo'?

tags: added: extensions-plugins
Jack Colfer (jackson-colfer) wrote :

I attempted to recreate this in a new SVG I could attach only to have it work.

I'd rebooted, purged my inkscape installation, checked for updates, tried to make new SVG files and nothing helped and for some reason it just works today. Sorry for the bug report.

FWIW I had been trying to produce a pattern along the path of a half circle made by breaking the nodes of a circle.

Krzysztof Kosinski (tweenk) wrote :

Not directly related to the bug, but to put text on path you should select a text object (not converted to path) and the path and then select "Put on Path" from the Text menu. This way the text will remain editable.

Regards, Krzysztof

Salim F (cassano2012) wrote :

i have the same problem when i select to paths (firs are small horizontal line the second are half ellipse path )
from path along pattern if i chose "Pattern is Vertical " the effect work but no that what i want ..i got totally deferent shape
Put when deselect it i got same error message ..and th pattern won't work .

~suv (suv-lp) wrote :

@Salim - convert the stroke of your pattern to path before applying the extension, or group it with an invisible rectangle to get a pattern with both dimensions > 0.

related: Bug #486920 “Extension 'Pattern along Path' python script fails”
<https://bugs.launchpad.net/inkscape/+bug/486920>

~suv (suv-lp) wrote :

… increase the spacing between the copies.

Alvin Penner (apenner) wrote :

attached is a quick and dirty patch which avoids this error message by putting a lower limit of 0.1 on the variable dx, where dx is the sum of the 'size of the object' plus the 'space between objects'

~suv (suv-lp) wrote :

The patched script prevents failure/error if both the relevant dimension of the pattern and 'Space between objects' are '0.0'. However it hides from the user that the visual width of a stroke is not considered as one of the dimensions of the pattern and can lead to unexpected results if the pattern has a wide stroke set, the actual spacing however is set to 0.1 px in the script.

What about displaying a message that one of the two parameters needs to be > 0 instead of using an arbitrary threshold the user can't influence or override?

Alvin Penner (apenner) wrote :

here is a modified version that raises an error message with some suggestions of what to do next.

Alvin Penner (apenner) on 2010-08-22
Changed in inkscape:
status: New → Fix Committed
Changed in inkscape (Ubuntu):
status: New → Confirmed
Alex Valavanis (valavanisalex) wrote :

Alvin's commit refers to r9721 in lp:inkscape

Changed in inkscape:
milestone: none → 0.49
Alex Valavanis (valavanisalex) wrote :

Upstream patch attached for testing in Ubuntu

Changed in inkscape (Ubuntu):
status: Confirmed → Triaged
Changed in inkscape:
importance: Undecided → Medium
Changed in inkscape (Ubuntu):
importance: Undecided → Low
~suv (suv-lp) on 2011-06-10
tags: added: backport-proposed
~suv (suv-lp) wrote :

Affects translated string - tag removed.

tags: removed: backport-proposed
tags: added: patch
Changed in inkscape:
assignee: nobody → Alvin Penner (apenner)
tags: added: patch-accepted-upstream
removed: patch
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers