Commit 771ac33c authored by jean-pierre charras's avatar jean-pierre charras

Pcbnew: fix a minor bug: in zones with no net, only the zone clerance was used...

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.
parent 707f5cd6
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
// 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
*/ */
......
...@@ -54,7 +54,7 @@ static void addTextSegmToPoly( int x0, int y0, int xf, int yf ) ...@@ -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:
......
...@@ -199,9 +199,11 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb ) ...@@ -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 ) ...@@ -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 ) ...@@ -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 ) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment