266 bool aClosed,
bool aInFill )
const
268 std::vector<std::unique_ptr<PCB_SHAPE>> results;
271 for(
int i = 0; i < (int) polyData.size(); i++ )
273 nlohmann::json val = polyData.at( i );
275 if( val.is_string() )
278 if( str == wxS(
"CIRCLE" ) )
281 center.x = ( polyData.at( ++i ) );
282 center.y = ( polyData.at( ++i ) );
283 double r = ( polyData.at( ++i ) );
285 std::unique_ptr<PCB_SHAPE> shape =
290 shape->SetFilled( aClosed );
292 results.emplace_back( std::move( shape ) );
294 else if( str == wxS(
"R" ) )
297 start.
x = ( polyData.at( ++i ) );
298 start.
y = ( polyData.at( ++i ) );
299 size.
x = ( polyData.at( ++i ) );
300 size.
y = -( polyData.at( ++i ).get<double>() );
301 double angle = polyData.at( ++i );
302 double cr = ( i + 1 ) < (
int) polyData.size() ? polyData.at( ++i ).get<
double>() : 0;
306 std::unique_ptr<PCB_SHAPE> shape =
309 shape->SetStart(
ScalePos( start ) );
310 shape->SetEnd(
ScalePos( start + size ) );
311 shape->SetFilled( aClosed );
314 results.emplace_back( std::move( shape ) );
322 std::unique_ptr<PCB_SHAPE> shape =
325 shape->SetStart(
ScalePos( aStart ) );
327 shape->SetFilled( aClosed );
330 results.emplace_back( std::move( shape ) );
335 std::unique_ptr<PCB_SHAPE> shape =
336 std::make_unique<PCB_SHAPE>( aContainer,
SHAPE_T::ARC );
338 shape->SetStart(
ScalePos( aStart ) );
341 shape->SetFilled( aClosed );
344 results.emplace_back( std::move( shape ) );
352 addArc( {
end.x - cr, start.
y }, {
end.x, start.
y - cr },
353 {
end.x - cr, start.
y - cr } );
356 {
end.x - cr,
end.y + cr } );
358 addArc( { start.
x + cr,
end.y }, { start.
x,
end.y + cr },
359 { start.
x + cr,
end.y + cr } );
361 addArc( { start.
x, start.
y - cr }, { start.
x + cr, start.
y },
362 { start.
x + cr, start.
y - cr } );
365 else if( str == wxS(
"ARC" ) || str == wxS(
"CARC" ) )
368 double angle = polyData.at( ++i ).get<
double>() / ( aInFill ? 10 : 1 );
369 end.x = ( polyData.at( ++i ) );
370 end.y = ( polyData.at( ++i ) );
372 std::unique_ptr<PCB_SHAPE> shape =
373 std::make_unique<PCB_SHAPE>( aContainer,
SHAPE_T::ARC );
377 shape->SetStart(
ScalePos( prevPt ) );
383 shape->SetEnd(
ScalePos( prevPt ) );
389 double ha = angle / 2;
390 double hd =
delta.EuclideanNorm() / 2;
391 double cdist = hd / tan(
DEG2RAD( ha ) );
395 shape->SetFilled( aClosed );
397 results.emplace_back( std::move( shape ) );
401 else if( str == wxS(
"L" ) )
406 while( i < (
int) polyData.size() - 2 && polyData.at( i + 1 ).is_number() )
409 pt.
x = ( polyData.at( ++i ) );
410 pt.
y = ( polyData.at( ++i ) );
419 std::unique_ptr<PCB_SHAPE> shape =
422 wxASSERT(
chain.PointCount() > 2 );
424 if(
chain.PointCount() > 2 )
426 chain.SetClosed(
true );
427 shape->SetFilled(
true );
428 shape->SetPolyShape(
chain );
430 results.emplace_back( std::move( shape ) );
435 for(
int s = 0; s <
chain.SegmentCount(); s++ )
439 std::unique_ptr<PCB_SHAPE> shape =
442 shape->SetStart( seg.
A );
443 shape->SetEnd( seg.
B );
445 results.emplace_back( std::move( shape ) );
450 else if( val.is_number() )
452 prevPt.
x = ( polyData.at( i ) );
453 prevPt.
y = ( polyData.at( ++i ) );
744 const wxString& aFpUuid,
745 const std::vector<nlohmann::json>& aLines )
747 std::unique_ptr<FOOTPRINT> footprintPtr = std::make_unique<FOOTPRINT>(
m_board );
748 FOOTPRINT* footprint = footprintPtr.get();
751 const int defaultTextThickness(
pcbIUScale.mmToIU( 0.15 ) );
755 field->SetTextSize( defaultTextSize );
756 field->SetTextThickness( defaultTextThickness );
759 for(
const nlohmann::json& line : aLines )
761 if( line.size() == 0 )
764 wxString type = line.at( 0 );
766 if( type == wxS(
"POLY" ) || type == wxS(
"PAD" ) || type == wxS(
"FILL" )
767 || type == wxS(
"ATTR" ) )
769 wxString uuid = line.at( 1 );
776 wxString netname = line.at( 3 );
777 int layer = line.at( 4 ).get<
int>();
780 if( type == wxS(
"POLY" ) )
782 double thickness = ( line.at( 5 ) );
783 nlohmann::json polyData = line.at( 6 );
785 std::vector<std::unique_ptr<PCB_SHAPE>> results =
786 ParsePoly( footprint, polyData,
false,
false );
788 for(
auto& shape : results )
790 shape->SetLayer( klayer );
791 shape->SetWidth(
ScaleSize( thickness ) );
796 else if( type == wxS(
"PAD" ) )
798 std::unique_ptr<PAD>
pad =
createPAD( footprint, line );
802 else if( type == wxS(
"FILL" ) )
804 int fillLayer = line.at( 4 ).get<
int>();
807 nlohmann::json polyDataList = line.at( 7 );
809 if( !polyDataList.is_null() && !polyDataList.empty() )
811 if( !polyDataList.at( 0 ).is_array() )
812 polyDataList = nlohmann::json::array( { polyDataList } );
814 std::vector<SHAPE_LINE_CHAIN> contours;
815 for( nlohmann::json& polyData : polyDataList )
820 contours.push_back( contour );
830 std::unique_ptr<PCB_GROUP>
group;
833 group = std::make_unique<PCB_GROUP>( footprint );
837 std::unique_ptr<PCB_SHAPE> shape =
840 shape->SetFilled(
true );
841 shape->SetPolyShape( poly );
842 shape->SetLayer( fillKlayer );
843 shape->SetWidth( 0 );
846 group->AddItem( shape.get() );
855 else if( type == wxS(
"ATTR" ) )
859 if( attr.
key == wxS(
"Designator" ) )
863 else if( type == wxS(
"REGION" ) )
865 wxString uuid = line.at( 1 );
872 int layer = line.at( 3 ).get<
int>();
875 std::set<int> flags = line.at( 5 );
876 nlohmann::json polyDataList = line.at( 6 );
878 for( nlohmann::json& polyData : polyDataList )
882 std::vector<std::unique_ptr<PCB_SHAPE>> results =
883 ParsePoly(
nullptr, polyData,
true,
false );
885 for(
auto& shape : results )
887 shape->SetFilled(
true );
894 std::unique_ptr<ZONE> zone = std::make_unique<ZONE>( footprint );
896 zone->SetIsRuleArea(
true );
897 zone->SetDoNotAllowFootprints( !!flags.count( 2 ) );
898 zone->SetDoNotAllowZoneFills( !!flags.count( 7 ) || !!flags.count( 6 )
899 || !!flags.count( 8 ) );
900 zone->SetDoNotAllowPads( !!flags.count( 7 ) );
901 zone->SetDoNotAllowTracks( !!flags.count( 7 ) || !!flags.count( 5 ) );
902 zone->SetDoNotAllowVias( !!flags.count( 7 ) );
904 zone->SetLayer( klayer );
905 zone->Outline()->Append( polySet );
912 if( aProject.is_object() && aProject.contains(
"devices" ) )
914 std::map<wxString, EASYEDAPRO::PRJ_DEVICE> devicesMap = aProject.at(
"devices" );
915 std::map<wxString, wxString> compAttrs;
917 for(
auto& [devUuid, devData] : devicesMap )
919 if(
auto fp =
get_opt( devData.attributes,
"Footprint" ) )
923 compAttrs = devData.attributes;
929 wxString modelUuid, modelTitle, modelTransform;
931 modelUuid =
get_def( compAttrs,
"3D Model",
"" );
932 modelTitle =
get_def( compAttrs,
"3D Model Title", modelUuid );
933 modelTransform =
get_def( compAttrs,
"3D Model Transform",
"" );
939 std::vector<PCB_SHAPE*> edgeShapes;
944 edgeShapes.push_back(
static_cast<PCB_SHAPE*
>( item ) );
955 std::unique_ptr<PCB_SHAPE> shape =
961 shape->SetEnd( bbox.
GetEnd() );
966 bool hasFabRef =
false;
972 if(
static_cast<PCB_TEXT*
>( item )->GetText() == wxT(
"${REFERENCE}" ) )
984 int c_refTextThickness =
pcbIUScale.mmToIU( 0.1 );
985 std::unique_ptr<PCB_TEXT> refText = std::make_unique<PCB_TEXT>( footprint );
987 refText->SetLayer(
F_Fab );
988 refText->SetTextSize(
VECTOR2I( c_refTextSize, c_refTextSize ) );
989 refText->SetTextThickness( c_refTextThickness );
990 refText->SetText( wxT(
"${REFERENCE}" ) );
995 return footprintPtr.release();
1000 BOARD* aBoard,
const nlohmann::json& aProject,
1001 std::map<wxString, std::unique_ptr<FOOTPRINT>>& aFootprintMap,
1002 const std::map<wxString, EASYEDAPRO::BLOB>& aBlobMap,
1003 const std::multimap<wxString, EASYEDAPRO::POURED>& aPouredMap,
1004 const std::vector<nlohmann::json>& aLines,
const wxString& aFpLibName )
1006 std::map<wxString, std::vector<nlohmann::json>> componentLines;
1007 std::map<wxString, std::vector<nlohmann::json>> ruleLines;
1009 std::multimap<wxString, EASYEDAPRO::POURED> boardPouredMap = aPouredMap;
1010 std::map<wxString, ZONE*> poursToFill;
1014 for(
const nlohmann::json& line : aLines )
1016 if( line.size() == 0 )
1019 wxString type = line.at( 0 );
1021 if( type == wxS(
"LAYER" ) )
1023 int layer = line.at( 1 );
1026 wxString layerType = line.at( 2 );
1027 wxString layerName = line.at( 3 );
1028 int layerFlag = line.at( 4 );
1030 if( layerFlag != 0 )
1033 blayers.
set( klayer );
1038 else if( type == wxS(
"NET" ) )
1040 wxString netname = line.at( 1 );
1045 else if( type == wxS(
"RULE" ) )
1047 wxString ruleType = line.at( 1 );
1048 wxString ruleName = line.at( 2 );
1049 int isDefault = line.at( 3 );
1050 nlohmann::json ruleData = line.at( 4 );
1052 if( ruleType == wxS(
"3" ) && isDefault )
1054 wxString units = ruleData.at( 0 );
1055 double minVal = ruleData.at( 1 );
1059 else if( ruleType == wxS(
"1" ) && isDefault )
1061 wxString units = ruleData.at( 0 );
1062 nlohmann::json
table = ruleData.at( 1 );
1064 int minVal = INT_MAX;
1065 for(
const auto& arr :
table )
1067 for(
int val : arr )
1077 ruleLines[ruleType].push_back( line );
1079 else if( type == wxS(
"POURED" ) )
1081 if( !line.at( 2 ).is_string() )
1085 boardPouredMap.emplace( poured.
parentId, poured );
1087 else if( type == wxS(
"VIA" ) || type == wxS(
"LINE" ) || type == wxS(
"ARC" )
1088 || type == wxS(
"POLY" ) || type == wxS(
"FILL" ) || type == wxS(
"POUR" ) )
1090 wxString uuid = line.at( 1 );
1097 wxString netname = line.at( 3 );
1099 if( type == wxS(
"VIA" ) )
1105 double drill = line.at( 7 );
1106 double dia = line.at( 8 );
1108 std::unique_ptr<PCB_VIA>
via = std::make_unique<PCB_VIA>( aBoard );
1118 else if( type == wxS(
"LINE" ) )
1120 int layer = line.at( 4 ).get<
int>();
1124 start.
x = line.at( 5 );
1125 start.
y = line.at( 6 );
1128 end.x = line.at( 7 );
1129 end.y = line.at( 8 );
1131 double width = line.at( 9 );
1133 std::unique_ptr<PCB_TRACK> track = std::make_unique<PCB_TRACK>( aBoard );
1135 track->SetLayer( klayer );
1136 track->SetStart(
ScalePos( start ) );
1140 track->SetNet( aBoard->
FindNet( netname ) );
1144 else if( type == wxS(
"ARC" ) )
1146 int layer = line.at( 4 ).get<
int>();
1150 start.
x = line.at( 5 );
1151 start.
y = line.at( 6 );
1154 end.x = line.at( 7 );
1155 end.y = line.at( 8 );
1157 double angle = line.at( 9 );
1158 double width = line.at( 10 );
1163 double ha = angle / 2;
1164 double hd =
delta.EuclideanNorm() / 2;
1165 double cdist = hd / tan(
DEG2RAD( ha ) );
1172 std::unique_ptr<PCB_ARC> arc = std::make_unique<PCB_ARC>( aBoard, &sarc );
1175 arc->SetLayer( klayer );
1176 arc->SetNet( aBoard->
FindNet( netname ) );
1180 else if( type == wxS(
"FILL" ) )
1182 int layer = line.at( 4 ).get<
int>();
1185 nlohmann::json polyDataList = line.at( 7 );
1187 if( !polyDataList.at( 0 ).is_array() )
1188 polyDataList = nlohmann::json::array( { polyDataList } );
1190 std::vector<SHAPE_LINE_CHAIN> contours;
1191 for( nlohmann::json& polyData : polyDataList )
1196 contours.push_back( contour );
1207 std::unique_ptr<ZONE> zone = std::make_unique<ZONE>( aBoard );
1209 zone->SetNet( aBoard->
FindNet( netname ) );
1210 zone->SetLayer( klayer );
1212 zone->SetFilledPolysList( klayer, zoneFillPoly );
1213 zone->SetAssignedPriority( 500 );
1214 zone->SetIsFilled(
true );
1215 zone->SetNeedRefill(
false );
1222 else if( type == wxS(
"POLY" ) )
1224 int layer = line.at( 4 );
1227 double thickness = line.at( 5 );
1228 nlohmann::json polyData = line.at( 6 );
1230 std::vector<std::unique_ptr<PCB_SHAPE>> results =
1231 ParsePoly( aBoard, polyData,
false,
false );
1233 for(
auto& shape : results )
1235 shape->SetLayer( klayer );
1236 shape->SetWidth(
ScaleSize( thickness ) );
1241 else if( type == wxS(
"POUR" ) )
1243 int layer = line.at( 4 ).get<
int>();
1246 wxString pourname = line.at( 6 );
1247 int fillOrder = line.at( 7 ).get<
int>();
1248 nlohmann::json polyDataList = line.at( 8 );
1250 std::unique_ptr<ZONE> zone = std::make_unique<ZONE>( aBoard );
1252 zone->SetNet( aBoard->
FindNet( netname ) );
1253 zone->SetLayer( klayer );
1254 zone->SetAssignedPriority( 500 - fillOrder );
1258 for( nlohmann::json& polyData : polyDataList )
1263 zone->Outline()->Append( contour );
1266 wxASSERT( zone->Outline()->OutlineCount() == 1 );
1268 poursToFill.emplace( uuid, zone.get() );
1273 else if( type == wxS(
"TEARDROP" ) )
1275 wxString uuid = line.at( 1 );
1276 wxString netname = line.at( 2 );
1277 int layer = line.at( 3 ).get<
int>();
1280 nlohmann::json polyData = line.at( 4 );
1285 std::unique_ptr<ZONE> zone = std::make_unique<ZONE>( aBoard );
1287 zone->SetNet( aBoard->
FindNet( netname ) );
1288 zone->SetLayer( klayer );
1289 zone->Outline()->Append( contour );
1290 zone->SetFilledPolysList( klayer, contour );
1291 zone->SetNeedRefill(
false );
1292 zone->SetIsFilled(
true );
1294 zone->SetAssignedPriority( 600 );
1295 zone->SetLocalClearance( 0 );
1296 zone->SetMinThickness( 0 );
1301 else if( type == wxS(
"REGION" ) )
1303 wxString uuid = line.at( 1 );
1310 int layer = line.at( 3 ).get<
int>();
1313 std::set<int> flags = line.at( 5 );
1314 nlohmann::json polyDataList = line.at( 6 );
1316 for( nlohmann::json& polyData : polyDataList )
1321 std::unique_ptr<ZONE> zone = std::make_unique<ZONE>( aBoard );
1323 zone->SetIsRuleArea(
true );
1324 zone->SetDoNotAllowFootprints( !!flags.count( 2 ) );
1325 zone->SetDoNotAllowZoneFills( !!flags.count( 7 ) || !!flags.count( 6 )
1326 || !!flags.count( 8 ) );
1327 zone->SetDoNotAllowPads( !!flags.count( 7 ) );
1328 zone->SetDoNotAllowTracks( !!flags.count( 7 ) || !!flags.count( 5 ) );
1329 zone->SetDoNotAllowVias( !!flags.count( 7 ) );
1331 zone->SetLayer( klayer );
1332 zone->Outline()->Append( contour );
1337 else if( type == wxS(
"PAD" ) )
1339 wxString netname = line.at( 3 );
1341 std::unique_ptr<FOOTPRINT> footprint = std::make_unique<FOOTPRINT>( aBoard );
1342 std::unique_ptr<PAD>
pad =
createPAD( footprint.get(), line );
1353 footprint->SetPosition( pos );
1354 footprint->SetOrientation( orient );
1356 wxString fpName = wxS(
"Pad_" ) + line.at( 1 ).get<wxString>();
1359 footprint->SetFPID( fpID );
1360 footprint->Reference().SetVisible(
true );
1361 footprint->Value().SetVisible(
true );
1362 footprint->AutoPositionFields();
1366 else if( type == wxS(
"IMAGE" ) )
1368 wxString uuid = line.at( 1 );
1375 int layer = line.at( 3 ).get<
int>();
1378 VECTOR2D start( line.at( 4 ), line.at( 5 ) );
1379 VECTOR2D size( line.at( 6 ), line.at( 7 ) );
1381 double angle = line.at( 8 );
1382 int mirror = line.at( 9 );
1383 nlohmann::json polyDataList = line.at( 10 );
1386 std::vector<SHAPE_LINE_CHAIN> contours;
1387 for( nlohmann::json& polyData : polyDataList )
1392 contours.push_back( contour );
1404 for(
int i = 0; i < contour.PointCount(); i++ )
1415 std::unique_ptr<PCB_GROUP>
group;
1418 group = std::make_unique<PCB_GROUP>( aBoard );
1424 std::unique_ptr<PCB_SHAPE> shape =
1427 shape->SetFilled(
true );
1428 shape->SetPolyShape( poly );
1429 shape->SetLayer( klayer );
1430 shape->SetWidth( 0 );
1440 shape->Mirror(
ScalePos( start ), flipDirection );
1444 group->AddItem( shape.get() );
1452 else if( type == wxS(
"OBJ" ) )
1455 wxString mimeType, base64Data;
1459 if( !line.at( 3 ).is_number() )
1462 int layer = line.at( 3 ).get<
int>();
1465 start =
VECTOR2D( line.at( 5 ), line.at( 6 ) );
1466 size =
VECTOR2D( line.at( 7 ), line.at( 8 ) );
1467 angle = line.at( 9 );
1468 flipped = line.at( 10 );
1470 wxString imageUrl = line.at( 11 );
1472 if( imageUrl.BeforeFirst(
':' ) == wxS(
"blob" ) )
1474 wxString objectId = imageUrl.AfterLast(
':' );
1476 if(
auto blob =
get_opt( aBlobMap, objectId ) )
1478 wxString blobUrl = blob->url;
1480 if( blobUrl.BeforeFirst(
':' ) == wxS(
"data" ) )
1482 wxArrayString paramsArr =
1483 wxSplit( blobUrl.AfterFirst(
':' ).BeforeFirst(
',' ),
';',
'\0' );
1485 base64Data = blobUrl.AfterFirst(
',' );
1487 if( paramsArr.size() > 0 )
1488 mimeType = paramsArr[0];
1496 if( mimeType.empty() || base64Data.empty() )
1499 wxMemoryBuffer buf = wxBase64Decode( base64Data );
1501 if( mimeType == wxS(
"image/svg+xml" ) )
1507 VECTOR2D kcenter = kstart + ksize / 2;
1509 std::unique_ptr<PCB_REFERENCE_IMAGE> bitmap =
1510 std::make_unique<PCB_REFERENCE_IMAGE>( aBoard, kcenter, klayer );
1513 wxImage::SetDefaultLoadFlags( wxImage::GetDefaultLoadFlags()
1514 & ~wxImage::Load_Verbose );
1526 int x = bitmap->GetPosition().x;
1537 else if( type == wxS(
"STRING" ) )
1539 wxString uuid = line.at( 1 );
1546 int layer = line.at( 3 ).get<
int>();
1550 wxString
string = line.at( 6 );
1551 wxString font = line.at( 7 );
1553 double height = line.at( 8 );
1554 double strokew = line.at( 9 );
1556 int align = line.at( 12 );
1557 double angle = line.at( 13 );
1558 int inverted = line.at( 14 );
1559 int mirror = line.at( 16 );
1563 text->SetText(
string );
1564 text->SetLayer( klayer );
1566 text->SetIsKnockout( inverted );
1570 if( font != wxS(
"default" ) )
1583 text->SetMirrored(
true );
1584 text->SetTextAngleDegrees( -angle );
1588 text->SetTextAngleDegrees( angle );
1593 else if( type == wxS(
"COMPONENT" ) )
1595 wxString compId = line.at( 1 );
1596 componentLines[compId].push_back( line );
1598 else if( type == wxS(
"ATTR" ) )
1600 wxString compId = line.at( 3 );
1601 componentLines[compId].push_back( line );
1603 else if( type == wxS(
"PAD_NET" ) )
1605 wxString compId = line.at( 1 );
1606 componentLines[compId].push_back( line );
1610 for(
auto const& [compId, lines] : componentLines )
1613 wxString fpIdOverride;
1614 wxString fpDesignator;
1615 std::map<wxString, wxString> localCompAttribs;
1617 for(
auto& line : lines )
1619 if( line.size() == 0 )
1622 wxString type = line.at( 0 );
1624 if( type == wxS(
"COMPONENT" ) )
1626 localCompAttribs = line.at( 7 );
1628 else if( type == wxS(
"ATTR" ) )
1632 if( attr.
key == wxS(
"Device" ) )
1633 deviceId = attr.
value;
1635 else if( attr.
key == wxS(
"Footprint" ) )
1636 fpIdOverride = attr.
value;
1638 else if( attr.
key == wxS(
"Designator" ) )
1639 fpDesignator = attr.
value;
1643 if( deviceId.empty() )
1646 nlohmann::json compAttrs = aProject.at(
"devices" ).at( deviceId ).at(
"attributes" );
1650 if( !fpIdOverride.IsEmpty() )
1651 fpId = fpIdOverride;
1653 fpId = compAttrs.at(
"Footprint" ).get<wxString>();
1655 auto it = aFootprintMap.find( fpId );
1656 if( it == aFootprintMap.end() )
1658 wxLogError(
"Footprint of '%s' with uuid '%s' not found.", fpDesignator, fpId );
1662 std::unique_ptr<FOOTPRINT>& footprintOrig = it->second;
1663 std::unique_ptr<FOOTPRINT> footprint(
static_cast<FOOTPRINT*
>( footprintOrig->Clone() ) );
1665 wxString modelUuid, modelTitle, modelTransform;
1667 if(
auto val =
get_opt( localCompAttribs,
"3D Model" ) )
1670 modelUuid = compAttrs.value<wxString>(
"3D Model",
"" );
1672 if(
auto val =
get_opt( localCompAttribs,
"3D Model Title" ) )
1673 modelTitle = val->Trim();
1675 modelTitle = compAttrs.value<wxString>(
"3D Model Title", modelUuid ).Trim();
1677 if(
auto val =
get_opt( localCompAttribs,
"3D Model Transform" ) )
1678 modelTransform = *val;
1680 modelTransform = compAttrs.value<wxString>(
"3D Model Transform",
"" );
1684 footprint->SetParent( aBoard );
1686 for(
auto& line : lines )
1688 if( line.size() == 0 )
1691 wxString type = line.at( 0 );
1693 if( type == wxS(
"COMPONENT" ) )
1695 int layer = line.at( 3 );
1700 double orient = line.at( 6 );
1703 if( klayer ==
B_Cu )
1706 footprint->SetOrientationDegrees( orient );
1709 else if( type == wxS(
"ATTR" ) )
1717 if( attr.
key == wxS(
"Designator" ) )
1719 if( attr.
key == wxS(
"Designator" ) )
1729 if( attr.
fontName != wxS(
"default" ) )
1758 else if( type == wxS(
"PAD_NET" ) )
1760 wxString padNumber = line.at( 2 );
1761 wxString padNet = line.at( 3 );
1763 PAD*
pad = footprint->FindPadByNumber( padNumber );
1781 for(
auto& [uuid, zone] : poursToFill )
1786 auto range = boardPouredMap.equal_range( uuid );
1787 for(
auto& it = range.first; it != range.second; ++it )
1793 for(
int dataId = 0; dataId < (int) poured.
polyData.size(); dataId++ )
1795 const nlohmann::json& fillData = poured.
polyData[dataId];
1796 const double ptScale = 10;
1801 for(
int i = 0; i < contour.
PointCount(); i++ )
1814 thisPoly.
Append( simple );
1823 const int thermalWidth =
pcbIUScale.mmToIU( 0.2 );
1825 for(
int segId = 0; segId < contour.
SegmentCount(); segId++ )
1835 fillPolySet.
Append( thisPoly );
1842 const int strokeWidth =
pcbIUScale.MilsToIU( 8 );
1851 zone->SetFilledPolysList( zone->GetFirstLayer(), fillPolySet );
1852 zone->SetNeedRefill(
false );
1853 zone->SetIsFilled(
true );
1859 std::vector<PCB_SHAPE*> shapes;
1867 shapes.push_back(
static_cast<PCB_SHAPE*
>( item ) );
1882 offset.
x =
KiROUND( offset.
x / alignGrid ) * alignGrid;
1883 offset.
y =
KiROUND( offset.
y / alignGrid ) * alignGrid;
1885 aBoard->
Move( offset );