From b6f2941a06fcb30039dbc87d867d5d4ad376f792 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 31 Mar 2021 22:34:13 +0100 Subject: [PATCH] Another try a allowing touching courtyards. Fixes https://gitlab.com/kicad/code/kicad/issues/8076 --- libs/kimath/include/geometry/shape_poly_set.h | 2 +- pcbnew/drc/drc_test_provider_courtyard_clearance.cpp | 6 ------ pcbnew/footprint.cpp | 6 ++++++ 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libs/kimath/include/geometry/shape_poly_set.h b/libs/kimath/include/geometry/shape_poly_set.h index e575bb63a5..0561748dac 100644 --- a/libs/kimath/include/geometry/shape_poly_set.h +++ b/libs/kimath/include/geometry/shape_poly_set.h @@ -964,7 +964,7 @@ public: * @param aAmount is the number of units to offset edges. * @param aCircleSegmentsCount is the number of segments per 360 degrees to use in curve approx * @param aCornerStrategy #ALLOW_ACUTE_CORNERS to preserve all angles, - * #CHOP_ACUTE_CORNERS to chop angles less than 90°, + * #CHAMFER_ACUTE_CORNERS to chop angles less than 90°, * #ROUND_ACUTE_CORNERS to round off angles less than 90°, * #ROUND_ALL_CORNERS to round regardless of angles */ diff --git a/pcbnew/drc/drc_test_provider_courtyard_clearance.cpp b/pcbnew/drc/drc_test_provider_courtyard_clearance.cpp index 4f00068a1a..d451b421cf 100644 --- a/pcbnew/drc/drc_test_provider_courtyard_clearance.cpp +++ b/pcbnew/drc/drc_test_provider_courtyard_clearance.cpp @@ -189,9 +189,6 @@ bool DRC_TEST_PROVIDER_COURTYARD_CLEARANCE::testCourtyardClearances() test, F_Cu ); clearance = constraint.GetValue().Min(); - // Touching courtyards, or courtyards -at- the clearance distance are legal. - clearance -= 1; - if( clearance >= 0 && footprintFront.Collide( &testFront, clearance, &actual, &pos ) ) { std::shared_ptr drce = DRC_ITEM::Create( DRCE_OVERLAPPING_FOOTPRINTS ); @@ -219,9 +216,6 @@ bool DRC_TEST_PROVIDER_COURTYARD_CLEARANCE::testCourtyardClearances() test, B_Cu ); clearance = constraint.GetValue().Min(); - // Touching courtyards, or courtyards -at- the clearance distance are legal. - clearance -= 1; - if( clearance >= 0 && footprintBack.Collide( &testBack, clearance, &actual, &pos ) ) { std::shared_ptr drce = DRC_ITEM::Create( DRCE_OVERLAPPING_FOOTPRINTS ); diff --git a/pcbnew/footprint.cpp b/pcbnew/footprint.cpp index 411d2fa896..54e96ed8bb 100644 --- a/pcbnew/footprint.cpp +++ b/pcbnew/footprint.cpp @@ -1956,6 +1956,9 @@ void FOOTPRINT::BuildPolyCourtyards( OUTLINE_ERROR_HANDLER* aErrorHandler ) if( ConvertOutlineToPolygon( list_front, m_poly_courtyard_front, errorMax, chainingEpsilon, aErrorHandler ) ) { + // Touching courtyards, or courtyards -at- the clearance distance are legal. + m_poly_courtyard_front.Inflate( -1, SHAPE_POLY_SET::CHAMFER_ACUTE_CORNERS ); + m_poly_courtyard_front.CacheTriangulation( false ); } else @@ -1966,6 +1969,9 @@ void FOOTPRINT::BuildPolyCourtyards( OUTLINE_ERROR_HANDLER* aErrorHandler ) if( ConvertOutlineToPolygon( list_back, m_poly_courtyard_back, errorMax, chainingEpsilon, aErrorHandler ) ) { + // Touching courtyards, or courtyards -at- the clearance distance are legal. + m_poly_courtyard_back.Inflate( -1, SHAPE_POLY_SET::CHAMFER_ACUTE_CORNERS ); + m_poly_courtyard_back.CacheTriangulation( false ); } else