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;
1042 auto zoneClearance = [&]() ->
int
1057 std::map<wxString, nlohmann::json> safeSpacingProfiles;
1058 std::map<wxString, wxString> pourSafeSpacingProfiles;
1060 for(
const nlohmann::json& line : aLines )
1062 if( line.empty() || !line.at( 0 ).is_string() )
1065 wxString type = line.at( 0 );
1067 if( type == wxS(
"RULE" ) && line.size() > 4 && line.at( 1 ).get<wxString>() == wxS(
"1" )
1068 && line.at( 3 ).get<
int>() != 2 && line.at( 4 ).is_array() && line.at( 4 ).size() > 1
1069 && line.at( 4 ).at( 1 ).is_array() )
1071 safeSpacingProfiles[line.at( 2 ).get<wxString>()] =
NormalizeSafeSpacing( line.at( 4 ).at( 1 ) );
1073 else if( type == wxS(
"RULE_SELECTOR" ) && line.size() > 3 && line.at( 1 ).is_array() && line.at( 1 ).size() > 1
1074 && line.at( 1 ).at( 0 ).is_string() && line.at( 1 ).at( 0 ).get<wxString>() == wxS(
"POUR" )
1075 && line.at( 1 ).at( 1 ).is_string() && line.at( 3 ).is_object() && line.at( 3 ).contains(
"1" )
1076 && line.at( 3 ).at(
"1" ).is_string() )
1078 pourSafeSpacingProfiles[line.at( 1 ).at( 1 ).get<wxString>()] = line.at( 3 ).at(
"1" ).get<wxString>();
1083 for(
const nlohmann::json& line : aLines )
1085 if( line.size() == 0 )
1088 wxString type = line.at( 0 );
1090 if( type == wxS(
"LAYER" ) )
1092 int layer = line.at( 1 );
1095 wxString layerType = line.at( 2 );
1096 wxString layerName = line.at( 3 );
1097 int layerFlag = line.at( 4 );
1099 if( layerFlag != 0 )
1102 blayers.
set( klayer );
1107 else if( type == wxS(
"NET" ) )
1109 wxString netname = line.at( 1 );
1113 else if( type == wxS(
"RULE" ) )
1115 wxString ruleType = line.at( 1 );
1116 wxString ruleName = line.at( 2 );
1117 int isDefault = line.at( 3 );
1118 nlohmann::json ruleData = line.at( 4 );
1120 if( ruleType == wxS(
"3" ) && isDefault )
1122 wxString units = ruleData.at( 0 );
1124 if( ruleData.at( 1 ).is_number() )
1127 double minVal = ruleData.at( 1 );
1137 nlohmann::json
table = ruleData.at( 1 );
1139 for(
auto& [key, arr] :
table.items() )
1141 double minVal = arr.at( 0 );
1150 else if( ruleType == wxS(
"1" ) && isDefault )
1152 wxString units = ruleData.at( 0 );
1153 nlohmann::json
table = ruleData.at( 1 );
1155 if(
table.is_array() )
1166 if( safeSpacing.is_array() && !safeSpacing.empty() && safeSpacing.at( 0 ).is_array()
1167 && !safeSpacing.at( 0 ).empty() && safeSpacing.at( 0 ).at( 0 ).is_number() )
1169 double trackClearance = safeSpacing.at( 0 ).at( 0 );
1171 if( trackClearance > 0 )
1180 double minEdgeClearance = 0;
1182 if( safeSpacing.is_array() && safeSpacing.size() > 11 && safeSpacing.at( 11 ).is_array() )
1184 for(
const nlohmann::json& value : safeSpacing.at( 11 ) )
1186 if( value.is_number() && value.get<
double>() > 0
1187 && ( minEdgeClearance == 0 || value.get<
double>() < minEdgeClearance ) )
1189 minEdgeClearance = value;
1194 if( minEdgeClearance > 0 )
1201 ruleLines[ruleType].push_back( line );
1203 else if( type == wxS(
"POURED" ) )
1205 if( !line.at( 2 ).is_string() )
1209 boardPouredMap.emplace( poured.
parentId, poured );
1211 else if( type == wxS(
"VIA" ) || type == wxS(
"LINE" ) || type == wxS(
"ARC" ) || type == wxS(
"POLY" )
1212 || type == wxS(
"FILL" ) || type == wxS(
"POUR" ) )
1214 wxString uuid = line.at( 1 );
1221 wxString netname = line.at( 3 );
1223 if( type == wxS(
"VIA" ) )
1229 double drill = line.at( 7 );
1230 double dia = line.at( 8 );
1232 std::unique_ptr<PCB_VIA>
via = std::make_unique<PCB_VIA>( aBoard );
1239 via->SetNet(
getNet( aBoard, netname ) );
1243 else if( type == wxS(
"LINE" ) )
1245 int layer = line.at( 4 ).get<
int>();
1249 start.
x = line.at( 5 );
1250 start.
y = line.at( 6 );
1253 end.x = line.at( 7 );
1254 end.y = line.at( 8 );
1256 double width = line.at( 9 );
1258 std::unique_ptr<PCB_TRACK> track = std::make_unique<PCB_TRACK>( aBoard );
1260 track->SetLayer( klayer );
1261 track->SetStart(
ScalePos( start ) );
1265 track->SetNet(
getNet( aBoard, netname ) );
1269 else if( type == wxS(
"ARC" ) )
1271 int layer = line.at( 4 ).get<
int>();
1275 start.
x = line.at( 5 );
1276 start.
y = line.at( 6 );
1279 end.x = line.at( 7 );
1280 end.y = line.at( 8 );
1282 double angle = line.at( 9 );
1283 double width = line.at( 10 );
1288 double ha = angle / 2;
1289 double hd =
delta.EuclideanNorm() / 2;
1290 double cdist = hd / tan(
DEG2RAD( ha ) );
1297 std::unique_ptr<PCB_ARC> arc = std::make_unique<PCB_ARC>( aBoard, &sarc );
1300 arc->SetLayer( klayer );
1301 arc->SetNet(
getNet( aBoard, netname ) );
1305 else if( type == wxS(
"FILL" ) )
1307 int layer = line.at( 4 ).get<
int>();
1310 nlohmann::json polyDataList = line.at( 7 );
1312 if( !polyDataList.at( 0 ).is_array() )
1313 polyDataList = nlohmann::json::array( { polyDataList } );
1315 std::vector<SHAPE_LINE_CHAIN> contours;
1316 for( nlohmann::json& polyData : polyDataList )
1321 contours.push_back( contour );
1332 std::unique_ptr<ZONE> zone = std::make_unique<ZONE>( aBoard );
1334 zone->SetNet(
getNet( aBoard, netname ) );
1335 zone->SetLayer( klayer );
1337 zone->SetFilledPolysList( klayer, zoneFillPoly );
1338 zone->SetAssignedPriority( 500 );
1339 zone->SetIsFilled(
true );
1340 zone->SetNeedRefill(
false );
1342 zone->SetLocalClearance( zoneClearance() );
1343 zone->SetMinThickness( zoneMinThickness );
1347 else if( type == wxS(
"POLY" ) )
1349 int layer = line.at( 4 );
1352 double thickness = line.at( 5 );
1353 nlohmann::json polyData = line.at( 6 );
1355 std::vector<std::unique_ptr<PCB_SHAPE>> results =
ParsePoly( aBoard, polyData,
false,
false );
1357 for(
auto& shape : results )
1359 shape->SetLayer( klayer );
1360 shape->SetWidth(
ScaleSize( thickness ) );
1365 else if( type == wxS(
"POUR" ) )
1367 int layer = line.at( 4 ).get<
int>();
1370 wxString pourname = line.at( 6 );
1371 int fillOrder = line.at( 7 ).get<
int>();
1372 nlohmann::json polyDataList = line.at( 8 );
1374 std::unique_ptr<ZONE> zone = std::make_unique<ZONE>( aBoard );
1376 zone->SetNet(
getNet( aBoard, netname ) );
1377 zone->SetLayer( klayer );
1378 zone->SetAssignedPriority( 500 - fillOrder );
1379 int localClearance = zoneClearance();
1381 if(
auto selector = pourSafeSpacingProfiles.find( uuid ); selector != pourSafeSpacingProfiles.end() )
1383 auto profile = safeSpacingProfiles.find( selector->second );
1385 if( profile != safeSpacingProfiles.end() && profile->second.size() > 7
1386 && profile->second.at( 7 ).is_array() && !profile->second.at( 7 ).empty()
1387 && profile->second.at( 7 ).at( 0 ).is_number() )
1389 const int profileClearance =
ScaleSize( profile->second.at( 7 ).at( 0 ).get<
double>() );
1391 if( profileClearance > 0 )
1392 localClearance = profileClearance;
1396 zone->SetLocalClearance( localClearance );
1397 zone->SetMinThickness( zoneMinThickness );
1399 for( nlohmann::json& polyData : polyDataList )
1404 zone->Outline()->Append( contour );
1407 wxASSERT( zone->Outline()->OutlineCount() == 1 );
1409 poursToFill.emplace( uuid, zone.get() );
1414 else if( type == wxS(
"TEARDROP" ) )
1416 wxString uuid = line.at( 1 );
1417 wxString netname = line.at( 2 );
1418 int layer = line.at( 3 ).get<
int>();
1421 nlohmann::json polyData = line.at( 4 );
1426 std::unique_ptr<ZONE> zone = std::make_unique<ZONE>( aBoard );
1428 zone->SetNet(
getNet( aBoard, netname ) );
1429 zone->SetLayer( klayer );
1430 zone->Outline()->Append( contour );
1431 zone->SetFilledPolysList( klayer, contour );
1432 zone->SetNeedRefill(
false );
1433 zone->SetIsFilled(
true );
1435 zone->SetAssignedPriority( 600 );
1436 zone->SetLocalClearance( 0 );
1437 zone->SetMinThickness( 0 );
1442 else if( type == wxS(
"REGION" ) )
1444 wxString uuid = line.at( 1 );
1451 int layer = line.at( 3 ).get<
int>();
1454 std::set<int> flags = line.at( 5 );
1455 nlohmann::json polyDataList = line.at( 6 );
1457 for( nlohmann::json& polyData : polyDataList )
1462 std::unique_ptr<ZONE> zone = std::make_unique<ZONE>( aBoard );
1464 zone->SetIsRuleArea(
true );
1465 zone->SetDoNotAllowFootprints( !!flags.count( 2 ) );
1466 zone->SetDoNotAllowZoneFills( !!flags.count( 7 ) || !!flags.count( 6 ) || !!flags.count( 8 ) );
1467 zone->SetDoNotAllowPads( !!flags.count( 7 ) );
1468 zone->SetDoNotAllowTracks( !!flags.count( 7 ) || !!flags.count( 5 ) );
1469 zone->SetDoNotAllowVias( !!flags.count( 7 ) );
1471 zone->SetLayer( klayer );
1472 zone->Outline()->Append( contour );
1477 else if( type == wxS(
"PAD" ) )
1479 wxString netname = line.at( 3 );
1481 std::unique_ptr<FOOTPRINT> footprint = std::make_unique<FOOTPRINT>( aBoard );
1482 std::unique_ptr<PAD>
pad =
createPAD( footprint.get(), line );
1484 pad->SetNet(
getNet( aBoard, netname ) );
1493 footprint->SetPosition( pos );
1494 footprint->SetOrientation( orient );
1496 wxString fpName = wxS(
"Pad_" ) + line.at( 1 ).get<wxString>();
1499 footprint->SetFPID( fpID );
1500 footprint->Reference().SetVisible(
true );
1501 footprint->Value().SetVisible(
true );
1502 footprint->AutoPositionFields();
1506 else if( type == wxS(
"IMAGE" ) )
1508 wxString uuid = line.at( 1 );
1515 int layer = line.at( 3 ).get<
int>();
1518 VECTOR2D start( line.at( 4 ), line.at( 5 ) );
1519 VECTOR2D size( line.at( 6 ), line.at( 7 ) );
1521 double angle = line.at( 8 );
1522 int mirror = line.at( 9 );
1523 nlohmann::json polyDataList = line.at( 10 );
1526 std::vector<SHAPE_LINE_CHAIN> contours;
1527 for( nlohmann::json& polyData : polyDataList )
1532 contours.push_back( contour );
1543 for(
int i = 0; i < contour.PointCount(); i++ )
1554 std::unique_ptr<PCB_GROUP>
group;
1557 group = std::make_unique<PCB_GROUP>( aBoard );
1563 std::unique_ptr<PCB_SHAPE> shape = std::make_unique<PCB_SHAPE>( aBoard,
SHAPE_T::POLY );
1565 shape->SetFilled(
true );
1566 shape->SetPolyShape( poly );
1567 shape->SetLayer( klayer );
1568 shape->SetWidth( 0 );
1577 shape->Mirror(
ScalePos( start ), flipDirection );
1581 group->AddItem( shape.get() );
1589 else if( type == wxS(
"OBJ" ) )
1592 wxString mimeType, base64Data;
1596 if( !line.at( 3 ).is_number() )
1599 int layer = line.at( 3 ).get<
int>();
1602 start =
VECTOR2D( line.at( 5 ), line.at( 6 ) );
1603 size =
VECTOR2D( line.at( 7 ), line.at( 8 ) );
1604 angle = line.at( 9 );
1605 flipped = line.at( 10 );
1607 wxString imageUrl = line.at( 11 );
1609 if( imageUrl.BeforeFirst(
':' ) == wxS(
"blob" ) )
1611 wxString objectId = imageUrl.AfterLast(
':' );
1613 if(
auto blob =
get_opt( aBlobMap, objectId ) )
1615 wxString blobUrl = blob->url;
1617 if( blobUrl.BeforeFirst(
':' ) == wxS(
"data" ) )
1619 wxArrayString paramsArr = wxSplit( blobUrl.AfterFirst(
':' ).BeforeFirst(
',' ),
';',
'\0' );
1621 base64Data = blobUrl.AfterFirst(
',' );
1623 if( paramsArr.size() > 0 )
1624 mimeType = paramsArr[0];
1632 if( mimeType.empty() || base64Data.empty() )
1635 wxMemoryBuffer buf = wxBase64Decode( base64Data );
1637 if( mimeType == wxS(
"image/svg+xml" ) )
1643 VECTOR2D kcenter = kstart + ksize / 2;
1645 std::unique_ptr<PCB_REFERENCE_IMAGE> bitmap =
1646 std::make_unique<PCB_REFERENCE_IMAGE>( aBoard, kcenter, klayer );
1649 wxImage::SetDefaultLoadFlags( wxImage::GetDefaultLoadFlags() & ~wxImage::Load_Verbose );
1661 int x = bitmap->GetPosition().x;
1672 else if( type == wxS(
"STRING" ) )
1674 wxString uuid = line.at( 1 );
1681 int layer = line.at( 3 ).get<
int>();
1685 wxString
string = line.at( 6 );
1686 wxString font = line.at( 7 );
1688 double height = line.at( 8 );
1689 double strokew = line.at( 9 );
1691 int align = line.at( 12 );
1692 double angle = line.at( 13 );
1693 int inverted = line.at( 14 );
1694 int mirror = line.at( 16 );
1698 text->SetText(
string );
1699 text->SetLayer( klayer );
1701 text->SetIsKnockout( inverted );
1705 if( font != wxS(
"default" ) )
1718 text->SetMirrored(
true );
1719 text->SetTextAngleDegrees( -angle );
1723 text->SetTextAngleDegrees( angle );
1728 else if( type == wxS(
"COMPONENT" ) )
1730 wxString compId = line.at( 1 );
1731 componentLines[compId].push_back( line );
1733 else if( type == wxS(
"ATTR" ) )
1735 wxString compId = line.at( 3 );
1736 componentLines[compId].push_back( line );
1738 else if( type == wxS(
"PAD_NET" ) )
1740 wxString compId = line.at( 1 );
1741 componentLines[compId].push_back( line );
1745 for(
auto const& [compId, lines] : componentLines )
1748 wxString fpIdOverride;
1749 wxString fpDesignator;
1750 std::map<wxString, wxString> localCompAttribs;
1752 for(
auto& line : lines )
1754 if( line.size() == 0 )
1757 wxString type = line.at( 0 );
1759 if( type == wxS(
"COMPONENT" ) )
1761 localCompAttribs = line.at( 7 );
1763 else if( type == wxS(
"ATTR" ) )
1767 if( attr.
key == wxS(
"Device" ) )
1768 deviceId = attr.
value;
1770 else if( attr.
key == wxS(
"Footprint" ) )
1771 fpIdOverride = attr.
value;
1773 else if( attr.
key == wxS(
"Designator" ) )
1774 fpDesignator = attr.
value;
1778 if( deviceId.empty() )
1781 nlohmann::json compAttrs = aProject.at(
"devices" ).at( deviceId ).at(
"attributes" );
1785 if( !fpIdOverride.IsEmpty() )
1786 fpId = fpIdOverride;
1788 fpId = compAttrs.at(
"Footprint" ).get<wxString>();
1790 auto it = aFootprintMap.find( fpId );
1791 if( it == aFootprintMap.end() )
1793 wxLogTrace(
traceEasyEdaIo,
"Footprint of '%s' with uuid '%s' not found.", fpDesignator, fpId );
1797 std::unique_ptr<FOOTPRINT>& footprintOrig = it->second;
1798 std::unique_ptr<FOOTPRINT> footprint(
static_cast<FOOTPRINT*
>( footprintOrig->Duplicate(
false ) ) );
1800 wxString modelUuid, modelTitle, modelTransform;
1802 if(
auto val =
get_opt( localCompAttribs,
"3D Model" ) )
1805 modelUuid = compAttrs.value<wxString>(
"3D Model",
"" );
1807 if(
auto val =
get_opt( localCompAttribs,
"3D Model Title" ) )
1808 modelTitle = val->Trim();
1810 modelTitle = compAttrs.value<wxString>(
"3D Model Title", modelUuid ).Trim();
1812 if(
auto val =
get_opt( localCompAttribs,
"3D Model Transform" ) )
1813 modelTransform = *val;
1815 modelTransform = compAttrs.value<wxString>(
"3D Model Transform",
"" );
1819 footprint->SetParent( aBoard );
1821 for(
auto& line : lines )
1823 if( line.size() == 0 )
1826 wxString type = line.at( 0 );
1828 if( type == wxS(
"COMPONENT" ) )
1830 int layer = line.at( 3 );
1835 double orient = line.at( 6 );
1838 if( klayer ==
B_Cu )
1841 footprint->SetOrientationDegrees( orient );
1844 else if( type == wxS(
"ATTR" ) )
1852 if( attr.
key == wxS(
"Designator" ) )
1854 if( attr.
key == wxS(
"Designator" ) )
1864 if( attr.
fontName != wxS(
"default" ) )
1891 else if( type == wxS(
"PAD_NET" ) )
1893 wxString padNumber = line.at( 2 );
1894 wxString padNet = line.at( 3 );
1896 for(
PAD*
pad : footprint->Pads() )
1898 if(
pad->GetNumber() == padNumber )
1899 pad->SetNet(
getNet( aBoard, padNet ) );
1910 for(
auto& [uuid, zone] : poursToFill )
1915 auto range = boardPouredMap.equal_range( uuid );
1916 for(
auto& it = range.first; it != range.second; ++it )
1922 for(
int dataId = 0; dataId < (int) poured.
polyData.size(); dataId++ )
1924 const nlohmann::json& fillData = poured.
polyData[dataId];
1925 const double ptScale = 10;
1930 for(
int i = 0; i < contour.
PointCount(); i++ )
1943 thisPoly.
Append( simple );
1952 const int thermalWidth =
pcbIUScale.mmToIU( 0.2 );
1954 for(
int segId = 0; segId < contour.
SegmentCount(); segId++ )
1964 fillPolySet.
Append( thisPoly );
1971 const int strokeWidth =
pcbIUScale.MilsToIU( 8 );
1979 zone->SetFilledPolysList( zone->GetFirstLayer(), fillPolySet );
1980 zone->SetNeedRefill(
false );
1981 zone->SetIsFilled(
true );
1987 std::vector<PCB_SHAPE*> shapes;
1995 shapes.push_back(
static_cast<PCB_SHAPE*
>( item ) );
2011 offset.
x =
KiROUND( offset.
x / alignGrid ) * alignGrid;
2012 offset.
y =
KiROUND( offset.
y / alignGrid ) * alignGrid;
2014 aBoard->
Move( offset );