Don't double-report segments that are too close.
This commit is contained in:
parent
b842e4556d
commit
c88b43e356
|
@ -275,17 +275,12 @@ int DRC::TestZoneToZoneOutline( ZONE_CONTAINER* aZone, bool aCreateMarkers )
|
||||||
for( auto iterator = refSmoothedPoly.IterateWithHoles(); iterator; iterator++ )
|
for( auto iterator = refSmoothedPoly.IterateWithHoles(); iterator; iterator++ )
|
||||||
{
|
{
|
||||||
VECTOR2I currentVertex = *iterator;
|
VECTOR2I currentVertex = *iterator;
|
||||||
|
wxPoint pt( currentVertex.x, currentVertex.y );
|
||||||
|
|
||||||
if( testSmoothedPoly.Contains( currentVertex ) )
|
if( testSmoothedPoly.Contains( currentVertex ) )
|
||||||
{
|
{
|
||||||
// COPPERAREA_COPPERAREA error: copper area ref corner inside copper area
|
|
||||||
if( aCreateMarkers )
|
if( aCreateMarkers )
|
||||||
{
|
commit.Add( newMarker( pt, zoneRef, zoneToTest, DRCE_ZONES_INTERSECT ) );
|
||||||
wxPoint pt( currentVertex.x, currentVertex.y );
|
|
||||||
auto marker = new MARKER_PCB( units, COPPERAREA_INSIDE_COPPERAREA,
|
|
||||||
pt, zoneRef, pt, zoneToTest, pt );
|
|
||||||
commit.Add( marker );
|
|
||||||
}
|
|
||||||
|
|
||||||
nerrors++;
|
nerrors++;
|
||||||
}
|
}
|
||||||
|
@ -295,23 +290,20 @@ int DRC::TestZoneToZoneOutline( ZONE_CONTAINER* aZone, bool aCreateMarkers )
|
||||||
for( auto iterator = testSmoothedPoly.IterateWithHoles(); iterator; iterator++ )
|
for( auto iterator = testSmoothedPoly.IterateWithHoles(); iterator; iterator++ )
|
||||||
{
|
{
|
||||||
VECTOR2I currentVertex = *iterator;
|
VECTOR2I currentVertex = *iterator;
|
||||||
|
wxPoint pt( currentVertex.x, currentVertex.y );
|
||||||
|
|
||||||
if( refSmoothedPoly.Contains( currentVertex ) )
|
if( refSmoothedPoly.Contains( currentVertex ) )
|
||||||
{
|
{
|
||||||
// COPPERAREA_COPPERAREA error: copper area corner inside copper area ref
|
|
||||||
if( aCreateMarkers )
|
if( aCreateMarkers )
|
||||||
{
|
commit.Add( newMarker( pt, zoneToTest, zoneRef, DRCE_ZONES_INTERSECT ) );
|
||||||
wxPoint pt( currentVertex.x, currentVertex.y );
|
|
||||||
auto marker = new MARKER_PCB( units, COPPERAREA_INSIDE_COPPERAREA,
|
|
||||||
pt, zoneToTest, pt, zoneRef, pt );
|
|
||||||
commit.Add( marker );
|
|
||||||
}
|
|
||||||
|
|
||||||
nerrors++;
|
nerrors++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Iterate through all the segments of refSmoothedPoly
|
// Iterate through all the segments of refSmoothedPoly
|
||||||
|
std::set<wxPoint> conflictPoints;
|
||||||
|
|
||||||
for( auto refIt = refSmoothedPoly.IterateSegmentsWithHoles(); refIt; refIt++ )
|
for( auto refIt = refSmoothedPoly.IterateSegmentsWithHoles(); refIt; refIt++ )
|
||||||
{
|
{
|
||||||
// Build ref segment
|
// Build ref segment
|
||||||
|
@ -344,19 +336,17 @@ int DRC::TestZoneToZoneOutline( ZONE_CONTAINER* aZone, bool aCreateMarkers )
|
||||||
&pt.x, &pt.y );
|
&pt.x, &pt.y );
|
||||||
|
|
||||||
if( d < zone2zoneClearance )
|
if( d < zone2zoneClearance )
|
||||||
{
|
conflictPoints.insert( pt );
|
||||||
// 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++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for( wxPoint pt : conflictPoints )
|
||||||
|
{
|
||||||
|
if( aCreateMarkers )
|
||||||
|
commit.Add( newMarker( pt, zoneRef, zoneToTest, DRCE_ZONES_TOO_CLOSE ) );
|
||||||
|
|
||||||
|
nerrors++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,8 +63,8 @@
|
||||||
#define DRCE_PAD_NEAR_PAD1 19 ///< pad too close to pad
|
#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_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 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 DRCE_ZONES_INTERSECT 22 ///< copper area outlines intersect
|
||||||
#define COPPERAREA_CLOSE_TO_COPPERAREA 23 ///< copper area outlines are too close
|
#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_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_PAD 25 ///< hole too close to pad
|
||||||
#define DRCE_HOLE_NEAR_TRACK 26 ///< hole too close to track
|
#define DRCE_HOLE_NEAR_TRACK 26 ///< hole too close to track
|
||||||
|
|
|
@ -767,7 +767,7 @@ bool DRC::doEdgeZoneDrc( ZONE_CONTAINER* aArea, int aCornerIndex )
|
||||||
if( area_to_test->Outline()->Contains( end ) )
|
if( area_to_test->Outline()->Contains( end ) )
|
||||||
{
|
{
|
||||||
wxPoint pos( end.x, end.y );
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -800,7 +800,7 @@ bool DRC::doEdgeZoneDrc( ZONE_CONTAINER* aArea, int aCornerIndex )
|
||||||
{
|
{
|
||||||
// COPPERAREA_COPPERAREA error : edge intersect or too close
|
// COPPERAREA_COPPERAREA error : edge intersect or too close
|
||||||
m_currentMarker = newMarker( wxPoint( x, y ), aArea, area_to_test,
|
m_currentMarker = newMarker( wxPoint( x, y ), aArea, area_to_test,
|
||||||
COPPERAREA_CLOSE_TO_COPPERAREA );
|
DRCE_ZONES_TOO_CLOSE );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -77,9 +77,9 @@ wxString DRC_ITEM::GetErrorText() const
|
||||||
return wxString( _( "Buried Via: not allowed" ) );
|
return wxString( _( "Buried Via: not allowed" ) );
|
||||||
case DRCE_DISABLED_LAYER_ITEM:
|
case DRCE_DISABLED_LAYER_ITEM:
|
||||||
return wxString( _( "Item on a disabled layer" ) );
|
return wxString( _( "Item on a disabled layer" ) );
|
||||||
case COPPERAREA_INSIDE_COPPERAREA:
|
case DRCE_ZONES_INTERSECT:
|
||||||
return wxString( _( "Copper area inside copper area" ) );
|
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" ) );
|
return wxString( _( "Copper areas intersect or are too close" ) );
|
||||||
|
|
||||||
case DRCE_SUSPICIOUS_NET_FOR_ZONE_OUTLINE:
|
case DRCE_SUSPICIOUS_NET_FOR_ZONE_OUTLINE:
|
||||||
|
|
Loading…
Reference in New Issue