From 9f24ea0bb71ef3986a1718281e71ef422c724e9d Mon Sep 17 00:00:00 2001 From: Thomas Pointhuber Date: Thu, 14 Jan 2021 22:18:46 +0100 Subject: [PATCH] altium: fix non-copper pads. Roundrect pads were not filled and SetLocalCoord() does not transform polygons into the local coordinates, which is unexpected. --- pcbnew/plugins/altium/altium_pcb.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pcbnew/plugins/altium/altium_pcb.cpp b/pcbnew/plugins/altium/altium_pcb.cpp index 2181e0beba..e12e4eb927 100644 --- a/pcbnew/plugins/altium/altium_pcb.cpp +++ b/pcbnew/plugins/altium/altium_pcb.cpp @@ -142,7 +142,20 @@ void ALTIUM_PCB::HelperDrawsegmentSetLocalCoord( PCB_SHAPE* aShape, uint16_t aCo FP_SHAPE* fpShape = dynamic_cast( aShape ); if( fpShape ) + { fpShape->SetLocalCoord(); + + // TODO: SetLocalCoord() does not update the polygon shape! + // This workaround converts the poly shape into the local coordinates + SHAPE_POLY_SET& polyShape = fpShape->GetPolyShape(); + if( !polyShape.IsEmpty() ) + { + FOOTPRINT* fp = m_components.at( aComponent ); + + polyShape.Move( -fp->GetPosition() ); + polyShape.Rotate( -fp->GetOrientationRadians() ); + } + } } } @@ -1967,6 +1980,7 @@ void ALTIUM_PCB::HelperParsePad6NonCopper( const APAD6& aElem ) wxPoint p21 = aElem.position + wxPoint( -offsetX, offsetY ); shape->SetShape( S_POLYGON ); + shape->SetFilled( true ); shape->SetPolyPoints( { p11, p12, p22, p21 } ); } else if( aElem.topsize.x == aElem.topsize.y )