Re: [Interest] Distance from point to path.

2015-12-30 Thread Jason H
> > Fair enough :) You could always try filing a feature request and see > > what people think. > > > > People will think, "What has this got to do with QML"? > Quaternion Math Library? ___ Interest mailing list Interest@qt-project.org http://lists.qt-

Re: [Interest] Distance from point to path.

2015-12-30 Thread william.croc...@analog.com
I think Qt opened the door for geometric consideration when they invented the scene, gave items mouse-event-handlers and provided intersection based item queries. :-) Fair enough :) You could always try filing a feature request and see what people think. People will think, "What has this

Re: [Interest] Distance from point to path.

2015-12-30 Thread Elvis Stansvik
2015-12-29 19:47 GMT+01:00 william.croc...@analog.com : > > Given a QPoint and a QPainterPath. > How do I find the distance from the QPoint to the > closest point along the QPainterPath. > >> >> Perhaps. But you should consider that QPainterPath is, as the name >> suggests, prim

Re: [Interest] Distance from point to path.

2015-12-29 Thread william.croc...@analog.com
Given a QPoint and a QPainterPath. How do I find the distance from the QPoint to the closest point along the QPainterPath. Perhaps. But you should consider that QPainterPath is, as the name suggests, primarily for painting, and not meant for solving generic geometric problems. So I'm not sure

Re: [Interest] Distance from point to path.

2015-12-29 Thread Jason H
> Sent: Monday, December 28, 2015 at 4:49 PM > From: "william.croc...@analog.com" > To: "interest@qt-project.org" > Subject: [Interest] Distance from point to path. > > Hello: > > Given a QPoint and a QPainterPath. > How do I find the distance f

Re: [Interest] Distance from point to path.

2015-12-29 Thread Elvis Stansvik
2015-12-29 15:07 GMT+01:00 william.croc...@analog.com : > On 12/29/2015 06:42 AM, Elvis Stansvik wrote: >> >> 2015-12-28 22:49 GMT+01:00 william.croc...@analog.com >>> >>> >>> Given a QPoint and a QPainterPath. >>> How do I find the distance from the QPoint to the >>> closest point along the QPaint

Re: [Interest] Distance from point to path.

2015-12-29 Thread william.croc...@analog.com
On 12/29/2015 06:42 AM, Elvis Stansvik wrote: 2015-12-28 22:49 GMT+01:00 william.croc...@analog.com Given a QPoint and a QPainterPath. How do I find the distance from the QPoint to the closest point along the QPainterPath. Like Konstantin said, the best approach probably depends on whether yo

Re: [Interest] Distance from point to path.

2015-12-29 Thread Elvis Stansvik
2015-12-28 22:49 GMT+01:00 william.croc...@analog.com : > Hello: > > Given a QPoint and a QPainterPath. > How do I find the distance from the QPoint to the > closest point along the QPainterPath. > > I could step along the path with pointAtPercent > looking for the closest point, but that seems und

Re: [Interest] Distance from point to path.

2015-12-28 Thread Nye
Hello, What kind of primitives do you have in your path, lines? If so, you could "parse" the path by elements and get the normal vectors for each one line, and check if they (could) pass through your point and at what distance the point is. If you have curves that might be quite more involved. Is y

[Interest] Distance from point to path.

2015-12-28 Thread william.croc...@analog.com
Hello: Given a QPoint and a QPainterPath. How do I find the distance from the QPoint to the closest point along the QPainterPath. I could step along the path with pointAtPercent looking for the closest point, but that seems unduly expensive: O(100N). Any better ideas. Thanks. Bill -