769 const wxString& aFpUuid,
770 const std::vector<nlohmann::json>& aLines )
772 std::unique_ptr<FOOTPRINT> footprintPtr = std::make_unique<FOOTPRINT>(
m_board );
773 FOOTPRINT* footprint = footprintPtr.get();
776 const int defaultTextThickness(
pcbIUScale.mmToIU( 0.15 ) );
781 field->SetTextSize( defaultTextSize );
782 field->SetTextThickness( defaultTextThickness );
785 for(
const nlohmann::json& line : aLines )
787 if( line.size() == 0 )
790 wxString type = line.at( 0 );
792 if( type == wxS(
"CANVAS" ) )
794 if( line.size() > 2 && line.at( 1 ).is_number() && line.at( 2 ).is_number() )
799 else if( type == wxS(
"POLY" ) || type == wxS(
"PAD" ) || type == wxS(
"FILL" ) || type == wxS(
"ATTR" ) )
801 wxString uuid = line.at( 1 );
808 wxString netname = line.at( 3 );
809 int layer = line.at( 4 ).get<
int>();
812 if( type == wxS(
"POLY" ) )
814 double thickness = ( line.at( 5 ) );
815 nlohmann::json polyData = line.at( 6 );
817 std::vector<std::unique_ptr<PCB_SHAPE>> results =
ParsePoly( footprint, polyData,
false,
false );
819 for(
auto& shape : results )
821 shape->SetLayer( klayer );
822 shape->SetWidth(
ScaleSize( thickness ) );
827 else if( type == wxS(
"PAD" ) )
829 std::unique_ptr<PAD>
pad =
createPAD( footprint, line );
833 else if( type == wxS(
"FILL" ) )
835 int fillLayer = line.at( 4 ).get<
int>();
838 nlohmann::json polyDataList = line.at( 7 );
840 if( !polyDataList.is_null() && !polyDataList.empty() )
842 if( !polyDataList.at( 0 ).is_array() )
843 polyDataList = nlohmann::json::array( { polyDataList } );
845 std::vector<SHAPE_LINE_CHAIN> contours;
846 for( nlohmann::json& polyData : polyDataList )
851 contours.push_back( contour );
861 std::unique_ptr<PCB_GROUP>
group;
864 group = std::make_unique<PCB_GROUP>( footprint );
868 std::unique_ptr<PCB_SHAPE> shape = std::make_unique<PCB_SHAPE>( footprint,
SHAPE_T::POLY );
870 shape->SetFilled(
true );
871 shape->SetPolyShape( poly );
872 shape->SetLayer( fillKlayer );
873 shape->SetWidth( 0 );
876 group->AddItem( shape.get() );
885 else if( type == wxS(
"ATTR" ) )
889 if( attr.
key == wxS(
"Designator" ) )
893 else if( type == wxS(
"REGION" ) )
895 wxString uuid = line.at( 1 );
902 int layer = line.at( 3 ).get<
int>();
905 std::set<int> flags = line.at( 5 );
906 nlohmann::json polyDataList = line.at( 6 );
908 for( nlohmann::json& polyData : polyDataList )
912 std::vector<std::unique_ptr<PCB_SHAPE>> results =
ParsePoly(
nullptr, polyData,
true,
false );
914 for(
auto& shape : results )
916 shape->SetFilled(
true );
922 std::unique_ptr<ZONE> zone = std::make_unique<ZONE>( footprint );
924 zone->SetIsRuleArea(
true );
925 zone->SetDoNotAllowFootprints( !!flags.count( 2 ) );
926 zone->SetDoNotAllowZoneFills( !!flags.count( 7 ) || !!flags.count( 6 ) || !!flags.count( 8 ) );
927 zone->SetDoNotAllowPads( !!flags.count( 7 ) );
928 zone->SetDoNotAllowTracks( !!flags.count( 7 ) || !!flags.count( 5 ) );
929 zone->SetDoNotAllowVias( !!flags.count( 7 ) );
931 zone->SetLayer( klayer );
932 zone->Outline()->Append( polySet );
939 if( aProject.is_object() && aProject.contains(
"devices" ) )
941 std::map<wxString, EASYEDAPRO::PRJ_DEVICE> devicesMap = aProject.at(
"devices" );
942 std::map<wxString, wxString> compAttrs;
944 for(
auto& [devUuid, devData] : devicesMap )
946 if(
auto fp =
get_opt( devData.attributes,
"Footprint" ) )
950 compAttrs = devData.attributes;
956 wxString modelUuid, modelTitle, modelTransform;
958 modelUuid =
get_def( compAttrs,
"3D Model",
"" );
959 modelTitle =
get_def( compAttrs,
"3D Model Title", modelUuid );
960 modelTransform =
get_def( compAttrs,
"3D Model Transform",
"" );
966 std::vector<PCB_SHAPE*> edgeShapes;
971 edgeShapes.push_back(
static_cast<PCB_SHAPE*
>( item ) );
982 std::unique_ptr<PCB_SHAPE> shape = std::make_unique<PCB_SHAPE>( footprint,
SHAPE_T::RECTANGLE );
987 shape->SetEnd( bbox.
GetEnd() );
992 bool hasFabRef =
false;
998 if(
static_cast<PCB_TEXT*
>( item )->GetText() == wxT(
"${REFERENCE}" ) )
1009 int c_refTextSize =
pcbIUScale.mmToIU( 0.5 );
1010 int c_refTextThickness =
pcbIUScale.mmToIU( 0.1 );
1011 std::unique_ptr<PCB_TEXT> refText = std::make_unique<PCB_TEXT>( footprint );
1013 refText->SetLayer(
F_Fab );
1014 refText->SetTextSize(
VECTOR2I( c_refTextSize, c_refTextSize ) );
1015 refText->SetTextThickness( c_refTextThickness );
1016 refText->SetText( wxT(
"${REFERENCE}" ) );
1023 return footprintPtr;
1028 std::map<wxString, std::unique_ptr<FOOTPRINT>>& aFootprintMap,
1029 const std::map<wxString, EASYEDAPRO::BLOB>& aBlobMap,
1030 const std::multimap<wxString, EASYEDAPRO::POURED>& aPouredMap,
1031 const std::vector<nlohmann::json>& aLines,
const wxString& aFpLibName )
1033 std::map<wxString, std::vector<nlohmann::json>> componentLines;
1034 std::map<wxString, std::vector<nlohmann::json>> ruleLines;
1036 std::multimap<wxString, EASYEDAPRO::POURED> boardPouredMap = aPouredMap;
1037 std::map<wxString, ZONE*> poursToFill;
1043 auto zoneClearance =
1063 std::map<wxString, nlohmann::json> safeSpacingProfiles;
1064 std::map<wxString, wxString> pourSafeSpacingProfiles;
1066 for(
const nlohmann::json& line : aLines )
1068 if( line.empty() || !line.at( 0 ).is_string() )
1071 wxString type = line.at( 0 );
1073 if( type == wxS(
"RULE" ) && line.size() > 4 && line.at( 1 ).get<wxString>() == wxS(
"1" )
1074 && line.at( 3 ).get<
int>() != 2 && line.at( 4 ).is_array() && line.at( 4 ).size() > 1
1075 && line.at( 4 ).at( 1 ).is_array() )
1077 safeSpacingProfiles[line.at( 2 ).get<wxString>()] =
NormalizeSafeSpacing( line.at( 4 ).at( 1 ) );
1079 else if( type == wxS(
"RULE_SELECTOR" ) && line.size() > 3 && line.at( 1 ).is_array() && line.at( 1 ).size() > 1
1080 && line.at( 1 ).at( 0 ).is_string() && line.at( 1 ).at( 0 ).get<wxString>() == wxS(
"POUR" )
1081 && line.at( 1 ).at( 1 ).is_string() && line.at( 3 ).is_object() && line.at( 3 ).contains(
"1" )
1082 && line.at( 3 ).at(
"1" ).is_string() )
1084 pourSafeSpacingProfiles[line.at( 1 ).at( 1 ).get<wxString>()] = line.at( 3 ).at(
"1" ).get<wxString>();
1089 for(
const nlohmann::json& line : aLines )
1091 if( line.size() == 0 )
1094 wxString type = line.at( 0 );
1096 if( type == wxS(
"LAYER" ) )
1098 int layer = line.at( 1 );
1101 wxString layerType = line.at( 2 );
1102 wxString layerName = line.at( 3 );
1103 int layerFlag = line.at( 4 );
1105 if( layerFlag != 0 )
1108 blayers.
set( klayer );
1113 else if( type == wxS(
"NET" ) )
1115 wxString netname = line.at( 1 );
1119 else if( type == wxS(
"RULE" ) )
1121 wxString ruleType = line.at( 1 );
1122 wxString ruleName = line.at( 2 );
1123 int isDefault = line.at( 3 );
1124 nlohmann::json ruleData = line.at( 4 );
1126 if( ruleType == wxS(
"3" ) && isDefault )
1128 wxString units = ruleData.at( 0 );
1130 if( ruleData.at( 1 ).is_number() )
1133 double minVal = ruleData.at( 1 );
1143 nlohmann::json
table = ruleData.at( 1 );
1145 for(
auto& [key, arr] :
table.items() )
1147 double minVal = arr.at( 0 );
1156 else if( ruleType == wxS(
"1" ) && isDefault )
1158 wxString units = ruleData.at( 0 );
1159 nlohmann::json
table = ruleData.at( 1 );
1161 if(
table.is_array() )
1172 if( safeSpacing.is_array() && !safeSpacing.empty() && safeSpacing.at( 0 ).is_array()
1173 && !safeSpacing.at( 0 ).empty() && safeSpacing.at( 0 ).at( 0 ).is_number() )
1175 double trackClearance = safeSpacing.at( 0 ).at( 0 );
1177 if( trackClearance > 0 )
1186 double minEdgeClearance = 0;
1188 if( safeSpacing.is_array() && safeSpacing.size() > 11 && safeSpacing.at( 11 ).is_array() )
1190 for(
const nlohmann::json& value : safeSpacing.at( 11 ) )
1192 if( value.is_number() && value.get<
double>() > 0
1193 && ( minEdgeClearance == 0 || value.get<
double>() < minEdgeClearance ) )
1195 minEdgeClearance = value;
1200 if( minEdgeClearance > 0 )
1207 ruleLines[ruleType].push_back( line );
1209 else if( type == wxS(
"POURED" ) )
1211 if( !line.at( 2 ).is_string() )
1215 boardPouredMap.emplace( poured.
parentId, poured );
1217 else if( type == wxS(
"VIA" ) || type == wxS(
"LINE" ) || type == wxS(
"ARC" ) || type == wxS(
"POLY" )
1218 || type == wxS(
"FILL" ) || type == wxS(
"POUR" ) )
1220 wxString uuid = line.at( 1 );
1227 wxString netname = line.at( 3 );
1229 if( type == wxS(
"VIA" ) )
1235 double drill = line.at( 7 );
1236 double dia = line.at( 8 );
1238 std::unique_ptr<PCB_VIA>
via = std::make_unique<PCB_VIA>( aBoard );
1245 via->SetNet(
getNet( aBoard, netname ) );
1249 else if( type == wxS(
"LINE" ) )
1251 int layer = line.at( 4 ).get<
int>();
1255 start.
x = line.at( 5 );
1256 start.
y = line.at( 6 );
1259 end.x = line.at( 7 );
1260 end.y = line.at( 8 );
1262 double width = line.at( 9 );
1264 std::unique_ptr<PCB_TRACK> track = std::make_unique<PCB_TRACK>( aBoard );
1266 track->SetLayer( klayer );
1267 track->SetStart(
ScalePos( start ) );
1271 track->SetNet(
getNet( aBoard, netname ) );
1275 else if( type == wxS(
"ARC" ) )
1277 int layer = line.at( 4 ).get<
int>();
1281 start.
x = line.at( 5 );
1282 start.
y = line.at( 6 );
1285 end.x = line.at( 7 );
1286 end.y = line.at( 8 );
1288 double angle = line.at( 9 );
1289 double width = line.at( 10 );
1294 double ha = angle / 2;
1295 double hd =
delta.EuclideanNorm() / 2;
1296 double cdist = hd / tan(
DEG2RAD( ha ) );
1303 std::unique_ptr<PCB_ARC> arc = std::make_unique<PCB_ARC>( aBoard, &sarc );
1306 arc->SetLayer( klayer );
1307 arc->SetNet(
getNet( aBoard, netname ) );
1311 else if( type == wxS(
"FILL" ) )
1313 int layer = line.at( 4 ).get<
int>();
1316 nlohmann::json polyDataList = line.at( 7 );
1318 if( !polyDataList.at( 0 ).is_array() )
1319 polyDataList = nlohmann::json::array( { polyDataList } );
1321 std::vector<SHAPE_LINE_CHAIN> contours;
1322 for( nlohmann::json& polyData : polyDataList )
1327 contours.push_back( contour );
1338 std::unique_ptr<ZONE> zone = std::make_unique<ZONE>( aBoard );
1340 zone->SetNet(
getNet( aBoard, netname ) );
1341 zone->SetLayer( klayer );
1343 zone->SetFilledPolysList( klayer, zoneFillPoly );
1344 zone->SetAssignedPriority( 500 );
1345 zone->SetIsFilled(
true );
1346 zone->SetNeedRefill(
false );
1348 zone->SetLocalClearance( zoneClearance() );
1349 zone->SetMinThickness( zoneMinThickness );
1353 else if( type == wxS(
"POLY" ) )
1355 int layer = line.at( 4 );
1358 double thickness = line.at( 5 );
1359 nlohmann::json polyData = line.at( 6 );
1361 std::vector<std::unique_ptr<PCB_SHAPE>> results =
ParsePoly( aBoard, polyData,
false,
false );
1363 for( std::unique_ptr<PCB_SHAPE>& shape : results )
1365 shape->SetLayer( klayer );
1366 shape->SetWidth(
ScaleSize( thickness ) );
1371 else if( type == wxS(
"POUR" ) )
1373 int layer = line.at( 4 ).get<
int>();
1376 wxString pourname = line.at( 6 );
1377 int fillOrder = line.at( 7 ).get<
int>();
1378 nlohmann::json polyDataList = line.at( 8 );
1380 std::unique_ptr<ZONE> zone = std::make_unique<ZONE>( aBoard );
1382 zone->SetNet(
getNet( aBoard, netname ) );
1383 zone->SetLayer( klayer );
1384 zone->SetAssignedPriority( 500 - fillOrder );
1385 int localClearance = zoneClearance();
1387 if(
auto selector = pourSafeSpacingProfiles.find( uuid ); selector != pourSafeSpacingProfiles.end() )
1389 auto profile = safeSpacingProfiles.find( selector->second );
1391 if( profile != safeSpacingProfiles.end() && profile->second.size() > 7
1392 && profile->second.at( 7 ).is_array() && !profile->second.at( 7 ).empty()
1393 && profile->second.at( 7 ).at( 0 ).is_number() )
1395 const int profileClearance =
ScaleSize( profile->second.at( 7 ).at( 0 ).get<
double>() );
1397 if( profileClearance > 0 )
1398 localClearance = profileClearance;
1402 zone->SetLocalClearance( localClearance );
1403 zone->SetMinThickness( zoneMinThickness );
1405 for( nlohmann::json& polyData : polyDataList )
1410 zone->Outline()->Append( contour );
1413 wxASSERT( zone->Outline()->OutlineCount() == 1 );
1415 poursToFill.emplace( uuid, zone.get() );
1420 else if( type == wxS(
"TEARDROP" ) )
1422 wxString uuid = line.at( 1 );
1423 wxString netname = line.at( 2 );
1424 int layer = line.at( 3 ).get<
int>();
1427 nlohmann::json polyData = line.at( 4 );
1432 std::unique_ptr<ZONE> zone = std::make_unique<ZONE>( aBoard );
1434 zone->SetNet(
getNet( aBoard, netname ) );
1435 zone->SetLayer( klayer );
1436 zone->Outline()->Append( contour );
1437 zone->SetFilledPolysList( klayer, contour );
1438 zone->SetNeedRefill(
false );
1439 zone->SetIsFilled(
true );
1441 zone->SetAssignedPriority( 600 );
1442 zone->SetLocalClearance( 0 );
1443 zone->SetMinThickness( 0 );
1448 else if( type == wxS(
"REGION" ) )
1450 wxString uuid = line.at( 1 );
1457 int layer = line.at( 3 ).get<
int>();
1460 std::set<int> flags = line.at( 5 );
1461 nlohmann::json polyDataList = line.at( 6 );
1463 for( nlohmann::json& polyData : polyDataList )
1468 std::unique_ptr<ZONE> zone = std::make_unique<ZONE>( aBoard );
1470 zone->SetIsRuleArea(
true );
1471 zone->SetDoNotAllowFootprints( !!flags.count( 2 ) );
1472 zone->SetDoNotAllowZoneFills( !!flags.count( 7 ) || !!flags.count( 6 ) || !!flags.count( 8 ) );
1473 zone->SetDoNotAllowPads( !!flags.count( 7 ) );
1474 zone->SetDoNotAllowTracks( !!flags.count( 7 ) || !!flags.count( 5 ) );
1475 zone->SetDoNotAllowVias( !!flags.count( 7 ) );
1477 zone->SetLayer( klayer );
1478 zone->Outline()->Append( contour );
1483 else if( type == wxS(
"PAD" ) )
1485 wxString netname = line.at( 3 );
1487 std::unique_ptr<FOOTPRINT> footprint = std::make_unique<FOOTPRINT>( aBoard );
1488 std::unique_ptr<PAD>
pad =
createPAD( footprint.get(), line );
1490 pad->SetNet(
getNet( aBoard, netname ) );
1499 footprint->SetPosition( pos );
1500 footprint->SetOrientation( orient );
1502 wxString fpName = wxS(
"Pad_" ) + line.at( 1 ).get<wxString>();
1505 footprint->SetFPID( fpID );
1506 footprint->Reference().SetVisible(
true );
1507 footprint->Value().SetVisible(
true );
1508 footprint->AutoPositionFields();
1512 else if( type == wxS(
"IMAGE" ) )
1514 wxString uuid = line.at( 1 );
1521 int layer = line.at( 3 ).get<
int>();
1524 VECTOR2D start( line.at( 4 ), line.at( 5 ) );
1525 VECTOR2D size( line.at( 6 ), line.at( 7 ) );
1527 double angle = line.at( 8 );
1528 int mirror = line.at( 9 );
1529 nlohmann::json polyDataList = line.at( 10 );
1532 std::vector<SHAPE_LINE_CHAIN> contours;
1533 for( nlohmann::json& polyData : polyDataList )
1538 contours.push_back( contour );
1549 for(
int i = 0; i < contour.PointCount(); i++ )
1560 std::unique_ptr<PCB_GROUP>
group;
1563 group = std::make_unique<PCB_GROUP>( aBoard );
1569 std::unique_ptr<PCB_SHAPE> shape = std::make_unique<PCB_SHAPE>( aBoard,
SHAPE_T::POLY );
1571 shape->SetFilled(
true );
1572 shape->SetPolyShape( poly );
1573 shape->SetLayer( klayer );
1574 shape->SetWidth( 0 );
1583 shape->Mirror(
ScalePos( start ), flipDirection );
1587 group->AddItem( shape.get() );
1595 else if( type == wxS(
"OBJ" ) )
1598 wxString mimeType, base64Data;
1602 if( !line.at( 3 ).is_number() )
1605 int layer = line.at( 3 ).get<
int>();
1608 start =
VECTOR2D( line.at( 5 ), line.at( 6 ) );
1609 size =
VECTOR2D( line.at( 7 ), line.at( 8 ) );
1610 angle = line.at( 9 );
1611 flipped = line.at( 10 );
1613 wxString imageUrl = line.at( 11 );
1615 if( imageUrl.BeforeFirst(
':' ) == wxS(
"blob" ) )
1617 wxString objectId = imageUrl.AfterLast(
':' );
1619 if(
auto blob =
get_opt( aBlobMap, objectId ) )
1621 wxString blobUrl = blob->url;
1623 if( blobUrl.BeforeFirst(
':' ) == wxS(
"data" ) )
1625 wxArrayString paramsArr = wxSplit( blobUrl.AfterFirst(
':' ).BeforeFirst(
',' ),
';',
'\0' );
1627 base64Data = blobUrl.AfterFirst(
',' );
1629 if( paramsArr.size() > 0 )
1630 mimeType = paramsArr[0];
1638 if( mimeType.empty() || base64Data.empty() )
1641 wxMemoryBuffer buf = wxBase64Decode( base64Data );
1643 if( mimeType == wxS(
"image/svg+xml" ) )
1649 VECTOR2D kcenter = kstart + ksize / 2;
1651 std::unique_ptr<PCB_REFERENCE_IMAGE> bitmap =
1652 std::make_unique<PCB_REFERENCE_IMAGE>( aBoard, kcenter, klayer );
1655 wxImage::SetDefaultLoadFlags( wxImage::GetDefaultLoadFlags() & ~wxImage::Load_Verbose );
1667 int x = bitmap->GetPosition().x;
1678 else if( type == wxS(
"STRING" ) )
1680 wxString uuid = line.at( 1 );
1687 int layer = line.at( 3 ).get<
int>();
1691 wxString
string = line.at( 6 );
1692 wxString font = line.at( 7 );
1694 double height = line.at( 8 );
1695 double strokew = line.at( 9 );
1697 int align = line.at( 12 );
1698 double angle = line.at( 13 );
1699 int inverted = line.at( 14 );
1700 int mirror = line.at( 16 );
1704 text->SetText(
string );
1705 text->SetLayer( klayer );
1707 text->SetIsKnockout( inverted );
1711 if( font != wxS(
"default" ) )
1724 text->SetMirrored(
true );
1725 text->SetTextAngleDegrees( -angle );
1729 text->SetTextAngleDegrees( angle );
1734 else if( type == wxS(
"COMPONENT" ) )
1736 wxString compId = line.at( 1 );
1737 componentLines[compId].push_back( line );
1739 else if( type == wxS(
"ATTR" ) )
1741 wxString compId = line.at( 3 );
1742 componentLines[compId].push_back( line );
1744 else if( type == wxS(
"PAD_NET" ) )
1746 wxString compId = line.at( 1 );
1747 componentLines[compId].push_back( line );
1751 for(
auto const& [compId, lines] : componentLines )
1754 wxString fpIdOverride;
1755 wxString fpDesignator;
1756 std::map<wxString, wxString> localCompAttribs;
1758 for(
auto& line : lines )
1760 if( line.size() == 0 )
1763 wxString type = line.at( 0 );
1765 if( type == wxS(
"COMPONENT" ) )
1767 localCompAttribs = line.at( 7 );
1769 else if( type == wxS(
"ATTR" ) )
1773 if( attr.
key == wxS(
"Device" ) )
1774 deviceId = attr.
value;
1776 else if( attr.
key == wxS(
"Footprint" ) )
1777 fpIdOverride = attr.
value;
1779 else if( attr.
key == wxS(
"Designator" ) )
1780 fpDesignator = attr.
value;
1784 if( deviceId.empty() )
1787 nlohmann::json compAttrs = aProject.at(
"devices" ).at( deviceId ).at(
"attributes" );
1791 if( !fpIdOverride.IsEmpty() )
1792 fpId = fpIdOverride;
1794 fpId = compAttrs.at(
"Footprint" ).get<wxString>();
1796 auto it = aFootprintMap.find( fpId );
1797 if( it == aFootprintMap.end() )
1799 wxLogTrace(
traceEasyEdaIo,
"Footprint of '%s' with uuid '%s' not found.", fpDesignator, fpId );
1803 std::unique_ptr<FOOTPRINT>& footprintOrig = it->second;
1804 std::unique_ptr<FOOTPRINT> footprint(
static_cast<FOOTPRINT*
>( footprintOrig->Duplicate(
false ) ) );
1806 wxString modelUuid, modelTitle, modelTransform;
1808 if(
auto val =
get_opt( localCompAttribs,
"3D Model" ) )
1811 modelUuid = compAttrs.value<wxString>(
"3D Model",
"" );
1813 if(
auto val =
get_opt( localCompAttribs,
"3D Model Title" ) )
1814 modelTitle = val->Trim();
1816 modelTitle = compAttrs.value<wxString>(
"3D Model Title", modelUuid ).Trim();
1818 if(
auto val =
get_opt( localCompAttribs,
"3D Model Transform" ) )
1819 modelTransform = *val;
1821 modelTransform = compAttrs.value<wxString>(
"3D Model Transform",
"" );
1825 footprint->SetParent( aBoard );
1827 for(
auto& line : lines )
1829 if( line.size() == 0 )
1832 wxString type = line.at( 0 );
1834 if( type == wxS(
"COMPONENT" ) )
1836 int layer = line.at( 3 );
1841 double orient = line.at( 6 );
1844 if( klayer ==
B_Cu )
1847 footprint->SetOrientationDegrees( orient );
1850 else if( type == wxS(
"ATTR" ) )
1858 if( attr.
key == wxS(
"Designator" ) )
1860 if( attr.
key == wxS(
"Designator" ) )
1870 if( attr.
fontName != wxS(
"default" ) )
1897 else if( type == wxS(
"PAD_NET" ) )
1899 wxString padNumber = line.at( 2 );
1900 wxString padNet = line.at( 3 );
1902 for(
PAD*
pad : footprint->Pads() )
1904 if(
pad->GetNumber() == padNumber )
1905 pad->SetNet(
getNet( aBoard, padNet ) );
1916 for(
auto& [uuid, zone] : poursToFill )
1921 auto range = boardPouredMap.equal_range( uuid );
1922 for(
auto& it = range.first; it != range.second; ++it )
1928 for(
int dataId = 0; dataId < (int) poured.
polyData.size(); dataId++ )
1930 const nlohmann::json& fillData = poured.
polyData[dataId];
1931 const double ptScale = 10;
1936 for(
int i = 0; i < contour.
PointCount(); i++ )
1949 thisPoly.
Append( simple );
1958 const int thermalWidth =
pcbIUScale.mmToIU( 0.2 );
1960 for(
int segId = 0; segId < contour.
SegmentCount(); segId++ )
1970 fillPolySet.
Append( thisPoly );
1977 const int strokeWidth =
pcbIUScale.MilsToIU( 8 );
1985 zone->SetFilledPolysList( zone->GetFirstLayer(), fillPolySet );
1986 zone->SetNeedRefill(
false );
1987 zone->SetIsFilled(
true );
1993 std::vector<PCB_SHAPE*> shapes;
2001 shapes.push_back(
static_cast<PCB_SHAPE*
>( item ) );
2017 offset.
x =
KiROUND( offset.
x / alignGrid ) * alignGrid;
2018 offset.
y =
KiROUND( offset.
y / alignGrid ) * alignGrid;
2020 aBoard->
Move( offset );