[Boost-users] [geometry] intersects bug?

50 katselukertaa
Siirry ensimmäiseen lukemattomaan viestiin

Akira Takahashi

lukematon,
26.7.2011 klo 21.17.0526.7.2011
vastaanottaja boost...@lists.boost.org
Hi,

I try boost::geometry::intersects algorithm(1 arg version) in Boost 1.47.0.
Follow program result is "false". but, I hope result is "true".
Is this Boost.Geometry bug?

#include <iostream>
#include <boost/assign/list_of.hpp>
#include <boost/geometry/geometry.hpp>

namespace bg = boost::geometry;

int main()
{
typedef bg::model::d2::point_xy<double> point;

const bg::model::linestring<point> line = boost::assign::list_of<point>
// (0, 0) // result become "true" when comment-in
(0, 4)
(4, 4)
(2, 2)
(2, 5)
;

const bool result = bg::intersects(line);
std::cout << std::boolalpha << result << std::endl;
}

Regards,

>>========================
Akira Takahashi
mailto:faitha...@gmail.com
blog: http://d.hatena.ne.jp/faith_and_brave/

line.png

Barend Gehrels

lukematon,
27.7.2011 klo 17.27.4227.7.2011
vastaanottaja boost...@lists.boost.org
Hi Akira,

> Hi,
>
> I try boost::geometry::intersects algorithm(1 arg version) in Boost 1.47.0.
> Follow program result is "false". but, I hope result is "true".

It certainly should return true.

> Is this Boost.Geometry bug?

Will look at this next weekend.

Thanks for the report,
Barend

_______________________________________________
Boost-users mailing list
Boost...@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users

Barend Gehrels

lukematon,
28.7.2011 klo 17.00.5028.7.2011
vastaanottaja boost...@lists.boost.org
Hi Akira,


On 27-7-2011 3:17, Akira Takahashi wrote:
> Hi,
>
> I try boost::geometry::intersects algorithm(1 arg version) in Boost 1.47.0.
> Follow program result is "false". but, I hope result is "true".
> Is this Boost.Geometry bug?

It is fixed (in Trunk), thanks for the report.

What was happening is that it detected that first/last segment
intersected, which is possible for a linestring (but skipped for a
closed ring). I added a unit test for this case.

Regards, Barend

Akira Takahashi

lukematon,
28.7.2011 klo 23.24.4028.7.2011
vastaanottaja boost...@lists.boost.org
Hi Barend

> It is fixed (in Trunk), thanks for the report.

I confirmed fix.
Thanks!

>>========================
Akira Takahashi
mailto:faitha...@gmail.com
blog: http://d.hatena.ne.jp/faith_and_brave/

Vastaa kaikille
Vastaa kirjoittajalle
Välitä
0 uutta viestiä