Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-75146

Numerical instability with QLineF::intersect and QLineF::BoundedIntersection

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.6.3, 5.12.0
    • Core: Other
    • None
    • macOS, Windows

    Description

      When trying to intersect (almost) parallel lines, QLineF::intersect may return the intersection type incorrectly as QLineF::BoundedIntersection when it is actually QLineF::UnboundedIntersection (or QLineF::NoIntersection)

      Since the values in the debugger are converted from double and are not the same as in memory, I dumped the memory values and attached the images. I also created a test code that demonstrates the issue.

      Attachments

        1. l.png
          l.png
          23 kB
        2. l1.png
          l1.png
          31 kB
        3. debugInfo.png
          debugInfo.png
          447 kB
        4. lines.png
          lines.png
          348 kB
        5. testIntersect.cpp
          1 kB
        6. main.cpp
          0.5 kB
        For Gerrit Dashboard: QTBUG-75146
        # Subject Branch Project Status CR V

        Activity

          People

            thiago Thiago Macieira
            ahi Adriel Jr.
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There is 1 open Gerrit change