[Qt-interest] Detecting intersections in a QPainterPath

benswerts at telenet.be benswerts at telenet.be
Tue Aug 10 13:34:05 CEST 2010


Hi Carl,

That's certainly an option. Unfortunately I can't seem to find out how to check for the intersection of a line with an arc or the intersection of 2 arcs. My google-fu has failed me. I'll continue the search...

Thanks,


  Ben

> API does not seem to have anything to test for intersection of an
> already built path...
> So how about doing the intersection test when you build the final
> path, by piece-wise adding a segment if it does not intersect with
> what already is in the final path?
> 
> Carl
> 
> On Mon, Aug 9, 2010 at 2:07 PM, Ben Swerts <benswerts at telenet.be>
> wrote:
> > Hello all,
> >
> > I have a QPainterPath created from a number of line and arc
> segments. This
> > path is allowed to be concave but it is not allowed to be
> self-intersecting.
> >
> > If the path consists of only line segments this self-intersection
> test is
> > easy: check for a bounding intersection (with QLineF::intersect)
> between all
> > non-adjacent segments.
> >
> > If the path also contains arced segments I have no idea how I should
> check
> > for intersections. I was kind of hoping the existing QPainterPath
> API
> > already has something to solve this.
> >
> > Many thanks in advance!
> > Greets,
> >
> >
> >        Ben




More information about the Qt-interest-old mailing list