Fix calculation of arc lengths; include them in net inspector

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8140
This commit is contained in:
Jon Evans 2021-04-15 21:06:35 -04:00
parent 64c8befa01
commit 29c45743b7
3 changed files with 9 additions and 1 deletions

View File

@ -1703,6 +1703,13 @@ std::tuple<int, double, double> BOARD::GetTrackLength( const TRACK& aTrack ) con
length += stackup.GetLayerDistance( via->TopLayer(), via->BottomLayer() );
continue;
}
else if( track->Type() == PCB_ARC_T )
{
// Note: we don't apply the clip-to-pad optimization if an arc ends in a pad
// Room for future improvement.
length += track->GetLength();
continue;
}
bool inPad = false;
SEG trackSeg( track->GetStart(), track->GetEnd() );

View File

@ -1038,6 +1038,7 @@ std::vector<CN_ITEM*> DIALOG_NET_INSPECTOR::relevantConnectivityItems() const
const auto type_bits = std::bitset<MAX_STRUCT_TYPE_ID>()
.set( PCB_TRACE_T )
.set( PCB_ARC_T )
.set( PCB_VIA_T )
.set( PCB_PAD_T );

View File

@ -328,7 +328,7 @@ public:
double radius = GetRadius();
double includedAngle = std::abs( GetAngle() );
return radius * M_PI * includedAngle / 180.0;
return radius * M_PI * includedAngle / 1800.0;
}
EDA_ITEM* Clone() const override;