Menu ▾ ▴

#4 Bug in the "smoothen path" functionality

open
None
5
2009-03-11
2008-12-01
Deak Ferenc
No

There is some bug in the "Cox de Boor" algorithm implementation used in the smoothen path functionality (sometimes some points get a really weird value and run out of the normal "path" flow), in Path.cpp. Because of this the maximum number of points allowed in taking part of a path is limited to 4, after this a new path is started every time, and this is somehow a kind of "unpleasant" side effect... If someone could find the reason for this bug and implement a bug free version it would be great. In case you need to reproduce this firstly you'll need to remove:

if(currentLines.size() == MAX_PATH_ALLOWED && mouseTracer->placingPath())
{
finalizeCurrentSection();
}

from

void CEditor::finalizeCurrentSection(int source)

and after compiling create a sharp path and smoothen it.

Discussion

  • Deak Ferenc

    Deak Ferenc - 2008-12-10

    Open the attached file in the editor, and smoothen the path, you'll see the bug

     
  • Deak Ferenc

    Deak Ferenc - 2008-12-10

    I have modified the sources to allow creation of longer paths. The only thing to be done is to load the attached file in the editor, select somehow the path on the right side of the window (you might need to click somewhere else, and then click on the path again to select it... another bug :) ) and after you have the Smoothen button visible click on it. The path should be smoothened with the unwanted bug coming in. Please note, this path is created from RIGHT to LEFT. If you create the same path from left to right, the bug is coming on the other side... :(

     
  • Deak Ferenc

    Deak Ferenc - 2008-12-12
    • assigned_to: nobody --> bgao
     
  • Deak Ferenc

    Deak Ferenc - 2008-12-12

    Bug location:void CPath::smoothenPath(int _factor)

     
  • Deak Ferenc

    Deak Ferenc - 2009-03-11
    • assigned_to: bgao --> bihayes