26#include <wx/mstream.h>
34#include <fmt/format.h>
73 aFormatter->
Print(
"(stackup" );
82 layer_name.Printf( wxT(
"dielectric %d" ), item->GetDielectricLayerId() );
84 layer_name =
LSET::Name( item->GetBrdLayerId() );
86 aFormatter->
Print(
"(layer %s (type %s)", aFormatter->
Quotew( layer_name ).c_str(),
87 aFormatter->
Quotew( item->GetTypeName() ).c_str() );
90 for(
int idx = 0; idx < item->GetSublayersCount(); idx++ )
93 aFormatter->
Print(
" addsublayer" );
95 if( item->IsColorEditable() &&
IsPrmSpecified( item->GetColor( idx ) ) )
97 aFormatter->
Print(
"(color %s)", aFormatter->
Quotew( item->GetColor( idx ) ).c_str() );
100 if( item->IsThicknessEditable() )
107 aFormatter->
Print(
" locked" );
109 aFormatter->
Print(
")" );
112 if( item->HasMaterialValue( idx ) )
114 aFormatter->
Print(
"(material %s)", aFormatter->
Quotew( item->GetMaterial( idx ) ).c_str() );
117 if( item->HasEpsilonRValue() && item->HasMaterialValue( idx ) )
120 if( item->HasLossTangentValue() && item->HasMaterialValue( idx ) )
126 aFormatter->
Print(
")" );
143 aFormatter->
Print(
")" );
162 if(
m_board->GetAreFontsEmbedded() )
165 m_board->GetEmbeddedFiles()->ClearEmbeddedFonts();
169 m_out->Print(
"(kicad_pcb (version %d) (generator \"pcbnew\") (generator_version %s)",
182 switch( aItem->
Type() )
226 default: wxFAIL_MSG( wxT(
"Cannot format item " ) + aItem->
GetClass() );
258 m_out->Print(
"(layer %s %s)",
m_out->Quotew(
LSET::Name( aLayer ) ).c_str(), aIsKnockout ?
"knockout" :
"" );
264 m_out->Print(
"(pts" );
266 for(
int ii = 0; ii < aOutline.
PointCount(); ++ii )
297 std::vector<std::unique_ptr<KIFONT::GLYPH>>* cache = aText->
GetRenderCache( aText->
GetFont(), resolvedText );
299 m_out->Print(
"(render_cache %s %s",
m_out->Quotew( resolvedText ).c_str(),
308 m_out->Print(
"(polygon" );
314 callback_gal.DrawGlyphs( *cache );
323 m_out->Print(
"(setup" );
345 m_out->Print(
"(pad_to_paste_clearance_ratio %s)",
352 m_out->Print( 0,
" (tenting " );
355 m_out->Print( 0,
")" );
357 m_out->Print( 0,
" (covering " );
360 m_out->Print( 0,
")" );
362 m_out->Print( 0,
" (plugging " );
365 m_out->Print( 0,
")" );
373 m_out->Print( 0,
" (zone_defaults" );
376 format( properties, 0, layer );
378 m_out->Print( 0,
")\n" );
407 m_out->Print(
"(general" );
422 m_out->Print(
"(layers" );
432 :
m_out->Quotew(
m_board->GetLayerName( layer ) ).c_str() );
440 bool print_type =
false;
454 print_type ? LAYER::ShowType( aBoard->
GetLayerType( layer ) ) :
"user",
457 :
m_out->Quotew(
m_board->GetLayerName( layer ) ).c_str() );
466 for(
const std::pair<const wxString, wxString>& prop : aBoard->
GetProperties() )
468 m_out->Print(
"(property %s %s)",
m_out->Quotew( prop.first ).c_str(),
m_out->Quotew( prop.second ).c_str() );
477 if( variantNames.empty() )
480 m_out->Print(
"(variants" );
482 for(
const wxString& variantName : variantNames )
484 m_out->Print(
"(variant (name %s)",
m_out->Quotew( variantName ).c_str() );
488 if( !description.IsEmpty() )
489 m_out->Print(
"(description %s)",
m_out->Quotew( description ).c_str() );
531 m_out->Print(
"(teardrops (best_length_ratio %s) (max_length %s) (best_width_ratio %s) "
551 std::set<BOARD_ITEM*, BOARD_ITEM::ptr_cmp> sorted_footprints( aBoard->
Footprints().begin(),
553 std::set<BOARD_ITEM*, BOARD::cmp_drawings> sorted_drawings( aBoard->
Drawings().begin(), aBoard->
Drawings().end() );
554 std::set<PCB_TRACK*, PCB_TRACK::cmp_tracks> sorted_tracks( aBoard->
Tracks().begin(), aBoard->
Tracks().end() );
555 std::set<PCB_POINT*, PCB_POINT::cmp_points> sorted_points( aBoard->
Points().begin(), aBoard->
Points().end() );
556 std::set<BOARD_ITEM*, BOARD_ITEM::ptr_cmp> sorted_zones( aBoard->
Zones().begin(), aBoard->
Zones().end() );
557 std::set<BOARD_ITEM*, BOARD_ITEM::ptr_cmp> sorted_groups( aBoard->
Groups().begin(), aBoard->
Groups().end() );
558 std::set<BOARD_ITEM*, BOARD_ITEM::ptr_cmp> sorted_generators( aBoard->
Generators().begin(),
563 for(
BOARD_ITEM* footprint : sorted_footprints )
581 for(
auto zone : sorted_zones )
598 files_to_write.
AddFile( file.second );
605 files_to_write.
AddFile( file.second );
610 if( !files_to_write.
IsEmpty() )
626 m_out->Print(
"(dimension" );
630 m_out->Print(
"(type orthogonal)" );
632 m_out->Print(
"(type aligned)" );
634 m_out->Print(
"(type leader)" );
636 m_out->Print(
"(type center)" );
638 m_out->Print(
"(type radial)" );
640 wxFAIL_MSG( wxT(
"Cannot format unknown dimension type!" ) );
663 m_out->Print(
"(orientation %d)",
static_cast<int>(
ortho->GetOrientation() ) );
667 m_out->Print(
"(format (prefix %s) (suffix %s) (units %d) (units_format %d) (precision %d)",
684 m_out->Print(
"(style (thickness %s) (arrow_length %s) (text_position_mode %d)",
689 if(
ortho || aligned )
695 m_out->Print(
"(arrow_direction inward)" );
728 std::string prefix = parentFP ?
"fp" :
"gr";
733 m_out->Print(
"(%s_line (start %s) (end %s)", prefix.c_str(),
739 m_out->Print(
"(%s_rect (start %s) (end %s)", prefix.c_str(),
748 m_out->Print(
"(%s_circle (center %s) (end %s)", prefix.c_str(),
754 m_out->Print(
"(%s_arc (start %s) (mid %s) (end %s)", prefix.c_str(),
766 m_out->Print(
"(%s_poly", prefix.c_str() );
777 m_out->Print(
"(%s_curve (pts (xy %s) (xy %s) (xy %s) (xy %s))", prefix.c_str(),
818 m_out->Print(
"(solder_mask_margin %s)",
832 wxCHECK_RET( aBitmap !=
nullptr &&
m_out !=
nullptr,
"" );
838 wxCHECK_RET(
image !=
nullptr,
"wxImage* is NULL" );
846 m_out->Print(
"%s", fmt::format(
"(scale {:g})", refImage.
GetImageScale() ).c_str() );
851 wxMemoryOutputStream ostream;
875 m_out->Print(
"(target %s (at %s) (size %s)", ( aTarget->
GetShape() ) ?
"x" :
"plus",
894 if( initial_comments )
896 for(
unsigned i = 0; i < initial_comments->GetCount(); ++i )
897 m_out->Print(
"%s\n",
TO_UTF8( ( *initial_comments )[i] ) );
907 m_out->Print(
"(footprint %s",
947 m_out->Print(
"(property %s %s",
m_out->Quotew( field->GetUntranslatedName() ).c_str(),
948 m_out->Quotew( field->GetText() ).c_str() );
957 if( !compClass->IsEmpty() )
959 m_out->Print(
"(component_classes" );
962 m_out->Print(
"(class %s)",
m_out->Quotew( constituent->GetName() ).c_str() );
970 m_out->Print(
"(property ki_fp_filters %s)",
m_out->Quotew( aFootprint->
GetFilters() ).c_str() );
985 m_out->Print(
"(units" );
989 m_out->Print(
"(unit (name %s)",
m_out->Quotew( u.m_unitName ).c_str() );
990 m_out->Print(
"(pins" );
992 for(
const wxString& n : u.m_pins )
993 m_out->Print(
" %s",
m_out->Quotew( n ).c_str() );
1004 m_out->Print(
"(solder_mask_margin %s)",
1010 m_out->Print(
"(solder_paste_margin %s)",
1016 m_out->Print(
"(solder_paste_margin_ratio %s)",
1033 m_out->Print(
"(attr" );
1036 m_out->Print(
" smd" );
1039 m_out->Print(
" through_hole" );
1042 m_out->Print(
" board_only" );
1045 m_out->Print(
" exclude_from_pos_files" );
1048 m_out->Print(
" exclude_from_bom" );
1051 m_out->Print(
" allow_missing_courtyard" );
1054 m_out->Print(
" dnp" );
1057 m_out->Print(
" allow_soldermask_bridges" );
1059 m_out->Print(
")" );
1065 m_out->Print(
"(stackup" );
1070 wxString canonicalName(
LSET::Name( layer ) );
1071 m_out->Print(
"(layer %s)",
m_out->Quotew( canonicalName ).c_str() );
1074 m_out->Print(
")" );
1079 m_out->Print(
"(private_layers" );
1083 wxString canonicalName(
LSET::Name( layer ) );
1084 m_out->Print(
" %s",
m_out->Quotew( canonicalName ).c_str() );
1087 m_out->Print(
")" );
1092 m_out->Print(
"(net_tie_pad_groups" );
1097 m_out->Print(
")" );
1107 m_out->Print(
"(jumper_pad_groups" );
1111 m_out->Print(
"(" );
1113 for(
const wxString& padName :
group.GetNames() )
1114 m_out->Print(
"%s ",
m_out->Quotew( padName ).c_str() );
1116 m_out->Print(
")" );
1119 m_out->Print(
")" );
1125 std::set<PAD*, FOOTPRINT::cmp_pads> sorted_pads( aFootprint->
Pads().begin(), aFootprint->
Pads().end() );
1126 std::set<BOARD_ITEM*, KICAD_FORMAT::LEGACY::FP_DRAWING_ORDER_V10> sorted_drawings(
1128 std::set<PCB_POINT*, PCB_POINT::cmp_points> sorted_points( aFootprint->
Points().begin(),
1129 aFootprint->
Points().end() );
1130 std::set<ZONE*, FOOTPRINT::cmp_zones> sorted_zones( aFootprint->
Zones().begin(), aFootprint->
Zones().end() );
1131 std::set<BOARD_ITEM*, PCB_GROUP::ptr_cmp> sorted_groups( aFootprint->
Groups().begin(), aFootprint->
Groups().end() );
1142 for(
PAD*
pad : sorted_pads )
1154 const bool baseDnp = aFootprint->
IsDNP();
1158 for(
const auto& [variantName, variant] : aFootprint->
GetVariants() )
1160 m_out->Print(
"(variant (name %s)",
m_out->Quotew( variantName ).c_str() );
1162 if( variant.GetDNP() != baseDnp )
1165 if( variant.GetExcludedFromBOM() != baseExcludedFromBOM )
1168 if( variant.GetExcludedFromPosFiles() != baseExcludedFromPosFiles )
1173 for(
const auto& [fieldName, fieldValue] : variant.GetFields() )
1176 const wxString baseValue = baseField ? baseField->
GetText() : wxString();
1178 if( fieldValue == baseValue )
1181 m_out->Print(
"(field (name %s) (value %s))",
m_out->Quotew( fieldName ).c_str(),
1182 m_out->Quotew( fieldValue ).c_str() );
1185 m_out->Print(
")" );
1194 auto bs3D = aFootprint->
Models().begin();
1195 auto es3D = aFootprint->
Models().end();
1197 while( bs3D != es3D )
1199 if( !bs3D->m_Filename.IsEmpty() )
1201 m_out->Print(
"(model %s",
m_out->Quotew( bs3D->m_Filename ).c_str() );
1206 if( bs3D->m_Opacity != 1.0 )
1207 m_out->Print(
"%s", fmt::format(
"(opacity {:.4f})", bs3D->m_Opacity ).c_str() );
1219 m_out->Print(
")" );
1225 m_out->Print(
")" );
1244 if( !aEnumerateLayers )
1247 if( ( aLayerMask & cu_board_mask ) == cu_board_mask )
1249 output +=
' ' +
m_out->Quotew(
"*.Cu" );
1254 aLayerMask &= ~cu_all;
1256 else if( ( aLayerMask & cu_board_mask ) == fr_bk )
1259 output +=
' ' +
m_out->Quotew(
"F&B.Cu" );
1261 output +=
' ' +
m_out->Quotew(
"*.Cu" );
1263 aLayerMask &= ~fr_bk;
1266 if( ( aLayerMask & adhes ) == adhes )
1268 output +=
' ' +
m_out->Quotew(
"*.Adhes" );
1269 aLayerMask &= ~adhes;
1274 output +=
' ' +
m_out->Quotew(
"*.Paste" );
1278 if( ( aLayerMask & silks ) == silks )
1280 output +=
' ' +
m_out->Quotew(
"*.SilkS" );
1281 aLayerMask &= ~silks;
1284 if( ( aLayerMask & mask ) == mask )
1286 output +=
' ' +
m_out->Quotew(
"*.Mask" );
1287 aLayerMask &= ~mask;
1290 if( ( aLayerMask & crt_yd ) == crt_yd )
1292 output +=
' ' +
m_out->Quotew(
"*.CrtYd" );
1293 aLayerMask &= ~crt_yd;
1296 if( ( aLayerMask & fab ) == fab )
1298 output +=
' ' +
m_out->Quotew(
"*.Fab" );
1306 if( aLayerMask[layer] )
1310 m_out->Print(
"(layers %s)", output.c_str() );
1346 const char*
property =
nullptr;
1378 bool forceShapeOffsetOutput =
false;
1383 if( aPad->
GetOffset( layer ) != shapeoffset )
1384 forceShapeOffsetOutput =
true;
1387 if( drill.
x > 0 || drill.
y > 0 || shapeoffset.
x != 0 || shapeoffset.
y != 0 || forceShapeOffsetOutput )
1389 m_out->Print(
"(drill" );
1392 m_out->Print(
" oval" );
1397 if( drill.
y > 0 && drill.
x != drill.
y )
1404 if( shapeoffset.
x != 0 || shapeoffset.
y != 0 || forceShapeOffsetOutput )
1407 m_out->Print(
")" );
1412 m_out->Print(
"(backdrill (size %s) (layers %s %s))",
1420 m_out->Print(
"(tertiary_drill (size %s) (layers %s %s))",
1431 m_out->Print(
"(%s %s", aName,
1434 if( aProps.size > 0 )
1437 if( aProps.depth > 0 )
1440 if( aProps.angle > 0 )
1443 m_out->Print(
")" );
1451 m_out->Print(
"(property %s)", property );
1465 m_out->Print(
"(zone_layer_connections" );
1473 m_out->Print(
")" );
1478 auto formatCornerProperties = [&](
PCB_LAYER_ID aLayer )
1483 m_out->Print(
"(roundrect_rratio %s)",
1492 m_out->Print(
"(chamfer" );
1495 m_out->Print(
" top_left" );
1498 m_out->Print(
" top_right" );
1501 m_out->Print(
" bottom_left" );
1504 m_out->Print(
" bottom_right" );
1506 m_out->Print(
")" );
1512 formatCornerProperties(
F_Cu );
1541 m_out->Print(
"(solder_mask_margin %s)",
1547 m_out->Print(
"(solder_paste_margin %s)",
1553 m_out->Print(
"(solder_paste_margin_ratio %s)",
1569 m_out->Print(
"(thermal_bridge_width %s)",
1578 defaultThermalSpokeAngle =
ANGLE_45;
1583 m_out->Print(
"(thermal_bridge_angle %s)",
1604 m_out->Print(
"(primitives" );
1607 for(
const std::shared_ptr<PCB_SHAPE>& primitive : aPad->
GetPrimitives( aLayer ) )
1611 bool emitted =
true;
1613 switch( primitive->GetShape() )
1616 if( primitive->IsProxyItem() )
1618 m_out->Print(
"(gr_vector (start %s) (end %s)",
1630 if( primitive->IsProxyItem() )
1640 if( primitive->GetCornerRadius() > 0 )
1648 m_out->Print(
"(gr_arc (start %s) (mid %s) (end %s)",
1660 m_out->Print(
"(gr_curve (pts (xy %s) (xy %s) (xy %s) (xy %s))",
1668 if( !primitive->IsPolyShapeValid() )
1677 m_out->Print(
"(gr_poly" );
1682 default: emitted =
false;
break;
1688 if( !primitive->IsProxyItem() )
1699 m_out->Print(
")" );
1702 m_out->Print(
")" );
1705 bool hasCustomLayer =
false;
1716 m_out->Print(
"(options" );
1719 m_out->Print(
"(clearance convexhull)" );
1721 m_out->Print(
"(clearance outline)" );
1724 m_out->Print(
"(anchor %s)", anchorShape(
F_Cu ) );
1726 m_out->Print(
")" );
1730 formatPrimitives(
F_Cu );
1739 m_out->Print( 0,
" (tenting " );
1742 m_out->Print( 0,
")" );
1751 m_out->Print(
"(shape %s)", shapeName( aLayer ) );
1759 shapeoffset = aPad->
GetOffset( aLayer );
1761 if( shapeoffset.
x != 0 || shapeoffset.
y != 0 )
1764 formatCornerProperties( aLayer );
1768 m_out->Print(
"(options" );
1771 m_out->Print(
"(clearance convexhull)" );
1773 m_out->Print(
"(clearance outline)" );
1776 m_out->Print(
"(anchor %s)", anchorShape( aLayer ) );
1778 m_out->Print(
")" );
1781 formatPrimitives( aLayer );
1795 if( layerSpokeAngle != defaultLayerAngle )
1800 if( padstack.
ThermalGap( aLayer ).has_value() )
1807 m_out->Print(
"(thermal_bridge_width %s)",
1811 if( padstack.
Clearance( aLayer ).has_value() )
1818 m_out->Print(
"(zone_connect %d)",
static_cast<int>( *padstack.
ZoneConnection( aLayer ) ) );
1827 m_out->Print(
"(padstack (mode front_inner_back)" );
1829 m_out->Print(
"(layer \"Inner\"" );
1831 m_out->Print(
")" );
1832 m_out->Print(
"(layer \"B.Cu\"" );
1833 formatPadLayer(
B_Cu );
1834 m_out->Print(
")" );
1838 m_out->Print(
"(padstack (mode custom)" );
1848 formatPadLayer( layer );
1849 m_out->Print(
")" );
1853 m_out->Print(
")" );
1856 m_out->Print(
")" );
1862 wxCHECK_RET( aBarcode !=
nullptr &&
m_out !=
nullptr,
"" );
1864 m_out->Print(
"(barcode" );
1881 const char* typeStr =
"code39";
1892 m_out->Print(
"(type %s)", typeStr );
1896 const char* eccStr =
"L";
1905 m_out->Print(
"(ecc_level %s)", eccStr );
1919 m_out->Print(
")" );
1950 m_out->Print(
"(%s_text %s %s", prefix.c_str(), type.c_str(),
m_out->Quotew( aText->
GetText() ).c_str() );
1979 m_out->Print(
")" );
1987 m_out->Print(
"(%s %s",
1989 : parentFP ?
"fp_text_box"
2019 m_out->Print(
"(span %d %d)", cell->GetColSpan(), cell->GetRowSpan() );
2049 m_out->Print(
")" );
2055 wxCHECK_RET( aTable !=
nullptr &&
m_out !=
nullptr,
"" );
2066 m_out->Print(
"(border" );
2073 m_out->Print(
")" );
2075 m_out->Print(
"(separators" );
2082 m_out->Print(
")" );
2084 m_out->Print(
"(column_widths" );
2086 for(
int col = 0; col < aTable->
GetColCount(); ++col )
2089 m_out->Print(
")" );
2091 m_out->Print(
"(row_heights" );
2093 for(
int row = 0; row < aTable->
GetRowCount(); ++row )
2096 m_out->Print(
")" );
2098 m_out->Print(
"(cells" );
2103 m_out->Print(
")" );
2104 m_out->Print(
")" );
2110 wxArrayString memberIds;
2114 const auto& cache =
m_board->GetItemByIdCache();
2116 std::unordered_set<const EDA_ITEM*> validPtrs;
2118 for(
const auto& [uuid, item] : cache )
2119 validPtrs.insert( item );
2123 if( validPtrs.count( member ) )
2124 memberIds.Add( member->m_Uuid.AsString() );
2130 memberIds.Add( member->m_Uuid.AsString() );
2133 if( memberIds.empty() )
2148 m_out->Print(
"(members" );
2150 for(
const wxString& memberId : memberIds )
2151 m_out->Print(
" %s",
m_out->Quotew( memberId ).c_str() );
2153 m_out->Print(
")" );
2154 m_out->Print(
")" );
2166 m_out->Print(
"(generated" );
2179 if( value.CheckType<
double>() || value.CheckType<
int>() || value.CheckType<
long>()
2180 || value.CheckType<
long long>() )
2184 if( !value.GetAs( &val ) )
2187 std::string buf = fmt::format(
"{:.10g}", val );
2190 m_out->Print(
"(%s %s)", key.c_str(), buf.c_str() );
2192 else if( value.CheckType<
bool>() )
2195 value.GetAs( &val );
2199 else if( value.CheckType<
VECTOR2I>() )
2202 value.GetAs( &val );
2209 value.GetAs( &val );
2211 m_out->Print(
"(%s ", key.c_str() );
2213 m_out->Print(
")" );
2219 if( value.CheckType<wxString>() )
2221 value.GetAs( &val );
2223 else if( value.CheckType<std::string>() )
2226 value.GetAs( &str );
2228 val = wxString::FromUTF8( str );
2231 m_out->Print(
"(%s %s)", key.c_str(),
m_out->Quotew( val ).c_str() );
2235 wxArrayString memberIds;
2238 memberIds.Add( member->m_Uuid.AsString() );
2242 m_out->Print(
"(members" );
2244 for(
const wxString& memberId : memberIds )
2245 m_out->Print(
" %s",
m_out->Quotew( memberId ).c_str() );
2247 m_out->Print(
")" );
2248 m_out->Print(
")" );
2259 const BOARD* board =
via->GetBoard();
2261 wxCHECK_RET( board !=
nullptr, wxT(
"Via has no parent." ) );
2263 m_out->Print(
"(via" );
2265 via->LayerPair( &layer1, &layer2 );
2267 switch(
via->GetViaType() )
2278 default:
THROW_IO_ERROR( wxString::Format(
_(
"unknown via type %d" ),
via->GetViaType() ) );
2294 if(
via->Padstack().SecondaryDrill().size.x > 0 )
2296 m_out->Print(
"(backdrill (size %s) (layers %s %s))",
2302 if(
via->Padstack().TertiaryDrill().size.x > 0 )
2304 m_out->Print(
"(tertiary_drill (size %s) (layers %s %s))",
2315 m_out->Print(
"(%s %s", aName,
2318 if( aProps.size > 0 )
2321 if( aProps.depth > 0 )
2324 if( aProps.angle > 0 )
2327 m_out->Print(
")" );
2330 formatPostMachining(
"front_post_machining",
via->Padstack().FrontPostMachining() );
2331 formatPostMachining(
"back_post_machining",
via->Padstack().BackPostMachining() );
2336 switch(
via->Padstack().UnconnectedLayerMode() )
2355 if(
via->IsLocked() )
2358 if(
via->GetIsFree() )
2361 if(
via->GetRemoveUnconnected() )
2363 m_out->Print(
"(zone_layer_connections" );
2371 m_out->Print(
")" );
2379 m_out->Print( 0,
" (tenting " );
2382 m_out->Print( 0,
")" );
2391 m_out->Print( 0,
" (covering " );
2394 m_out->Print( 0,
")" );
2400 m_out->Print( 0,
" (plugging " );
2403 m_out->Print( 0,
")" );
2411 m_out->Print(
"(padstack" );
2415 m_out->Print(
"(mode front_inner_back)" );
2417 m_out->Print(
"(layer \"Inner\"" );
2419 m_out->Print(
")" );
2420 m_out->Print(
"(layer \"B.Cu\"" );
2422 m_out->Print(
")" );
2426 m_out->Print(
"(mode custom)" );
2435 m_out->Print(
")" );
2439 m_out->Print(
")" );
2451 m_out->Print(
"(arc (start %s) (mid %s) (end %s) (width %s)",
2474 m_out->Print(
"(solder_mask_margin %s)",
2482 m_out->Print(
")" );
2488 m_out->Print(
"(zone" );
2503 if( layers.count() > 1 )
2534 m_out->Print(
"(attr (teardrop (type %s)))",
2538 m_out->Print(
"(connect_pads" );
2555 m_out->Print(
")" );
2562 m_out->Print(
"(keepout (tracks %s) (vias %s) (pads %s) (copperpour %s) (footprints %s))",
2570 m_out->Print(
"(placement" );
2588 m_out->Print(
")" );
2591 m_out->Print(
"(fill" );
2595 m_out->Print(
" yes" );
2599 m_out->Print(
"(mode hatch)" );
2603 m_out->Print(
"(thermal_gap %s) (thermal_bridge_width %s)",
2617 THROW_IO_ERROR( wxString::Format(
_(
"unknown zone corner smoothing type %d" ),
2629 m_out->Print(
"(island_area_min %s)",
2635 m_out->Print(
"(hatch_thickness %s) (hatch_gap %s) (hatch_orientation %s)",
2646 m_out->Print(
"(hatch_border_algorithm %s) (hatch_min_hole_area %s)",
2651 m_out->Print(
")" );
2655 format( properties, 0, layer );
2666 m_out->Print(
"(polygon" );
2668 m_out->Print(
")" );
2677 for(
int ii = 0; ii < fv->OutlineCount(); ++ii )
2679 m_out->Print(
"(filled_polygon" );
2688 m_out->Print(
")" );
2692 m_out->Print(
")" );
2703 m_out->Print( aNestLevel,
"(property\n" );
2708 m_out->Print( aNestLevel,
"(hatch_position (xy %s))",
2712 m_out->Print( aNestLevel,
")\n" );
constexpr EDA_IU_SCALE pcbIUScale
bool IsPrmSpecified(const wxString &aPrmValue)
@ BS_ITEM_TYPE_DIELECTRIC
wxString GetMajorMinorVersion()
Get only the major and minor version in a string major.minor.
bool SaveImageData(wxOutputStream &aOutStream) const
Write the bitmap data to aOutStream.
wxString GetNetname() const
PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
TEARDROP_PARAMETERS & GetTeardropParams()
Container for design settings for a BOARD object.
std::map< PCB_LAYER_ID, ZONE_LAYER_PROPERTIES > m_ZoneLayerProperties
const VECTOR2I & GetGridOrigin() const
int GetBoardThickness() const
The full thickness of the board including copper and masks.
bool m_AllowSoldermaskBridgesInFPs
const VECTOR2I & GetAuxOrigin() const
int m_SolderMaskExpansion
BOARD_STACKUP & GetStackupDescriptor()
double m_SolderPasteMarginRatio
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
virtual bool IsKnockout() const
bool IsLocked() const override
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
FOOTPRINT * GetParentFootprint() const
VECTOR2I GetFPRelativePosition() const
Manage one layer needed to make a physical board.
Manage layers needed to make a physical board.
const std::vector< BOARD_STACKUP_ITEM * > & GetList() const
bool m_HasDielectricConstrains
True if some layers have impedance controlled tracks or have specific constrains for micro-wave appli...
bool m_EdgePlating
True if the edge board is plated.
BS_EDGE_CONNECTOR_CONSTRAINTS m_EdgeConnectorConstraints
If the board has edge connector cards, some constrains can be specified in job file: BS_EDGE_CONNECTO...
wxString m_FinishType
The name of external copper finish.
Information pertinent to a Pcbnew printed circuit board.
EMBEDDED_FILES * GetEmbeddedFiles() override
const std::vector< wxString > & GetVariantNames() const
const GENERATORS & Generators() const
const PCB_POINTS & Points() const
const PAGE_INFO & GetPageSettings() const
const ZONES & Zones() const
const GROUPS & Groups() const
The groups must maintain the following invariants.
LAYER_T GetLayerType(PCB_LAYER_ID aLayer) const
Return the type of the copper layer given by aLayer.
TITLE_BLOCK & GetTitleBlock()
int GetCopperLayerCount() const
const std::map< wxString, wxString > & GetProperties() const
const FOOTPRINTS & Footprints() const
const TRACKS & Tracks() const
wxString GetVariantDescription(const wxString &aVariantName) const
const PCB_PLOT_PARAMS & GetPlotOptions() const
bool LegacyTeardrops() const
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
const LSET & GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
const DRAWINGS & Drawings() const
A lightweight representation of a component class.
const std::vector< COMPONENT_CLASS * > & GetConstituentClasses() const
Fetches a vector of the constituent classes for this (effective) class.
const LIB_ID & GetDesignBlockLibId() const
std::unordered_set< EDA_ITEM * > & GetItems()
bool HasDesignBlockLink() const
A base class for most all the KiCad significant classes used in schematics and boards.
KICAD_T Type() const
Returns the type of object.
const VECTOR2I & GetBezierC2() const
FILL_T GetFillMode() const
SHAPE_POLY_SET & GetPolyShape()
const VECTOR2I & GetEnd() const
Return the ending point of the graphic.
const VECTOR2I & GetStart() const
Return the starting point of the graphic.
wxString SHAPE_T_asString() const
const VECTOR2I & GetBezierC1() const
int GetCornerRadius() const
bool IsPolyShapeValid() const
VECTOR2I GetArcMid() const
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
virtual const wxString & GetText() const
Return the string associated with the text object.
bool IsKeepUpright() const
virtual bool IsVisible() const
KIFONT::FONT * GetFont() const
std::vector< std::unique_ptr< KIFONT::GLYPH > > * GetRenderCache(const KIFONT::FONT *aFont, const wxString &forResolvedText, const VECTOR2I &aOffset={ 0, 0 }) const
virtual EDA_ANGLE GetDrawRotation() const
virtual wxString GetShownText(RESOLUTION_CONTEXT aContext, int aDepth=0) const
Return the string actually shown after processing of the base text.
virtual int GetTextThickness() const
void ClearEmbeddedFiles(bool aDeleteFiles=true)
void ClearEmbeddedFonts()
Remove all embedded fonts from the collection.
EMBEDDED_FILE * AddFile(const wxFileName &aName, bool aOverwrite)
Load a file from disk and adds it to the collection.
const std::map< wxString, std::shared_ptr< EMBEDDED_FILE > > & EmbeddedFileMap() const
Provide an iterable view of the file collection.
bool GetAreFontsEmbedded() const
Represents an (ordered) list of JUMPER_GROUP objects.
const std::vector< JUMPER_GROUP > & GetAll() const
Represents a group of jumper pins or pads, keyed by name.
virtual bool IsOutline() const
virtual void SetLineWidth(float aLineWidth)
Set the line width.
virtual wxString GetClass() const =0
Return the class name.
wxString AsString() const
const UTF8 & GetLibItemName() const
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
LSET is a set of PCB_LAYER_IDs.
static const LSET & AllCuMask()
return AllCuMask( MAX_CU_LAYERS );
LSEQ CuStack() const
Return a sequence of copper layers in starting from the front/top and extending to the back/bottom.
LSEQ TechAndUserUIOrder() const
Return the technical and user layers in the order shown in layer widget.
LSEQ Seq(const LSEQ &aSequence) const
Return an LSEQ from the union of this LSET and a desired sequence.
static LSET AllCuMask(int aCuLayerCount)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
static wxString Name(PCB_LAYER_ID aLayerId)
Return the fixed name association with aLayerId.
A PADSTACK defines the characteristics of a single or multi-layer pad, in the IPC sense of the word.
std::optional< int > & Clearance(PCB_LAYER_ID aLayer=F_Cu)
MASK_LAYER_PROPS & FrontOuterLayers()
void ForEachUniqueLayer(const std::function< void(PCB_LAYER_ID)> &aMethod) const
Runs the given callable for each active unique copper layer in this padstack, meaning F_Cu for MODE::...
std::optional< int > & ThermalSpokeWidth(PCB_LAYER_ID aLayer=F_Cu)
EDA_ANGLE ThermalSpokeAngle(PCB_LAYER_ID aLayer=F_Cu) const
POST_MACHINING_PROPS & FrontPostMachining()
std::optional< int > & ThermalGap(PCB_LAYER_ID aLayer=F_Cu)
DRILL_PROPS & TertiaryDrill()
const VECTOR2I & Size(PCB_LAYER_ID aLayer) const
@ NORMAL
Shape is the same on all layers.
@ FRONT_INNER_BACK
Up to three shapes can be defined (F_Cu, inner copper layers, B_Cu)
DRILL_PROPS & SecondaryDrill()
POST_MACHINING_PROPS & BackPostMachining()
MASK_LAYER_PROPS & BackOuterLayers()
static constexpr PCB_LAYER_ID INNER_LAYERS
! The layer identifier to use for "inner layers" on top/inner/bottom padstacks
std::optional< ZONE_CONNECTION > & ZoneConnection(PCB_LAYER_ID aLayer=F_Cu)
PAD_PROP GetProperty() const
bool GetRemoveUnconnected() const
LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
const std::vector< std::shared_ptr< PCB_SHAPE > > & GetPrimitives(PCB_LAYER_ID aLayer) const
Accessor to the basic shape list for custom-shaped pads.
const ZONE_LAYER_OVERRIDE & GetZoneLayerOverride(PCB_LAYER_ID aLayer) const
std::optional< double > GetLocalSolderPasteMarginRatio() const
const wxString & GetPinType() const
PAD_ATTRIB GetAttribute() const
const wxString & GetPinFunction() const
const wxString & GetNumber() const
const VECTOR2I & GetDelta(PCB_LAYER_ID aLayer) const
EDA_ANGLE GetThermalSpokeAngle() const
VECTOR2I GetOffset(PCB_LAYER_ID aLayer) const
VECTOR2I GetDrillSize() const
double GetRoundRectRadiusRatio(PCB_LAYER_ID aLayer) const
PAD_SHAPE GetShape(PCB_LAYER_ID aLayer) const
bool GetKeepTopBottom() const
VECTOR2I GetSize(PCB_LAYER_ID aLayer) const
int GetPadToDieDelay() const
std::optional< int > GetLocalClearance() const override
Return any local clearances set in the "classic" (ie: pre-rule) system.
const PADSTACK & Padstack() const
EDA_ANGLE GetOrientation() const
Return the rotation angle of the pad.
PAD_DRILL_SHAPE GetDrillShape() const
int GetChamferPositions(PCB_LAYER_ID aLayer) const
std::optional< int > GetLocalSolderPasteMargin() const
std::optional< int > GetLocalSolderMaskMargin() const
double GetChamferRectRatio(PCB_LAYER_ID aLayer) const
std::optional< int > GetLocalThermalSpokeWidthOverride() const
ZONE_CONNECTION GetLocalZoneConnection() const
CUSTOM_SHAPE_ZONE_MODE GetCustomShapeInZoneOpt() const
int GetLocalThermalGapOverride(wxString *aSource) const
PAD_SHAPE GetAnchorPadShape(PCB_LAYER_ID aLayer) const
int GetPadToDieLength() const
const VECTOR2I & GetMid() const
const VECTOR2I & GetMargin() const
Get the barcode margin (in internal units).
VECTOR2I GetPosition() const override
Get the position (center) of the barcode in internal units.
bool IsKnockout() const override
int GetHeight() const
Get the barcode height (in internal units).
BARCODE_ECC_T GetErrorCorrection() const
EDA_ANGLE GetAngle() const
BARCODE_T GetKind() const
Returns the type of the barcode (QR, CODE_39, etc.).
int GetWidth() const
Get the barcode width (in internal units).
wxString GetOverrideText() const
wxString GetSuffix() const
int GetLineThickness() const
DIM_TEXT_POSITION GetTextPositionMode() const
bool GetKeepTextAligned() const
DIM_PRECISION GetPrecision() const
wxString GetPrefix() const
DIM_UNITS_MODE GetUnitsMode() const
DIM_UNITS_FORMAT GetUnitsFormat() const
DIM_ARROW_DIRECTION GetArrowDirection() const
virtual VECTOR2I GetEnd() const
bool GetSuppressZeroes() const
int GetExtensionOffset() const
virtual VECTOR2I GetStart() const
The dimension's origin is the first feature point for the dimension.
int GetArrowLength() const
bool GetOverrideTextEnabled() const
For better understanding of the points that make a dimension:
int GetExtensionHeight() const
Mark the center of a circle or arc with a cross shape.
A leader is a dimension-like object pointing to a specific point.
DIM_TEXT_BORDER GetTextBorder() const
An orthogonal dimension is like an aligned dimension, but the extension lines are locked to the X or ...
A radial dimension indicates either the radius or diameter of an arc or circle.
int GetLeaderLength() const
PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
virtual wxString GetGeneratorType() const
A set of BOARD_ITEMs (i.e., without duplicates).
A PCB_POINT is a 0-dimensional point that is used to mark a position on a PCB, or more usually a foot...
VECTOR2I GetPosition() const override
Object to handle a bitmap image that can be inserted in a PCB.
VECTOR2I GetPosition() const override
Get the position of the image (this is the center of the image).
REFERENCE_IMAGE & GetReferenceImage()
std::optional< int > GetLocalSolderMaskMargin() const
bool HasSolderMask() const
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
STROKE_PARAMS GetStroke() const override
PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
bool StrokeHeaderSeparator() const
bool StrokeColumns() const
bool StrokeExternal() const
std::vector< PCB_TABLECELL * > GetCells() const
const STROKE_PARAMS & GetSeparatorsStroke() const
const STROKE_PARAMS & GetBorderStroke() const
int GetColWidth(int aCol) const
int GetRowHeight(int aRow) const
VECTOR2I GetPosition() const override
bool IsBorderEnabled() const
Tests whether the border is disabled, as configured by the stroke.
int GetMarginBottom() const
EDA_ANGLE GetTextAngle() const override
int GetMarginLeft() const
int GetMarginRight() const
EDA_ANGLE GetTextAngle() const override
VECTOR2I GetTextPos() const override
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
bool HasSolderMask() const
std::optional< int > GetLocalSolderMaskMargin() const
const VECTOR2I & GetStart() const
const VECTOR2I & GetEnd() const
virtual int GetWidth() const
static constexpr int FORMAT_VERSION
void formatGeneral(const BOARD *aBoard) const
void FormatBoardToFormatter(OUTPUTFORMATTER *aOut, BOARD *aBoard)
void formatProperties(const BOARD *aBoard) const
void formatLayer(PCB_LAYER_ID aLayer, bool aIsKnockout=false) const
void formatLayers(LSET aLayerMask, bool aEnumerateLayers, bool aIsZone=false) const
void formatPolyPts(const SHAPE_LINE_CHAIN &aOutline, const FOOTPRINT *aParentFP=nullptr) const
void formatHeader(const BOARD *aBoard) const
void formatTeardropParameters(const TEARDROP_PARAMETERS &tdParams) const
void formatVariants(const BOARD *aBoard) const
void formatBoardLayers(const BOARD *aBoard) const
void Format(const BOARD_ITEM *aItem) const
void SaveFootprintFile(const wxString &aFileName, FOOTPRINT *aFootprint)
void format(const BOARD *aBoard) const
void SaveBoard(const wxString &aFileName, BOARD *aBoard)
void formatSetup(const BOARD *aBoard) const
void formatRenderCache(const EDA_TEXT *aText) const
A REFERENCE_IMAGE is a wrapper around a BITMAP_IMAGE that is displayed in an editor as a reference fo...
const BITMAP_BASE & GetImage() const
Get the underlying image.
double GetImageScale() const
const VECTOR2I & GetArcMid() const
const VECTOR2I & GetP1() const
const VECTOR2I & GetP0() const
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
const SHAPE_ARC & Arc(size_t aArc) const
int PointCount() const
Return the number of points (vertices) in this line chain.
ssize_t ArcIndex(size_t aSegment) const
Return the arc index for the given segment index.
const VECTOR2I & CPoint(int aIndex) const
Return a reference to a given point in the line chain.
Represent a set of closed polygons.
POLYGON & Polygon(int aIndex)
Return the aIndex-th subpolygon in the set.
std::vector< SHAPE_LINE_CHAIN > POLYGON
represents a single polygon outline with holes.
SHAPE_LINE_CHAIN & Outline(int aIndex)
Return the reference to aIndex-th outline in the set.
TEARDROP_PARAMETARS is a helper class to handle parameters needed to build teardrops for a board thes...
double m_BestWidthRatio
The height of a teardrop as ratio between height and size of pad/via.
int m_TdMaxLen
max allowed length for teardrops in IU. <= 0 to disable
bool m_AllowUseTwoTracks
True to create teardrops using 2 track segments if the first in too small.
int m_TdMaxWidth
max allowed height for teardrops in IU. <= 0 to disable
double m_BestLengthRatio
The length of a teardrop as ratio between length and size of pad/via.
double m_WidthtoSizeFilterRatio
The ratio (H/D) between the via/pad size and the track width max value to create a teardrop 1....
bool m_TdOnPadsInZones
A filter to exclude pads inside zone fills.
bool m_Enabled
Flag to enable teardrops.
bool m_CurvedEdges
True if the teardrop should be curved.
Handle a list of polygons defining a copper zone.
int GetHatchBorderAlgorithm() const
bool GetIsRuleArea() const
Accessors to parameters used in Rule Area zones:
std::optional< int > GetLocalClearance() const override
bool GetDoNotAllowVias() const
ZONE_LAYER_PROPERTIES & LayerProperties(PCB_LAYER_ID aLayer)
wxString GetPlacementAreaSource() const
std::shared_ptr< SHAPE_POLY_SET > GetFilledPolysList(PCB_LAYER_ID aLayer) const
bool GetDoNotAllowPads() const
PLACEMENT_SOURCE_T GetPlacementAreaSourceType() const
bool GetDoNotAllowTracks() const
ISLAND_REMOVAL_MODE GetIslandRemovalMode() const
bool IsIsland(PCB_LAYER_ID aLayer, int aPolyIdx) const
Check if a given filled polygon is an insulated island.
long long int GetMinIslandArea() const
const wxString & GetZoneName() const
int GetMinThickness() const
SHAPE_POLY_SET GetBoardOutline() const
ZONE_SETTINGS::CORNER_SMOOTHING GetCornerSmoothingType() const
ZONE_CONNECTION GetPadConnection() const
int GetHatchThickness() const
double GetHatchHoleMinArea() const
bool GetPlacementAreaEnabled() const
bool IsTeardropArea() const
int GetThermalReliefSpokeWidth() const
int GetBorderHatchPitch() const
HatchBorder related methods.
ZONE_BORDER_DISPLAY_STYLE GetHatchStyle() const
EDA_ANGLE GetHatchOrientation() const
bool GetDoNotAllowFootprints() const
ZONE_FILL_MODE GetFillMode() const
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
TEARDROP_TYPE GetTeardropAreaType() const
double GetHatchSmoothingValue() const
bool GetDoNotAllowZoneFills() const
int GetHatchSmoothingLevel() const
unsigned int GetCornerRadius() const
bool IsOnCopperLayer() const override
PCB_LAYER_ID GetFirstLayer() const
int GetThermalReliefGap() const
unsigned GetAssignedPriority() const
int GetNumCorners(void) const
Access to m_Poly parameters.
@ RECT_CHAMFER_BOTTOM_RIGHT
@ RECT_CHAMFER_BOTTOM_LEFT
#define CTL_OMIT_HYPERLINK
Omit the hyperlink attribute in .kicad_xxx files.
#define CTL_OMIT_UUIDS
Omit component unique ids (useless in library)
#define CTL_OMIT_FOOTPRINT_VERSION
Omit the version string from the (footprint) sexpr group.
#define CTL_OMIT_INITIAL_COMMENTS
Omit FOOTPRINT initial comments.
#define CTL_OMIT_LIBNAME
Omit lib alias when saving (used for board/not library).
#define CTL_OMIT_PATH
Omit component sheet time stamp (useless in library).
#define CTL_OMIT_AT
Omit position and rotation.
#define CTL_OMIT_PAD_NETS
Omit pads net names (useless in library).
#define CTL_OMIT_COLOR
Omit the color attribute in .kicad_xxx files.
static constexpr EDA_ANGLE ANGLE_90
static constexpr EDA_ANGLE ANGLE_45
@ FILLED_SHAPE
Fill with object color.
@ RECTANGLE
Use RECTANGLE instead of RECT to avoid collision in a Windows header.
EDA_DATA_TYPE
The type of unit.
#define THROW_IO_ERROR(msg)
macro which captures the "call site" values of FILE_, __FUNCTION & LINE
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
bool IsCopperLayer(int aLayerId)
Test whether a layer is a copper layer.
bool IsExternalCopperLayer(int aLayerId)
Test whether a layer is an external (F_Cu or B_Cu) copper layer.
PCB_LAYER_ID
A quick note on layer IDs:
This file contains miscellaneous commonly used macros and functions.
#define UNIMPLEMENTED_FOR(type)
KICOMMON_API std::string FormatAngle(const EDA_ANGLE &aAngle)
Convert aAngle from board units to a string appropriate for writing to file.
KICOMMON_API std::string FormatInternalUnits(const EDA_IU_SCALE &aIuScale, int aValue, EDA_DATA_TYPE aDataType=EDA_DATA_TYPE::DISTANCE)
Converts aValue from internal units to a string appropriate for writing to file.
@ NPTH
like PAD_PTH, but not plated mechanical use only, no connection allowed
@ SMD
Smd pad, appears on the solder paste layer (default)
@ PTH
Plated through hole pad.
@ CONN
Like smd, does not appear on the solder paste layer (default) Note: also has a special attribute in G...
@ FIDUCIAL_LOCAL
a fiducial (usually a smd) local to the parent footprint
@ FIDUCIAL_GLBL
a fiducial (usually a smd) for the full board
@ MECHANICAL
a pad used for mechanical support
@ PRESSFIT
a PTH with a hole diameter with tight tolerances for press fit pin
@ HEATSINK
a pad used as heat sink, usually in SMD footprints
@ NONE
no special fabrication property
@ TESTPOINT
a test point pad
@ CASTELLATED
a pad with a castellated through hole
@ BGA
Smd pad, used in BGA footprints.
@ REMOVE_EXCEPT_START_AND_END
BARCODE class definition.
Class to handle a set of BOARD_ITEMs.
bool isDefaultTeardropParameters(const TEARDROP_PARAMETERS &tdParams)
std::string formatInternalUnits(const int aValue, const EDA_DATA_TYPE aDataType=EDA_DATA_TYPE::DISTANCE)
#define CTL_FOR_BOARD
The zero arg constructor when PCB_PLUGIN is used for PLUGIN::Load() and PLUGIN::Save()ing a BOARD fil...
#define CTL_FOR_LIBRARY
Format output for a footprint library instead of clipboard or BOARD.
#define UNDEFINED_DRILL_DIAMETER
static bool isDefaultTeardropParameters(const TEARDROP_PARAMETERS &tdParams)
static void formatBoardStackupV10(OUTPUTFORMATTER *aFormatter, const BOARD *aBoard)
static std::string formatInternalUnits(const int aValue, const EDA_DATA_TYPE aDataType=EDA_DATA_TYPE::DISTANCE)
std::string FormatDouble2Str(double aValue)
Print a float number without using scientific notation and no trailing 0 This function is intended in...
VECTOR2I size
Drill diameter (x == y) or slot dimensions (x != y)
std::optional< bool > is_capped
True if the drill hole should be capped.
std::optional< bool > is_filled
True if the drill hole should be filled completely.
std::optional< bool > has_covering
True if the pad on this side should have covering.
std::optional< bool > has_solder_mask
True if this outer layer has mask (is not tented)
std::optional< bool > has_plugging
True if the drill hole should be plugged on this side.
std::optional< VECTOR2I > hatching_offset
const SHAPE_LINE_CHAIN chain
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
Calculate the new point of coord coord pX, pY, for a rotation center 0, 0.
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
@ PCB_DIM_ORTHOGONAL_T
class PCB_DIM_ORTHOGONAL, a linear dimension constrained to x/y
@ PCB_DIM_LEADER_T
class PCB_DIM_LEADER, a leader dimension (graphic item)
@ PCB_GENERATOR_T
class PCB_GENERATOR, generator on a layer
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
@ PCB_DIM_CENTER_T
class PCB_DIM_CENTER, a center point marking (graphic item)
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
@ PCB_TEXTBOX_T
class PCB_TEXTBOX, wrapped text on a layer
@ PCB_ZONE_T
class ZONE, a copper pour area
@ PCB_TEXT_T
class PCB_TEXT, text on a layer
@ PCB_REFERENCE_IMAGE_T
class PCB_REFERENCE_IMAGE, bitmap on a layer
@ PCB_FIELD_T
class PCB_FIELD, text associated with a footprint property
@ PCB_BARCODE_T
class PCB_BARCODE, a barcode (graphic item)
@ PCB_TARGET_T
class PCB_TARGET, a target (graphic item)
@ PCB_TABLECELL_T
class PCB_TABLECELL, PCB_TEXTBOX for use in tables
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
@ PCB_DIM_ALIGNED_T
class PCB_DIM_ALIGNED, a linear dimension (graphic item)
@ PCB_PAD_T
class PAD, a pad in a footprint
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
@ PCB_TABLE_T
class PCB_TABLE, table of PCB_TABLECELLs
@ PCB_POINT_T
class PCB_POINT, a 0-dimensional point
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
@ PCB_DIM_RADIAL_T
class PCB_DIM_RADIAL, a radius or diameter dimension
VECTOR2< int32_t > VECTOR2I
@ THERMAL
Use thermal relief for pads.
@ THT_THERMAL
Thermal relief only for THT pads.
@ NONE
Pads are not covered.
@ FULL
pads are covered by copper