mirror of
https://github.com/boostorg/geometry.git
synced 2025-05-11 05:24:02 +00:00
[geometry] test cases for #buffer_mp1 and #buffer_mp2, see previous two commits
[SVN r83476]
This commit is contained in:
parent
8fbc112550
commit
72f3b3f18e
@ -249,6 +249,19 @@ void test_all()
|
||||
1, 5, 1,
|
||||
1, 5, 1);
|
||||
|
||||
test_one<polygon, polygon, polygon>("buffer_mp1",
|
||||
buffer_mp1[0], buffer_mp1[1],
|
||||
1, 61, 10.2717,
|
||||
1, 61, 10.2717);
|
||||
|
||||
if (boost::is_same<ct, double>::value)
|
||||
{
|
||||
test_one<polygon, polygon, polygon>("buffer_mp2",
|
||||
buffer_mp2[0], buffer_mp2[1],
|
||||
1, 92, 12.09857,
|
||||
1, 157, 24.19787);
|
||||
}
|
||||
|
||||
/*** TODO: self-tangencies for difference
|
||||
test_one<polygon, polygon, polygon>("wrapped_a",
|
||||
wrapped[0], wrapped[1],
|
||||
|
@ -213,6 +213,13 @@ void test_areal()
|
||||
test_one<Polygon, Polygon, Polygon>("buffer_rt_g", buffer_rt_g[0], buffer_rt_g[1],
|
||||
1, 0, 2.914213562373);
|
||||
|
||||
|
||||
test_one<Polygon, Polygon, Polygon>("buffer_mp1", buffer_mp1[0], buffer_mp1[1],
|
||||
1, 31, 2.271707796);
|
||||
|
||||
test_one<Polygon, Polygon, Polygon>("buffer_mp2", buffer_mp2[0], buffer_mp2[1],
|
||||
1, 29, 0.457126);
|
||||
|
||||
return;
|
||||
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -7,10 +7,10 @@
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// #define BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE
|
||||
// #define BOOST_GEOMETRY_OVERLAY_NO_THROW
|
||||
// #define TEST_WITH_SVG
|
||||
// #define HAVE_TTMATH
|
||||
//#define BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE
|
||||
//#define BOOST_GEOMETRY_OVERLAY_NO_THROW
|
||||
//#define TEST_WITH_SVG
|
||||
//#define HAVE_TTMATH
|
||||
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
@ -271,7 +271,7 @@ struct test_traverse
|
||||
out << "vx: " << turn.operations[0].enriched.travels_to_vertex_index
|
||||
<< " -> ip: " << turn.operations[0].enriched.travels_to_ip_index;
|
||||
}
|
||||
out << " ";
|
||||
out << " / ";
|
||||
if (turn.operations[1].enriched.next_ip_index != -1)
|
||||
{
|
||||
out << "ip: " << turn.operations[1].enriched.next_ip_index;
|
||||
@ -281,7 +281,7 @@ struct test_traverse
|
||||
out << "vx: " << turn.operations[1].enriched.travels_to_vertex_index
|
||||
<< " -> ip: " << turn.operations[1].enriched.travels_to_ip_index;
|
||||
}
|
||||
|
||||
|
||||
out << std::endl;
|
||||
|
||||
/*out
|
||||
@ -928,6 +928,20 @@ void test_all(bool test_self_tangencies = true, bool test_mixed = false)
|
||||
1, 30,
|
||||
buffer_rt_g_boxes[4], buffer_rt_g_boxes[3]);
|
||||
|
||||
|
||||
test_traverse<polygon, polygon, operation_union>::apply("buffer_mp2",
|
||||
2, 36.7535642, buffer_mp2[0], buffer_mp2[1], 0.01);
|
||||
test_traverse<polygon, polygon, operation_union>::apply("collinear_opposite_rr",
|
||||
1, 6.41, collinear_opposite_right[0], collinear_opposite_right[1]);
|
||||
test_traverse<polygon, polygon, operation_union>::apply("collinear_opposite_ll",
|
||||
1, 11.75, collinear_opposite_left[0], collinear_opposite_left[1]);
|
||||
test_traverse<polygon, polygon, operation_union>::apply("collinear_opposite_ss",
|
||||
1, 6, collinear_opposite_straight[0], collinear_opposite_straight[1]);
|
||||
test_traverse<polygon, polygon, operation_union>::apply("collinear_opposite_lr",
|
||||
1, 8.66, collinear_opposite_left[0], collinear_opposite_right[1]);
|
||||
test_traverse<polygon, polygon, operation_union>::apply("collinear_opposite_rl",
|
||||
1, 9, collinear_opposite_right[0], collinear_opposite_left[1]);
|
||||
|
||||
#ifdef BOOST_GEOMETRY_OVERLAY_NO_THROW
|
||||
{
|
||||
// NOTE: currently throws (normally)
|
||||
|
@ -232,10 +232,12 @@ void test_areal()
|
||||
if_typed<ct, double>(5, if_typed_tt<ct>(8, 7)),
|
||||
14729.07145);
|
||||
|
||||
|
||||
// Float gives sometimes 14, sometimes 14 points
|
||||
test_one<Polygon, Polygon, Polygon>("ggl_list_20110716_enrico",
|
||||
ggl_list_20110716_enrico[0], ggl_list_20110716_enrico[1],
|
||||
1, 1,
|
||||
if_typed<ct, double>(18, if_typed<ct, float>(15, 17)),
|
||||
if_typed<ct, double>(18, if_typed<ct, float>(-1, 17)),
|
||||
129904.197692871);
|
||||
|
||||
test_one<Polygon, Polygon, Polygon>("ggl_list_20110820_christophe",
|
||||
@ -328,6 +330,23 @@ void test_areal()
|
||||
1, 0, if_typed_tt<ct>(16, 14), 15.6569);
|
||||
test_one<Polygon, Polygon, Polygon>("buffer_rt_t_ref", buffer_rt_t[1], buffer_rt_t[0],
|
||||
1, 0, if_typed_tt<ct>(16, 14), 15.6569);
|
||||
|
||||
test_one<Polygon, Polygon, Polygon>("buffer_mp1", buffer_mp1[0], buffer_mp1[1],
|
||||
1, 0, 91, 22.815);
|
||||
|
||||
if (boost::is_same<ct, double>::type::value)
|
||||
{
|
||||
// Contains robustness issue for collinear-opposite.
|
||||
// In double it delivers a polygon and a hole
|
||||
test_one<Polygon, Polygon, Polygon>("buffer_mp2", buffer_mp2[0], buffer_mp2[1],
|
||||
1, 1, 218, 36.7535642);
|
||||
}
|
||||
else if (boost::is_same<ct, float>::type::value)
|
||||
{
|
||||
// In float (and ttmath) it delivers one polygon
|
||||
test_one<Polygon, Polygon, Polygon>("buffer_mp2", buffer_mp2[0], buffer_mp2[1],
|
||||
1, 0, 217, 36.7528377);
|
||||
}
|
||||
}
|
||||
|
||||
template <typename P>
|
||||
|
Loading…
x
Reference in New Issue
Block a user