63 const double angle_tol_deg = 1.0;
66 const int pos_tol = 1;
68 BOOST_CHECK_PREDICATE( KI_TEST::IsVecWithinTol<VECTOR2I>,
71 BOOST_CHECK_PREDICATE( KI_TEST::IsVecWithinTol<VECTOR2I>,
74 BOOST_CHECK_PREDICATE( KI_TEST::IsVecWithinTol<VECTOR2I>,
77 BOOST_CHECK_PREDICATE( KI_TEST::IsWithinWrapped<double>,
80 BOOST_CHECK_PREDICATE( KI_TEST::IsWithinWrapped<double>,
83 BOOST_CHECK_PREDICATE( KI_TEST::IsWithinWrapped<double>,
86 BOOST_CHECK_PREDICATE( KI_TEST::IsWithin<double>,
92 BOOST_CHECK_PREDICATE( KI_TEST::IsVecWithinTol<VECTOR2I>,
95 BOOST_CHECK_PREDICATE( KI_TEST::IsVecWithinTol<VECTOR2I>,
99 BOOST_CHECK_EQUAL( aArc.
IsSolid(),
true );
101 BOOST_CHECK_PREDICATE( KI_TEST::IsBoxWithinTol<BOX2I>,
102 ( aArc.
BBox() )( aProps.
m_bbox )( pos_tol ) );
120 std::unique_ptr<SHAPE> new_shape{ aArc.
Clone() };
122 BOOST_CHECK_EQUAL( new_shape->Type(),
SH_ARC );
126 BOOST_REQUIRE( new_arc !=
nullptr );
139 BOOST_CHECK_EQUAL( arc.GetWidth(), 0 );
186 "C(0,0) 114 + 360 degree",
201 { { -752587, -752587 }, { 1505174, 1505174 } },
205 "C(0,0) 180 + 360 degree",
220 { { -100, -100 }, { 200, 200 } },
224 "C(0,0) 180 + 90 degree",
239 { { -100, -100 }, { 100, 100 } },
243 "C(100,200) 0 - 30 degree",
258 { { 273, 100 }, { 27, 100 } },
265 "C(0,0) 30 + 120 degree",
281 { { -17320, 10000 }, { 17320 * 2, 10000 } },
286 "C(0,0) 150 + 240 degree",
302 { { -20000, -20000 }, { 40000, 30000 } },
307 "C(0,0) 30 - 300 degree",
323 { { -20000, -20000 }, { 40000, 30000 } },
333 BOOST_TEST_CONTEXT( c.m_ctx_name )
336 const auto this_arc =
SHAPE_ARC{ c.m_geom.m_center_point, c.m_geom.m_start_point,
340 CheckArc( this_arc, c.m_properties );
376 "90 degree segments intersecting",
391 { { 0, 0 }, { 1000, 1000 } },
395 "45 degree segments intersecting",
398 { 0, 0, 1000, 1000 },
410 { { 0, 1414 }, { 1707, 1000 } },
414 "135 degree segments intersecting",
417 { 0, 0, 1000, -1000 },
429 { { 0, -293 }, { 293, 707 } },
441 BOOST_TEST_CONTEXT( c.m_ctx_name )
443 for(
int testCase = 0; testCase < 8; ++testCase )
445 SEG seg1 = c.m_geom.m_segment_1;
446 SEG seg2 = c.m_geom.m_segment_2;
452 seg1 = c.m_geom.m_segment_2;
453 seg2 = c.m_geom.m_segment_1;
464 if( ( testCase % 4 ) == 1 || ( testCase % 4 ) == 3 )
472 if( ( testCase % 4 ) == 2 || ( testCase % 4 ) == 3 )
480 const auto this_arc =
SHAPE_ARC{ seg1, seg2,
481 c.m_geom.m_radius, c.m_width };
520 {
"180 deg, clockwise", { { 100, 0 }, { 0, 0 }, { 50, 0 } },
true, { 50, -50 } },
521 {
"180 deg, anticlockwise", { { 100, 0 }, { 0, 0 }, { 50, 0 } },
false, { 50, 50 } },
522 {
"180 deg flipped, clockwise", { { 0, 0 }, { 100, 0 }, { 50, 0 } },
true, { 50, 50 } },
523 {
"180 deg flipped, anticlockwise", { { 0, 0 }, { 100, 0 }, { 50, 0 } },
false, { 50, -50 } },
524 {
"90 deg, clockwise", { { -100, 0 }, { 0, 100 }, { 0, 0 } },
true, { -71, 71 } },
525 {
"90 deg, anticlockwise", { { -100, 0 }, { 0, 100 }, { 0, 0 } },
false, { 71, -71 } },
533 BOOST_TEST_CONTEXT( c.m_ctx_name )
537 VECTOR2I center = c.m_geom.m_center;
538 bool cw = c.m_clockwise;
543 BOOST_CHECK_EQUAL( this_arc.
GetArcMid(), c.m_expected_mid );
561 {
" 270deg, 0 cl, 0 deg ", { { 0, 0 }, { 100, 0 }, 270.0 }, 0, { 100, 0 },
true, 0 },
562 {
" 270deg, 0 cl, 90 deg ", { { 0, 0 }, { 100, 0 }, 270.0 }, 0, { 0, 100 },
true, 0 },
563 {
" 270deg, 0 cl, 180 deg ", { { 0, 0 }, { 100, 0 }, 270.0 }, 0, { -100, 0 },
true, 0 },
564 {
" 270deg, 0 cl, 270 deg ", { { 0, 0 }, { 100, 0 }, 270.0 }, 0, { 0, -100 },
true, 0 },
565 {
" 270deg, 0 cl, 45 deg ", { { 0, 0 }, { 100, 0 }, 270.0 }, 0, { 71, 71 },
true, 0 },
566 {
" 270deg, 0 cl, -45 deg ", { { 0, 0 }, { 100, 0 }, 270.0 }, 0, { 71, -71 },
false, -1 },
567 {
"-270deg, 0 cl, 0 deg ", { { 0, 0 }, { 100, 0 }, -270.0 }, 0, { 100, 0 },
true, 0 },
568 {
"-270deg, 0 cl, 90 deg ", { { 0, 0 }, { 100, 0 }, -270.0 }, 0, { 0, 100 },
true, 0 },
569 {
"-270deg, 0 cl, 180 deg ", { { 0, 0 }, { 100, 0 }, -270.0 }, 0, { -100, 0 },
true, 0 },
570 {
"-270deg, 0 cl, 270 deg ", { { 0, 0 }, { 100, 0 }, -270.0 }, 0, { 0, -100 },
true, 0 },
571 {
"-270deg, 0 cl, 45 deg ", { { 0, 0 }, { 100, 0 }, -270.0 }, 0, { 71, 71 },
false, -1 },
572 {
"-270deg, 0 cl, -45 deg ", { { 0, 0 }, { 100, 0 }, -270.0 }, 0, { 71, -71 },
true, 0 },
573 {
" 270deg, 5 cl, 0 deg, 5 pos X", { { 0, 0 }, { 100, 0 }, 270.0 }, 5, { 105, 0 },
true, 5 },
574 {
" 270deg, 5 cl, 0 deg, 5 pos Y", { { 0, 0 }, { 100, 0 }, 270.0 }, 5, { 100, -5 },
true, 5 },
575 {
" 270deg, 5 cl, 90 deg, 5 pos", { { 0, 0 }, { 100, 0 }, 270.0 }, 5, { 0, 105 },
true, 5 },
576 {
" 270deg, 5 cl, 180 deg, 5 pos", { { 0, 0 }, { 100, 0 }, 270.0 }, 5, { -105, 0 },
true, 5 },
577 {
" 270deg, 5 cl, 270 deg, 5 pos", { { 0, 0 }, { 100, 0 }, 270.0 }, 5, { 0, -105 },
true, 5 },
578 {
" 270deg, 5 cl, 0 deg, 5 neg", { { 0, 0 }, { 100, 0 }, 270.0 }, 5, { 105, 0 },
true, 5 },
579 {
" 270deg, 5 cl, 90 deg, 5 neg", { { 0, 0 }, { 100, 0 }, 270.0 }, 5, { 0, 105 },
true, 5 },
580 {
" 270deg, 5 cl, 180 deg, 5 neg", { { 0, 0 }, { 100, 0 }, 270.0 }, 5, { -105, 0 },
true, 5 },
581 {
" 270deg, 5 cl, 270 deg, 5 neg", { { 0, 0 }, { 100, 0 }, 270.0 }, 5, { 0, -105 },
true, 5 },
582 {
" 270deg, 5 cl, 45 deg, 5 pos", { { 0, 0 }, { 100, 0 }, 270.0 }, 5, { 74, 75 },
true, 5 },
583 {
" 270deg, 5 cl, -45 deg, 5 pos", { { 0, 0 }, { 100, 0 }, 270.0 }, 5, { 74, -75 },
false, -1 },
584 {
" 270deg, 5 cl, 45 deg, 5 neg", { { 0, 0 }, { 100, 0 }, 270.0 }, 5, { 67, 67 },
true, 5 },
585 {
" 270deg, 5 cl, -45 deg, 5 neg", { { 0, 0 }, { 100, 0 }, 270.0 }, 5, { 67, -67 },
false, -1 },
586 {
" 270deg, 4 cl, 0 deg pos", { { 0, 0 }, { 100, 0 }, 270.0 }, 4, { 105, 0 },
false, -1 },
587 {
" 270deg, 4 cl, 90 deg pos", { { 0, 0 }, { 100, 0 }, 270.0 }, 4, { 0, 105 },
false, -1 },
588 {
" 270deg, 4 cl, 180 deg pos", { { 0, 0 }, { 100, 0 }, 270.0 }, 4, { -105, 0 },
false, -1 },
589 {
" 270deg, 4 cl, 270 deg pos", { { 0, 0 }, { 100, 0 }, 270.0 }, 4, { 0, -105 },
false, -1 },
590 {
" 90deg, 0 cl, 0 deg ", { { 0, 0 }, { 71, -71 }, 90.0 }, 0, { 71, -71 },
true, 0 },
591 {
" 90deg, 0 cl, 45 deg ", { { 0, 0 }, { 71, -71 }, 90.0 }, 0, { 100, 0 },
true, 0 },
592 {
" 90deg, 0 cl, 90 deg ", { { 0, 0 }, { 71, -71 }, 90.0 }, 0, { 71, 71 },
true, 0 },
593 {
" 90deg, 0 cl, 135 deg ", { { 0, 0 }, { 71, -71 }, 90.0 }, 0, { 0, -100 },
false, -1 },
594 {
" 90deg, 0 cl, -45 deg ", { { 0, 0 }, { 71, -71 }, 90.0 }, 0, { 0, 100 },
false, -1 },
595 {
" -90deg, 0 cl, 0 deg ", { { 0, 0 }, { 71, 71 }, -90.0 }, 0, { 71, -71 },
true, 0 },
596 {
" -90deg, 0 cl, 45 deg ", { { 0, 0 }, { 71, 71 }, -90.0 }, 0, { 100, 0 },
true, 0 },
597 {
" -90deg, 0 cl, 90 deg ", { { 0, 0 }, { 71, 71 }, -90.0 }, 0, { 71, 71 },
true, 0 },
598 {
" -90deg, 0 cl, 135 deg ", { { 0, 0 }, { 71, 71 }, -90.0 }, 0, { 0, -100 },
false, -1 },
599 {
" -90deg, 0 cl, -45 deg ", { { 0, 0 }, { 71, 71 }, -90.0 }, 0, { 0, 100 },
false, -1 },
600 {
"issue 11358 collide",
601 { { 119888000, 60452000 }, { 120904000, 60452000 }, 360.0 },
603 { 120395500, 59571830 },
606 {
"issue 11358 dist",
607 { { 119888000, 60452000 }, { 120904000, 60452000 }, 360.0 },
609 { 118872050, 60452000 },
619 BOOST_TEST_CONTEXT( c.m_ctx_name )
621 SHAPE_ARC arc( c.m_geom.m_center_point, c.m_geom.m_start_point,
625 BOOST_TEST_CONTEXT(
"Test Clearance" )
628 BOOST_CHECK_EQUAL( arc.
Collide( c.m_point, c.m_arc_clearance, &dist ),
630 BOOST_CHECK_EQUAL( dist, c.m_exp_distance );
634 BOOST_TEST_CONTEXT(
"Test Width" )
637 arc.
SetWidth( c.m_arc_clearance * 2 );
638 BOOST_CHECK_EQUAL( arc.
Collide( c.m_point, 0, &dist ), c.m_exp_result );
641 BOOST_CHECK_EQUAL( dist, 0 );
643 BOOST_CHECK_EQUAL( dist, -1 );
665 {
"0 deg ", { { 0, 0 }, { 100, 0 }, 270.0 }, 0, { { 100, 0 }, { 50, 0 } },
true, 0 },
666 {
"90 deg ", { { 0, 0 }, { 100, 0 }, 270.0 }, 0, { { 0, 100 }, { 0, 50 } },
true, 0 },
667 {
"180 deg ", { { 0, 0 }, { 100, 0 }, 270.0 }, 0, { { -100, 0 }, { -50, 0 } },
true, 0 },
668 {
"270 deg ", { { 0, 0 }, { 100, 0 }, 270.0 }, 0, { { 0, -100 }, { 0, -50 } },
true, 0 },
669 {
"45 deg ", { { 0, 0 }, { 100, 0 }, 270.0 }, 0, { { 71, 71 }, { 35, 35 } },
true, 0 },
670 {
"-45 deg ", { { 0, 0 }, { 100, 0 }, 270.0 }, 0, { { 71, -71 }, { 35, -35 } },
false, -1 },
671 {
"seg inside arc start", { { 0, 0 }, { 71, -71 }, 90.0 },
672 10, { { 90, 0 }, { -35, 0 } },
true, 10 },
673 {
"seg inside arc end", { { 0, 0 }, { 71, -71 }, 90.0 },
674 10, { { -35, 0 }, { 90, 0 } },
true, 10 },
675 {
"large diameter arc", { { 172367922, 82282076 }, { 162530000, 92120000 }, -45.0 },
676 433300, { { 162096732, 92331236 }, { 162096732, 78253268 } },
true, 433268 },
684 BOOST_TEST_CONTEXT( c.m_ctx_name )
686 SHAPE_ARC arc( c.m_geom.m_center_point, c.m_geom.m_start_point,
690 BOOST_TEST_CONTEXT(
"Test Clearance" )
693 BOOST_CHECK_EQUAL( arc.
Collide( c.m_seg, c.m_arc_clearance, &dist ),
695 BOOST_CHECK_EQUAL( dist, c.m_exp_distance );
699 BOOST_TEST_CONTEXT(
"Test Width" )
702 arc.
SetWidth( c.m_arc_clearance * 2 );
703 BOOST_CHECK_EQUAL( arc.
Collide( c.m_seg, 0, &dist ), c.m_exp_result );
706 BOOST_CHECK_EQUAL( dist, 0 );
708 BOOST_CHECK_EQUAL( dist, -1 );
748 {
"case 1: No intersection",
749 { 73.843527, 74.355869, 71.713528, 72.965869, -76.36664803, 0.2 },
750 { 71.236473, 74.704131, 73.366472, 76.094131, -76.36664803, 0.2 },
753 {
"case 2: No intersection",
754 { 82.542335, 74.825975, 80.413528, 73.435869, -76.4, 0.2 },
755 { 76.491192, 73.839894, 78.619999, 75.23, -76.4, 0.2 },
758 {
"case 3: No intersection",
759 { 89.318807, 74.810106, 87.19, 73.42, -76.4, 0.2 },
760 { 87.045667, 74.632941, 88.826472, 75.794131, -267.9, 0.2 },
763 {
"case 4: Co-centered not intersecting",
764 { 94.665667, 73.772941, 96.446472, 74.934131, -267.9, 0.2 },
765 { 94.665667, 73.772941, 93.6551, 73.025482, -255.5, 0.2 },
768 {
"case 5: Not intersecting, but end points very close",
769 { 72.915251, 80.493054, 73.570159, 81.257692, -260.5, 0.2 },
770 { 73.063537, 82.295989, 71.968628, 81.581351, -255.5, 0.2 },
773 {
"case 6: Coincident centers, colliding due to arc thickness",
774 { 79.279991, 80.67988, 80.3749, 81.394518, -255.5, 0.2 },
775 { 79.279991, 80.67988, 80.3749, 81.694518, -255.5, 0.2 },
778 {
"case 7: Single intersection",
779 { 88.495265, 81.766089, 90.090174, 82.867869, -255.5, 0.2 },
780 { 86.995265, 81.387966, 89.090174, 82.876887, -255.5, 0.2 },
783 {
"case 8: Double intersection",
784 { 96.149734, 81.792126, 94.99, 83.37, -347.2, 0.2 },
785 { 94.857156, 81.240589, 95.91, 83.9, -288.5, 0.2 },
788 {
"case 9: Endpoints within arc width",
789 { 72.915251, 86.493054, 73.970159, 87.257692, -260.5, 0.2 },
790 { 73.063537, 88.295989, 71.968628, 87.581351, -255.5, 0.2 },
793 {
"case 10: Endpoints close, outside, no collision",
794 { 78.915251, 86.393054, 79.970159, 87.157692, 99.5, 0.2 },
795 { 79.063537, 88.295989, 77.968628, 87.581351, -255.5, 0.2 },
798 {
"case 11: Endpoints close, inside, collision due to arc width",
799 { 85.915251, 86.993054, 86.970159, 87.757692, 99.5, 0.2 },
800 { 86.063537, 88.295989, 84.968628, 87.581351, -255.5, 0.2 },
803 {
"case 12: Simulated differential pair length-tuning",
804 { 94.6551, 88.296, 95.6551, 88.296, 90.0, 0.1 },
805 { 94.6551, 88.296, 95.8551, 88.296, 90.0, 0.1 },
808 {
"case 13: One arc fully enclosed in other, non-concentric",
809 { 73.77532, 93.413654, 75.70532, 93.883054, 60.0, 0.1 },
810 { 73.86532, 93.393054, 75.86532, 93.393054, 90.0, 0.3 },
813 {
"case 14: One arc fully enclosed in other, concentric",
814 { 79.87532, 93.413654, 81.64532, 94.113054, 60.0, 0.1 },
815 { 79.87532, 93.413654, 81.86532, 93.393054, 90.0, 0.3 },
825 BOOST_TEST_CONTEXT( c.m_ctx_name )
827 SHAPE_ARC arc1( c.m_arc1.GenerateArc() );
828 SHAPE_ARC arc2( c.m_arc2.GenerateArc() );
840 SHAPE* arc1_sh = &arc1;
841 SHAPE* arc2_sh = &arc2;
842 SHAPE* arc1_slc_sh = &arc1_slc;
843 SHAPE* arc2_slc_sh = &arc2_slc;
846 &actual, &location );
852 bool result_arc_to_chain =
853 arc1_sh->
Collide( arc2_slc_sh, clearance, &actual, &location );
856 bool result_chain_to_arc =
857 arc1_slc_sh->
Collide( arc2_sh, clearance, &actual, &location );
860 bool result_chain_to_chain =
861 arc1_slc_sh->
Collide( arc2_slc_sh, clearance, &actual, &location );
863 BOOST_CHECK_EQUAL( result_arc_to_arc, c.m_exp_result );
864 BOOST_CHECK_EQUAL( result_arc_to_chain, c.m_exp_result );
865 BOOST_CHECK_EQUAL( result_chain_to_arc, c.m_exp_result );
866 BOOST_CHECK_EQUAL( result_chain_to_chain, c.m_exp_result );
875 VECTOR2I( 197822958, 136722959 ), 250000 );
886 SHAPE* arc_sh = &arc;
889 BOOST_CHECK_EQUAL( arc_sh->Collide( &lc, 100000 ),
true );
890 BOOST_CHECK_EQUAL( lc_sh->
Collide( &arc, 100000 ),
true );
893 BOOST_CHECK_EQUAL( arc.
Collide( seg, 0 ),
true );
904 int clearance = ( arc.
GetWidth() * 3 ) / 2;
912 BOOST_CHECK_EQUAL( arcBuffer.
HoleCount( 0 ), 0 );
915 BOX2I arcbbox = arc.
BBox( clearance * 4 );
927 zoneFill.AddHole( arcBuffer.
Outline( 0 ) );
928 zoneFill.CacheTriangulation(
false );
932 int epsilon = polygonApproximationError / 10;
934 BOOST_CHECK_EQUAL( zoneFill.Collide( &arc, clearance +
epsilon, &actual, &location ),
true );
936 BOOST_CHECK_EQUAL( zoneFill.Collide( &arc, clearance -
epsilon, &actual, &location ),
false );
957 int aRad,
int aTolerance )
959 std::vector<VECTOR2I> points;
961 for(
int i = 0; i < aPolyline.
PointCount(); ++i )
963 points.push_back( aPolyline.
CPoint( i ) );
980 int aRad,
int aTolerance )
982 std::vector<VECTOR2I> points;
984 for(
int i = 0; i < aPolyline.
PointCount() - 1; ++i )
987 points.push_back( mid_pt );
996 const std::vector<ARC_TO_POLYLINE_CASE> cases = {
1016 "Extremely small semicircle",
1025 "Non-round geometry",
1034 const int width = 0;
1039 const int accuracy = 100;
1042 for(
const auto& c : cases )
1044 BOOST_TEST_CONTEXT( c.m_ctx_name )
1046 const SHAPE_ARC this_arc{ c.m_geom.m_center_point, c.m_geom.m_start_point,
1051 BOOST_TEST_MESSAGE(
"Polyline has " << chain.
PointCount() <<
" points" );
1054 BOOST_CHECK_EQUAL( chain.
CPoint( 0 ), c.m_geom.m_start_point );
1057 BOOST_CHECK_EQUAL( chain.
CPoint( -1 ), this_arc.GetP1() );
1059 int radius = ( c.m_geom.m_center_point - c.m_geom.m_start_point ).EuclideanNorm();
1063 ( chain )( c.m_geom.m_center_point )( radius )( accuracy +
epsilon ) );
1066 ( chain )( c.m_geom.m_center_point )( radius )( accuracy +
epsilon ) );
constexpr EDA_IU_SCALE pcbIUScale
constexpr const Vec & GetPosition() const
constexpr const Vec GetEnd() const
constexpr size_type GetWidth() const
EDA_ANGLE GetCentralAngle() const
const VECTOR2I & GetArcMid() const
const BOX2I BBox(int aClearance=0) const override
Compute a bounding box of the shape, with a margin of aClearance a collision.
EDA_ANGLE GetEndAngle() const
void SetWidth(int aWidth)
SHAPE_ARC & ConstructFromStartEndCenter(const VECTOR2I &aStart, const VECTOR2I &aEnd, const VECTOR2I &aCenter, bool aClockwise=false, double aWidth=0)
Constructs this arc from the given start, end and center.
const VECTOR2I & GetP1() const
bool Collide(const SEG &aSeg, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const override
Check if the boundary of shape (this) lies closer to the segment aSeg than aClearance,...
EDA_ANGLE GetStartAngle() const
static double DefaultAccuracyForPCB()
SHAPE * Clone() const override
Return a dynamically allocated copy of the shape.
const VECTOR2I & GetP0() const
bool IsSolid() const override
const VECTOR2I & GetCenter() const
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
int PointCount() const
Return the number of points (vertices) in this line chain.
const VECTOR2I & CPoint(int aIndex) const
Return a reference to a given point in the line chain.
void SetWidth(int aWidth)
Set the width of all segments in the chain.
Represent a set of closed polygons.
int AddOutline(const SHAPE_LINE_CHAIN &aOutline)
Adds a new outline to the set and returns its index.
int HoleCount(int aOutline) const
Returns the number of holes in a given outline.
SHAPE_LINE_CHAIN & Outline(int aIndex)
Return the reference to aIndex-th outline in the set.
int OutlineCount() const
Return the number of outlines in the set.
An abstract shape on 2D plane.
virtual bool Collide(const VECTOR2I &aP, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const
Check if the boundary of shape (this) lies closer to the point aP than aClearance,...
static const int MIN_PRECISION_IU
This is the minimum precision for all the points in a shape.
void TransformArcToPolygon(SHAPE_POLY_SET &aBuffer, const VECTOR2I &aStart, const VECTOR2I &aMid, const VECTOR2I &aEnd, int aWidth, int aError, ERROR_LOC aErrorLoc)
Convert arc to multiple straight segments.
bool ArePointsNearCircle(const std::vector< VECTOR2< T > > &aPoints, const VECTOR2< T > &aCentre, T aRad, T aTol)
Predicate for checking a set of points is within a certain tolerance of a circle.
Numerical test predicates.
Info to set up an arc by centre, start point and angle.
ARC_CENTRE_PT_ANGLE m_geom
Geom of the arc.
std::string m_ctx_name
The text context name.
ARC_PROPERTIES m_properties
Expected properties.
int m_width
Arc line width.
SHAPE_ARC GenerateArc() const
All properties of an arc (depending on how it's constructed, some of these might be the same as the c...
ARC_CENTRE_PT_ANGLE m_geom
std::string m_ctx_name
The text context name.
bool m_clockwise
clockwise or anti-clockwise?
ARC_START_END_CENTER m_geom
Geom of the arc.
VECTOR2I m_expected_mid
Expected mid-point of the arc.
ARC_CENTRE_PT_ANGLE m_geom
Info to set up an arc start, end and center.
Info to set up an arc by tangent to two segments and a radius.
ARC_CENTRE_PT_ANGLE m_geom
ARC_PROPERTIES m_properties
Expected properties.
ARC_TAN_TAN_RADIUS m_geom
Geom of the arc.
int m_width
Arc line width.
std::string m_ctx_name
The text context name.
constexpr int mmToIU(double mm) const
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_AUTO_TEST_SUITE_END()
bool ArePolylineMidPointsNearCircle(const SHAPE_LINE_CHAIN &aPolyline, const VECTOR2I &aCentre, int aRad, int aTolerance)
Predicate for checking a polyline has all the segment mid points on (near) a circle of given centre a...
static const std::vector< ARC_PT_COLLIDE_CASE > arc_pt_collide_cases
static void CheckArcGeom(const SHAPE_ARC &aArc, const ARC_PROPERTIES &aProps, const int aSynErrIU=1)
Check a SHAPE_ARC against a given set of geometric properties.
static const std::vector< ARC_SEC_CASE > arc_sec_cases
bool ArePolylineEndPointsNearCircle(const SHAPE_LINE_CHAIN &aPolyline, const VECTOR2I &aCentre, int aRad, int aTolerance)
Predicate for checking a polyline has all the points on (near) a circle of given centre and radius.
static const std::vector< ARC_SEG_COLLIDE_CASE > arc_seg_collide_cases
static void CheckArc(const SHAPE_ARC &aArc, const ARC_PROPERTIES &aProps, const int aSynErrIU=1)
Check an arcs geometry and other class functions.
BOOST_AUTO_TEST_CASE(NullCtor)
Check correct handling of filter strings (as used by WX)
static const std::vector< ARC_CPA_CASE > arc_cases
static const std::vector< ARC_TTR_CASE > arc_ttr_cases
static const std::vector< ARC_ARC_COLLIDE_CASE > arc_arc_collide_cases
VECTOR2< int32_t > VECTOR2I
VECTOR2< double > VECTOR2D