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 ) )
308 return aLegacyLayerNum ==
LAYER_N_FRONT || aLegacyLayerNum < aCu_Count;
315 unsigned old = aLayerNum;
333 newid = cu_count - 1 - old;
334 wxASSERT( newid >= 0 );
376 aMask &= ~ALL_CU_LAYERS;
379 for(
int i=0; aMask; ++i, aMask >>= 1 )
395static inline int intParse(
const char*
next,
const char** out =
nullptr )
398 return (
int) strtol(
next, (
char**) out, 10 );
408static inline long hexParse(
const char*
next,
const char** out =
nullptr )
411 return strtol(
next, (
char**) out, 16 );
445 char* line = reader.
Line();
454 if( !strncasecmp( line,
"$MODULE", strlen(
"$MODULE" ) ) )
477 std::unique_ptr<BOARD> boardDeleter;
485 boardDeleter = std::make_unique<BOARD>();
542 std::unique_ptr<FOOTPRINT> footprint = std::make_unique<FOOTPRINT>(
m_board );
545 std::string fpName =
StrPurge( line +
SZ(
"$MODULE" ) );
551 if( !fpName.empty() )
552 fpid.
Parse( fpName,
true );
554 footprint->SetFPID( fpid );
557 m_board->
Add( footprint.release(), ADD_MODE::APPEND );
559 else if(
TESTLINE(
"$DRAWSEGMENT" ) )
579 else if(
TESTLINE(
"$CZONE_OUTLINE" ) )
600 else if(
TESTLINE(
"$SHEETDESCR" ) )
637 char* line = aReader->
Line();
645 sscanf( line,
"PCBNEW-BOARD Version %d", &ver );
653 if( ver > LEGACY_BOARD_FILE_VERSION )
655 THROW_IO_ERROR( wxString::Format(
_(
"File '%s' has an unrecognized version: %d." ),
668 bool saw_LayerCount =
false;
677 data = strtok_r( line +
SZ(
"Units"),
delims, &saveptr );
679 if( !strcmp( data,
"mm" ) )
686 int tmp =
intParse( line +
SZ(
"LayerCount" ) );
694 saw_LayerCount =
true;
696 else if(
TESTLINE(
"EnabledLayers" ) )
698 if( !saw_LayerCount )
713 else if(
TESTLINE(
"VisibleLayers" ) )
719 if( !saw_LayerCount )
731 if( !saw_LayerCount )
738 saw_LayerCount =
true;
741 else if(
TESTLINE(
"BoardThickness" ) )
766 else if(
TESTLINE(
"$EndGENERAL" ) )
790 char* sname = strtok_r( line +
SZ(
"Sheet" ),
delims, &data );
798 m_error.Printf(
_(
"Unknown sheet type '%s' on line: %d." ),
804 char* width = strtok_r(
nullptr,
delims, &data );
805 char* height = strtok_r(
nullptr,
delims, &data );
806 char* orient = strtok_r(
nullptr,
delims, &data );
811 if( width && height )
823 if( orient && !strcmp( orient,
"portrait" ) )
896 else if(
TESTLINE(
"$EndSHEETDESCR" ) )
911 std::shared_ptr<NETCLASS> defaultNetclass = bds.
m_NetSettings->m_DefaultNetClass;
928 plot_opts.
Parse( &parser );
940 else if(
TESTLINE(
"AuxiliaryAxisOrg" ) )
951 int layer_num =
intParse( line +
SZ(
"Layer[" ), &data );
954 data = strtok_r( (
char*) data+1,
delims, &saveptr );
961 data = strtok_r(
nullptr,
delims, &saveptr );
973 defaultNetclass->SetTrackWidth( tmp );
975 else if(
TESTLINE(
"TrackWidthList" ) )
980 else if(
TESTLINE(
"TrackClearence" ) )
983 defaultNetclass->SetClearance( tmp );
985 else if(
TESTLINE(
"TrackMinWidth" ) )
990 else if(
TESTLINE(
"ZoneClearence" ) )
995 else if(
TESTLINE(
"Zone_45_Only" ) )
999 else if(
TESTLINE(
"DrawSegmWidth" ) )
1004 else if(
TESTLINE(
"EdgeSegmWidth" ) )
1009 else if(
TESTLINE(
"ViaMinSize" ) )
1014 else if(
TESTLINE(
"MicroViaMinSize" ) )
1019 else if(
TESTLINE(
"ViaSizeList" ) )
1024 BIU diameter =
biuParse( line +
SZ(
"ViaSizeList" ), &data );
1026 data = strtok_r( (
char*) data,
delims, (
char**) &data );
1035 defaultNetclass->SetViaDiameter( tmp );
1040 defaultNetclass->SetViaDrill( tmp );
1042 else if(
TESTLINE(
"ViaMinDrill" ) )
1047 else if(
TESTLINE(
"MicroViaSize" ) )
1050 defaultNetclass->SetuViaDiameter( tmp );
1052 else if(
TESTLINE(
"MicroViaDrill" ) )
1055 defaultNetclass->SetuViaDrill( tmp );
1057 else if(
TESTLINE(
"MicroViaMinDrill" ) )
1062 else if(
TESTLINE(
"MicroViasAllowed" ) )
1066 else if(
TESTLINE(
"TextPcbWidth" ) )
1071 else if(
TESTLINE(
"TextPcbSize" ) )
1078 else if(
TESTLINE(
"EdgeModWidth" ) )
1084 else if(
TESTLINE(
"TextModWidth" ) )
1090 else if(
TESTLINE(
"TextModSize" ) )
1110 else if(
TESTLINE(
"Pad2MaskClearance" ) )
1115 else if(
TESTLINE(
"SolderMaskMinWidth" ) )
1120 else if(
TESTLINE(
"Pad2PasteClearance" ) )
1125 else if(
TESTLINE(
"Pad2PasteClearanceRatio" ) )
1127 double ratio = atof( line +
SZ(
"Pad2PasteClearanceRatio" ) );
1131 else if(
TESTLINE(
"GridOrigin" ) )
1138 else if(
TESTLINE(
"VisibleElements" ) )
1144 int visibleElements =
hexParse( line +
SZ(
"VisibleElements" ) );
1150 for(
size_t i = 0; i < visibles.size(); i++ )
1151 visibles.
set( i, visibleElements & ( 1u << i ) );
1191 for(
unsigned ii = 1; ii < designSettings.
m_TrackWidthList.size() - 1; ii++ )
1212 if(
TESTSUBSTR(
"D" ) && strchr(
"SCAP", line[1] ) )
1250 int orient =
intParse( data, &data );
1251 int layer_num =
intParse( data, &data );
1254 [[maybe_unused]]
long edittime =
hexParse( data, &data );
1256 char* uuid = strtok_r( (
char*) data,
delims, (
char**) &data );
1258 data = strtok_r( (
char*) data+1,
delims, (
char**) &data );
1262 if( data && data[0] ==
'F' )
1265 if( data && data[1] ==
'P' )
1275 char* uuid = strtok_r( (
char*) line +
SZ(
"Sc" ),
delims, (
char**) &data );
1287 data = line +
SZ(
"At" );
1289 if( strstr( data,
"SMD" ) )
1291 else if( strstr( data,
"VIRTUAL" ) )
1301 data = strtok_r( line +
SZ(
"AR" ),
delims, (
char**) &data );
1319 else if(
TESTLINE(
".SolderPasteRatio" ) )
1321 double tmp = atof( line +
SZ(
".SolderPasteRatio" ) );
1335 else if(
TESTLINE(
".SolderPaste" ) )
1340 else if(
TESTLINE(
".SolderMask" ) )
1345 else if(
TESTLINE(
".LocalClearance" ) )
1350 else if(
TESTLINE(
".ZoneConnection" ) )
1352 int tmp =
intParse( line +
SZ(
".ZoneConnection" ) );
1355 else if(
TESTLINE(
".ThermalWidth" ) )
1360 else if(
TESTLINE(
".ThermalGap" ) )
1365 else if(
TESTLINE(
"$EndMODULE" ) )
1371 wxString msg = wxString::Format(
_(
"Missing '$EndMODULE' for MODULE '%s'." ),
1379 std::unique_ptr<PAD>
pad = std::make_unique<PAD>( aFootprint );
1395 char mypadnumber[50];
1397 data = line +
SZ(
"Sh" ) + 1;
1400 data = data +
ReadDelimitedText( mypadnumber, data,
sizeof( mypadnumber ) ) + 1;
1405 unsigned char padchar = (
unsigned char) *data++;
1416 case 'C': padshape =
static_cast<int>( PAD_SHAPE::CIRCLE );
break;
1417 case 'R': padshape =
static_cast<int>( PAD_SHAPE::RECTANGLE );
break;
1418 case 'O': padshape =
static_cast<int>( PAD_SHAPE::OVAL );
break;
1419 case 'T': padshape =
static_cast<int>( PAD_SHAPE::TRAPEZOID );
break;
1421 m_error.Printf(
_(
"Unknown padshape '%c=0x%02x' on line: %d of footprint: '%s'." ),
1434 const unsigned char* cp = (
unsigned char*) mypadnumber;
1447 pad->SetNumber( padNumber );
1451 pad->SetOrientation( orient );
1457 BIU drill_y = drill_x;
1463 data = strtok_r( (
char*) data,
delims, &saveptr );
1467 if( data[0] ==
'O' )
1469 drShape = PAD_DRILL_SHAPE::OBLONG;
1471 data = strtok_r(
nullptr,
delims, &saveptr );
1474 data = strtok_r(
nullptr,
delims, &saveptr );
1479 pad->SetDrillShape( drShape );
1481 pad->SetDrillSize(
VECTOR2I( drill_x, drill_y ) );
1490 data = strtok_r( line +
SZ(
"At" ),
delims, &saveptr );
1492 if( !strcmp( data,
"SMD" ) )
1493 attribute = PAD_ATTRIB::SMD;
1494 else if( !strcmp( data,
"CONN" ) )
1495 attribute = PAD_ATTRIB::CONN;
1496 else if( !strcmp( data,
"HOLE" ) )
1497 attribute = PAD_ATTRIB::NPTH;
1499 attribute = PAD_ATTRIB::PTH;
1501 strtok_r(
nullptr,
delims, &saveptr );
1502 data = strtok_r(
nullptr,
delims, &saveptr );
1507 pad->SetAttribute( attribute );
1514 int netcode =
intParse( line +
SZ(
"Ne" ), &data );
1536 pad->SetFPRelativePosition( pos );
1541 pad->SetPadToDieLength( tmp );
1543 else if(
TESTLINE(
".SolderMask" ) )
1546 pad->SetLocalSolderMaskMargin( tmp );
1548 else if(
TESTLINE(
".SolderPasteRatio" ) )
1550 double tmp = atof( line +
SZ(
".SolderPasteRatio" ) );
1551 pad->SetLocalSolderPasteMarginRatio( tmp );
1553 else if(
TESTLINE(
".SolderPaste" ) )
1556 pad->SetLocalSolderPasteMargin( tmp );
1558 else if(
TESTLINE(
".LocalClearance" ) )
1561 pad->SetLocalClearance( tmp );
1563 else if(
TESTLINE(
".ZoneConnection" ) )
1565 int tmp =
intParse( line +
SZ(
".ZoneConnection" ) );
1568 else if(
TESTLINE(
".ThermalWidth" ) )
1571 pad->SetThermalSpokeWidth( tmp );
1573 else if(
TESTLINE(
".ThermalGap" ) )
1576 pad->SetThermalGap( tmp );
1580 if(
pad->GetSizeX() > 0 &&
pad->GetSizeY() > 0 )
1582 aFootprint->
Add(
pad.release() );
1586 wxLogError(
_(
"Invalid zero-sized pad ignored in\nfile: %s" ),
1605 case 'S': shape = SHAPE_T::SEGMENT;
break;
1606 case 'C': shape = SHAPE_T::CIRCLE;
break;
1607 case 'A': shape = SHAPE_T::ARC;
break;
1608 case 'P': shape = SHAPE_T::POLY;
break;
1610 m_error.Printf(
_(
"Unknown PCB_SHAPE type:'%c=0x%02x' on line %d of footprint '%s'." ),
1616 std::unique_ptr<PCB_SHAPE> dwg = std::make_unique<PCB_SHAPE>( aFootprint, shape );
1637 dwg->SetCenter(
VECTOR2I( center0_x, center0_y ) );
1638 dwg->SetStart(
VECTOR2I( start0_x, start0_y ) );
1639 dwg->SetArcAngleAndEnd( angle,
true );
1643 case SHAPE_T::SEGMENT:
1644 case SHAPE_T::CIRCLE:
1655 dwg->SetStart(
VECTOR2I( start0_x, start0_y ) );
1656 dwg->SetEnd(
VECTOR2I( end0_x, end0_y ) );
1667 int ptCount =
intParse( data, &data );
1672 dwg->SetStart(
VECTOR2I( start0_x, start0_y ) );
1673 dwg->SetEnd(
VECTOR2I( end0_x, end0_y ) );
1675 std::vector<VECTOR2I> pts;
1676 pts.reserve( ptCount );
1678 for(
int ii = 0; ii < ptCount; ++ii )
1695 pts.emplace_back( x, y );
1698 dwg->SetPolyPoints( pts );
1713 dwg->SetStroke(
STROKE_PARAMS( width, LINE_STYLE::SOLID ) );
1718 aFootprint->
Add( dwg.release() );
1725 const char* txt_end;
1733 int type =
intParse( line+1, &data );
1748 m_field.Replace( wxT(
"%V" ), wxT(
"${VALUE}" ) );
1749 m_field.Replace( wxT(
"%R" ), wxT(
"${REFERENCE}" ) );
1756 char* mirror = strtok_r( (
char*) data,
delims, (
char**) &data );
1757 char* hide = strtok_r(
nullptr,
delims, (
char**) &data );
1758 char* tmp = strtok_r(
nullptr,
delims, (
char**) &data );
1762 char* italic = strtok_r(
nullptr,
delims, (
char**) &data );
1764 char* hjust = strtok_r( (
char*) txt_end,
delims, (
char**) &data );
1765 char* vjust = strtok_r(
nullptr,
delims, (
char**) &data );
1779 aText->
SetVisible( !(hide && *hide ==
'I') );
1781 aText->
SetItalic( italic && *italic ==
'I' );
1834 else if(
TESTLINE(
"$EndSHAPE3D" ) )
1836 aFootprint->
Models().push_back( t3D );
1854 std::unique_ptr<PCB_SHAPE> dseg = std::make_unique<PCB_SHAPE>(
m_board );
1865 int shape =
intParse( line +
SZ(
"Po" ), &data );
1875 dseg->SetShape(
static_cast<SHAPE_T>( shape ) );
1876 dseg->SetFilled(
false );
1877 dseg->SetStroke(
STROKE_PARAMS( width, LINE_STYLE::SOLID ) );
1879 if( dseg->GetShape() == SHAPE_T::ARC )
1881 dseg->SetCenter(
VECTOR2I( start_x, start_y ) );
1882 dseg->SetStart(
VECTOR2I( end_x, end_y ) );
1886 dseg->SetStart(
VECTOR2I( start_x, start_y ) );
1887 dseg->SetEnd(
VECTOR2I( end_x, end_y ) );
1895 data = strtok_r( line +
SZ(
"De" ),
delims, &saveptr );
1897 for(
int i = 0; data; ++i, data = strtok_r(
nullptr,
delims, &saveptr ) )
1920 if( dseg->GetShape() == SHAPE_T::ARC )
1921 dseg->SetArcAngleAndEnd( angle );
1926 const_cast<KIID&
>( dseg->m_Uuid ) =
KIID( data );
1940 dseg->SetBezierC1(
VECTOR2I( x, y ) );
1947 dseg->SetBezierC2(
VECTOR2I( x, y ) );
1955 else if(
TESTLINE(
"$EndDRAWSEGMENT" ) )
1957 m_board->
Add( dseg.release(), ADD_MODE::APPEND );
1988 netCode =
intParse( line +
SZ(
"Na" ), &data );
1992 if( net ==
nullptr )
1999 THROW_IO_ERROR( wxT(
"Two net definitions in '$EQUIPOT' block" ) );
2002 else if(
TESTLINE(
"$EndEQUIPOT" ) )
2098 int layer_num =
intParse( line +
SZ(
"De" ), &data );
2099 int notMirrored =
intParse( data, &data );
2100 char* uuid = strtok_r( (
char*) data,
delims, (
char**) &data );
2101 char* style = strtok_r(
nullptr,
delims, (
char**) &data );
2102 char* hJustify = strtok_r(
nullptr,
delims, (
char**) &data );
2103 char* vJustify = strtok_r(
nullptr,
delims, (
char**) &data );
2107 pcbtxt->
SetItalic( !strcmp( style,
"Italic" ) );
2133 else if(
TESTLINE(
"$EndTEXTPCB" ) )
2157 if( line[0] ==
'$' )
2170 data = strtok_r( (
char*) data,
delims, (
char**) &data );
2200 int layer_num =
intParse( line +
SZ(
"De" ), &data );
2201 int type =
intParse( data, &data );
2202 int net_code =
intParse( data, &data );
2203 char* uuid = strtok_r( (
char*) data,
delims, (
char**) &data );
2206 intParse( data, (
const char**) &data );
2218 wxFAIL_MSG( wxT(
"Segment type unknown" ) );
2240 via->SetViaType( viatype );
2243 via->SetDrillDefault();
2245 via->SetDrill( drill );
2247 if(
via->GetViaType() == VIATYPE::THROUGH )
2259 via->SetLayerPair( front, back );
2306 std::shared_ptr<NETCLASS> nc = std::make_shared<NETCLASS>( wxEmptyString );
2318 std::make_unique<EDA_COMBINED_MATCHER>( netname,
CTX_NETCLASS ),
2325 nc->SetClearance( tmp );
2327 else if(
TESTLINE(
"TrackWidth" ) )
2330 nc->SetTrackWidth( tmp );
2335 nc->SetViaDiameter( tmp );
2340 nc->SetViaDrill( tmp );
2345 nc->SetuViaDiameter( tmp );
2350 nc->SetuViaDrill( tmp );
2362 else if(
TESTLINE(
"$EndNCLASS" ) )
2371 m_error.Printf(
_(
"Duplicate NETCLASS name '%s'." ), nc->GetName() );
2389 std::unique_ptr<ZONE> zc = std::make_unique<ZONE>(
m_board );
2392 bool endContour =
false;
2416 zc->AppendCorner(
VECTOR2I( x, y ), holeIndex );
2426 char* uuid = strtok_r( (
char*) line +
SZ(
"ZInfo" ),
delims, (
char**) &data );
2427 int netcode =
intParse( data, &data );
2432 const_cast<KIID&
>( zc->m_Uuid ) =
KIID( uuid );
2437 zc->BOARD_CONNECTED_ITEM::SetNetCode(
getNetCode( netcode ) );
2441 int layer_num =
intParse( line +
SZ(
"ZLayer" ) );
2448 char* hopt = strtok_r( (
char*) data,
delims, (
char**) &data );
2452 m_error.Printf(
_(
"Bad ZAux for CZONE_CONTAINER \"%s\"" ),
2453 zc->GetNetname().GetData() );
2459 case 'N': outline_hatch = ZONE_BORDER_DISPLAY_STYLE::NO_HATCH;
break;
2460 case 'E': outline_hatch = ZONE_BORDER_DISPLAY_STYLE::DIAGONAL_EDGE;
break;
2461 case 'F': outline_hatch = ZONE_BORDER_DISPLAY_STYLE::DIAGONAL_FULL;
break;
2463 m_error.Printf(
_(
"Bad ZAux for CZONE_CONTAINER \"%s\"" ),
2464 zc->GetNetname().GetData() );
2470 else if(
TESTLINE(
"ZSmoothing" ) )
2473 int smoothing =
intParse( line +
SZ(
"ZSmoothing" ), &data );
2478 m_error.Printf(
_(
"Bad ZSmoothing for CZONE_CONTAINER \"%s\"" ),
2479 zc->GetNetname().GetData() );
2483 zc->SetCornerSmoothingType( smoothing );
2484 zc->SetCornerRadius( cornerRadius );
2489 zc->SetIsRuleArea(
true );
2490 zc->SetDoNotAllowPads(
false );
2491 zc->SetDoNotAllowFootprints(
false );
2494 token = strtok_r( line +
SZ(
"ZKeepout" ),
delims, (
char**) &data );
2498 if( !strcmp( token,
"tracks" ) )
2500 token = strtok_r(
nullptr,
delims, (
char**) &data );
2501 zc->SetDoNotAllowTracks( token && *token ==
'N' );
2503 else if( !strcmp( token,
"vias" ) )
2505 token = strtok_r(
nullptr,
delims, (
char**) &data );
2506 zc->SetDoNotAllowVias( token && *token ==
'N' );
2508 else if( !strcmp( token,
"copperpour" ) )
2510 token = strtok_r(
nullptr,
delims, (
char**) &data );
2511 zc->SetDoNotAllowCopperPour( token && *token ==
'N' );
2514 token = strtok_r(
nullptr,
delims, (
char**) &data );
2520 int fillmode =
intParse( line +
SZ(
"ZOptions" ), &data );
2522 char fillstate = data[1];
2523 BIU thermalReliefGap =
biuParse( data += 2 , &data );
2530 wxLogWarning(
_(
"The legacy segment zone fill mode is no longer supported.\n"
2531 "Zone fills will be converted on a best-effort basis." ) );
2537 zc->SetFillMode( ZONE_FILL_MODE::POLYGONS );
2538 zc->SetIsFilled( fillstate ==
'S' );
2539 zc->SetThermalReliefGap( thermalReliefGap );
2540 zc->SetThermalReliefSpokeWidth( thermalReliefCopperBridge );
2542 else if(
TESTLINE(
"ZClearance" ) )
2545 BIU clearance =
biuParse( line +
SZ(
"ZClearance" ), &data );
2546 char* padoption = strtok_r( (
char*) data,
delims, (
char**) &data );
2549 switch( *padoption )
2551 case 'I': popt = ZONE_CONNECTION::FULL;
break;
2552 case 'T': popt = ZONE_CONNECTION::THERMAL;
break;
2553 case 'H': popt = ZONE_CONNECTION::THT_THERMAL;
break;
2554 case 'X': popt = ZONE_CONNECTION::NONE;
break;
2556 m_error.Printf(
_(
"Bad ZClearance padoption for CZONE_CONTAINER \"%s\"" ),
2557 zc->GetNetname().GetData() );
2561 zc->SetLocalClearance( clearance );
2562 zc->SetPadConnection( popt );
2564 else if(
TESTLINE(
"ZMinThickness" ) )
2567 zc->SetMinThickness( thickness );
2571 int priority =
intParse( line +
SZ(
"ZPriority" ) );
2572 zc->SetAssignedPriority( priority );
2574 else if(
TESTLINE(
"$POLYSCORNERS" ) )
2579 bool makeNewOutline =
true;
2583 if(
TESTLINE(
"$endPOLYSCORNERS" ) )
2590 if( makeNewOutline )
2593 polysList.
Append( x, y );
2596 bool end_contour =
intParse( data, &data );
2599 makeNewOutline = end_contour;
2602 zc->SetFilledPolysList( zc->GetFirstLayer(), polysList );
2604 else if(
TESTLINE(
"$FILLSEGMENTS" ) )
2608 if(
TESTLINE(
"$endFILLSEGMENTS" ) )
2618 else if(
TESTLINE(
"$endCZONE_OUTLINE" ) )
2622 if( zc->GetIsRuleArea() )
2625 if( zc->GetMinThickness() > 0 )
2632 CORNER_STRATEGY::ROUND_ALL_CORNERS,
2636 zc->SetFilledPolysList( layer, inflatedFill );
2642 if( zc->GetNumCorners() > 2 )
2644 if( !zc->IsOnCopperLayer() )
2646 zc->SetFillMode( ZONE_FILL_MODE::POLYGONS );
2667 std::unique_ptr<PCB_DIM_ALIGNED> dim = std::make_unique<PCB_DIM_ALIGNED>(
m_board,
2680 dim->UpdateHeight( crossBarF, crossBarO );
2682 m_board->
Add( dim.release(), ADD_MODE::APPEND );
2695 int shape =
intParse( line +
SZ(
"De" ), (
const char**) &data );
2696 int layer_num =
intParse( data, &data );
2697 char* uuid = strtok_r( (
char*) data,
delims, (
char**) &data );
2700 const_cast<KIID&
>( dim->m_Uuid ) =
KIID( uuid );
2710 dim->SetOverrideText(
From_UTF8( buf ) );
2711 dim->SetOverrideTextEnabled(
true );
2712 dim->SetUnitsFormat( DIM_UNITS_FORMAT::NO_SUFFIX );
2713 dim->SetAutoUnits();
2723 char* mirror = strtok_r( (
char*) data,
delims, (
char**) &data );
2725 dim->SetTextPos(
VECTOR2I( pos_x, pos_y ) );
2726 dim->SetTextSize(
VECTOR2I( width, height ) );
2727 dim->SetMirrored( mirror && *mirror ==
'0' );
2728 dim->SetTextThickness( thickn );
2729 dim->SetTextAngle( orient );
2740 dim->SetLineThickness( width );
2741 crossBarO =
VECTOR2I( crossBarOx, crossBarOy );
2742 crossBarF =
VECTOR2I( crossBarFx, crossBarFy );
2753 dim->SetStart(
VECTOR2I( featureLineDOx, featureLineDOy ) );
2764 dim->SetEnd(
VECTOR2I( featureLineGOx, featureLineGOy ) );
2818 int shape =
intParse( line +
SZ(
"Po" ), &data );
2819 int layer_num =
intParse( data, &data );
2824 char* uuid = strtok_r( (
char*) data,
delims, (
char**) &data );
2832 VECTOR2I( pos_x, pos_y ), size, width );
2849 double fval = strtod( aValue, &nptr );
2853 m_error.Printf(
_(
"Invalid floating point number in file: '%s'\nline: %d, offset: %d" ),
2861 if( aValue == nptr )
2863 m_error.Printf(
_(
"Missing floating point number in file: '%s'\nline: %d, offset: %d" ),
2888 double fval = strtod( aValue, &nptr );
2892 m_error.Printf(
_(
"Invalid floating point number in file: '%s'\nline: %d, offset: %d" ),
2900 if( aValue == nptr )
2902 m_error.Printf(
_(
"Missing floating point number in file: '%s'\nline: %d, offset: %d" ),
2980 static long long GetTimestamp(
const wxString& aLibPath );
2996 m_lib_path( aLibraryPath ),
2998 m_cache_dirty( true ),
2999 m_cache_timestamp( 0 )
3014 return wxFileName( aLibPath ).GetModificationTime().GetValue().GetValue();
3043 if( !
TESTLINE(
"PCBNEW-LibModule-V1" ) )
3046 while( ( line = aReader->
ReadLine() ) !=
nullptr )
3050 const char* units = strtok_r( line +
SZ(
"Units" ),
delims, &data );
3052 if( !strcmp( units,
"mm" ) )
3070 char* line = aReader->
Line();
3078 while( ( line = aReader->
ReadLine() ) !=
nullptr )
3091 }
while( ( line = aReader->
ReadLine() ) !=
nullptr );
3099 char* line = aReader->
Line();
3106 std::unique_ptr<FOOTPRINT> fp_ptr = std::make_unique<FOOTPRINT>(
m_owner->
m_board );
3108 std::string footprintName =
StrPurge( line +
SZ(
"$MODULE" ) );
3115 fp_ptr->SetFPID(
LIB_ID( wxEmptyString, footprintName ) );
3137 FOOTPRINT_MAP::const_iterator it =
m_footprints.find( footprintName );
3143 wxFAIL_MSG( wxT(
"error doing cache insert using guaranteed unique name" ) );
3150 bool nameOK =
false;
3156 std::string newName = footprintName;
3159 snprintf( buf,
sizeof(buf),
"%d", version++ );
3172 wxFAIL_MSG( wxT(
"error doing cache insert using guaranteed unique "
3180 }
while( ( line = aReader->
ReadLine() ) !=
nullptr );
3208 init( aProperties );
3216 errorMsg = ioe.
What();
3223 aFootprintNames.Add(
From_UTF8( footprint.first.c_str() ) );
3225 if( !errorMsg.IsEmpty() && !aBestEfforts )
3231 const wxString& aFootprintName,
bool aKeepUUID,
3236 init( aProperties );
3241 FOOTPRINT_MAP::const_iterator it = footprints.find(
TO_UTF8( aFootprintName ) );
3243 if( it == footprints.end() )
3250 copy->SetParent(
nullptr );
3258 wxFileName fn = aLibraryPath;
3260 if( !fn.FileExists() )
3265 if( wxRemove( aLibraryPath ) )
3267 THROW_IO_ERROR( wxString::Format(
_(
"Footprint library '%s' cannot be deleted." ),
3268 aLibraryPath.GetData() ) );
3299 m_progressReporter( nullptr ),
3300 m_lastProgressLine( 0 ),
3302 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.
BASE_SET & set(size_t pos=std::numeric_limits< size_t >::max(), bool value=true)
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.
std::optional< bool > GetLegacyPlotViaOnMaskLayer() const
void Parse(PCB_PLOT_PARAMS_PARSER *aParser)
void SetEnd(const VECTOR2I &aEnd)
void SetPosition(const VECTOR2I &aPos) override
virtual void SetWidth(int aWidth)
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_DRILL_SHAPE
The set of pad drill shapes, used with PAD::{Set,Get}DrillShape()
PAD_ATTRIB
The set of pad shapes, used with PAD::{Set,Get}Attribute().
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, bool aQuiet=false)
Round a floating point number to an integer using "round halfway cases away from zero".
VECTOR2< int32_t > VECTOR2I
ZONE_BORDER_DISPLAY_STYLE
Zone border styles.
ZONE_CONNECTION
How pads are covered by copper in zone.