Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Calculating areas between QGraphicsItems



  • Hi!

    Currently I am trying to implement a bucket tool to fill with color the areas generated by the intersection of several QGraphicItems. Let me describe a couple of examples of my requirement.

    Example 1: If I have three independent paths that form a shape like this:
    alt text
    Could it be possible to calculate the area created by them, so I can add fourth element with the yellow shape?

    Example 2: If I have two ellipses
    alt text
    Could it be possible to calculate the area generated by the intersection of both elements, so I can include a third element with the yellow form?

    I am guessing that I will have to implement several algorithms, one for every case. Any way, I just started my research about this topic, so any suggestion or reference related to this problem is very welcome!
    Thanks.


Log in to reply