From a7d540ce94564e6cf25b493f1b44cf6be777494f Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 12 Oct 2023 15:53:05 +0200 Subject: [PATCH] TestBoardOutlinesGraphicItems(): add missing case. DRC_TEST_PROVIDER_MISC::testOutline(): use a smaller size to dectedt small items. --- pcbnew/convert_shape_list_to_polygon.cpp | 3 +++ pcbnew/drc/drc_test_provider_misc.cpp | 12 ++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/pcbnew/convert_shape_list_to_polygon.cpp b/pcbnew/convert_shape_list_to_polygon.cpp index 8bc4d74309..9a2e1425ed 100644 --- a/pcbnew/convert_shape_list_to_polygon.cpp +++ b/pcbnew/convert_shape_list_to_polygon.cpp @@ -682,6 +682,9 @@ bool TestBoardOutlinesGraphicItems( BOARD* aBoard, int aMinDist, case SHAPE_T::ARC: break; + case SHAPE_T::POLY: + break; + case SHAPE_T::BEZIER: break; diff --git a/pcbnew/drc/drc_test_provider_misc.cpp b/pcbnew/drc/drc_test_provider_misc.cpp index 260cf53bb2..71cfc943f3 100644 --- a/pcbnew/drc/drc_test_provider_misc.cpp +++ b/pcbnew/drc/drc_test_provider_misc.cpp @@ -97,11 +97,11 @@ void DRC_TEST_PROVIDER_MISC::testOutline() errorHandled = true; }; - // Use the standard chaining epsilon here so that we report errors that might affect - // other tools (such as 3D viewer). - int chainingEpsilon = m_board->GetOutlinesChainingEpsilon(); + // Test for very small graphic items (a few nm size) that can create issues + // when trying to build the board outlines, and they are not easy to locate onn screen. + const int minSizeForValideGraphics = pcbIUScale.mmToIU( 0.001 ); - if( !TestBoardOutlinesGraphicItems(m_board, chainingEpsilon, &errorHandler ) ) + if( !TestBoardOutlinesGraphicItems(m_board, minSizeForValideGraphics, &errorHandler ) ) { if( errorHandled ) { @@ -122,6 +122,10 @@ void DRC_TEST_PROVIDER_MISC::testOutline() } + // Use the standard chaining epsilon here so that we report errors that might affect + // other tools (such as 3D viewer). + int chainingEpsilon = m_board->GetOutlinesChainingEpsilon(); + if( !BuildBoardPolygonOutlines( m_board, dummyOutline, m_board->GetDesignSettings().m_MaxError, chainingEpsilon, &errorHandler ) ) {