diff --git a/common/advanced_config.cpp b/common/advanced_config.cpp index 466081360b..00576c562e 100644 --- a/common/advanced_config.cpp +++ b/common/advanced_config.cpp @@ -79,6 +79,7 @@ static const wxChar DRCEpsilon[] = wxT( "DRCEpsilon" ); * Angle and width tolerances for copper and solder mask sliver detection. */ static const wxChar DRCSliverWidthTolerance[] = wxT( "DRCSliverWidthTolerance" ); +static const wxChar DRCSliverMinimumLength[] = wxT( "DRCSliverMinimumLength" ); static const wxChar DRCSliverAngleTolerance[] = wxT( "DRCSliverAngleTolerance" ); /** @@ -298,6 +299,7 @@ ADVANCED_CFG::ADVANCED_CFG() m_DRCEpsilon = 0.0005; // 0.5um is small enough not to materially violate // any constraints. m_SliverWidthTolerance = 0.08; + m_SliverMinimumLength = 0.0005; m_SliverAngleTolerance = 20.0; m_HoleWallThickness = 0.020; // IPC-6012 says 15-18um; Cadence says at least @@ -380,6 +382,9 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg ) configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::DRCSliverWidthTolerance, &m_SliverWidthTolerance, m_SliverWidthTolerance, 0.01, 0.25 ) ); + configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::DRCSliverMinimumLength, + &m_SliverMinimumLength, m_SliverMinimumLength, 1e-9, 10 ) ); + configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::DRCSliverAngleTolerance, &m_SliverAngleTolerance, m_SliverAngleTolerance, 1.0, 90.0 ) ); diff --git a/include/advanced_config.h b/include/advanced_config.h index 4c679e7c7b..141f6d6ff0 100644 --- a/include/advanced_config.h +++ b/include/advanced_config.h @@ -105,6 +105,7 @@ public: * Sliver tolerances for DRC. Units are mm and deg. */ double m_SliverWidthTolerance; + double m_SliverMinimumLength; double m_SliverAngleTolerance; /** diff --git a/pcbnew/drc/drc_test_provider_sliver_checker.cpp b/pcbnew/drc/drc_test_provider_sliver_checker.cpp index bd43b003fd..2ecdc85f32 100644 --- a/pcbnew/drc/drc_test_provider_sliver_checker.cpp +++ b/pcbnew/drc/drc_test_provider_sliver_checker.cpp @@ -197,7 +197,7 @@ bool DRC_TEST_PROVIDER_SLIVER_CHECKER::Run() // We skip very small vertices: one cannot really compute a valid orientation of // such a vertex // So skip points near than min_len (in internal units). - const int min_len = 3; + const int min_len = pcbIUScale.mmToIU( ADVANCED_CFG::GetCfg().m_SliverMinimumLength ); for( int jj = 0; jj < poly.OutlineCount(); ++jj ) {