Effects - Modify Path - Flatten Beziers fails on complicated paths with small flatness parameter

Bug #340123 reported by Robert DeMaria on 2009-03-09
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Inkscape
Low
Alvin Penner

Bug Description

Reproduction Steps:
1)Generate a long, highly detailed curve with the freehand curve tool (a scribble is the best way to reproduce the bug)
2)Select the curve
3)Select the "Flatten Beziers" effect from the "Effects - Modify Path" menu
4)Use a small flatness value (around 2 consistently produces the bug)
5)Observe the failure of the effect

A sample .svg file containing a curve that consistently produces a failure with a flatness parameter of "2" is included.

The python traceback ultimately reports:
" File "C:\Program Files\Inkscape\share\extensions\ffgeom.py", line 66, in delta_x

    return self[1]['x'] - self[0]['x']

RuntimeError: maximum recursion depth exceeded"

A version of this effect that works on curves of arbitrary length and detail would be very valuable for those wishing to use Inkscape as a level design tool for games. It greatly simplifies the process of generating a triangle mesh from a closed path. However, in its current form artists have a difficult time predicting how long or detailed the curves they generate can be before the path will produce a failure.

jazzynico (jazzynico) wrote :

Confirmed on Vista sp1, Inkscape rev. 21852 and 0.46.
Reproduced with parameter value of 2.
Attached is the complete log message.

Changed in inkscape:
importance: Undecided → Low
status: New → Confirmed
tags: added: extensions-plugins
jazzynico (jazzynico) wrote :
su_v (suv-lp) wrote :

Apparently affects export to HPGL too:
Bug #487052 “HPGL Output crashes ”
Bug #717767 “hpgl export crashes, file remains empty”

Alvin Penner (apenner) wrote :

attached is a modified version of the file cspsubdiv.py, which avoids the crash.

in order to implement this, you will need to copy the file cspsubdiv.py into the directory \Inkscape\share\extensions\ to replace the file that is there. you may want to make a backup of the original file, just in case.

as usual, any feedback would be welcome...

Alvin Penner (apenner) on 2011-03-02
Changed in inkscape:
status: Confirmed → Incomplete

I can confirm that this fix works. I was not able to generate a path that
the Flatten Beziers tool failed on.

On Wed, Mar 2, 2011 at 4:27 AM, Alvin Penner <email address hidden> wrote:

> ** Changed in: inkscape
> Status: Confirmed => Incomplete
>
> --
> You received this bug notification because you are a direct subscriber
> of the bug.
> https://bugs.launchpad.net/bugs/340123
>
> Title:
> Effects - Modify Path - Flatten Beziers fails on complicated paths
> with small flatness parameter
>
> Status in Inkscape: A Vector Drawing Tool:
> Incomplete
>
> Bug description:
> Reproduction Steps:
> 1)Generate a long, highly detailed curve with the freehand curve tool (a
> scribble is the best way to reproduce the bug)
> 2)Select the curve
> 3)Select the "Flatten Beziers" effect from the "Effects - Modify Path"
> menu
> 4)Use a small flatness value (around 2 consistently produces the bug)
> 5)Observe the failure of the effect
>
> A sample .svg file containing a curve that consistently produces a
> failure with a flatness parameter of "2" is included.
>
> The python traceback ultimately reports:
> " File "C:\Program Files\Inkscape\share\extensions\ffgeom.py", line 66,
> in delta_x
>
> return self[1]['x'] - self[0]['x']
>
> RuntimeError: maximum recursion depth exceeded"
>
> A version of this effect that works on curves of arbitrary length and
> detail would be very valuable for those wishing to use Inkscape as a
> level design tool for games. It greatly simplifies the process of
> generating a triangle mesh from a closed path. However, in its
> current form artists have a difficult time predicting how long or
> detailed the curves they generate can be before the path will produce
> a failure.
>
> To unsubscribe from this bug, go to:
> https://bugs.launchpad.net/inkscape/+bug/340123/+subscribe
>

Alvin Penner (apenner) wrote :

good to hear, committed to bzr rev 10076

Changed in inkscape:
status: Incomplete → Fix Committed
su_v (suv-lp) on 2011-03-03
Changed in inkscape:
assignee: nobody → Alvin Penner (apenner)
milestone: none → 0.49
status: Fix Committed → Incomplete
status: Incomplete → Fix Committed
su_v (suv-lp) on 2011-06-10
tags: added: backport-proposed
Krzysztof Kosinski (tweenk) wrote :

Fix copied to stable in 9863

Changed in inkscape:
milestone: 0.49 → 0.48.3
tags: removed: backport-proposed
Ted Gould (ted) on 2012-02-15
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers