diff --git a/pcbnew/router/pns_joint.h b/pcbnew/router/pns_joint.h index df06458f65..d1e4a14fc6 100644 --- a/pcbnew/router/pns_joint.h +++ b/pcbnew/router/pns_joint.h @@ -84,9 +84,6 @@ public: /// segments of the same net, on the same layer. bool IsLineCorner() const { - if( m_locked ) - return false; - if( m_linkedItems.Size() != 2 || m_linkedItems.Count( SEGMENT ) != 2 ) return false; diff --git a/pcbnew/router/pns_node.cpp b/pcbnew/router/pns_node.cpp index fa99dd82a2..b276b799a3 100644 --- a/pcbnew/router/pns_node.cpp +++ b/pcbnew/router/pns_node.cpp @@ -737,7 +737,8 @@ void PNS_NODE::Remove( PNS_LINE& aLine ) void PNS_NODE::followLine( PNS_SEGMENT* aCurrent, bool aScanDirection, int& aPos, - int aLimit, VECTOR2I* aCorners, PNS_SEGMENT** aSegments, bool& aGuardHit ) + int aLimit, VECTOR2I* aCorners, PNS_SEGMENT** aSegments, bool& aGuardHit, + bool aStopAtLockedJoints ) { bool prevReversed = false; @@ -762,7 +763,9 @@ void PNS_NODE::followLine( PNS_SEGMENT* aCurrent, bool aScanDirection, int& aPos break; } - if( !jt->IsLineCorner() || aPos < 0 || aPos == aLimit ) + bool locked = aStopAtLockedJoints ? jt->IsLocked() : false; + + if( locked || !jt->IsLineCorner() || aPos < 0 || aPos == aLimit ) break; aCurrent = jt->NextSegment( aCurrent ); @@ -773,7 +776,7 @@ void PNS_NODE::followLine( PNS_SEGMENT* aCurrent, bool aScanDirection, int& aPos } -const PNS_LINE PNS_NODE::AssembleLine( PNS_SEGMENT* aSeg, int* aOriginSegmentIndex ) +const PNS_LINE PNS_NODE::AssembleLine( PNS_SEGMENT* aSeg, int* aOriginSegmentIndex, bool aStopAtLockedJoints ) { const int MaxVerts = 1024 * 16; @@ -790,10 +793,10 @@ const PNS_LINE PNS_NODE::AssembleLine( PNS_SEGMENT* aSeg, int* aOriginSegmentInd pl.SetNet( aSeg->Net() ); pl.SetOwner( this ); - followLine( aSeg, false, i_start, MaxVerts, corners, segs, guardHit ); + followLine( aSeg, false, i_start, MaxVerts, corners, segs, guardHit, aStopAtLockedJoints ); if( !guardHit ) - followLine( aSeg, true, i_end, MaxVerts, corners, segs, guardHit ); + followLine( aSeg, true, i_end, MaxVerts, corners, segs, guardHit, aStopAtLockedJoints ); int n = 0; diff --git a/pcbnew/router/pns_node.h b/pcbnew/router/pns_node.h index 2c52f6aee4..9846da85d9 100644 --- a/pcbnew/router/pns_node.h +++ b/pcbnew/router/pns_node.h @@ -309,7 +309,8 @@ public: * @param aOriginSegmentIndex index of aSeg in the resulting line * @return the line */ - const PNS_LINE AssembleLine( PNS_SEGMENT* aSeg, int* aOriginSegmentIndex = NULL ); + const PNS_LINE AssembleLine( PNS_SEGMENT* aSeg, int* aOriginSegmentIndex = NULL, + bool aStopAtLockedJoints = false ); ///> Prints the contents and joints structure void Dump( bool aLong = false ); @@ -446,7 +447,8 @@ private: int aLimit, VECTOR2I* aCorners, PNS_SEGMENT** aSegments, - bool& aGuardHit ); + bool& aGuardHit, + bool aStopAtLockedJoints ); ///> hash table with the joints, linking the items. Joints are hashed by ///> their position, layer set and net. diff --git a/pcbnew/router/pns_shove.cpp b/pcbnew/router/pns_shove.cpp index c03afa7555..9ff66ca607 100644 --- a/pcbnew/router/pns_shove.cpp +++ b/pcbnew/router/pns_shove.cpp @@ -95,7 +95,7 @@ PNS_SHOVE::~PNS_SHOVE() PNS_LINE PNS_SHOVE::assembleLine( const PNS_SEGMENT* aSeg, int* aIndex ) { - return m_currentNode->AssembleLine( const_cast( aSeg ), aIndex ); + return m_currentNode->AssembleLine( const_cast( aSeg ), aIndex, true ); } // A dumb function that checks if the shoved line is shoved the right way, e.g.