diff --git a/common/geometry/shape_arc.cpp b/common/geometry/shape_arc.cpp index 3cf7cf281f..280574715c 100644 --- a/common/geometry/shape_arc.cpp +++ b/common/geometry/shape_arc.cpp @@ -158,7 +158,7 @@ const BOX2I SHAPE_ARC::BBox( int aClearance ) const // Put start and end points in the point list points.push_back( m_p0 ); points.push_back( GetP1() ); -// points.push_back( m_pc ); the center point is not necessary in the BBox + // points.push_back( m_pc ); the center point is not necessary in the BBox double start_angle = GetStartAngle(); double end_angle = start_angle + GetCentralAngle(); diff --git a/qa/common/geometry/test_shape_arc.cpp b/qa/common/geometry/test_shape_arc.cpp index fb445097fa..a466f62c8f 100644 --- a/qa/common/geometry/test_shape_arc.cpp +++ b/qa/common/geometry/test_shape_arc.cpp @@ -87,6 +87,15 @@ static void CheckArcGeom( const SHAPE_ARC& aArc, const ARC_PROPERTIES& aProps ) /// All arcs are solid BOOST_CHECK_EQUAL( aArc.IsSolid(), true ); + /// Test bouding box + #if 0 // Only for debug. + printf("abox %d %d %d %d prp %d %d %d %d\n", + aArc.BBox().GetX(), aArc.BBox().GetY(), aArc.BBox().GetSize().x, aArc.BBox().GetSize().y, + aProps.m_bbox.GetX(),aProps.m_bbox.GetY(), + aProps.m_bbox.GetSize().x, aProps.m_bbox.GetSize().y ); + fflush(0); + #endif + BOOST_CHECK_PREDICATE( KI_TEST::IsBoxWithinTol, ( aArc.BBox() )( aProps.m_bbox )( pos_tol ) ); @@ -199,7 +208,7 @@ static const std::vector arc_cases = { 0, 330, 200, - { { 100, 100 }, { 200, 100 } }, + { { 273, 100 }, { 27, 100 } }, }, }, { @@ -222,7 +231,7 @@ static const std::vector arc_cases = { 150, 20000, // bbox defined by: centre, top quadrant point, two endpoints - { { -17320, 0 }, { 17320 * 2, 20000 } }, + { { -17320, 10000 }, { 17320 * 2, 10000 } }, }, }, {