Commit 9d48d104 authored by charras's avatar charras
Browse files

solved minor problems about thermal shapes in zones in no grid filling mode

parent 21a299cf
Loading
Loading
Loading
Loading
+22 −22
Original line number Original line Diff line number Diff line
@@ -23,7 +23,7 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng, D_PAD& aPad, int
void        AddThermalReliefPadPolygon( Bool_Engine* aBooleng,
void        AddThermalReliefPadPolygon( Bool_Engine* aBooleng,
                                        D_PAD&       aPad,
                                        D_PAD&       aPad,
                                        int          aThermalGap,
                                        int          aThermalGap,
                                        int          aCopperTickness );
                                        int          aCopperThickness );
void        AddRoundedEndsSegmentPolygon( Bool_Engine* aBooleng,
void        AddRoundedEndsSegmentPolygon( Bool_Engine* aBooleng,
                                          wxPoint aStart, wxPoint aEnd,
                                          wxPoint aStart, wxPoint aEnd,
                                          int aWidth );
                                          int aWidth );
@@ -226,7 +226,7 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng,


    case PAD_OVAL:
    case PAD_OVAL:
        angle = aPad.m_Orient;
        angle = aPad.m_Orient;
        if( dy > dx )                                                   // Oval pad X/Y ratio for chooring translation axles
        if( dy > dx )                                                   // Oval pad X/Y ratio for choosing translation axles
        {
        {
            int     angle_pg;                                           // Polygon angle
            int     angle_pg;                                           // Polygon angle
            wxPoint shape_offset = wxPoint( 0, (dy - dx) );
            wxPoint shape_offset = wxPoint( 0, (dy - dx) );
@@ -324,7 +324,7 @@ void AddPadWithClearancePolygon( Bool_Engine* aBooleng,
void    AddThermalReliefPadPolygon( Bool_Engine* aBooleng,
void    AddThermalReliefPadPolygon( Bool_Engine* aBooleng,
                                    D_PAD&       aPad,
                                    D_PAD&       aPad,
                                    int          aThermalGap,
                                    int          aThermalGap,
                                    int          aCopperTickness )
                                    int          aCopperThickness )
{
{
    wxPoint corner, corner_end;
    wxPoint corner, corner_end;
    wxPoint PadShapePos = aPad.ReturnShapePos();    /* Note: for pad having a shape offset,
    wxPoint PadShapePos = aPad.ReturnShapePos();    /* Note: for pad having a shape offset,
@@ -336,8 +336,8 @@ void AddThermalReliefPadPolygon( Bool_Engine* aBooleng,


    int     delta = 3600 / s_CircleToSegmentsCount; // rot angle in 0.1 degree
    int     delta = 3600 / s_CircleToSegmentsCount; // rot angle in 0.1 degree


    copper_tickness.x = min( dx, aCopperTickness );
    copper_tickness.x = min( dx, aCopperThickness );
    copper_tickness.y = min( dy, aCopperTickness );
    copper_tickness.y = min( dy, aCopperThickness );


    switch( aPad.m_PadShape )
    switch( aPad.m_PadShape )
    {
    {
@@ -360,13 +360,13 @@ void AddThermalReliefPadPolygon( Bool_Engine* aBooleng,


        // calculate the starting point of the outter arc
        // calculate the starting point of the outter arc
        dx      += aThermalGap;     // The radius of the outter arc is dx = pad radius + aThermalGap
        dx      += aThermalGap;     // The radius of the outter arc is dx = pad radius + aThermalGap
        corner.x = aThermalGap / 2;
        corner.x = copper_tickness.x / 2;
        double dtmp = ( (double) dx * dx ) - ( (double) corner.x * corner.x );
        double dtmp = ( (double) dx * dx ) - ( (double) corner.x * corner.x );
        corner.y = (int) sqrt( dtmp );
        corner.y = (int) sqrt( dtmp );


        // calculate the ending point of the outter arc
        // calculate the ending point of the outter arc
        corner_end.x = corner.y;
        corner_end.x = corner.y;
        corner_end.y = aThermalGap / 2;
        corner_end.y = copper_tickness.y / 2;


        // calculate intermediate points (y coordinate from corner.y to corner_end.y
        // calculate intermediate points (y coordinate from corner.y to corner_end.y
        while( (corner.y > corner_end.y)  && (corner.x < corner_end.x) )
        while( (corner.y > corner_end.y)  && (corner.x < corner_end.x) )
@@ -380,13 +380,13 @@ void AddThermalReliefPadPolygon( Bool_Engine* aBooleng,
        corners_buffer.push_back( corner_end.y );
        corners_buffer.push_back( corner_end.y );


        /* add the radius lines */
        /* add the radius lines */
        corner.x = corner.y = aThermalGap / 2;
        corners_buffer.push_back( copper_tickness.x / 2);
        corners_buffer.push_back( corner.x );
        corners_buffer.push_back( copper_tickness.y / 2);
        corners_buffer.push_back( corner.y );




        // Now, add the 4 holes ( each is the pattern, rotated by 0, 90, 180 and 270  deg
        // Now, add the 4 holes ( each is the pattern, rotated by 0, 90, 180 and 270  deg
        angle = 450;    // TODO: problems with kbool if angle = 0 (bad filled polygon on some pads, but not alls)
        angle = 450;    // TODO: problems with kbool if angle = 0 (bad filled polygon on some pads, but not alls)
        int	angle_pad = aPad.m_Orient;				// Pad orientation
        for( unsigned ihole = 0; ihole < 4; ihole++ )
        for( unsigned ihole = 0; ihole < 4; ihole++ )
        {
        {
            if( aBooleng->StartPolygonAdd( GROUP_B ) )
            if( aBooleng->StartPolygonAdd( GROUP_B ) )
@@ -394,7 +394,7 @@ void AddThermalReliefPadPolygon( Bool_Engine* aBooleng,
                for( unsigned ii = 0; ii < corners_buffer.size(); ii += 2 )
                for( unsigned ii = 0; ii < corners_buffer.size(); ii += 2 )
                {
                {
                    corner = wxPoint( corners_buffer[ii], corners_buffer[ii + 1] );
                    corner = wxPoint( corners_buffer[ii], corners_buffer[ii + 1] );
                    RotatePoint( &corner, angle );
                    RotatePoint( &corner, angle + angle_pad );		// Rotate by segment angle and pad orientation
                    corner += PadShapePos;
                    corner += PadShapePos;
                    aBooleng->AddPoint( corner.x, corner.y );
                    aBooleng->AddPoint( corner.x, corner.y );
                }
                }
@@ -429,10 +429,10 @@ void AddThermalReliefPadPolygon( Bool_Engine* aBooleng,
        //  |       |
        //  |       |
        //  |       |
        //  |       |
        // 1  ------- 4
        // 1  ------- 4
        wxPoint corners_hole[4];            // buffer for 6 corners
        wxPoint corners_hole[4];            // buffer for 4 corners
        // Create 1 hole, for a pad centered at 0,0, orient 0
        // Create 1 hole, for a pad centered at 0,0, orient 0
        // Calculate coordinates for corner 1 to corner 4:
        // Calculate coordinates for corner 1 to corner 4:
        corners_hole[0] = wxPoint( copper_tickness.x / 2, -copper_tickness.x / 2 );
        corners_hole[0] = wxPoint( copper_tickness.x / 2, -copper_tickness.y / 2 );
        corners_hole[1] = wxPoint( (copper_tickness.x / 2), -dy - aThermalGap );
        corners_hole[1] = wxPoint( (copper_tickness.x / 2), -dy - aThermalGap );
        corners_hole[2] = wxPoint(   dx + aThermalGap, -dy - aThermalGap );
        corners_hole[2] = wxPoint(   dx + aThermalGap, -dy - aThermalGap );
        corners_hole[3] = wxPoint( dx + aThermalGap, -(copper_tickness.y / 2) );
        corners_hole[3] = wxPoint( dx + aThermalGap, -(copper_tickness.y / 2) );