Opened 4 years ago

Last modified 4 years ago

#13553 assigned Bugs

intersection gives wrong result

Reported by: marnix.berg@… Owned by: Barend Gehrels
Milestone: Boost 1.68.0 Component: geometry
Version: Boost 1.66.0 Severity: Problem
Keywords: Cc: henrik@…

Description

The following polygons result in a wrong intersection:

using point_type = boost::geometry::model::d2::point_xy<double>; typedef boost::geometry::model::ring<point_type, false, true> polygon;

polygon op1, op2;

boost::geometry::read_wkt("POLYGON((7.7058932076134967 -11.523889618379748,8.0348094747518424 0.63492733448631888,7.7720440433489850 0.63492733448631888, 7.7058932076134967 -11.523889618379748))", op1); boost::geometry::read_wkt("POLYGON((2.6206910206017642 -32.773696844382265, 5.5835888947200090 -24.273798818378602, 6.7109368565951772 -20.023839227004206, 7.4191426214038723 -15.773870150408516, 7.7058941612236938 -11.523876267001913, -3.1025600674348395 -11.523582486001384, -3.1025610210450365 -32.773541282571529, 2.6206910206017642 -32.773696844382265))", op2); std::vector<polygon> result; boost::geometry::intersection(op1, op2, result);

result is equal to op1, while op1 is mostly outside op2.

Change History (5)

comment:1 by Barend Gehrels, 4 years ago

Status: newassigned
Version: Boost 1.66.0Boost Development Trunk

Thanks for the report. It will be fixed. I'm currently removing rescaling. I tested your case and added it to the test suite, and it passes already. This will hopefully be part of next Boost (1.68).

Besides that, most probably, it will work for you also if you define BOOST_GEOMETRY_NO_ROBUSTNESS, if that is a possible solution for you.

comment:2 by Barend Gehrels, 4 years ago

Milestone: To Be DeterminedBoost 1.68.0
Version: Boost Development TrunkBoost 1.66.0

comment:3 by anonymous, 4 years ago

Was this related to and possibly also solves #13522?

comment:4 by henrik@…, 4 years ago

btw. using the define BOOST_GEOMETRY_NO_ROBUSTNESS at least my problem with intersections and differences (posted as a comment in #13522)

comment:5 by Henrik Zimmer <henrik@…>, 4 years ago

Cc: henrik@… added
Note: See TracTickets for help on using tickets.