Plot pad outlines on Fab files: fix many issues. Depending on

plotter type and pad type, the plotted shapes were not always the outlines,
but a outline inside the pad shape (due to legacy reasons). In many cases the
plotted shape was in fact incorrect. Now the actual pads outlines are plotted
without modification.
From Master branch
This commit is contained in:
jean-pierre charras
2022-05-13 14:25:02 +02:00
parent ebb3e04718
commit f25d74628b
4 changed files with 12 additions and 53 deletions
+2 -39
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2020-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2020-2022 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -127,13 +127,7 @@ void PSLIKE_PLOTTER::FlashPadCircle( const wxPoint& aPadPos, int aDiameter,
else // Plot a ring:
{
SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH );
int linewidth = GetCurrentLineWidth();
// avoid aDiameter <= 1 )
if( linewidth > aDiameter-2 )
linewidth = aDiameter-2;
Circle( aPadPos, aDiameter - linewidth, FILL_T::NO_FILL, linewidth );
Circle( aPadPos, aDiameter, FILL_T::NO_FILL, GetCurrentLineWidth() );
}
SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH );
@@ -152,15 +146,6 @@ void PSLIKE_PLOTTER::FlashPadRect( const wxPoint& aPadPos, const wxSize& aSize,
else
SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH );
size.x -= GetCurrentLineWidth();
size.y -= GetCurrentLineWidth();
if( size.x < 1 )
size.x = 1;
if( size.y < 1 )
size.y = 1;
int dx = size.x / 2;
int dy = size.y / 2;
@@ -203,9 +188,6 @@ void PSLIKE_PLOTTER::FlashPadRoundRect( const wxPoint& aPadPos, const wxSize& aS
else
{
SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH );
size.x -= GetCurrentLineWidth();
size.y -= GetCurrentLineWidth();
aCornerRadius -= GetCurrentLineWidth() / 2;
}
@@ -243,8 +225,6 @@ void PSLIKE_PLOTTER::FlashPadCustom( const wxPoint& aPadPos, const wxSize& aSize
else
{
SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH );
size.x -= GetCurrentLineWidth();
size.y -= GetCurrentLineWidth();
}
@@ -283,23 +263,6 @@ void PSLIKE_PLOTTER::FlashPadTrapez( const wxPoint& aPadPos, const wxPoint *aCor
else
{
SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH );
int w = GetCurrentLineWidth();
// offset polygon by w
// coord[0] is assumed the lower left
// coord[1] is assumed the upper left
// coord[2] is assumed the upper right
// coord[3] is assumed the lower right
/* Trace the outline. */
cornerList[0].x += w;
cornerList[0].y -= w;
cornerList[1].x += w;
cornerList[1].y += w;
cornerList[2].x -= w;
cornerList[2].y += w;
cornerList[3].x -= w;
cornerList[3].y -= w;
}
for( int ii = 0; ii < 4; ii++ )