Don't double-report segments that are too close.

This commit is contained in:
Jeff Young 2018-08-27 18:34:28 +01:00
parent b842e4556d
commit c88b43e356
4 changed files with 21 additions and 31 deletions

View File

@ -275,17 +275,12 @@ int DRC::TestZoneToZoneOutline( ZONE_CONTAINER* aZone, bool aCreateMarkers )
for( auto iterator = refSmoothedPoly.IterateWithHoles(); iterator; iterator++ )
{
VECTOR2I currentVertex = *iterator;
wxPoint pt( currentVertex.x, currentVertex.y );
if( testSmoothedPoly.Contains( currentVertex ) )
{
// COPPERAREA_COPPERAREA error: copper area ref corner inside copper area
if( aCreateMarkers )
{
wxPoint pt( currentVertex.x, currentVertex.y );
auto marker = new MARKER_PCB( units, COPPERAREA_INSIDE_COPPERAREA,
pt, zoneRef, pt, zoneToTest, pt );
commit.Add( marker );
}
commit.Add( newMarker( pt, zoneRef, zoneToTest, DRCE_ZONES_INTERSECT ) );
nerrors++;
}
@ -295,23 +290,20 @@ int DRC::TestZoneToZoneOutline( ZONE_CONTAINER* aZone, bool aCreateMarkers )
for( auto iterator = testSmoothedPoly.IterateWithHoles(); iterator; iterator++ )
{
VECTOR2I currentVertex = *iterator;
wxPoint pt( currentVertex.x, currentVertex.y );
if( refSmoothedPoly.Contains( currentVertex ) )
{
// COPPERAREA_COPPERAREA error: copper area corner inside copper area ref
if( aCreateMarkers )
{
wxPoint pt( currentVertex.x, currentVertex.y );
auto marker = new MARKER_PCB( units, COPPERAREA_INSIDE_COPPERAREA,
pt, zoneToTest, pt, zoneRef, pt );
commit.Add( marker );
}
commit.Add( newMarker( pt, zoneToTest, zoneRef, DRCE_ZONES_INTERSECT ) );
nerrors++;
}
}
// Iterate through all the segments of refSmoothedPoly
std::set<wxPoint> conflictPoints;
for( auto refIt = refSmoothedPoly.IterateSegmentsWithHoles(); refIt; refIt++ )
{
// Build ref segment
@ -344,19 +336,17 @@ int DRC::TestZoneToZoneOutline( ZONE_CONTAINER* aZone, bool aCreateMarkers )
&pt.x, &pt.y );
if( d < zone2zoneClearance )
{
// COPPERAREA_COPPERAREA error : intersect or too close
if( aCreateMarkers )
{
auto marker = new MARKER_PCB( units, COPPERAREA_CLOSE_TO_COPPERAREA,
pt, zoneRef, pt, zoneToTest, pt );
commit.Add( marker );
}
nerrors++;
}
conflictPoints.insert( pt );
}
}
for( wxPoint pt : conflictPoints )
{
if( aCreateMarkers )
commit.Add( newMarker( pt, zoneRef, zoneToTest, DRCE_ZONES_TOO_CLOSE ) );
nerrors++;
}
}
}

View File

@ -63,8 +63,8 @@
#define DRCE_PAD_NEAR_PAD1 19 ///< pad too close to pad
#define DRCE_VIA_HOLE_BIGGER 20 ///< via's hole is bigger than its diameter
#define DRCE_MICRO_VIA_INCORRECT_LAYER_PAIR 21 ///< micro via's layer pair incorrect (layers must be adjacent)
#define COPPERAREA_INSIDE_COPPERAREA 22 ///< copper area outlines intersect
#define COPPERAREA_CLOSE_TO_COPPERAREA 23 ///< copper area outlines are too close
#define DRCE_ZONES_INTERSECT 22 ///< copper area outlines intersect
#define DRCE_ZONES_TOO_CLOSE 23 ///< copper area outlines are too close
#define DRCE_SUSPICIOUS_NET_FOR_ZONE_OUTLINE 24 ///< copper area has a net but no pads in nets, which is suspicious
#define DRCE_HOLE_NEAR_PAD 25 ///< hole too close to pad
#define DRCE_HOLE_NEAR_TRACK 26 ///< hole too close to track

View File

@ -767,7 +767,7 @@ bool DRC::doEdgeZoneDrc( ZONE_CONTAINER* aArea, int aCornerIndex )
if( area_to_test->Outline()->Contains( end ) )
{
wxPoint pos( end.x, end.y );
m_currentMarker = newMarker( pos, aArea, area_to_test, COPPERAREA_INSIDE_COPPERAREA );
m_currentMarker = newMarker( pos, aArea, area_to_test, DRCE_ZONES_INTERSECT );
return false;
}
@ -800,7 +800,7 @@ bool DRC::doEdgeZoneDrc( ZONE_CONTAINER* aArea, int aCornerIndex )
{
// COPPERAREA_COPPERAREA error : edge intersect or too close
m_currentMarker = newMarker( wxPoint( x, y ), aArea, area_to_test,
COPPERAREA_CLOSE_TO_COPPERAREA );
DRCE_ZONES_TOO_CLOSE );
return false;
}

View File

@ -77,9 +77,9 @@ wxString DRC_ITEM::GetErrorText() const
return wxString( _( "Buried Via: not allowed" ) );
case DRCE_DISABLED_LAYER_ITEM:
return wxString( _( "Item on a disabled layer" ) );
case COPPERAREA_INSIDE_COPPERAREA:
case DRCE_ZONES_INTERSECT:
return wxString( _( "Copper area inside copper area" ) );
case COPPERAREA_CLOSE_TO_COPPERAREA:
case DRCE_ZONES_TOO_CLOSE:
return wxString( _( "Copper areas intersect or are too close" ) );
case DRCE_SUSPICIOUS_NET_FOR_ZONE_OUTLINE: