3d viewer: fix incorrect calculation of pad hole size of vertical shape.

Fixes #5627
https://gitlab.com/kicad/code/kicad/issues/5627
This commit is contained in:
jean-pierre charras 2020-09-15 10:17:31 +02:00
parent 514da2f886
commit 98339cd5eb
1 changed files with 4 additions and 8 deletions

View File

@ -799,16 +799,12 @@ void C3D_RENDER_OGL_LEGACY::generate_3D_Vias_and_Pads()
if( !hasHole ) if( !hasHole )
continue; continue;
// we use the hole diameter to calculate the seg count. const int copperThickness = m_boardAdapter.GetCopperThicknessBIU();
// for round holes, drillsize.x == drillsize.y
// for slots, the diameter is the smaller of (drillsize.x, drillsize.y)
int copperThickness = m_boardAdapter.GetCopperThicknessBIU();
int radius = std::min( drillsize.x, drillsize.y ) / 2 + copperThickness;
pad->TransformHoleWithClearanceToPolygon( tht_outer_holes_poly, pad->TransformHoleWithClearanceToPolygon( tht_outer_holes_poly,
copperThickness + radius ); copperThickness, ARC_LOW_DEF );
pad->TransformHoleWithClearanceToPolygon( tht_inner_holes_poly,
pad->TransformHoleWithClearanceToPolygon( tht_inner_holes_poly, radius ); 0, ARC_LOW_DEF );
} }
} }
} }