From 2393165ada70a33c6766559592e72595c75a4fbb Mon Sep 17 00:00:00 2001 From: Roberto Fernandez Bautista Date: Sun, 4 Sep 2022 00:21:56 +0200 Subject: [PATCH] CADSTAR PCB: Fix regression when loading pads in footprints Zero sized pads can be valid - e.g. a through hole pad (cherry picked from commit fa5dc2379701900b29e926bc5da3da010cc5801e) --- .../cadstar/cadstar_pcb_archive_loader.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp b/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp index be405578cc..6d4bedfdbe 100644 --- a/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp +++ b/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp @@ -832,12 +832,6 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadLibraryCoppers( const SYMDEF_PCB& aComponen shapePolys.Move( aFootprint->GetPosition() - anchorPos ); pad->AddPrimitivePoly( shapePolys, 0, true ); - aFootprint->Add( pad.release(), ADD_MODE::APPEND ); // Append so that we get the correct behaviour - // when finding pads by PAD_ID. See loadNets() - - m_librarycopperpads[aComponent.ID][anchorPad.ID].push_back( aFootprint->Pads().size() ); - totalCopperPads++; - // Now renumber all the associated pads COMPONENT_PAD associatedPad; @@ -846,6 +840,12 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadLibraryCoppers( const SYMDEF_PCB& aComponen PAD* assocPad = getPadReference( aFootprint, padID ); assocPad->SetNumber( pad->GetNumber() ); } + + aFootprint->Add( pad.release(), ADD_MODE::APPEND ); // Append so that we get the correct behaviour + // when finding pads by PAD_ID. See loadNets() + + m_librarycopperpads[aComponent.ID][anchorPad.ID].push_back( aFootprint->Pads().size() ); + totalCopperPads++; } else { @@ -921,9 +921,6 @@ PAD* CADSTAR_PCB_ARCHIVE_LOADER::getKiCadPad( const COMPONENT_PAD& aCadstarPad, PADCODE csPadcode = getPadCode( aCadstarPad.PadCodeID ); wxString errorMSG; - if( csPadcode.Shape.Size <= 0) - return nullptr; - std::unique_ptr pad = std::make_unique( aParent ); LSET padLayerSet;