Browse Source

Fix a dumb copy/pasta and an overzealous delete.

master
Jeff Young 1 month ago
parent
commit
836ac0903f
  1. 11
      pcbnew/drc/drc_test_provider_copper_clearance.cpp
  2. 25
      pcbnew/drc/drc_test_provider_physical_clearance.cpp

11
pcbnew/drc/drc_test_provider_copper_clearance.cpp

@ -914,17 +914,6 @@ bool DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem( PAD* pad, SHAPE* pa
testHoles = false;
}
if( testHoles && pad->HasHole() )
{
clearance = constraint.GetValue().Min();
if( otherPad && !otherPad->FlashLayer( aLayer ) )
clearance = 0;
if( clearance > 0 )
doTestHole( other, otherShape.get(), pad, pad->GetEffectiveHoleShape().get(), clearance );
}
if( testHoles && otherPad && otherPad->HasHole() )
{
clearance = constraint.GetValue().Min();

25
pcbnew/drc/drc_test_provider_physical_clearance.cpp

@ -315,10 +315,33 @@ bool DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::Run()
break;
}
case SHAPE_T::ARC:
{
SHAPE_LINE_CHAIN asPoly;
VECTOR2I center = shape->GetCenter();
EDA_ANGLE angle = -shape->GetArcAngle();
double r = shape->GetRadius();
int steps = GetArcToSegmentCount( r, errorMax, angle );
asPoly.Append( shape->GetStart() );
for( int step = 1; step <= steps; ++step )
{
EDA_ANGLE rotation = ( angle * step ) / steps;
VECTOR2I pt = shape->GetStart();
RotatePoint( pt, center, rotation );
asPoly.Append( pt );
}
testShapeLineChain( asPoly, shape->GetWidth(), layer, item, c );
break;
}
// Simple shapes can't create self-intersections, and I'm not sure a user
// would want a report that one side of their rectangle was too close to
// the other side.
case SHAPE_T::ARC:
case SHAPE_T::RECTANGLE:
case SHAPE_T::SEGMENT:
case SHAPE_T::CIRCLE:

Loading…
Cancel
Save