Browse Source

Add an advanced config value for the minimum sliver

The hard coded value was too small for certain calculations.  Better to
have a configurable value that is initially set to our error level to
allow for deviations that don't meet the visibility test for spikes.
These have become more apparent with Clipper2
7.0
Seth Hillbrand 3 years ago
parent
commit
92266635cc
  1. 5
      common/advanced_config.cpp
  2. 1
      include/advanced_config.h
  3. 2
      pcbnew/drc/drc_test_provider_sliver_checker.cpp

5
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 ) );

1
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;
/**

2
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 )
{

Loading…
Cancel
Save