66 std::vector<SPS_DISTANCE_TO_SEG_CASE> cases;
74 const SHAPE_POLY_SET squares_10mm_0_0_and_20_0 = KT::BuildPolyset( {
85 "Square poly -> 1D segment",
93 "Square poly -> 2D (thick) segment",
101 "Two Squares poly -> 2D segment (nearest second square)", squares_10mm_0_0_and_20_0,
108 "Square poly -> one intersect", square_10mm_0_0,
115 "Square poly -> multiple intersection", square_10mm_0_0,
122 "Square poly -> 1D seg touching", square_10mm_0_0,
130 "Square poly -> 2D seg (end cap is nearest)", square_10mm_0_0,
146 BOOST_TEST_CONTEXT( c.m_case_name )
153 BOOST_CHECK_PREDICATE( KI_TEST::IsWithin<int>, ( dist )( c.m_exp_dist )( 1 ) );
Represent a set of closed polygons.
SEG::ecoord SquaredDistanceToSeg(const SEG &aSegment, VECTOR2I *aNearest=nullptr) const
Compute the minimum distance squared between aSegment and all the polygons in the set.
Utilities for creating useful polygon shapes that are commonly found in QA utilities and tests.
Utilities for creating useful line chain idioms commonly founds in QA utilities and tests.
Declares the Boost test suite fixture.
SEG m_seg
the segment to check distance to
int m_exp_dist
The expected answer.
SHAPE_POLY_SET m_polyset
list of lists of polygon points
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_AUTO_TEST_SUITE_END()
static constexpr int Millimeter2iu(double mm)
static constexpr double IU_PER_MM
Mock up a conversion function.
BOOST_AUTO_TEST_CASE(SegDistance)
Check segment distances.
static std::vector< SPS_DISTANCE_TO_SEG_CASE > GetSPSSegDistCases()