775 const wxString& aFpUuid,
776 const std::vector<nlohmann::json>& aLines )
778 std::unique_ptr<FOOTPRINT> footprintPtr = std::make_unique<FOOTPRINT>(
m_board );
779 FOOTPRINT* footprint = footprintPtr.get();
782 const int defaultTextThickness(
pcbIUScale.mmToIU( 0.15 ) );
787 field->SetTextSize( defaultTextSize );
788 field->SetTextThickness( defaultTextThickness );
791 for(
const nlohmann::json& line : aLines )
793 if( line.size() == 0 )
796 wxString type = line.at( 0 );
798 if( type == wxS(
"CANVAS" ) )
800 if( line.size() > 2 && line.at( 1 ).is_number() && line.at( 2 ).is_number() )
805 else if( type == wxS(
"POLY" ) || type == wxS(
"PAD" ) || type == wxS(
"FILL" ) || type == wxS(
"ATTR" ) )
807 wxString uuid = line.at( 1 );
814 wxString netname = line.at( 3 );
815 int layer = line.at( 4 ).get<
int>();
818 if( type == wxS(
"POLY" ) )
820 double thickness = ( line.at( 5 ) );
821 nlohmann::json polyData = line.at( 6 );
823 std::vector<std::unique_ptr<PCB_SHAPE>> results =
ParsePoly( footprint, polyData,
false,
false );
825 for(
auto& shape : results )
827 shape->SetLayer( klayer );
828 shape->SetWidth(
ScaleSize( thickness ) );
833 else if( type == wxS(
"PAD" ) )
835 std::unique_ptr<PAD>
pad =
createPAD( footprint, line );
839 else if( type == wxS(
"FILL" ) )
841 int fillLayer = line.at( 4 ).get<
int>();
844 nlohmann::json polyDataList = line.at( 7 );
846 if( !polyDataList.is_null() && !polyDataList.empty() )
848 if( !polyDataList.at( 0 ).is_array() )
849 polyDataList = nlohmann::json::array( { polyDataList } );
851 std::vector<SHAPE_LINE_CHAIN> contours;
852 for( nlohmann::json& polyData : polyDataList )
857 contours.push_back( contour );
867 std::unique_ptr<PCB_GROUP>
group;
870 group = std::make_unique<PCB_GROUP>( footprint );
874 std::unique_ptr<PCB_SHAPE> shape = std::make_unique<PCB_SHAPE>( footprint,
SHAPE_T::POLY );
876 shape->SetFilled(
true );
877 shape->SetPolyShape( poly );
878 shape->SetLayer( fillKlayer );
879 shape->SetWidth( 0 );
882 group->AddItem( shape.get() );
891 else if( type == wxS(
"ATTR" ) )
895 if( attr.
key == wxS(
"Designator" ) )
899 else if( type == wxS(
"REGION" ) )
901 wxString uuid = line.at( 1 );
908 int layer = line.at( 3 ).get<
int>();
911 std::set<int> flags = line.at( 5 );
912 nlohmann::json polyDataList = line.at( 6 );
914 for( nlohmann::json& polyData : polyDataList )
918 std::vector<std::unique_ptr<PCB_SHAPE>> results =
ParsePoly(
nullptr, polyData,
true,
false );
920 for(
auto& shape : results )
922 shape->SetFilled(
true );
928 std::unique_ptr<ZONE> zone = std::make_unique<ZONE>( footprint );
930 zone->SetIsRuleArea(
true );
931 zone->SetDoNotAllowFootprints( !!flags.count( 2 ) );
932 zone->SetDoNotAllowZoneFills( !!flags.count( 7 ) || !!flags.count( 6 ) || !!flags.count( 8 ) );
933 zone->SetDoNotAllowPads( !!flags.count( 7 ) );
934 zone->SetDoNotAllowTracks( !!flags.count( 7 ) || !!flags.count( 5 ) );
935 zone->SetDoNotAllowVias( !!flags.count( 7 ) );
937 zone->SetLayer( klayer );
938 zone->Outline()->Append( polySet );
945 if( aProject.is_object() && aProject.contains(
"devices" ) )
947 std::map<wxString, EASYEDAPRO::PRJ_DEVICE> devicesMap = aProject.at(
"devices" );
948 std::map<wxString, wxString> compAttrs;
950 for(
auto& [devUuid, devData] : devicesMap )
952 if(
auto fp =
get_opt( devData.attributes,
"Footprint" ) )
956 compAttrs = devData.attributes;
962 wxString modelUuid, modelTitle, modelTransform;
964 modelUuid =
get_def( compAttrs,
"3D Model",
"" );
965 modelTitle =
get_def( compAttrs,
"3D Model Title", modelUuid );
966 modelTransform =
get_def( compAttrs,
"3D Model Transform",
"" );
972 std::vector<PCB_SHAPE*> edgeShapes;
977 edgeShapes.push_back(
static_cast<PCB_SHAPE*
>( item ) );
988 std::unique_ptr<PCB_SHAPE> shape = std::make_unique<PCB_SHAPE>( footprint,
SHAPE_T::RECTANGLE );
993 shape->SetEnd( bbox.
GetEnd() );
998 bool hasFabRef =
false;
1004 if(
static_cast<PCB_TEXT*
>( item )->GetText() == wxT(
"${REFERENCE}" ) )
1015 int c_refTextSize =
pcbIUScale.mmToIU( 0.5 );
1016 int c_refTextThickness =
pcbIUScale.mmToIU( 0.1 );
1017 std::unique_ptr<PCB_TEXT> refText = std::make_unique<PCB_TEXT>( footprint );
1019 refText->SetLayer(
F_Fab );
1020 refText->SetTextSize(
VECTOR2I( c_refTextSize, c_refTextSize ) );
1021 refText->SetTextThickness( c_refTextThickness );
1022 refText->SetText( wxT(
"${REFERENCE}" ) );
1029 return footprintPtr;
1034 std::map<wxString, std::unique_ptr<FOOTPRINT>>& aFootprintMap,
1035 const std::map<wxString, EASYEDAPRO::BLOB>& aBlobMap,
1036 const std::multimap<wxString, EASYEDAPRO::POURED>& aPouredMap,
1037 const std::vector<nlohmann::json>& aLines,
const wxString& aFpLibName )
1039 std::map<wxString, std::vector<nlohmann::json>> componentLines;
1040 std::map<wxString, std::vector<nlohmann::json>> ruleLines;
1042 std::multimap<wxString, EASYEDAPRO::POURED> boardPouredMap = aPouredMap;
1043 std::map<wxString, ZONE*> poursToFill;
1049 auto zoneClearance =
1069 std::map<wxString, nlohmann::json> safeSpacingProfiles;
1070 std::map<wxString, wxString> pourSafeSpacingProfiles;
1072 for(
const nlohmann::json& line : aLines )
1074 if( line.empty() || !line.at( 0 ).is_string() )
1077 wxString type = line.at( 0 );
1079 if( type == wxS(
"RULE" ) && line.size() > 4 && line.at( 1 ).get<wxString>() == wxS(
"1" )
1080 && line.at( 3 ).get<
int>() != 2 && line.at( 4 ).is_array() && line.at( 4 ).size() > 1
1081 && line.at( 4 ).at( 1 ).is_array() )
1083 safeSpacingProfiles[line.at( 2 ).get<wxString>()] =
NormalizeSafeSpacing( line.at( 4 ).at( 1 ) );
1085 else if( type == wxS(
"RULE_SELECTOR" ) && line.size() > 3 && line.at( 1 ).is_array() && line.at( 1 ).size() > 1
1086 && line.at( 1 ).at( 0 ).is_string() && line.at( 1 ).at( 0 ).get<wxString>() == wxS(
"POUR" )
1087 && line.at( 1 ).at( 1 ).is_string() && line.at( 3 ).is_object() && line.at( 3 ).contains(
"1" )
1088 && line.at( 3 ).at(
"1" ).is_string() )
1090 pourSafeSpacingProfiles[line.at( 1 ).at( 1 ).get<wxString>()] = line.at( 3 ).at(
"1" ).get<wxString>();
1095 for(
const nlohmann::json& line : aLines )
1097 if( line.size() == 0 )
1100 wxString type = line.at( 0 );
1102 if( type == wxS(
"LAYER" ) )
1104 int layer = line.at( 1 );
1107 wxString layerType = line.at( 2 );
1108 wxString layerName = line.at( 3 );
1109 int layerFlag = line.at( 4 );
1111 if( layerFlag != 0 )
1114 blayers.
set( klayer );
1119 else if( type == wxS(
"NET" ) )
1121 wxString netname = line.at( 1 );
1125 else if( type == wxS(
"RULE" ) )
1127 wxString ruleType = line.at( 1 );
1128 wxString ruleName = line.at( 2 );
1129 int isDefault = line.at( 3 );
1130 nlohmann::json ruleData = line.at( 4 );
1132 if( ruleType == wxS(
"3" ) && isDefault )
1134 wxString units = ruleData.at( 0 );
1136 if( ruleData.at( 1 ).is_number() )
1139 double minVal = ruleData.at( 1 );
1149 nlohmann::json
table = ruleData.at( 1 );
1151 for(
auto& [key, arr] :
table.items() )
1153 double minVal = arr.at( 0 );
1162 else if( ruleType == wxS(
"1" ) && isDefault )
1164 wxString units = ruleData.at( 0 );
1165 nlohmann::json
table = ruleData.at( 1 );
1167 if(
table.is_array() )
1178 if( safeSpacing.is_array() && !safeSpacing.empty() && safeSpacing.at( 0 ).is_array()
1179 && !safeSpacing.at( 0 ).empty() && safeSpacing.at( 0 ).at( 0 ).is_number() )
1181 double trackClearance = safeSpacing.at( 0 ).at( 0 );
1183 if( trackClearance > 0 )
1192 double minEdgeClearance = 0;
1194 if( safeSpacing.is_array() && safeSpacing.size() > 11 && safeSpacing.at( 11 ).is_array() )
1196 for(
const nlohmann::json& value : safeSpacing.at( 11 ) )
1198 if( value.is_number() && value.get<
double>() > 0
1199 && ( minEdgeClearance == 0 || value.get<
double>() < minEdgeClearance ) )
1201 minEdgeClearance = value;
1206 if( minEdgeClearance > 0 )
1213 ruleLines[ruleType].push_back( line );
1215 else if( type == wxS(
"POURED" ) )
1217 if( !line.at( 2 ).is_string() )
1221 boardPouredMap.emplace( poured.
parentId, poured );
1223 else if( type == wxS(
"VIA" ) || type == wxS(
"LINE" ) || type == wxS(
"ARC" ) || type == wxS(
"POLY" )
1224 || type == wxS(
"FILL" ) || type == wxS(
"POUR" ) )
1226 wxString uuid = line.at( 1 );
1233 wxString netname = line.at( 3 );
1235 if( type == wxS(
"VIA" ) )
1241 double drill = line.at( 7 );
1242 double dia = line.at( 8 );
1244 std::unique_ptr<PCB_VIA>
via = std::make_unique<PCB_VIA>( aBoard );
1251 via->SetNet(
getNet( aBoard, netname ) );
1255 else if( type == wxS(
"LINE" ) )
1257 int layer = line.at( 4 ).get<
int>();
1261 start.
x = line.at( 5 );
1262 start.
y = line.at( 6 );
1265 end.x = line.at( 7 );
1266 end.y = line.at( 8 );
1268 double width = line.at( 9 );
1270 std::unique_ptr<PCB_TRACK> track = std::make_unique<PCB_TRACK>( aBoard );
1272 track->SetLayer( klayer );
1273 track->SetStart(
ScalePos( start ) );
1277 track->SetNet(
getNet( aBoard, netname ) );
1281 else if( type == wxS(
"ARC" ) )
1283 int layer = line.at( 4 ).get<
int>();
1287 start.
x = line.at( 5 );
1288 start.
y = line.at( 6 );
1291 end.x = line.at( 7 );
1292 end.y = line.at( 8 );
1294 double angle = line.at( 9 );
1295 double width = line.at( 10 );
1300 double ha = angle / 2;
1301 double hd =
delta.EuclideanNorm() / 2;
1302 double cdist = hd / tan(
DEG2RAD( ha ) );
1309 std::unique_ptr<PCB_ARC> arc = std::make_unique<PCB_ARC>( aBoard, &sarc );
1312 arc->SetLayer( klayer );
1313 arc->SetNet(
getNet( aBoard, netname ) );
1317 else if( type == wxS(
"FILL" ) )
1319 int layer = line.at( 4 ).get<
int>();
1322 nlohmann::json polyDataList = line.at( 7 );
1324 if( !polyDataList.at( 0 ).is_array() )
1325 polyDataList = nlohmann::json::array( { polyDataList } );
1327 std::vector<SHAPE_LINE_CHAIN> contours;
1328 for( nlohmann::json& polyData : polyDataList )
1333 contours.push_back( contour );
1344 std::unique_ptr<ZONE> zone = std::make_unique<ZONE>( aBoard );
1346 zone->SetNet(
getNet( aBoard, netname ) );
1347 zone->SetLayer( klayer );
1349 zone->SetFilledPolysList( klayer, zoneFillPoly );
1350 zone->SetAssignedPriority( 500 );
1351 zone->SetIsFilled(
true );
1352 zone->SetNeedRefill(
false );
1354 zone->SetLocalClearance( zoneClearance() );
1355 zone->SetMinThickness( zoneMinThickness );
1359 else if( type == wxS(
"POLY" ) )
1361 int layer = line.at( 4 );
1364 double thickness = line.at( 5 );
1365 nlohmann::json polyData = line.at( 6 );
1367 std::vector<std::unique_ptr<PCB_SHAPE>> results =
ParsePoly( aBoard, polyData,
false,
false );
1369 for( std::unique_ptr<PCB_SHAPE>& shape : results )
1371 shape->SetLayer( klayer );
1372 shape->SetWidth(
ScaleSize( thickness ) );
1377 else if( type == wxS(
"POUR" ) )
1379 int layer = line.at( 4 ).get<
int>();
1382 wxString pourname = line.at( 6 );
1383 int fillOrder = line.at( 7 ).get<
int>();
1384 nlohmann::json polyDataList = line.at( 8 );
1386 std::unique_ptr<ZONE> zone = std::make_unique<ZONE>( aBoard );
1388 zone->SetNet(
getNet( aBoard, netname ) );
1389 zone->SetLayer( klayer );
1390 zone->SetAssignedPriority( 500 - fillOrder );
1391 int localClearance = zoneClearance();
1393 if(
auto selector = pourSafeSpacingProfiles.find( uuid ); selector != pourSafeSpacingProfiles.end() )
1395 auto profile = safeSpacingProfiles.find( selector->second );
1397 if( profile != safeSpacingProfiles.end() && profile->second.size() > 7
1398 && profile->second.at( 7 ).is_array() && !profile->second.at( 7 ).empty()
1399 && profile->second.at( 7 ).at( 0 ).is_number() )
1401 const int profileClearance =
ScaleSize( profile->second.at( 7 ).at( 0 ).get<
double>() );
1403 if( profileClearance > 0 )
1404 localClearance = profileClearance;
1408 zone->SetLocalClearance( localClearance );
1409 zone->SetMinThickness( zoneMinThickness );
1411 for( nlohmann::json& polyData : polyDataList )
1416 zone->Outline()->Append( contour );
1419 wxASSERT( zone->Outline()->OutlineCount() == 1 );
1421 poursToFill.emplace( uuid, zone.get() );
1426 else if( type == wxS(
"TEARDROP" ) )
1428 wxString uuid = line.at( 1 );
1429 wxString netname = line.at( 2 );
1430 int layer = line.at( 3 ).get<
int>();
1433 nlohmann::json polyData = line.at( 4 );
1438 std::unique_ptr<ZONE> zone = std::make_unique<ZONE>( aBoard );
1440 zone->SetNet(
getNet( aBoard, netname ) );
1441 zone->SetLayer( klayer );
1442 zone->Outline()->Append( contour );
1443 zone->SetFilledPolysList( klayer, contour );
1444 zone->SetNeedRefill(
false );
1445 zone->SetIsFilled(
true );
1447 zone->SetAssignedPriority( 600 );
1448 zone->SetLocalClearance( 0 );
1449 zone->SetMinThickness( 0 );
1454 else if( type == wxS(
"REGION" ) )
1456 wxString uuid = line.at( 1 );
1463 int layer = line.at( 3 ).get<
int>();
1466 std::set<int> flags = line.at( 5 );
1467 nlohmann::json polyDataList = line.at( 6 );
1469 for( nlohmann::json& polyData : polyDataList )
1474 std::unique_ptr<ZONE> zone = std::make_unique<ZONE>( aBoard );
1476 zone->SetIsRuleArea(
true );
1477 zone->SetDoNotAllowFootprints( !!flags.count( 2 ) );
1478 zone->SetDoNotAllowZoneFills( !!flags.count( 7 ) || !!flags.count( 6 ) || !!flags.count( 8 ) );
1479 zone->SetDoNotAllowPads( !!flags.count( 7 ) );
1480 zone->SetDoNotAllowTracks( !!flags.count( 7 ) || !!flags.count( 5 ) );
1481 zone->SetDoNotAllowVias( !!flags.count( 7 ) );
1483 zone->SetLayer( klayer );
1484 zone->Outline()->Append( contour );
1489 else if( type == wxS(
"PAD" ) )
1491 wxString netname = line.at( 3 );
1493 std::unique_ptr<FOOTPRINT> footprint = std::make_unique<FOOTPRINT>( aBoard );
1494 std::unique_ptr<PAD>
pad =
createPAD( footprint.get(), line );
1496 pad->SetNet(
getNet( aBoard, netname ) );
1505 footprint->SetPosition( pos );
1506 footprint->SetOrientation( orient );
1508 wxString fpName = wxS(
"Pad_" ) + line.at( 1 ).get<wxString>();
1511 footprint->SetFPID( fpID );
1512 footprint->Reference().SetVisible(
true );
1513 footprint->Value().SetVisible(
true );
1514 footprint->AutoPositionFields();
1518 else if( type == wxS(
"IMAGE" ) )
1520 wxString uuid = line.at( 1 );
1527 int layer = line.at( 3 ).get<
int>();
1530 VECTOR2D start( line.at( 4 ), line.at( 5 ) );
1531 VECTOR2D size( line.at( 6 ), line.at( 7 ) );
1533 double angle = line.at( 8 );
1534 int mirror = line.at( 9 );
1535 nlohmann::json polyDataList = line.at( 10 );
1538 std::vector<SHAPE_LINE_CHAIN> contours;
1539 for( nlohmann::json& polyData : polyDataList )
1544 contours.push_back( contour );
1555 for(
int i = 0; i < contour.PointCount(); i++ )
1566 std::unique_ptr<PCB_GROUP>
group;
1569 group = std::make_unique<PCB_GROUP>( aBoard );
1575 std::unique_ptr<PCB_SHAPE> shape = std::make_unique<PCB_SHAPE>( aBoard,
SHAPE_T::POLY );
1577 shape->SetFilled(
true );
1578 shape->SetPolyShape( poly );
1579 shape->SetLayer( klayer );
1580 shape->SetWidth( 0 );
1589 shape->Mirror(
ScalePos( start ), flipDirection );
1593 group->AddItem( shape.get() );
1601 else if( type == wxS(
"OBJ" ) )
1604 wxString mimeType, base64Data;
1608 if( !line.at( 3 ).is_number() )
1611 int layer = line.at( 3 ).get<
int>();
1614 start =
VECTOR2D( line.at( 5 ), line.at( 6 ) );
1615 size =
VECTOR2D( line.at( 7 ), line.at( 8 ) );
1616 angle = line.at( 9 );
1617 flipped = line.at( 10 );
1619 wxString imageUrl = line.at( 11 );
1621 if( imageUrl.BeforeFirst(
':' ) == wxS(
"blob" ) )
1623 wxString objectId = imageUrl.AfterLast(
':' );
1625 if(
auto blob =
get_opt( aBlobMap, objectId ) )
1627 wxString blobUrl = blob->url;
1629 if( blobUrl.BeforeFirst(
':' ) == wxS(
"data" ) )
1631 wxArrayString paramsArr = wxSplit( blobUrl.AfterFirst(
':' ).BeforeFirst(
',' ),
';',
'\0' );
1633 base64Data = blobUrl.AfterFirst(
',' );
1635 if( paramsArr.size() > 0 )
1636 mimeType = paramsArr[0];
1644 if( mimeType.empty() || base64Data.empty() )
1647 wxMemoryBuffer buf = wxBase64Decode( base64Data );
1649 if( mimeType == wxS(
"image/svg+xml" ) )
1655 VECTOR2D kcenter = kstart + ksize / 2;
1657 std::unique_ptr<PCB_REFERENCE_IMAGE> bitmap =
1658 std::make_unique<PCB_REFERENCE_IMAGE>( aBoard, kcenter, klayer );
1661 wxImage::SetDefaultLoadFlags( wxImage::GetDefaultLoadFlags() & ~wxImage::Load_Verbose );
1673 int x = bitmap->GetPosition().x;
1684 else if( type == wxS(
"STRING" ) )
1686 wxString uuid = line.at( 1 );
1693 int layer = line.at( 3 ).get<
int>();
1697 wxString
string = line.at( 6 );
1698 wxString font = line.at( 7 );
1700 double height = line.at( 8 );
1701 double strokew = line.at( 9 );
1703 int align = line.at( 12 );
1704 double angle = line.at( 13 );
1705 int inverted = line.at( 14 );
1706 int mirror = line.at( 16 );
1710 text->SetText(
string );
1711 text->SetLayer( klayer );
1713 text->SetIsKnockout( inverted );
1717 if( font != wxS(
"default" ) )
1730 text->SetMirrored(
true );
1731 text->SetTextAngleDegrees( -angle );
1735 text->SetTextAngleDegrees( angle );
1740 else if( type == wxS(
"COMPONENT" ) )
1742 wxString compId = line.at( 1 );
1743 componentLines[compId].push_back( line );
1745 else if( type == wxS(
"ATTR" ) )
1747 wxString compId = line.at( 3 );
1748 componentLines[compId].push_back( line );
1750 else if( type == wxS(
"PAD_NET" ) )
1752 wxString compId = line.at( 1 );
1753 componentLines[compId].push_back( line );
1757 for(
auto const& [compId, lines] : componentLines )
1760 wxString fpIdOverride;
1761 wxString fpDesignator;
1762 std::map<wxString, wxString> localCompAttribs;
1764 for(
auto& line : lines )
1766 if( line.size() == 0 )
1769 wxString type = line.at( 0 );
1771 if( type == wxS(
"COMPONENT" ) )
1773 localCompAttribs = line.at( 7 );
1775 else if( type == wxS(
"ATTR" ) )
1779 if( attr.
key == wxS(
"Device" ) )
1780 deviceId = attr.
value;
1782 else if( attr.
key == wxS(
"Footprint" ) )
1783 fpIdOverride = attr.
value;
1785 else if( attr.
key == wxS(
"Designator" ) )
1786 fpDesignator = attr.
value;
1790 if( deviceId.empty() )
1793 nlohmann::json compAttrs = aProject.at(
"devices" ).at( deviceId ).at(
"attributes" );
1797 if( !fpIdOverride.IsEmpty() )
1798 fpId = fpIdOverride;
1800 fpId = compAttrs.at(
"Footprint" ).get<wxString>();
1802 auto it = aFootprintMap.find( fpId );
1803 if( it == aFootprintMap.end() )
1805 wxLogTrace(
traceEasyEdaIo,
"Footprint of '%s' with uuid '%s' not found.", fpDesignator, fpId );
1809 std::unique_ptr<FOOTPRINT>& footprintOrig = it->second;
1810 std::unique_ptr<FOOTPRINT> footprint(
static_cast<FOOTPRINT*
>( footprintOrig->Duplicate(
false ) ) );
1812 wxString modelUuid, modelTitle, modelTransform;
1814 if(
auto val =
get_opt( localCompAttribs,
"3D Model" ) )
1817 modelUuid = compAttrs.value<wxString>(
"3D Model",
"" );
1819 if(
auto val =
get_opt( localCompAttribs,
"3D Model Title" ) )
1820 modelTitle = val->Trim();
1822 modelTitle = compAttrs.value<wxString>(
"3D Model Title", modelUuid ).Trim();
1824 if(
auto val =
get_opt( localCompAttribs,
"3D Model Transform" ) )
1825 modelTransform = *val;
1827 modelTransform = compAttrs.value<wxString>(
"3D Model Transform",
"" );
1831 footprint->SetParent( aBoard );
1833 for(
auto& line : lines )
1835 if( line.size() == 0 )
1838 wxString type = line.at( 0 );
1840 if( type == wxS(
"COMPONENT" ) )
1842 int layer = line.at( 3 );
1847 double orient = line.at( 6 );
1850 if( klayer ==
B_Cu )
1853 footprint->SetOrientationDegrees( orient );
1856 else if( type == wxS(
"ATTR" ) )
1864 if( attr.
key == wxS(
"Designator" ) )
1866 if( attr.
key == wxS(
"Designator" ) )
1876 if( attr.
fontName != wxS(
"default" ) )
1903 else if( type == wxS(
"PAD_NET" ) )
1905 wxString padNumber = line.at( 2 );
1906 wxString padNet = line.at( 3 );
1908 for(
PAD*
pad : footprint->Pads() )
1910 if(
pad->GetNumber() == padNumber )
1911 pad->SetNet(
getNet( aBoard, padNet ) );
1922 for(
auto& [uuid, zone] : poursToFill )
1927 auto range = boardPouredMap.equal_range( uuid );
1928 for(
auto& it = range.first; it != range.second; ++it )
1934 for(
int dataId = 0; dataId < (int) poured.
polyData.size(); dataId++ )
1936 const nlohmann::json& fillData = poured.
polyData[dataId];
1937 const double ptScale = 10;
1942 for(
int i = 0; i < contour.
PointCount(); i++ )
1955 thisPoly.
Append( simple );
1964 const int thermalWidth =
pcbIUScale.mmToIU( 0.2 );
1966 for(
int segId = 0; segId < contour.
SegmentCount(); segId++ )
1976 fillPolySet.
Append( thisPoly );
1983 const int strokeWidth =
pcbIUScale.MilsToIU( 8 );
1991 zone->SetFilledPolysList( zone->GetFirstLayer(), fillPolySet );
1992 zone->SetNeedRefill(
false );
1993 zone->SetIsFilled(
true );
1999 std::vector<PCB_SHAPE*> shapes;
2007 shapes.push_back(
static_cast<PCB_SHAPE*
>( item ) );
2023 offset.
x =
KiROUND( offset.
x / alignGrid ) * alignGrid;
2024 offset.
y =
KiROUND( offset.
y / alignGrid ) * alignGrid;
2026 aBoard->
Move( offset );