From ccb668c105bfb7192d782a3ef2e9b4cb0cfeee47 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sat, 28 Apr 2018 20:31:50 +0200 Subject: [PATCH] 3D viewer: fix polygon contours of pads solder paste when solder paste ratio was not null. (the oval and round rect pads 3D contours were incorrect) Fixes: lp:1767209 https://bugs.launchpad.net/kicad/+bug/1767209 --- 3d-viewer/3d_canvas/create_layer_poly.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/3d-viewer/3d_canvas/create_layer_poly.cpp b/3d-viewer/3d_canvas/create_layer_poly.cpp index 3e1dd03fa9..28630fd4c9 100644 --- a/3d-viewer/3d_canvas/create_layer_poly.cpp +++ b/3d-viewer/3d_canvas/create_layer_poly.cpp @@ -52,8 +52,19 @@ void CINFO3D_VISU::buildPadShapePolygon( const D_PAD* aPad, case PAD_SHAPE_CIRCLE: case PAD_SHAPE_OVAL: case PAD_SHAPE_ROUNDRECT: - aPad->TransformShapeWithClearanceToPolygon( aCornerBuffer, aInflateValue.x, + { + // We are using TransformShapeWithClearanceToPolygon to build the shape. + // Currently, this method uses only the same inflate value for X and Y dirs. + // so because here this is not the case, we use a inflated dummy pad to build + // the polygonal shape + // TODO: remove this dummy pad when TransformShapeWithClearanceToPolygon will use + // a wxSize to inflate the pad size + D_PAD dummy( *aPad ); + wxSize new_size = aPad->GetSize() + aInflateValue + aInflateValue; + dummy.SetSize( new_size ); + dummy.TransformShapeWithClearanceToPolygon( aCornerBuffer, 0, aSegmentsPerCircle, aCorrectionFactor ); + } break; case PAD_SHAPE_TRAPEZOID: