Commit 9c43d6f2 authored by jean-pierre charras's avatar jean-pierre charras
Browse files

Very minor fixes: 3D viewer: remove artifacts with NPTH pads having the save...

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
parent 0e03fbff
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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,
+0 −3
Original line number Diff line number Diff line
@@ -349,9 +349,6 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
    preferencesMenu->AppendSeparator();
    Pgm().AddMenuLanguageList( preferencesMenu );

    // Hotkey submenu
    AddHotkeyConfigMenu( preferencesMenu );

    // Menu Tools:
    wxMenu* toolsMenu = new wxMenu;

+25 −1
Original line number Diff line number Diff line
@@ -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 )
        {
+3 −1
Original line number Diff line number Diff line
@@ -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();

+12 −5
Original line number Diff line number Diff line
@@ -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 ).
Loading