7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-21 22:13:44 +00:00

Eagle: Make pad drill optional to support some DipTrace-exported boards.

This commit is contained in:
Alex Shvartzkop 2024-12-29 02:43:36 +03:00
parent b078d828df
commit ceefbea34a
3 changed files with 6 additions and 6 deletions
common/io/eagle
pcbnew/pcb_io/eagle

View File

@ -1063,11 +1063,11 @@ EPAD::EPAD( wxXmlNode* aPad, IO_BASE* aIo ) :
>
*/
// #REQUIRED says DTD, throw exception if not found
drill = parseRequiredAttribute<ECOORD>( aPad, "drill" );
// #REQUIRED says DTD, but DipTrace doesn't write it sometimes
drill = parseOptionalAttribute<ECOORD>( aPad, "drill" );
// Optional attributes
diameter = parseOptionalAttribute<ECOORD>( aPad, "diameter" );
diameter = parseOptionalAttribute<ECOORD>( aPad, "diameter" );
opt_wxString s = parseOptionalAttribute<wxString>( aPad, "shape" );

View File

@ -1011,7 +1011,7 @@ struct EPAD : public EPAD_COMMON
* first %Bool; "no"
* >
*/
ECOORD drill;
opt_ecoord drill;
opt_ecoord diameter;
// for shape: (square | round | octagon | long | offset)

View File

@ -1958,7 +1958,7 @@ void PCB_IO_EAGLE::packagePad( FOOTPRINT* aFootprint, wxXmlNode* aTree )
// this is thru hole technology here, no SMDs
EPAD e( aTree );
int shape = EPAD::UNDEF;
int eagleDrillz = e.drill.ToPcbUnits();
int eagleDrillz = e.drill ? e.drill->ToPcbUnits() : 0;
std::unique_ptr<PAD> pad = std::make_unique<PAD>( aFootprint );
transferPad( e, pad.get() );
@ -2049,7 +2049,7 @@ void PCB_IO_EAGLE::packagePad( FOOTPRINT* aFootprint, wxXmlNode* aTree )
// Eagle spokes are always '+'
pad->SetThermalSpokeAngle( ANGLE_0 );
if( pad->GetSizeX() > 0 && pad->GetSizeY() > 0 )
if( pad->GetSizeX() > 0 && pad->GetSizeY() > 0 && pad->HasHole() )
{
aFootprint->Add( pad.release() );
}