From 455268f45eae31ee0fa3113ede5cfdc0fd3683d5 Mon Sep 17 00:00:00 2001 From: Alex Shvartzkop Date: Sat, 7 Oct 2023 06:25:27 +0300 Subject: [PATCH] Allow to specify meander initial side via meander settings. --- pcbnew/router/pns_meander.h | 4 ++++ pcbnew/router/pns_meander_placer.cpp | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/pcbnew/router/pns_meander.h b/pcbnew/router/pns_meander.h index b09e870f41..31e24f5b9a 100644 --- a/pcbnew/router/pns_meander.h +++ b/pcbnew/router/pns_meander.h @@ -71,6 +71,7 @@ public: m_cornerStyle = MEANDER_STYLE_ROUND; m_cornerRadiusPercentage = 100; m_singleSided = false; + m_segmentSide = 0; m_lengthTolerance = 100000; } @@ -101,6 +102,9 @@ public: ///< Place meanders on one side. bool m_singleSided; + ///< Force initial side at segment (0: based on cursor, 1: right side, -1: left side) + int m_segmentSide; + ///< Allowable tuning error. int m_lengthTolerance; diff --git a/pcbnew/router/pns_meander_placer.cpp b/pcbnew/router/pns_meander_placer.cpp index a104f8d1e2..70e387a4ec 100644 --- a/pcbnew/router/pns_meander_placer.cpp +++ b/pcbnew/router/pns_meander_placer.cpp @@ -138,9 +138,16 @@ bool MEANDER_PLACER::doMove( const VECTOR2I& aP, ITEM* aEndItem, long long int a continue; } + bool side = false; const SEG s = tuned.CSegment( i ); + + if( m_settings.m_segmentSide == 0 ) + side = s.Side( aP ) < 0; + else + side = m_settings.m_segmentSide < 0; + m_result.AddCorner( s.A ); - m_result.MeanderSegment( s, s.Side( aP ) < 0 ); + m_result.MeanderSegment( s, side ); m_result.AddCorner( s.B ); }