File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
common/autoware_universe_utils/test/src/geometry Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 2929#include < boost/geometry/algorithms/distance.hpp>
3030#include < boost/geometry/algorithms/union.hpp>
3131#include < boost/geometry/io/wkt/write.hpp>
32+ #include < boost/version.hpp>
3233
3334#include < gtest/gtest.h>
3435
@@ -2700,10 +2701,16 @@ TEST(geometry, UnionDifferenceIntersectPolygon)
27002701 std::vector<autoware::universe_utils::Polygon2d> boost_difference_result (
27012702 boost_difference_resultMP.begin (), boost_difference_resultMP.end ());
27022703
2704+ #if BOOST_VERSION >= 108300 // Boost 1.83+ fixed precision issues in polygon boolean operations
2705+ EXPECT_TRUE (polygon_equal_vector (custom_union_poly, boost_union_result, epsilon));
2706+ EXPECT_TRUE (polygon_equal_vector (custom_intersection_poly, boost_intersection_result, epsilon));
2707+ EXPECT_TRUE (polygon_equal_vector (custom_difference_poly, boost_difference_result, epsilon));
2708+ #else
27032709 EXPECT_FALSE (polygon_equal_vector (custom_union_poly, boost_union_result, epsilon));
27042710 EXPECT_FALSE (
27052711 polygon_equal_vector (custom_intersection_poly, boost_intersection_result, epsilon));
27062712 EXPECT_FALSE (polygon_equal_vector (custom_difference_poly, boost_difference_result, epsilon));
2713+ #endif
27072714 }
27082715
27092716 { // case where Boost.Geometry omits a very small polygon in the difference result, while Shapely
You can’t perform that action at this time.
0 commit comments