From b9246dd46386a33d1d2a99cda97c31681959df93 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Wed, 28 May 2014 13:16:15 +0200 Subject: [PATCH] bugfix #1323135: PNS creates vias with giant holes. --- pcbnew/router/pns_line_placer.cpp | 13 +++++-------- pcbnew/router/pns_via.h | 4 +++- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/pcbnew/router/pns_line_placer.cpp b/pcbnew/router/pns_line_placer.cpp index a79993249f..a0869dab9f 100644 --- a/pcbnew/router/pns_line_placer.cpp +++ b/pcbnew/router/pns_line_placer.cpp @@ -380,8 +380,7 @@ bool PNS_LINE_PLACER::handleViaPlacement( PNS_LINE& aHead ) return true; PNS_LAYERSET allLayers( 0, 15 ); - PNS_VIA v( aHead.CPoint( -1 ), allLayers, m_viaDiameter, aHead.Net() ); - v.SetDrill( m_viaDrill ); + PNS_VIA v( aHead.CPoint( -1 ), allLayers, m_viaDiameter, m_viaDrill, aHead.Net() ); VECTOR2I force; VECTOR2I lead = aHead.CPoint( -1 ) - aHead.CPoint( 0 ); @@ -441,7 +440,7 @@ bool PNS_LINE_PLACER::rhWalkOnly ( const VECTOR2I& aP, PNS_LINE& aNewHead ) else if( m_placingVia && viaOk ) { PNS_LAYERSET allLayers( 0, 15 ); - PNS_VIA v1( walkFull.CPoint( -1 ), allLayers, m_viaDiameter ); + PNS_VIA v1( walkFull.CPoint( -1 ), allLayers, m_viaDiameter, m_viaDrill ); walkFull.AppendVia( v1 ); } @@ -466,7 +465,7 @@ bool PNS_LINE_PLACER::rhMarkObstacles( const VECTOR2I& aP, PNS_LINE& aNewHead ) if( m_placingVia ) { PNS_LAYERSET allLayers( 0, 15 ); - PNS_VIA v1( m_head.CPoint( -1 ), allLayers, m_viaDiameter ); + PNS_VIA v1( m_head.CPoint( -1 ), allLayers, m_viaDiameter, m_viaDrill ); m_head.AppendVia( v1 ); } @@ -509,10 +508,8 @@ bool PNS_LINE_PLACER::rhShoveOnly ( const VECTOR2I& aP, PNS_LINE& aNewHead ) if( m_placingVia ) { PNS_LAYERSET allLayers( 0, 15 ); - PNS_VIA v1( l.CPoint( -1 ), allLayers, m_viaDiameter ); - PNS_VIA v2( l2.CPoint( -1 ), allLayers, m_viaDiameter ); - v1.SetDrill( m_viaDrill ); - v2.SetDrill( m_viaDrill ); + PNS_VIA v1( l.CPoint( -1 ), allLayers, m_viaDiameter, m_viaDrill ); + PNS_VIA v2( l2.CPoint( -1 ), allLayers, m_viaDiameter, m_viaDrill ); l.AppendVia( v1 ); l2.AppendVia( v2 ); diff --git a/pcbnew/router/pns_via.h b/pcbnew/router/pns_via.h index 00a4587b74..8ebb5a0de1 100644 --- a/pcbnew/router/pns_via.h +++ b/pcbnew/router/pns_via.h @@ -35,13 +35,15 @@ public: PNS_ITEM( VIA ) {} - PNS_VIA( const VECTOR2I& aPos, const PNS_LAYERSET& aLayers, int aDiameter, int aNet = -1 ) : + PNS_VIA( const VECTOR2I& aPos, const PNS_LAYERSET& aLayers, + int aDiameter, int aDrill, int aNet = -1 ) : PNS_ITEM( VIA ) { SetNet( aNet ); SetLayers( aLayers ); m_pos = aPos; m_diameter = aDiameter; + m_drill = aDrill; m_shape = SHAPE_CIRCLE( aPos, aDiameter / 2 ); }