Loading pcbnew/zones_convert_brd_items_to_polygons.cpp +34 −26 Original line number Diff line number Diff line Loading @@ -202,7 +202,10 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb ) continue; } if( (m_PadOption == PAD_NOT_IN_ZONE) || (GetNet() == 0) || pad->m_PadShape == PAD_TRAPEZOID ) if( (m_PadOption == PAD_NOT_IN_ZONE) || (GetNet() == 0) || pad->m_PadShape == PAD_TRAPEZOID ) // PAD_TRAPEZOID shapes are *never* in zones becuase they are used in microwave apps // and the shae *must not* be changed by thermal pads or others { item_boundingbox = pad->GetBoundingBox(); if( item_boundingbox.Intersects( zone_boundingbox ) ) Loading @@ -210,7 +213,6 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb ) AddPadWithClearancePolygon( booleng, *pad, clearance ); have_poly_to_substract = true; } } } } Loading Loading @@ -353,7 +355,6 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb ) // Remove insulated islands: if( GetNet() > 0 ) Test_For_Copper_Island_And_Remove_Insulated_Islands( aPcb ); } // Now we remove all unused thermal stubs. Loading Loading @@ -432,7 +433,8 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb ) // polygons are rectangles with width of copper bridge value // contour line width has to be taken into calculation to avoid "thermal stub bleed" const int iDTRC = ( m_ThermalReliefCopperBridgeValue - m_ZoneMinThickness ) / 2; const int iDTRC = ( m_ThermalReliefCopperBridgeValue - m_ZoneMinThickness ) / 2; switch( i ) { Loading Loading @@ -492,12 +494,14 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb ) /* put these areas in m_FilledPolysList */ m_FilledPolysList.clear(); CopyPolygonsFromBoolengineToFilledPolysList( booleng ); // Remove insulated islands, if any: if( GetNet() > 0 ) Test_For_Copper_Island_And_Remove_Insulated_Islands( aPcb ); } delete booleng; //#endif } Loading @@ -519,6 +523,9 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng, int delta = 3600 / s_CircleToSegmentsCount; // rot angle in 0.1 degree wxPoint PadShapePos = aPad.ReturnShapePos(); /* Note: for pad having a shape offset, * the pad position is NOT the shape position */ wxSize psize = aPad.m_Size; /* pad size unsed in RECT and TRAPEZOIDAL pads * trapezoidal pads are considered as rect pad shape having they boudary box size */ switch( aPad.m_PadShape ) { Loading Loading @@ -601,11 +608,11 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng, break; } default: case PAD_TRAPEZOID: default: /* @todo: the others shapes must be calculated: see trapezoidal shape * but before this is made, the rect shape is used insteed. * A polygon *must* be created because we have started a polygon in kbool engine */ psize.x += ABS(aPad.m_DeltaSize.y); psize.y += ABS(aPad.m_DeltaSize.x); // fall through case PAD_RECT: // Easy implementation for rectangular cutouts with rounded corners // Easy implementation for rectangular cutouts with rounded corners angle = aPad.m_Orient; int rounding_radius = (int) ( aClearanceValue * s_Correction ); // Corner rounding radius Loading @@ -617,7 +624,7 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng, RotatePoint( &corner_position, (1800 / s_CircleToSegmentsCount) ); // Start at half increment offset angle_pg = i * delta; RotatePoint( &corner_position, angle_pg ); // Rounding vector rotation corner_position -= aPad.m_Size / 2; // Rounding vector + Pad corner offset corner_position -= psize / 2; // Rounding vector + Pad corner offset RotatePoint( &corner_position, angle ); // Rotate according to module orientation corner_position += PadShapePos; // Shift origin to position aBooleng->AddPoint( corner_position.x, corner_position.y ); Loading @@ -629,7 +636,7 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng, RotatePoint( &corner_position, (1800 / s_CircleToSegmentsCount) ); angle_pg = i * delta; RotatePoint( &corner_position, angle_pg ); corner_position -= wxPoint( aPad.m_Size.x / 2, -aPad.m_Size.y / 2 ); corner_position -= wxPoint( psize.x / 2, -psize.y / 2 ); RotatePoint( &corner_position, angle ); corner_position += PadShapePos; aBooleng->AddPoint( corner_position.x, corner_position.y ); Loading @@ -641,7 +648,7 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng, RotatePoint( &corner_position, (1800 / s_CircleToSegmentsCount) ); angle_pg = i * delta; RotatePoint( &corner_position, angle_pg ); corner_position += aPad.m_Size / 2; corner_position += psize / 2; RotatePoint( &corner_position, angle ); corner_position += PadShapePos; aBooleng->AddPoint( corner_position.x, corner_position.y ); Loading @@ -653,7 +660,7 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng, RotatePoint( &corner_position, (1800 / s_CircleToSegmentsCount) ); angle_pg = i * delta; RotatePoint( &corner_position, angle_pg ); corner_position -= wxPoint( -aPad.m_Size.x / 2, aPad.m_Size.y / 2 ); corner_position -= wxPoint( -psize.x / 2, psize.y / 2 ); RotatePoint( &corner_position, angle ); corner_position += PadShapePos; aBooleng->AddPoint( corner_position.x, corner_position.y ); Loading Loading @@ -703,7 +710,8 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng, * * Note 2: * Trapezoidal pads are not considered here because they are very special case * and are used in microwave applications and they do not have a therma relief that change the shape * and are used in microwave applications and they *DO NOT* have a thermal relief that change the shape * by creating stubs and destroy their properties. */ void AddThermalReliefPadPolygon( Bool_Engine* aBooleng, D_PAD& aPad, Loading Loading
pcbnew/zones_convert_brd_items_to_polygons.cpp +34 −26 Original line number Diff line number Diff line Loading @@ -202,7 +202,10 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb ) continue; } if( (m_PadOption == PAD_NOT_IN_ZONE) || (GetNet() == 0) || pad->m_PadShape == PAD_TRAPEZOID ) if( (m_PadOption == PAD_NOT_IN_ZONE) || (GetNet() == 0) || pad->m_PadShape == PAD_TRAPEZOID ) // PAD_TRAPEZOID shapes are *never* in zones becuase they are used in microwave apps // and the shae *must not* be changed by thermal pads or others { item_boundingbox = pad->GetBoundingBox(); if( item_boundingbox.Intersects( zone_boundingbox ) ) Loading @@ -210,7 +213,6 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb ) AddPadWithClearancePolygon( booleng, *pad, clearance ); have_poly_to_substract = true; } } } } Loading Loading @@ -353,7 +355,6 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb ) // Remove insulated islands: if( GetNet() > 0 ) Test_For_Copper_Island_And_Remove_Insulated_Islands( aPcb ); } // Now we remove all unused thermal stubs. Loading Loading @@ -432,7 +433,8 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb ) // polygons are rectangles with width of copper bridge value // contour line width has to be taken into calculation to avoid "thermal stub bleed" const int iDTRC = ( m_ThermalReliefCopperBridgeValue - m_ZoneMinThickness ) / 2; const int iDTRC = ( m_ThermalReliefCopperBridgeValue - m_ZoneMinThickness ) / 2; switch( i ) { Loading Loading @@ -492,12 +494,14 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb ) /* put these areas in m_FilledPolysList */ m_FilledPolysList.clear(); CopyPolygonsFromBoolengineToFilledPolysList( booleng ); // Remove insulated islands, if any: if( GetNet() > 0 ) Test_For_Copper_Island_And_Remove_Insulated_Islands( aPcb ); } delete booleng; //#endif } Loading @@ -519,6 +523,9 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng, int delta = 3600 / s_CircleToSegmentsCount; // rot angle in 0.1 degree wxPoint PadShapePos = aPad.ReturnShapePos(); /* Note: for pad having a shape offset, * the pad position is NOT the shape position */ wxSize psize = aPad.m_Size; /* pad size unsed in RECT and TRAPEZOIDAL pads * trapezoidal pads are considered as rect pad shape having they boudary box size */ switch( aPad.m_PadShape ) { Loading Loading @@ -601,11 +608,11 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng, break; } default: case PAD_TRAPEZOID: default: /* @todo: the others shapes must be calculated: see trapezoidal shape * but before this is made, the rect shape is used insteed. * A polygon *must* be created because we have started a polygon in kbool engine */ psize.x += ABS(aPad.m_DeltaSize.y); psize.y += ABS(aPad.m_DeltaSize.x); // fall through case PAD_RECT: // Easy implementation for rectangular cutouts with rounded corners // Easy implementation for rectangular cutouts with rounded corners angle = aPad.m_Orient; int rounding_radius = (int) ( aClearanceValue * s_Correction ); // Corner rounding radius Loading @@ -617,7 +624,7 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng, RotatePoint( &corner_position, (1800 / s_CircleToSegmentsCount) ); // Start at half increment offset angle_pg = i * delta; RotatePoint( &corner_position, angle_pg ); // Rounding vector rotation corner_position -= aPad.m_Size / 2; // Rounding vector + Pad corner offset corner_position -= psize / 2; // Rounding vector + Pad corner offset RotatePoint( &corner_position, angle ); // Rotate according to module orientation corner_position += PadShapePos; // Shift origin to position aBooleng->AddPoint( corner_position.x, corner_position.y ); Loading @@ -629,7 +636,7 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng, RotatePoint( &corner_position, (1800 / s_CircleToSegmentsCount) ); angle_pg = i * delta; RotatePoint( &corner_position, angle_pg ); corner_position -= wxPoint( aPad.m_Size.x / 2, -aPad.m_Size.y / 2 ); corner_position -= wxPoint( psize.x / 2, -psize.y / 2 ); RotatePoint( &corner_position, angle ); corner_position += PadShapePos; aBooleng->AddPoint( corner_position.x, corner_position.y ); Loading @@ -641,7 +648,7 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng, RotatePoint( &corner_position, (1800 / s_CircleToSegmentsCount) ); angle_pg = i * delta; RotatePoint( &corner_position, angle_pg ); corner_position += aPad.m_Size / 2; corner_position += psize / 2; RotatePoint( &corner_position, angle ); corner_position += PadShapePos; aBooleng->AddPoint( corner_position.x, corner_position.y ); Loading @@ -653,7 +660,7 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng, RotatePoint( &corner_position, (1800 / s_CircleToSegmentsCount) ); angle_pg = i * delta; RotatePoint( &corner_position, angle_pg ); corner_position -= wxPoint( -aPad.m_Size.x / 2, aPad.m_Size.y / 2 ); corner_position -= wxPoint( -psize.x / 2, psize.y / 2 ); RotatePoint( &corner_position, angle ); corner_position += PadShapePos; aBooleng->AddPoint( corner_position.x, corner_position.y ); Loading Loading @@ -703,7 +710,8 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng, * * Note 2: * Trapezoidal pads are not considered here because they are very special case * and are used in microwave applications and they do not have a therma relief that change the shape * and are used in microwave applications and they *DO NOT* have a thermal relief that change the shape * by creating stubs and destroy their properties. */ void AddThermalReliefPadPolygon( Bool_Engine* aBooleng, D_PAD& aPad, Loading