Very minor fixes: 3D viewer: remove artifacts with NPTH pads having the save size as their hole. Kicad: remove duplicate submenu in menubar. remove a minor coverity warning
This commit is contained in:
parent
0e03fbff07
commit
9c43d6f22b
|
@ -692,11 +692,13 @@ void EDA_3D_CANVAS::BuildBoard3DView( GLuint aBoardList, GLuint aBodyOnlyList,
|
|||
// draw pads
|
||||
for( MODULE* module = pcb->m_Modules; module; module = module->Next() )
|
||||
{
|
||||
// Note: NPTH pads are not drawn on copper layers when the pad
|
||||
// has same shape as its hole
|
||||
module->TransformPadsShapesWithClearanceToPolygon( layer,
|
||||
bufferPolys,
|
||||
0,
|
||||
segcountforcircle,
|
||||
correctionFactor );
|
||||
correctionFactor, true );
|
||||
|
||||
// Micro-wave modules may have items on copper layers
|
||||
module->TransformGraphicShapesWithClearanceToPolygonSet( layer,
|
||||
|
|
|
@ -349,9 +349,6 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
|
|||
preferencesMenu->AppendSeparator();
|
||||
Pgm().AddMenuLanguageList( preferencesMenu );
|
||||
|
||||
// Hotkey submenu
|
||||
AddHotkeyConfigMenu( preferencesMenu );
|
||||
|
||||
// Menu Tools:
|
||||
wxMenu* toolsMenu = new wxMenu;
|
||||
|
||||
|
|
|
@ -131,7 +131,8 @@ void MODULE::TransformPadsShapesWithClearanceToPolygon( LAYER_ID aLayer,
|
|||
CPOLYGONS_LIST& aCornerBuffer,
|
||||
int aInflateValue,
|
||||
int aCircleToSegmentsCount,
|
||||
double aCorrectionFactor )
|
||||
double aCorrectionFactor,
|
||||
bool aSkipNPTHPadsWihNoCopper )
|
||||
{
|
||||
D_PAD* pad = Pads();
|
||||
|
||||
|
@ -141,6 +142,29 @@ void MODULE::TransformPadsShapesWithClearanceToPolygon( LAYER_ID aLayer,
|
|||
if( !pad->IsOnLayer(aLayer) )
|
||||
continue;
|
||||
|
||||
// NPTH pads are not drawn on layers if the shape size and pos is the same
|
||||
// as their hole:
|
||||
if( aSkipNPTHPadsWihNoCopper && pad->GetAttribute() == PAD_HOLE_NOT_PLATED )
|
||||
{
|
||||
if( pad->GetDrillSize() == pad->GetSize() && pad->GetOffset() == wxPoint( 0, 0 ) )
|
||||
{
|
||||
switch( pad->GetShape() )
|
||||
{
|
||||
case PAD_CIRCLE:
|
||||
if( pad->GetDrillShape() == PAD_DRILL_CIRCLE )
|
||||
continue;
|
||||
break;
|
||||
|
||||
case PAD_OVAL:
|
||||
if( pad->GetDrillShape() != PAD_DRILL_CIRCLE )
|
||||
continue;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch( aLayer )
|
||||
{
|
||||
|
|
|
@ -58,7 +58,7 @@ MODULE::MODULE( BOARD* parent ) :
|
|||
m_Layer = F_Cu;
|
||||
m_Orient = 0;
|
||||
m_ModuleStatus = MODULE_PADS_LOCKED;
|
||||
flag = 0;
|
||||
m_arflag = 0;
|
||||
m_CntRot90 = m_CntRot180 = 0;
|
||||
m_Surface = 0.0;
|
||||
m_Link = 0;
|
||||
|
@ -157,6 +157,8 @@ MODULE::MODULE( const MODULE& aModule ) :
|
|||
m_Doc = aModule.m_Doc;
|
||||
m_KeyWord = aModule.m_KeyWord;
|
||||
|
||||
m_arflag = 0;
|
||||
|
||||
// Ensure auxiliary data is up to date
|
||||
CalculateBoundingBox();
|
||||
|
||||
|
|
|
@ -199,9 +199,9 @@ public:
|
|||
int GetAttributes() const { return m_Attributs; }
|
||||
void SetAttributes( int aAttributes ) { m_Attributs = aAttributes; }
|
||||
|
||||
void SetFlag( int aFlag ) { flag = aFlag; }
|
||||
void IncrementFlag() { flag += 1; }
|
||||
int GetFlag() const { return flag; }
|
||||
void SetFlag( int aFlag ) { m_arflag = aFlag; }
|
||||
void IncrementFlag() { m_arflag += 1; }
|
||||
int GetFlag() const { return m_arflag; }
|
||||
|
||||
void Move( const wxPoint& aMoveVector );
|
||||
|
||||
|
@ -328,12 +328,19 @@ public:
|
|||
* if aCorrectionFactor = 1.0, the polygon is inside the circle
|
||||
* the radius of circle approximated by segments is
|
||||
* initial radius * aCorrectionFactor
|
||||
* @param aSkipNPTHPadsWihNoCopper = if true, do not add a NPTH pad shape,
|
||||
* if the shape has same size and position as the hole. Usually, these
|
||||
* pads are not drawn on copper layers, because there is actually no copper
|
||||
* Due to diff between layers and holes, these pads must be skipped to be sure
|
||||
* there is no copper left on the board (for instance when creating Gerber Files or 3D shapes)
|
||||
* default = false
|
||||
*/
|
||||
void TransformPadsShapesWithClearanceToPolygon( LAYER_ID aLayer,
|
||||
CPOLYGONS_LIST& aCornerBuffer,
|
||||
int aInflateValue,
|
||||
int aCircleToSegmentsCount,
|
||||
double aCorrectionFactor );
|
||||
double aCorrectionFactor,
|
||||
bool aSkipNPTHPadsWihNoCopper = false );
|
||||
|
||||
/**
|
||||
* function TransformGraphicShapesWithClearanceToPolygonSet
|
||||
|
@ -645,7 +652,7 @@ private:
|
|||
wxString m_Path;
|
||||
ZoneConnection m_ZoneConnection;
|
||||
time_t m_LastEditTime;
|
||||
int flag; ///< Use to trace ratsnest and auto routing.
|
||||
int m_arflag; ///< Use to trace ratsnest and auto routing.
|
||||
double m_Surface; ///< Bounding box area
|
||||
time_t m_Link; ///< Temporary logical link used in edition
|
||||
int m_CntRot90; ///< Horizontal automatic placement cost ( 0..10 ).
|
||||
|
|
|
@ -93,7 +93,7 @@ static EDA_HOTKEY HkSwitch2NextCopperLayer( _HKI( "Switch to Next Layer" ),
|
|||
static EDA_HOTKEY HkSwitch2PreviousCopperLayer( _HKI( "Switch to Previous Layer" ),
|
||||
HK_SWITCH_LAYER_TO_PREVIOUS, '-' );
|
||||
|
||||
static EDA_HOTKEY HkSaveModule( _HKI( "Save Module" ), HK_SAVE_MODULE, 'S' + GR_KB_CTRL );
|
||||
static EDA_HOTKEY HkSaveModule( _HKI( "Save Footprint" ), HK_SAVE_MODULE, 'S' + GR_KB_CTRL );
|
||||
static EDA_HOTKEY HkSavefile( _HKI( "Save Board" ), HK_SAVE_BOARD, 'S' + GR_KB_CTRL );
|
||||
static EDA_HOTKEY HkSavefileAs( _HKI( "Save Board As" ), HK_SAVE_BOARD_AS, 'S' + GR_KB_CTRL + GR_KB_SHIFT );
|
||||
static EDA_HOTKEY HkLoadfile( _HKI( "Load Board" ), HK_LOAD_BOARD, 'L' + GR_KB_CTRL );
|
||||
|
|
|
@ -2125,6 +2125,8 @@ void LEGACY_PLUGIN::loadNETINFO_ITEM()
|
|||
}
|
||||
}
|
||||
|
||||
// If we are here, there is an error.
|
||||
delete net;
|
||||
THROW_IO_ERROR( "Missing '$EndEQUIPOT'" );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue