diff --git a/pcbnew/router/pns_optimizer.cpp b/pcbnew/router/pns_optimizer.cpp index 86624a722a..42ca171f22 100644 --- a/pcbnew/router/pns_optimizer.cpp +++ b/pcbnew/router/pns_optimizer.cpp @@ -224,6 +224,8 @@ bool AREA_CONSTRAINT::Check( int aVertex1, int aVertex2, const LINE* aOriginLine bool p1_in = m_allowedArea.Contains( p1 ); bool p2_in = m_allowedArea.Contains( p2 ); + bool p1n_in = false; + bool p2n_in = false; return p1_in || p2_in; } @@ -672,6 +674,7 @@ bool OPTIMIZER::mergeStep( LINE* aLine, SHAPE_LINE_CHAIN& aCurrentPath, int step bool ok = false; if ( !checkColliding( aLine, bypass ) ) { + //printf("Chk-constraints: %d %d\n", n, n+step+1 ); ok = checkConstraints ( n, n + step + 1, aLine, aCurrentPath, bypass ); } diff --git a/pcbnew/router/pns_optimizer.h b/pcbnew/router/pns_optimizer.h index 05e37d7945..b83218bef4 100644 --- a/pcbnew/router/pns_optimizer.h +++ b/pcbnew/router/pns_optimizer.h @@ -145,9 +145,10 @@ public: m_effortLevel |= OPTIMIZER::RESTRICT_VERTEX_RANGE; } - void SetRestrictArea( const BOX2I& aArea ) + void SetRestrictArea( const BOX2I& aArea, bool aStrict = true ) { m_restrictArea = aArea; + m_restrictAreaIsStrict = aStrict; } void ClearConstraints(); @@ -208,6 +209,7 @@ private: VECTOR2I m_preservedVertex; std::pair m_restrictedVertexRange; BOX2I m_restrictArea; + bool m_restrictAreaIsStrict; }; @@ -259,9 +261,10 @@ private: class AREA_CONSTRAINT : public OPT_CONSTRAINT { public: - AREA_CONSTRAINT( NODE* aWorld, const BOX2I& aAllowedArea ) : + AREA_CONSTRAINT( NODE* aWorld, const BOX2I& aAllowedArea, bool aAllowedAreaStrict ) : OPT_CONSTRAINT( aWorld ), - m_allowedArea ( aAllowedArea ) + m_allowedArea ( aAllowedArea ), + m_allowedAreaStrict ( aAllowedAreaStrict ) { }; @@ -271,6 +274,7 @@ public: private: BOX2I m_allowedArea; + bool m_allowedAreaStrict; };