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 b68b3cce17
commit 9e39b3bbec
3 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -815,11 +815,11 @@ EPAD::EPAD( wxXmlNode* aPad )
>
*/
// #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" );
+1 -1
View File
@@ -711,7 +711,7 @@ struct EPAD_COMMON
/// Eagle thru hole pad
struct EPAD : public EPAD_COMMON
{
ECOORD drill;
opt_ecoord drill;
opt_ecoord diameter;
// for shape: (square | round | octagon | long | offset)
+2 -2
View File
@@ -1938,7 +1938,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() );
@@ -2029,7 +2029,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() );
}