68#include <wx/filename.h>
69#include <wx/wfstream.h>
70#include <wx/txtstrm.h>
71#include <boost/ptr_container/ptr_map.hpp>
104#define FIRST_COPPER_LAYER 0
105#define LAYER_N_BACK 0
120#define LAYER_N_FRONT 15
121#define LAST_COPPER_LAYER LAYER_N_FRONT
123#define FIRST_NON_COPPER_LAYER 16
124#define ADHESIVE_N_BACK 16
125#define ADHESIVE_N_FRONT 17
126#define SOLDERPASTE_N_BACK 18
127#define SOLDERPASTE_N_FRONT 19
128#define SILKSCREEN_N_BACK 20
129#define SILKSCREEN_N_FRONT 21
130#define SOLDERMASK_N_BACK 22
131#define SOLDERMASK_N_FRONT 23
137#define LAST_NON_COPPER_LAYER 28
141#define LAYER_BACK (1 << LAYER_N_BACK)
142#define LAYER_2 (1 << LAYER_N_2)
143#define LAYER_3 (1 << LAYER_N_3)
144#define LAYER_4 (1 << LAYER_N_4)
145#define LAYER_5 (1 << LAYER_N_5)
146#define LAYER_6 (1 << LAYER_N_6)
147#define LAYER_7 (1 << LAYER_N_7)
148#define LAYER_8 (1 << LAYER_N_8)
149#define LAYER_9 (1 << LAYER_N_9)
150#define LAYER_10 (1 << LAYER_N_10)
151#define LAYER_11 (1 << LAYER_N_11)
152#define LAYER_12 (1 << LAYER_N_12)
153#define LAYER_13 (1 << LAYER_N_13)
154#define LAYER_14 (1 << LAYER_N_14)
155#define LAYER_15 (1 << LAYER_N_15)
156#define LAYER_FRONT (1 << LAYER_N_FRONT)
157#define ADHESIVE_LAYER_BACK (1 << ADHESIVE_N_BACK)
158#define ADHESIVE_LAYER_FRONT (1 << ADHESIVE_N_FRONT)
159#define SOLDERPASTE_LAYER_BACK (1 << SOLDERPASTE_N_BACK)
160#define SOLDERPASTE_LAYER_FRONT (1 << SOLDERPASTE_N_FRONT)
161#define SILKSCREEN_LAYER_BACK (1 << SILKSCREEN_N_BACK)
162#define SILKSCREEN_LAYER_FRONT (1 << SILKSCREEN_N_FRONT)
163#define SOLDERMASK_LAYER_BACK (1 << SOLDERMASK_N_BACK)
164#define SOLDERMASK_LAYER_FRONT (1 << SOLDERMASK_N_FRONT)
165#define DRAW_LAYER (1 << DRAW_N)
166#define COMMENT_LAYER (1 << COMMENT_N)
167#define ECO1_LAYER (1 << ECO1_N)
168#define ECO2_LAYER (1 << ECO2_N)
169#define EDGE_LAYER (1 << EDGE_N)
174#define ALL_NO_CU_LAYERS 0x1FFF0000
175#define ALL_CU_LAYERS 0x0000FFFF
176#define FRONT_TECH_LAYERS (SILKSCREEN_LAYER_FRONT | SOLDERMASK_LAYER_FRONT \
177 | ADHESIVE_LAYER_FRONT | SOLDERPASTE_LAYER_FRONT)
178#define BACK_TECH_LAYERS (SILKSCREEN_LAYER_BACK | SOLDERMASK_LAYER_BACK \
179 | ADHESIVE_LAYER_BACK | SOLDERPASTE_LAYER_BACK)
180#define ALL_TECH_LAYERS (FRONT_TECH_LAYERS | BACK_TECH_LAYERS)
181#define BACK_LAYERS (LAYER_BACK | BACK_TECH_LAYERS)
182#define FRONT_LAYERS (LAYER_FRONT | FRONT_TECH_LAYERS)
184#define ALL_USER_LAYERS (DRAW_LAYER | COMMENT_LAYER | ECO1_LAYER | ECO2_LAYER )
186#define NO_LAYERS 0x00000000
188#define PCB_LEGACY_TEXT_is_REFERENCE 0
189#define PCB_LEGACY_TEXT_is_VALUE 1
190#define PCB_LEGACY_TEXT_is_DIVERS 2
193#define PCB_LEGACY_INTERNAL_UNIT 10000
196#define SZ( x ) (sizeof(x)-1)
202static bool inline isSpace(
int c ) {
return strchr(
delims, c ) !=
nullptr; }
204#define MASK(x) (1<<(x))
209 const unsigned PROGRESS_DELTA = 250;
232#define TESTLINE( x ) ( !strncasecmp( line, x, SZ( x ) ) && isSpace( line[SZ( x )] ) )
235#define TESTSUBSTR( x ) ( !strncasecmp( line, x, SZ( x ) ) )
239#define READLINE( rdr ) rdr->ReadLine()
245static inline char* ReadLine(
LINE_READER* rdr,
const char* caller )
249 const char* line = rdr->
Line();
252 if( !strcmp(
"loadSETUP", caller ) && !strcmp(
"$EndSETUP\n", line ) )
260#define READLINE( rdr ) ReadLine( rdr, __FUNCTION__ )
266 if( !strcmp(
"L", horizontal ) )
269 if( !strcmp(
"R", horizontal ) )
277 if( !strcmp(
"T", vertical ) )
280 if( !strcmp(
"B", vertical ) )
292 for(
int i = 0; aMask; ++i, aMask >>= 1 )
306 return aLegacyLayerNum ==
LAYER_N_FRONT || aLegacyLayerNum < aCu_Count;
313 unsigned old = aLayerNum;
331 newid = cu_count - 1 - old;
332 wxASSERT( newid >= 0 );
374 aMask &= ~ALL_CU_LAYERS;
377 for(
int i=0; aMask; ++i, aMask >>= 1 )
393static inline int intParse(
const char*
next,
const char** out =
nullptr )
396 return (
int) strtol(
next, (
char**) out, 10 );
406static inline long hexParse(
const char*
next,
const char** out =
nullptr )
409 return strtol(
next, (
char**) out, 16 );
443 char* line = reader.
Line();
452 if( !strncasecmp( line,
"$MODULE", strlen(
"$MODULE" ) ) )
475 std::unique_ptr<BOARD> boardDeleter;
483 boardDeleter = std::make_unique<BOARD>();
540 std::unique_ptr<FOOTPRINT> footprint = std::make_unique<FOOTPRINT>(
m_board );
543 std::string fpName =
StrPurge( line +
SZ(
"$MODULE" ) );
549 if( !fpName.empty() )
550 fpid.
Parse( fpName,
true );
552 footprint->SetFPID( fpid );
555 m_board->
Add( footprint.release(), ADD_MODE::APPEND );
557 else if(
TESTLINE(
"$DRAWSEGMENT" ) )
577 else if(
TESTLINE(
"$CZONE_OUTLINE" ) )
598 else if(
TESTLINE(
"$SHEETDESCR" ) )
635 char* line = aReader->
Line();
643 sscanf( line,
"PCBNEW-BOARD Version %d", &ver );
651 if( ver > LEGACY_BOARD_FILE_VERSION )
653 THROW_IO_ERROR( wxString::Format(
_(
"File '%s' has an unrecognized version: %d." ),
666 bool saw_LayerCount =
false;
675 data = strtok_r( line +
SZ(
"Units"),
delims, &saveptr );
677 if( !strcmp( data,
"mm" ) )
684 int tmp =
intParse( line +
SZ(
"LayerCount" ) );
692 saw_LayerCount =
true;
694 else if(
TESTLINE(
"EnabledLayers" ) )
696 if( !saw_LayerCount )
711 else if(
TESTLINE(
"VisibleLayers" ) )
717 if( !saw_LayerCount )
729 if( !saw_LayerCount )
736 saw_LayerCount =
true;
739 else if(
TESTLINE(
"BoardThickness" ) )
764 else if(
TESTLINE(
"$EndGENERAL" ) )
788 char* sname = strtok_r( line +
SZ(
"Sheet" ),
delims, &data );
796 m_error.Printf(
_(
"Unknown sheet type '%s' on line: %d." ),
802 char* width = strtok_r(
nullptr,
delims, &data );
803 char* height = strtok_r(
nullptr,
delims, &data );
804 char* orient = strtok_r(
nullptr,
delims, &data );
809 if( width && height )
821 if( orient && !strcmp( orient,
"portrait" ) )
894 else if(
TESTLINE(
"$EndSHEETDESCR" ) )
909 std::shared_ptr<NETCLASS> defaultNetclass = bds.
m_NetSettings->m_DefaultNetClass;
926 plot_opts.
Parse( &parser );
931 else if(
TESTLINE(
"AuxiliaryAxisOrg" ) )
942 int layer_num =
intParse( line +
SZ(
"Layer[" ), &data );
945 data = strtok_r( (
char*) data+1,
delims, &saveptr );
952 data = strtok_r(
nullptr,
delims, &saveptr );
964 defaultNetclass->SetTrackWidth( tmp );
966 else if(
TESTLINE(
"TrackWidthList" ) )
971 else if(
TESTLINE(
"TrackClearence" ) )
974 defaultNetclass->SetClearance( tmp );
976 else if(
TESTLINE(
"TrackMinWidth" ) )
981 else if(
TESTLINE(
"ZoneClearence" ) )
986 else if(
TESTLINE(
"Zone_45_Only" ) )
990 else if(
TESTLINE(
"DrawSegmWidth" ) )
995 else if(
TESTLINE(
"EdgeSegmWidth" ) )
1000 else if(
TESTLINE(
"ViaMinSize" ) )
1005 else if(
TESTLINE(
"MicroViaMinSize" ) )
1010 else if(
TESTLINE(
"ViaSizeList" ) )
1015 BIU diameter =
biuParse( line +
SZ(
"ViaSizeList" ), &data );
1017 data = strtok_r( (
char*) data,
delims, (
char**) &data );
1026 defaultNetclass->SetViaDiameter( tmp );
1031 defaultNetclass->SetViaDrill( tmp );
1033 else if(
TESTLINE(
"ViaMinDrill" ) )
1038 else if(
TESTLINE(
"MicroViaSize" ) )
1041 defaultNetclass->SetuViaDiameter( tmp );
1043 else if(
TESTLINE(
"MicroViaDrill" ) )
1046 defaultNetclass->SetuViaDrill( tmp );
1048 else if(
TESTLINE(
"MicroViaMinDrill" ) )
1053 else if(
TESTLINE(
"MicroViasAllowed" ) )
1057 else if(
TESTLINE(
"TextPcbWidth" ) )
1062 else if(
TESTLINE(
"TextPcbSize" ) )
1069 else if(
TESTLINE(
"EdgeModWidth" ) )
1075 else if(
TESTLINE(
"TextModWidth" ) )
1081 else if(
TESTLINE(
"TextModSize" ) )
1101 else if(
TESTLINE(
"Pad2MaskClearance" ) )
1106 else if(
TESTLINE(
"SolderMaskMinWidth" ) )
1111 else if(
TESTLINE(
"Pad2PasteClearance" ) )
1116 else if(
TESTLINE(
"Pad2PasteClearanceRatio" ) )
1118 double ratio = atof( line +
SZ(
"Pad2PasteClearanceRatio" ) );
1122 else if(
TESTLINE(
"GridOrigin" ) )
1129 else if(
TESTLINE(
"VisibleElements" ) )
1135 int visibleElements =
hexParse( line +
SZ(
"VisibleElements" ) );
1141 for(
size_t i = 0; i < visibles.size(); i++ )
1142 visibles.
set( i, visibleElements & ( 1u << i ) );
1182 for(
unsigned ii = 1; ii < designSettings.
m_TrackWidthList.size() - 1; ii++ )
1203 if(
TESTSUBSTR(
"D" ) && strchr(
"SCAP", line[1] ) )
1241 int orient =
intParse( data, &data );
1242 int layer_num =
intParse( data, &data );
1245 [[maybe_unused]]
long edittime =
hexParse( data, &data );
1247 char* uuid = strtok_r( (
char*) data,
delims, (
char**) &data );
1249 data = strtok_r( (
char*) data+1,
delims, (
char**) &data );
1253 if( data && data[0] ==
'F' )
1256 if( data && data[1] ==
'P' )
1266 char* uuid = strtok_r( (
char*) line +
SZ(
"Sc" ),
delims, (
char**) &data );
1278 data = line +
SZ(
"At" );
1280 if( strstr( data,
"SMD" ) )
1282 else if( strstr( data,
"VIRTUAL" ) )
1292 data = strtok_r( line +
SZ(
"AR" ),
delims, (
char**) &data );
1310 else if(
TESTLINE(
".SolderPasteRatio" ) )
1312 double tmp = atof( line +
SZ(
".SolderPasteRatio" ) );
1326 else if(
TESTLINE(
".SolderPaste" ) )
1331 else if(
TESTLINE(
".SolderMask" ) )
1336 else if(
TESTLINE(
".LocalClearance" ) )
1341 else if(
TESTLINE(
".ZoneConnection" ) )
1343 int tmp =
intParse( line +
SZ(
".ZoneConnection" ) );
1346 else if(
TESTLINE(
".ThermalWidth" ) )
1351 else if(
TESTLINE(
".ThermalGap" ) )
1356 else if(
TESTLINE(
"$EndMODULE" ) )
1362 wxString msg = wxString::Format(
_(
"Missing '$EndMODULE' for MODULE '%s'." ),
1370 std::unique_ptr<PAD>
pad = std::make_unique<PAD>( aFootprint );
1386 char mypadnumber[50];
1388 data = line +
SZ(
"Sh" ) + 1;
1391 data = data +
ReadDelimitedText( mypadnumber, data,
sizeof( mypadnumber ) ) + 1;
1396 unsigned char padchar = (
unsigned char) *data++;
1407 case 'C': padshape =
static_cast<int>( PAD_SHAPE::CIRCLE );
break;
1408 case 'R': padshape =
static_cast<int>( PAD_SHAPE::RECTANGLE );
break;
1409 case 'O': padshape =
static_cast<int>( PAD_SHAPE::OVAL );
break;
1410 case 'T': padshape =
static_cast<int>( PAD_SHAPE::TRAPEZOID );
break;
1412 m_error.Printf(
_(
"Unknown padshape '%c=0x%02x' on line: %d of footprint: '%s'." ),
1425 const unsigned char* cp = (
unsigned char*) mypadnumber;
1438 pad->SetNumber( padNumber );
1442 pad->SetOrientation( orient );
1448 BIU drill_y = drill_x;
1454 data = strtok_r( (
char*) data,
delims, &saveptr );
1458 if( data[0] ==
'O' )
1462 data = strtok_r(
nullptr,
delims, &saveptr );
1465 data = strtok_r(
nullptr,
delims, &saveptr );
1470 pad->SetDrillShape( drShape );
1472 pad->SetDrillSize(
VECTOR2I( drill_x, drill_y ) );
1481 data = strtok_r( line +
SZ(
"At" ),
delims, &saveptr );
1483 if( !strcmp( data,
"SMD" ) )
1484 attribute = PAD_ATTRIB::SMD;
1485 else if( !strcmp( data,
"CONN" ) )
1486 attribute = PAD_ATTRIB::CONN;
1487 else if( !strcmp( data,
"HOLE" ) )
1488 attribute = PAD_ATTRIB::NPTH;
1490 attribute = PAD_ATTRIB::PTH;
1492 strtok_r(
nullptr,
delims, &saveptr );
1493 data = strtok_r(
nullptr,
delims, &saveptr );
1498 pad->SetAttribute( attribute );
1505 int netcode =
intParse( line +
SZ(
"Ne" ), &data );
1527 pad->SetFPRelativePosition( pos );
1532 pad->SetPadToDieLength( tmp );
1534 else if(
TESTLINE(
".SolderMask" ) )
1537 pad->SetLocalSolderMaskMargin( tmp );
1539 else if(
TESTLINE(
".SolderPasteRatio" ) )
1541 double tmp = atof( line +
SZ(
".SolderPasteRatio" ) );
1542 pad->SetLocalSolderPasteMarginRatio( tmp );
1544 else if(
TESTLINE(
".SolderPaste" ) )
1547 pad->SetLocalSolderPasteMargin( tmp );
1549 else if(
TESTLINE(
".LocalClearance" ) )
1552 pad->SetLocalClearance( tmp );
1554 else if(
TESTLINE(
".ZoneConnection" ) )
1556 int tmp =
intParse( line +
SZ(
".ZoneConnection" ) );
1559 else if(
TESTLINE(
".ThermalWidth" ) )
1562 pad->SetThermalSpokeWidth( tmp );
1564 else if(
TESTLINE(
".ThermalGap" ) )
1567 pad->SetThermalGap( tmp );
1571 if(
pad->GetSizeX() > 0 &&
pad->GetSizeY() > 0 )
1573 aFootprint->
Add(
pad.release() );
1577 wxLogError(
_(
"Invalid zero-sized pad ignored in\nfile: %s" ),
1596 case 'S': shape = SHAPE_T::SEGMENT;
break;
1597 case 'C': shape = SHAPE_T::CIRCLE;
break;
1598 case 'A': shape = SHAPE_T::ARC;
break;
1599 case 'P': shape = SHAPE_T::POLY;
break;
1601 m_error.Printf(
_(
"Unknown PCB_SHAPE type:'%c=0x%02x' on line %d of footprint '%s'." ),
1607 std::unique_ptr<PCB_SHAPE> dwg = std::make_unique<PCB_SHAPE>( aFootprint, shape );
1628 dwg->SetCenter(
VECTOR2I( center0_x, center0_y ) );
1629 dwg->SetStart(
VECTOR2I( start0_x, start0_y ) );
1630 dwg->SetArcAngleAndEnd( angle,
true );
1634 case SHAPE_T::SEGMENT:
1635 case SHAPE_T::CIRCLE:
1646 dwg->SetStart(
VECTOR2I( start0_x, start0_y ) );
1647 dwg->SetEnd(
VECTOR2I( end0_x, end0_y ) );
1658 int ptCount =
intParse( data, &data );
1663 dwg->SetStart(
VECTOR2I( start0_x, start0_y ) );
1664 dwg->SetEnd(
VECTOR2I( end0_x, end0_y ) );
1666 std::vector<VECTOR2I> pts;
1667 pts.reserve( ptCount );
1669 for(
int ii = 0; ii < ptCount; ++ii )
1686 pts.emplace_back( x, y );
1689 dwg->SetPolyPoints( pts );
1704 dwg->SetStroke(
STROKE_PARAMS( width, LINE_STYLE::SOLID ) );
1709 aFootprint->
Add( dwg.release() );
1716 const char* txt_end;
1724 int type =
intParse( line+1, &data );
1739 m_field.Replace( wxT(
"%V" ), wxT(
"${VALUE}" ) );
1740 m_field.Replace( wxT(
"%R" ), wxT(
"${REFERENCE}" ) );
1747 char* mirror = strtok_r( (
char*) data,
delims, (
char**) &data );
1748 char* hide = strtok_r(
nullptr,
delims, (
char**) &data );
1749 char* tmp = strtok_r(
nullptr,
delims, (
char**) &data );
1753 char* italic = strtok_r(
nullptr,
delims, (
char**) &data );
1755 char* hjust = strtok_r( (
char*) txt_end,
delims, (
char**) &data );
1756 char* vjust = strtok_r(
nullptr,
delims, (
char**) &data );
1770 aText->
SetVisible( !(hide && *hide ==
'I') );
1772 aText->
SetItalic( italic && *italic ==
'I' );
1825 else if(
TESTLINE(
"$EndSHAPE3D" ) )
1827 aFootprint->
Models().push_back( t3D );
1845 std::unique_ptr<PCB_SHAPE> dseg = std::make_unique<PCB_SHAPE>(
m_board );
1856 int shape =
intParse( line +
SZ(
"Po" ), &data );
1866 dseg->SetShape(
static_cast<SHAPE_T>( shape ) );
1867 dseg->SetFilled(
false );
1868 dseg->SetStroke(
STROKE_PARAMS( width, LINE_STYLE::SOLID ) );
1870 if( dseg->GetShape() == SHAPE_T::ARC )
1872 dseg->SetCenter(
VECTOR2I( start_x, start_y ) );
1873 dseg->SetStart(
VECTOR2I( end_x, end_y ) );
1877 dseg->SetStart(
VECTOR2I( start_x, start_y ) );
1878 dseg->SetEnd(
VECTOR2I( end_x, end_y ) );
1886 data = strtok_r( line +
SZ(
"De" ),
delims, &saveptr );
1888 for(
int i = 0; data; ++i, data = strtok_r(
nullptr,
delims, &saveptr ) )
1911 if( dseg->GetShape() == SHAPE_T::ARC )
1912 dseg->SetArcAngleAndEnd( angle );
1917 const_cast<KIID&
>( dseg->m_Uuid ) =
KIID( data );
1931 dseg->SetBezierC1(
VECTOR2I( x, y ) );
1938 dseg->SetBezierC2(
VECTOR2I( x, y ) );
1946 else if(
TESTLINE(
"$EndDRAWSEGMENT" ) )
1948 m_board->
Add( dseg.release(), ADD_MODE::APPEND );
1979 netCode =
intParse( line +
SZ(
"Na" ), &data );
1983 if( net ==
nullptr )
1990 THROW_IO_ERROR( wxT(
"Two net definitions in '$EQUIPOT' block" ) );
1993 else if(
TESTLINE(
"$EndEQUIPOT" ) )
2089 int layer_num =
intParse( line +
SZ(
"De" ), &data );
2090 int notMirrored =
intParse( data, &data );
2091 char* uuid = strtok_r( (
char*) data,
delims, (
char**) &data );
2092 char* style = strtok_r(
nullptr,
delims, (
char**) &data );
2093 char* hJustify = strtok_r(
nullptr,
delims, (
char**) &data );
2094 char* vJustify = strtok_r(
nullptr,
delims, (
char**) &data );
2098 pcbtxt->
SetItalic( !strcmp( style,
"Italic" ) );
2124 else if(
TESTLINE(
"$EndTEXTPCB" ) )
2148 if( line[0] ==
'$' )
2161 data = strtok_r( (
char*) data,
delims, (
char**) &data );
2191 int layer_num =
intParse( line +
SZ(
"De" ), &data );
2192 int type =
intParse( data, &data );
2193 int net_code =
intParse( data, &data );
2194 char* uuid = strtok_r( (
char*) data,
delims, (
char**) &data );
2197 intParse( data, (
const char**) &data );
2209 wxFAIL_MSG( wxT(
"Segment type unknown" ) );
2231 via->SetViaType( viatype );
2234 via->SetDrillDefault();
2236 via->SetDrill( drill );
2238 if(
via->GetViaType() == VIATYPE::THROUGH )
2250 via->SetLayerPair( front, back );
2297 std::shared_ptr<NETCLASS> nc = std::make_shared<NETCLASS>( wxEmptyString );
2309 std::make_unique<EDA_COMBINED_MATCHER>( netname,
CTX_NETCLASS ),
2316 nc->SetClearance( tmp );
2318 else if(
TESTLINE(
"TrackWidth" ) )
2321 nc->SetTrackWidth( tmp );
2326 nc->SetViaDiameter( tmp );
2331 nc->SetViaDrill( tmp );
2336 nc->SetuViaDiameter( tmp );
2341 nc->SetuViaDrill( tmp );
2353 else if(
TESTLINE(
"$EndNCLASS" ) )
2362 m_error.Printf(
_(
"Duplicate NETCLASS name '%s'." ), nc->GetName() );
2380 std::unique_ptr<ZONE> zc = std::make_unique<ZONE>(
m_board );
2383 bool endContour =
false;
2407 zc->AppendCorner(
VECTOR2I( x, y ), holeIndex );
2417 char* uuid = strtok_r( (
char*) line +
SZ(
"ZInfo" ),
delims, (
char**) &data );
2418 int netcode =
intParse( data, &data );
2423 const_cast<KIID&
>( zc->m_Uuid ) =
KIID( uuid );
2428 zc->BOARD_CONNECTED_ITEM::SetNetCode(
getNetCode( netcode ) );
2432 int layer_num =
intParse( line +
SZ(
"ZLayer" ) );
2439 char* hopt = strtok_r( (
char*) data,
delims, (
char**) &data );
2443 m_error.Printf(
_(
"Bad ZAux for CZONE_CONTAINER \"%s\"" ),
2444 zc->GetNetname().GetData() );
2450 case 'N': outline_hatch = ZONE_BORDER_DISPLAY_STYLE::NO_HATCH;
break;
2451 case 'E': outline_hatch = ZONE_BORDER_DISPLAY_STYLE::DIAGONAL_EDGE;
break;
2452 case 'F': outline_hatch = ZONE_BORDER_DISPLAY_STYLE::DIAGONAL_FULL;
break;
2454 m_error.Printf(
_(
"Bad ZAux for CZONE_CONTAINER \"%s\"" ),
2455 zc->GetNetname().GetData() );
2461 else if(
TESTLINE(
"ZSmoothing" ) )
2464 int smoothing =
intParse( line +
SZ(
"ZSmoothing" ), &data );
2469 m_error.Printf(
_(
"Bad ZSmoothing for CZONE_CONTAINER \"%s\"" ),
2470 zc->GetNetname().GetData() );
2474 zc->SetCornerSmoothingType( smoothing );
2475 zc->SetCornerRadius( cornerRadius );
2480 zc->SetIsRuleArea(
true );
2481 zc->SetDoNotAllowPads(
false );
2482 zc->SetDoNotAllowFootprints(
false );
2485 token = strtok_r( line +
SZ(
"ZKeepout" ),
delims, (
char**) &data );
2489 if( !strcmp( token,
"tracks" ) )
2491 token = strtok_r(
nullptr,
delims, (
char**) &data );
2492 zc->SetDoNotAllowTracks( token && *token ==
'N' );
2494 else if( !strcmp( token,
"vias" ) )
2496 token = strtok_r(
nullptr,
delims, (
char**) &data );
2497 zc->SetDoNotAllowVias( token && *token ==
'N' );
2499 else if( !strcmp( token,
"copperpour" ) )
2501 token = strtok_r(
nullptr,
delims, (
char**) &data );
2502 zc->SetDoNotAllowCopperPour( token && *token ==
'N' );
2505 token = strtok_r(
nullptr,
delims, (
char**) &data );
2511 int fillmode =
intParse( line +
SZ(
"ZOptions" ), &data );
2513 char fillstate = data[1];
2514 BIU thermalReliefGap =
biuParse( data += 2 , &data );
2521 wxLogWarning(
_(
"The legacy segment zone fill mode is no longer supported.\n"
2522 "Zone fills will be converted on a best-effort basis." ) );
2528 zc->SetFillMode( ZONE_FILL_MODE::POLYGONS );
2529 zc->SetIsFilled( fillstate ==
'S' );
2530 zc->SetThermalReliefGap( thermalReliefGap );
2531 zc->SetThermalReliefSpokeWidth( thermalReliefCopperBridge );
2533 else if(
TESTLINE(
"ZClearance" ) )
2536 BIU clearance =
biuParse( line +
SZ(
"ZClearance" ), &data );
2537 char* padoption = strtok_r( (
char*) data,
delims, (
char**) &data );
2540 switch( *padoption )
2542 case 'I': popt = ZONE_CONNECTION::FULL;
break;
2543 case 'T': popt = ZONE_CONNECTION::THERMAL;
break;
2544 case 'H': popt = ZONE_CONNECTION::THT_THERMAL;
break;
2545 case 'X': popt = ZONE_CONNECTION::NONE;
break;
2547 m_error.Printf(
_(
"Bad ZClearance padoption for CZONE_CONTAINER \"%s\"" ),
2548 zc->GetNetname().GetData() );
2552 zc->SetLocalClearance( clearance );
2553 zc->SetPadConnection( popt );
2555 else if(
TESTLINE(
"ZMinThickness" ) )
2558 zc->SetMinThickness( thickness );
2562 int priority =
intParse( line +
SZ(
"ZPriority" ) );
2563 zc->SetAssignedPriority( priority );
2565 else if(
TESTLINE(
"$POLYSCORNERS" ) )
2570 bool makeNewOutline =
true;
2574 if(
TESTLINE(
"$endPOLYSCORNERS" ) )
2581 if( makeNewOutline )
2584 polysList.
Append( x, y );
2587 bool end_contour =
intParse( data, &data );
2590 makeNewOutline = end_contour;
2593 zc->SetFilledPolysList( zc->GetFirstLayer(), polysList );
2595 else if(
TESTLINE(
"$FILLSEGMENTS" ) )
2599 if(
TESTLINE(
"$endFILLSEGMENTS" ) )
2609 else if(
TESTLINE(
"$endCZONE_OUTLINE" ) )
2613 if( zc->GetIsRuleArea() )
2616 if( zc->GetMinThickness() > 0 )
2623 CORNER_STRATEGY::ROUND_ALL_CORNERS,
2627 zc->SetFilledPolysList( layer, inflatedFill );
2633 if( zc->GetNumCorners() > 2 )
2635 if( !zc->IsOnCopperLayer() )
2637 zc->SetFillMode( ZONE_FILL_MODE::POLYGONS );
2658 std::unique_ptr<PCB_DIM_ALIGNED> dim = std::make_unique<PCB_DIM_ALIGNED>(
m_board,
2671 dim->UpdateHeight( crossBarF, crossBarO );
2673 m_board->
Add( dim.release(), ADD_MODE::APPEND );
2686 int shape =
intParse( line +
SZ(
"De" ), (
const char**) &data );
2687 int layer_num =
intParse( data, &data );
2688 char* uuid = strtok_r( (
char*) data,
delims, (
char**) &data );
2691 const_cast<KIID&
>( dim->m_Uuid ) =
KIID( uuid );
2701 dim->SetOverrideText(
From_UTF8( buf ) );
2702 dim->SetOverrideTextEnabled(
true );
2703 dim->SetUnitsFormat( DIM_UNITS_FORMAT::NO_SUFFIX );
2704 dim->SetAutoUnits();
2714 char* mirror = strtok_r( (
char*) data,
delims, (
char**) &data );
2716 dim->SetTextPos(
VECTOR2I( pos_x, pos_y ) );
2717 dim->SetTextSize(
VECTOR2I( width, height ) );
2718 dim->SetMirrored( mirror && *mirror ==
'0' );
2719 dim->SetTextThickness( thickn );
2720 dim->SetTextAngle( orient );
2731 dim->SetLineThickness( width );
2732 crossBarO =
VECTOR2I( crossBarOx, crossBarOy );
2733 crossBarF =
VECTOR2I( crossBarFx, crossBarFy );
2744 dim->SetStart(
VECTOR2I( featureLineDOx, featureLineDOy ) );
2755 dim->SetEnd(
VECTOR2I( featureLineGOx, featureLineGOy ) );
2809 int shape =
intParse( line +
SZ(
"Po" ), &data );
2810 int layer_num =
intParse( data, &data );
2815 char* uuid = strtok_r( (
char*) data,
delims, (
char**) &data );
2823 VECTOR2I( pos_x, pos_y ), size, width );
2840 double fval = strtod( aValue, &nptr );
2844 m_error.Printf(
_(
"Invalid floating point number in file: '%s'\nline: %d, offset: %d" ),
2852 if( aValue == nptr )
2854 m_error.Printf(
_(
"Missing floating point number in file: '%s'\nline: %d, offset: %d" ),
2879 double fval = strtod( aValue, &nptr );
2883 m_error.Printf(
_(
"Invalid floating point number in file: '%s'\nline: %d, offset: %d" ),
2891 if( aValue == nptr )
2893 m_error.Printf(
_(
"Missing floating point number in file: '%s'\nline: %d, offset: %d" ),
2971 static long long GetTimestamp(
const wxString& aLibPath );
2987 m_lib_path( aLibraryPath ),
2989 m_cache_dirty( true ),
2990 m_cache_timestamp( 0 )
3005 return wxFileName( aLibPath ).GetModificationTime().GetValue().GetValue();
3034 if( !
TESTLINE(
"PCBNEW-LibModule-V1" ) )
3037 while( ( line = aReader->
ReadLine() ) !=
nullptr )
3041 const char* units = strtok_r( line +
SZ(
"Units" ),
delims, &data );
3043 if( !strcmp( units,
"mm" ) )
3061 char* line = aReader->
Line();
3069 while( ( line = aReader->
ReadLine() ) !=
nullptr )
3082 }
while( ( line = aReader->
ReadLine() ) !=
nullptr );
3090 char* line = aReader->
Line();
3097 std::unique_ptr<FOOTPRINT> fp_ptr = std::make_unique<FOOTPRINT>(
m_owner->
m_board );
3099 std::string footprintName =
StrPurge( line +
SZ(
"$MODULE" ) );
3106 fp_ptr->SetFPID(
LIB_ID( wxEmptyString, footprintName ) );
3128 FOOTPRINT_MAP::const_iterator it =
m_footprints.find( footprintName );
3134 wxFAIL_MSG( wxT(
"error doing cache insert using guaranteed unique name" ) );
3141 bool nameOK =
false;
3147 std::string newName = footprintName;
3150 snprintf( buf,
sizeof(buf),
"%d", version++ );
3163 wxFAIL_MSG( wxT(
"error doing cache insert using guaranteed unique "
3171 }
while( ( line = aReader->
ReadLine() ) !=
nullptr );
3199 init( aProperties );
3207 errorMsg = ioe.
What();
3214 aFootprintNames.Add(
From_UTF8( footprint.first.c_str() ) );
3216 if( !errorMsg.IsEmpty() && !aBestEfforts )
3222 const wxString& aFootprintName,
bool aKeepUUID,
3227 init( aProperties );
3232 FOOTPRINT_MAP::const_iterator it = footprints.find(
TO_UTF8( aFootprintName ) );
3234 if( it == footprints.end() )
3241 copy->SetParent(
nullptr );
3249 wxFileName fn = aLibraryPath;
3251 if( !fn.FileExists() )
3256 if( wxRemove( aLibraryPath ) )
3258 THROW_IO_ERROR( wxString::Format(
_(
"Footprint library '%s' cannot be deleted." ),
3259 aLibraryPath.GetData() ) );
3290 m_progressReporter( nullptr ),
3291 m_lastProgressLine( 0 ),
3293 m_reader( nullptr ),
constexpr int ARC_HIGH_DEF
constexpr EDA_IU_SCALE pcbIUScale
LAYER_T
The allowed types of layers, same as Specctra DSN spec.
bool SetNetCode(int aNetCode, bool aNoAssert)
Set net using a net code.
Container for design settings for a BOARD object.
std::shared_ptr< NET_SETTINGS > m_NetSettings
void SetGridOrigin(const VECTOR2I &aOrigin)
std::unique_ptr< PAD > m_Pad_Master
void SetAuxOrigin(const VECTOR2I &aOrigin)
int m_SolderMaskExpansion
void SetDefaultZoneSettings(const ZONE_SETTINGS &aSettings)
int m_TextThickness[LAYER_CLASS_COUNT]
std::vector< int > m_TrackWidthList
int m_LineThickness[LAYER_CLASS_COUNT]
void SetBoardThickness(int aThickness)
double m_SolderPasteMarginRatio
ZONE_SETTINGS & GetDefaultZoneSettings()
VECTOR2I m_TextSize[LAYER_CLASS_COUNT]
std::vector< VIA_DIMENSION > m_ViasDimensionsList
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
void SetFPRelativePosition(const VECTOR2I &aPos)
Information pertinent to a Pcbnew printed circuit board.
void SetPlotOptions(const PCB_PLOT_PARAMS &aOptions)
bool m_LegacyDesignSettingsLoaded
True if the legacy board design settings were loaded from a file.
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
void SetFileName(const wxString &aFileName)
void SetEnabledLayers(LSET aLayerMask)
A proxy function that calls the correspondent function in m_BoardSettings.
NETINFO_ITEM * FindNet(int aNetcode) const
Search for a net with the given netcode.
bool SetLayerName(PCB_LAYER_ID aLayer, const wxString &aLayerName)
Changes the name of the layer given by aLayer.
void SetPageSettings(const PAGE_INFO &aPageSettings)
void SetVisibleLayers(LSET aLayerMask)
A proxy function that calls the correspondent function in m_BoardSettings changes the bit-mask of vis...
bool m_LegacyNetclassesLoaded
True if netclasses were loaded from the file.
void SetCopperLayerCount(int aCount)
bool SetLayerType(PCB_LAYER_ID aLayer, LAYER_T aLayerType)
Change the type of the layer given by aLayer.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
void SetTitleBlock(const TITLE_BLOCK &aTitleBlock)
void SetVisibleElements(const GAL_SET &aMask)
A proxy function that calls the correspondent function in m_BoardSettings.
void SetFileFormatVersionAtLoad(int aVersion)
void SetTextSize(VECTOR2I aNewSize, bool aEnforceMinTextSize=true)
virtual const wxString & GetText() const
Return the string associated with the text object.
void SetTextPos(const VECTOR2I &aPoint)
void SetMirrored(bool isMirrored)
void SetVertJustify(GR_TEXT_V_ALIGN_T aType)
GR_TEXT_H_ALIGN_T GetHorizJustify() const
virtual void SetVisible(bool aVisible)
void SetTextThickness(int aWidth)
The TextThickness is that set by the user.
virtual void SetText(const wxString &aText)
virtual void SetTextAngle(const EDA_ANGLE &aAngle)
void SetItalic(bool aItalic)
void SetHorizJustify(GR_TEXT_H_ALIGN_T aType)
A LINE_READER that reads from an open file.
void Rewind()
Rewind the file and resets the line number back to zero.
char * ReadLine() override
Read a line of text into the buffer and increments the line number counter.
VECTOR3D m_Offset
3D model offset (mm)
VECTOR3D m_Rotation
3D model rotation (degrees)
VECTOR3D m_Scale
3D model scaling factor (dimensionless)
wxString m_Filename
The 3D shape filename in 3D library.
Helper for storing and iterating over GAL_LAYER_IDs.
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
virtual const wxString What() const
A composite of Problem() and Where()
A logical library item identifier and consists of various portions much like a URI.
int Parse(const UTF8 &aId, bool aFix=false)
Parse LIB_ID with the information from aId.
const UTF8 & GetLibItemName() const
An abstract class from which implementation specific LINE_READERs may be derived to read single lines...
virtual char * ReadLine()=0
Read a line of text into the buffer and increments the line number counter.
virtual const wxString & GetSource() const
Returns the name of the source of the lines in an abstract sense.
virtual unsigned LineNumber() const
Return the line number of the last line read from this LINE_READER.
char * Line() const
Return a pointer to the last line that was read in.
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
LSET is a set of PCB_LAYER_IDs.
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Handle the data for a net.
static const int UNCONNECTED
Constant that holds the "unconnected net" number (typically 0) all items "connected" to this net are ...
Describe the page size and margins of a paper page on which to eventually print or plot.
void SetPortrait(bool aIsPortrait)
Rotate the paper page 90 degrees.
static const wxChar Custom[]
"User" defined page type
void SetHeightMils(double aHeightInMils)
void SetWidthMils(double aWidthInMils)
bool SetType(const wxString &aStandardPageDescriptionName, bool aIsPortrait=false)
Set the name of the page type and also the sizes and margins commonly associated with that type name.
A #PLUGIN derivation which could possibly be put into a DLL/DSO.
wxString m_error
for throwing exceptions
EDA_ANGLE degParse(const char *aValue, const char **nptrptr=nullptr)
Parse an ASCII decimal floating point value which is certainly an angle in tenths of a degree.
void loadMODULE_TEXT(PCB_TEXT *aText)
bool CanReadFootprint(const wxString &aFileName) const override
Checks if this PCB_IO can read a footprint from specified file or directory.
PROGRESS_REPORTER * m_progressReporter
may be NULL, no ownership
BOARD * LoadBoard(const wxString &aFileName, BOARD *aAppendToMe, const STRING_UTF8_MAP *aProperties=nullptr, PROJECT *aProject=nullptr) override
Load information from some input file format that this PCB_IO implementation knows about into either ...
void loadFP_SHAPE(FOOTPRINT *aFootprint)
FOOTPRINT * FootprintLoad(const wxString &aLibraryPath, const wxString &aFootprintName, bool aKeepUUID=false, const STRING_UTF8_MAP *aProperties=nullptr) override
Load a footprint having aFootprintName from the aLibraryPath containing a library format that this PC...
std::vector< int > m_netCodes
net codes mapping for boards being loaded
long long GetLibraryTimestamp(const wxString &aLibraryPath) const override
Generate a timestamp representing all the files in the library (including the library directory).
void loadAllSections(bool doAppend)
bool m_showLegacySegmentZoneWarning
unsigned m_lineCount
for progress reporting
void cacheLib(const wxString &aLibraryPath)
we only cache one footprint library for now, this determines which one.
void loadPAD(FOOTPRINT *aFootprint)
double biuToDisk
convert from BIUs to disk engineering units with this scale factor
static LSET leg_mask2new(int cu_count, unsigned aMask)
void loadTrackList(int aStructType)
Read a list of segments (Tracks and Vias, or Segzones)
unsigned m_lastProgressLine
LINE_READER * m_reader
no ownership here.
void SetReader(LINE_READER *aReader)
double diskToBiu
convert from disk engineering units to BIUs
BIU biuParse(const char *aValue, const char **nptrptr=nullptr)
Parse an ASCII decimal floating point value and scales it into a BIU according to the current value o...
void loadZONE_CONTAINER()
wxString m_field
reused to stuff FOOTPRINT fields.
void FootprintEnumerate(wxArrayString &aFootprintNames, const wxString &aLibraryPath, bool aBestEfforts, const STRING_UTF8_MAP *aProperties=nullptr) override
Return a list of footprint names contained within the library at aLibraryPath.
void checkpoint()
Converts net code using the mapping table if available, otherwise returns unchanged net code.
bool DeleteLibrary(const wxString &aLibraryPath, const STRING_UTF8_MAP *aProperties=nullptr) override
Delete an existing library and returns true, or if library does not exist returns false,...
void init(const STRING_UTF8_MAP *aProperties)
initialize PLUGIN like a constructor would, and futz with fresh BOARD if needed.
void loadFOOTPRINT(FOOTPRINT *aFootprint)
static int getVersion(LINE_READER *aReader)
void load3D(FOOTPRINT *aFootprint)
bool CanReadBoard(const wxString &aFileName) const override
Checks if this PCB_IO can read the specified board file.
int getNetCode(int aNetCode)
bool IsLibraryWritable(const wxString &aLibraryPath) override
Return true if the library at aLibraryPath is writable.
int m_loading_format_version
which BOARD_FORMAT_VERSION am I Load()ing?
static PCB_LAYER_ID leg_layer2new(int cu_count, int aLayerNum)
A base class that BOARD loading and saving plugins should derive from.
BOARD * m_board
The board BOARD being worked on, no ownership here.
virtual bool CanReadFootprint(const wxString &aFileName) const
Checks if this PCB_IO can read a footprint from specified file or directory.
const STRING_UTF8_MAP * m_props
Properties passed via Save() or Load(), no ownership, may be NULL.
virtual bool CanReadBoard(const wxString &aFileName) const
Checks if this PCB_IO can read the specified board file.
The parser for PCB_PLOT_PARAMS.
Parameters and options when plotting/printing a board.
void Parse(PCB_PLOT_PARAMS_PARSER *aParser)
void SetWidth(int aWidth)
void SetEnd(const VECTOR2I &aEnd)
void SetPosition(const VECTOR2I &aPos) override
virtual bool KeepRefreshing(bool aWait=false)=0
Update the UI (if any).
virtual void Report(const wxString &aMessage)=0
Display aMessage in the progress bar dialog.
virtual void SetCurrentProgress(double aProgress)=0
Set the progress value to aProgress (0..1).
Container for project specific data.
Represent a set of closed polygons.
void InflateWithLinkedHoles(int aFactor, CORNER_STRATEGY aCornerStrategy, int aMaxError, POLYGON_MODE aFastMode)
Perform outline inflation/deflation, using round corners.
int Append(int x, int y, int aOutline=-1, int aHole=-1, bool aAllowDuplication=false)
Appends a vertex at the end of the given outline/hole (default: the last outline)
int NewOutline()
Creates a new empty polygon in the set and returns its index.
A name/value tuple with unique names and optional values.
Simple container to manage line stroke parameters.
Hold the information shown in the lower right corner of a plot, printout, or editing view.
void SetRevision(const wxString &aRevision)
void SetComment(int aIdx, const wxString &aComment)
void SetTitle(const wxString &aTitle)
void SetCompany(const wxString &aCompany)
void SetDate(const wxString &aDate)
Set the date field, and defaults to the current time and date.
Read lines of text from another LINE_READER but only returns non-comment lines and non-blank lines wi...
char * ReadLine() override
Read a line of text into the buffer and increments the line number counter.
ZONE_SETTINGS handles zones parameters.
static int GetDefaultHatchPitch()
This file is part of the common library.
#define FIRST_COPPER_LAYER
static bool isSpace(char cc)
Test for whitespace.
void ignore_unused(const T &)
#define THROW_IO_ERROR(msg)
PCB_LAYER_ID
A quick note on layer IDs:
This file contains miscellaneous commonly used macros and functions.
PAD_ATTRIB
The set of pad shapes, used with PAD::{Set,Get}Attribute().
PAD_DRILL_SHAPE_T
The set of pad drill shapes, used with PAD::{Set,Get}DrillShape()
PAD_SHAPE
The set of pad shapes, used with PAD::{Set,Get}Shape()
std::map< wxString, FOOTPRINT * > FOOTPRINT_MAP
static GR_TEXT_V_ALIGN_T vertJustify(const char *vertical)
static int intParse(const char *next, const char **out=nullptr)
Parse an ASCII integer string with possible leading whitespace into an integer and updates the pointe...
#define SILKSCREEN_N_BACK
#define PCB_LEGACY_TEXT_is_DIVERS
#define SZ(x)
Get the length of a string constant, at compile time.
static const char delims[]
#define TESTSUBSTR(x)
C sub-string compare test for a specific length of characters.
#define LAST_NON_COPPER_LAYER
PCB_IO_KICAD_LEGACY::BIU BIU
#define SOLDERMASK_N_FRONT
#define SOLDERMASK_N_BACK
bool is_leg_copperlayer_valid(int aCu_Count, int aLegacyLayerNum)
#define SOLDERPASTE_N_BACK
int layerMaskCountSet(LEG_MASK aMask)
Count the number of set layers in the mask.
static long hexParse(const char *next, const char **out=nullptr)
Parse an ASCII hex integer string with possible leading whitespace into a long integer and updates th...
#define SOLDERPASTE_N_FRONT
#define PCB_LEGACY_TEXT_is_REFERENCE
static GR_TEXT_H_ALIGN_T horizJustify(const char *horizontal)
#define SILKSCREEN_N_FRONT
#define TESTLINE(x)
C string compare test for a specific length of characters.
boost::ptr_map< std::string, FOOTPRINT > FOOTPRINT_MAP
#define FIRST_NON_COPPER_LAYER
#define PCB_LEGACY_TEXT_is_VALUE
static bool isSpace(int c)
#define FOOTPRINT_LIBRARY_HEADER_CNT
#define FOOTPRINT_LIBRARY_HEADER
wxString ConvertToNewOverbarNotation(const wxString &aOldStr)
Convert the old ~...~ overbar notation to the new ~{...} one.
wxString From_UTF8(const char *cstring)
int ReadDelimitedText(wxString *aDest, const char *aSource)
Copy bytes from aSource delimited string segment to aDest wxString.
bool ReplaceIllegalFileNameChars(std::string *aName, int aReplaceChar)
Checks aName for illegal file name characters.
char * StrPurge(char *text)
Remove leading and training spaces, tabs and end of line chars in text.
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
static LAYER_T ParseType(const char *aType)
Convert a string to a LAYER_T.
The footprint portion of the PLUGIN API, and only for the PCB_IO_KICAD_LEGACY, so therefore is privat...
PCB_IO_KICAD_LEGACY * m_owner
void ReadAndVerifyHeader(LINE_READER *aReader)
long long m_cache_timestamp
void LoadModules(LINE_READER *aReader)
FOOTPRINT_MAP m_footprints
static long long GetTimestamp(const wxString &aLibPath)
LP_CACHE(PCB_IO_KICAD_LEGACY *aOwner, const wxString &aLibraryPath)
void SkipIndex(LINE_READER *aReader)
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
@ NOT_USED
the 3d code uses this value
@ PCB_DIM_ALIGNED_T
class PCB_DIM_ALIGNED, a linear dimension (graphic item)
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
ZONE_BORDER_DISPLAY_STYLE
Zone border styles.
ZONE_CONNECTION
How pads are covered by copper in zone.