Results 1 to 7 of 7

Thread: Spline interpolation behaves "weird"

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,318
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Spline interpolation behaves "weird"

    The problem should be related to the polygon clipping, that is enabled by default. As the cutting point between curve and canvas replaces the previous point you get a different polynomial.
    If I'm right you should be able to work around this problem by:

    Qt Code:
    1. m_curve->setPaintAttribute( QwtPlotCurve::ClipPolygons, false );
    To copy to clipboard, switch view to plain text mode 
    Could you please modify the code in QwtPlotCurve:: drawLines, so that the fitting is done before the spline interpolation ?

    However a proper fix is not so easy as this reordering results in ( potentially many ) more points that go into both algos and could be a real performance issue for QwtWeedingCurveFitter.

    Uwe

  2. #2
    Join Date
    Oct 2019
    Posts
    22
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Spline interpolation behaves "weird"

    The workaround helped to fix the problem, thank you.

    (I do not know where and how exactly to patch the QwtPlotCurve::drawLines method... it helped to turn polygon clipping off in our code when we switch to spline interpolation.)

    I am well aware that both, the workaround and a proper fix have an impact on the performance, but since a spline interpolation by definition is slower than a linear interpolation I do not consider this a real problem for us (other qwt users may of course object to this option).

  3. #3
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,318
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Spline interpolation behaves "weird"

    I added a bug report with an idea how to "avoid" the problem: https://sourceforge.net/p/qwt/bugs/369/

    Uwe

  4. #4
    Join Date
    Oct 2019
    Posts
    22
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Spline interpolation behaves "weird"

    Sounds good.

Similar Threads

  1. Replies: 1
    Last Post: 20th November 2015, 10:02
  2. Replies: 2
    Last Post: 13th September 2015, 21:48
  3. Replies: 3
    Last Post: 16th March 2015, 07:31
  4. Spline interpolation
    By DomantasB in forum Qt Programming
    Replies: 1
    Last Post: 10th November 2013, 21:53
  5. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 19:05

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.