diff --git a/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp b/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp index 9586a0ad2e..e0dbf8d6ef 100644 --- a/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp +++ b/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp @@ -386,9 +386,22 @@ void CINFO3D_VISU::createNewPadWithClearance( const D_PAD* aPad, case PAD_SHAPE_RECT: { // see pcbnew/board_items_to_polygon_shape_transform.cpp - wxPoint corners[4]; - aPad->BuildPadPolygon( corners, aClearanceValue, aPad->GetOrientation() ); + bool drawOutline; + + // For aClearanceValue.x == aClearanceValue.y and > 0 we use the pad shape + // and draw outlines with thicknes = aClearanceValue. + // Otherwise we draw only the inflated/deflated shape + if( aClearanceValue.x > 0 && aClearanceValue.x == aClearanceValue.y ) + { + drawOutline = true; + aPad->BuildPadPolygon( corners, wxSize( 0, 0 ), aPad->GetOrientation() ); + } + else + { + drawOutline = false; + aPad->BuildPadPolygon( corners, aClearanceValue, aPad->GetOrientation() ); + } SFVEC2F corners3DU[4]; @@ -416,20 +429,23 @@ void CINFO3D_VISU::createNewPadWithClearance( const D_PAD* aPad, // Add the PAD contours // Round segments cannot have 0-length elements, so we approximate them // as a small circle - for( int i = 1; i <= 4; i++ ) + if( drawOutline ) { - if( Is_segment_a_circle( corners3DU[i - 1], corners3DU[i & 3] ) ) + for( int i = 1; i <= 4; i++ ) { - aDstContainer->Add( new CFILLEDCIRCLE2D( corners3DU[i - 1], - aClearanceValue.x * m_biuTo3Dunits, - *aPad ) ); - } - else - { - aDstContainer->Add( new CROUNDSEGMENT2D( corners3DU[i - 1], - corners3DU[i & 3], - aClearanceValue.x * 2.0f * m_biuTo3Dunits, - *aPad ) ); + if( Is_segment_a_circle( corners3DU[i - 1], corners3DU[i & 3] ) ) + { + aDstContainer->Add( new CFILLEDCIRCLE2D( corners3DU[i - 1], + aClearanceValue.x * m_biuTo3Dunits, + *aPad ) ); + } + else + { + aDstContainer->Add( new CROUNDSEGMENT2D( corners3DU[i - 1], + corners3DU[i & 3], + aClearanceValue.x * 2.0f * m_biuTo3Dunits, + *aPad ) ); + } } } }