diff --git a/pcbnew/router/pns_walkaround.cpp b/pcbnew/router/pns_walkaround.cpp index cd67cfc69c..c25450f01c 100644 --- a/pcbnew/router/pns_walkaround.cpp +++ b/pcbnew/router/pns_walkaround.cpp @@ -173,7 +173,7 @@ const WALKAROUND::RESULT WALKAROUND::Route( const LINE& aInitialPath ) break; // Safety valve - if( path_cw.Line().Length() > lengthLimit && path_ccw.Line().Length() > lengthLimit ) + if( m_lengthLimitOn && path_cw.Line().Length() > lengthLimit && path_ccw.Line().Length() > lengthLimit ) break; m_iteration++; diff --git a/pcbnew/router/pns_walkaround.h b/pcbnew/router/pns_walkaround.h index db1f960cdc..3e9875cb0b 100644 --- a/pcbnew/router/pns_walkaround.h +++ b/pcbnew/router/pns_walkaround.h @@ -49,6 +49,7 @@ public: m_iteration = 0; m_forceCw = false; m_forceLongerPath = false; + m_lengthLimitOn = true; } ~WALKAROUND() {}; @@ -111,6 +112,11 @@ public: const RESULT Route( const LINE& aInitialPath ); + void SetLengthLimit( bool aEnable ) + { + m_lengthLimitOn = aEnable; + } + private: void start( const LINE& aInitialPath ); @@ -129,6 +135,7 @@ private: std::set m_restrictedSet; std::vector m_restrictedVertices; bool m_forceLongerPath; + bool m_lengthLimitOn; }; }