Pcbnew: fix a minor bug: in zones with no net, only the zone clerance was used to created clearence, regardless the pad or footprint local clerance.

Very minor other fixes.
This commit is contained in:
jean-pierre charras 2014-05-29 13:48:14 +02:00
parent 707f5cd6e6
commit 771ac33c80
5 changed files with 35 additions and 31 deletions

View File

@ -19,8 +19,8 @@
// Default marquer shape: // Default marquer shape:
const int M_SHAPE_SCALE = 6; // default scaling factor for MarkerShapeCorners coordinates const int M_SHAPE_SCALE = 6; // default scaling factor for MarkerShapeCorners coordinates
const int CORNERS_COUNT = 8; const unsigned CORNERS_COUNT = 8;
/* corners of the default shape /* corners of the default shape
* actual coordinates are these values * .m_ScalingFactor * actual coordinates are these values * .m_ScalingFactor
*/ */

View File

@ -54,7 +54,7 @@ static void addTextSegmToPoly( int x0, int y0, int xf, int yf )
void BOARD::ConvertBrdLayerToPolygonalContours( LAYER_NUM aLayer, CPOLYGONS_LIST& aOutlines ) void BOARD::ConvertBrdLayerToPolygonalContours( LAYER_NUM aLayer, CPOLYGONS_LIST& aOutlines )
{ {
// Number of segments to convert a circle to a polygon // Number of segments to convert a circle to a polygon
const int segcountforcircle = 16; const int segcountforcircle = 18;
double correctionFactor = 1.0 / cos( M_PI / (segcountforcircle * 2) ); double correctionFactor = 1.0 / cos( M_PI / (segcountforcircle * 2) );
// convert tracks and vias: // convert tracks and vias:

View File

@ -131,13 +131,13 @@ PNS_ITEM* PNS_ROUTER::syncPad( D_PAD* aPad )
int i; int i;
for( i = FIRST_COPPER_LAYER; i <= LAST_COPPER_LAYER; i++ ) for( i = FIRST_COPPER_LAYER; i <= LAST_COPPER_LAYER; i++ )
{ {
if( lmsk & ( 1 << i ) ) if( lmsk & ( 1 << i ) )
{ {
layers = PNS_LAYERSET( i ); layers = PNS_LAYERSET( i );
break; break;
} }
} }
break; break;
} }
@ -796,7 +796,7 @@ bool PNS_ROUTER::FixRoute( const VECTOR2I& aP, PNS_ITEM* aEndItem )
break; break;
default: default:
break; break;
} }
if( rv ) if( rv )

View File

@ -199,9 +199,11 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb )
*/ */
MODULE dummymodule( aPcb ); // Creates a dummy parent MODULE dummymodule( aPcb ); // Creates a dummy parent
D_PAD dummypad( &dummymodule ); D_PAD dummypad( &dummymodule );
D_PAD* nextpad;
for( MODULE* module = aPcb->m_Modules; module; module = module->Next() ) for( MODULE* module = aPcb->m_Modules; module; module = module->Next() )
{ {
D_PAD* nextpad;
for( D_PAD* pad = module->Pads(); pad != NULL; pad = nextpad ) for( D_PAD* pad = module->Pads(); pad != NULL; pad = nextpad )
{ {
nextpad = pad->Next(); // pad pointer can be modified by next code, so nextpad = pad->Next(); // pad pointer can be modified by next code, so
@ -228,7 +230,8 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb )
pad = &dummypad; pad = &dummypad;
} }
if( pad->GetNetCode() != GetNetCode() ) // Note: netcode <=0 means not connected item
if( ( pad->GetNetCode() != GetNetCode() ) || ( pad->GetNetCode() <= 0 ) )
{ {
item_clearance = pad->GetClearance() + margin; item_clearance = pad->GetClearance() + margin;
item_boundingbox = pad->GetBoundingBox(); item_boundingbox = pad->GetBoundingBox();
@ -246,14 +249,15 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb )
continue; continue;
} }
int gap = zone_clearance;
if( ( GetPadConnection( pad ) == PAD_NOT_IN_ZONE ) if( ( GetPadConnection( pad ) == PAD_NOT_IN_ZONE )
|| ( GetNetCode() == 0 ) || ( pad->GetShape() == PAD_TRAPEZOID ) ) || ( pad->GetShape() == PAD_TRAPEZOID ) )
// PAD_TRAPEZOID shapes are not in zones because they are used in microwave apps // PAD_TRAPEZOID shapes are not in zones because they are used in microwave apps
// and i think it is good that shapes are not changed by thermal pads or others // and i think it is good that shapes are not changed by thermal pads or others
{ {
int gap = zone_clearance;
int thermalGap = GetThermalReliefGap( pad );
gap = std::max( gap, thermalGap );
item_boundingbox = pad->GetBoundingBox(); item_boundingbox = pad->GetBoundingBox();
if( item_boundingbox.Intersects( zone_boundingbox ) ) if( item_boundingbox.Intersects( zone_boundingbox ) )