3D Viewer: Fix missing barrel walls for NPTH holes in OpenGL mode

NPTH holes were not showing barrel walls because their polygons were
stored in m_NPTH_ODPolys but the barrel wall generation in generateHoles()
only used m_TH_ODPolys. Add NPTH polygons to the outer polygon set before
generating through-hole geometry.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21181
This commit is contained in:
Seth Hillbrand
2026-01-29 09:20:09 -08:00
parent a26c25b7e5
commit 44e5ef0aa0
@@ -754,6 +754,10 @@ void RENDER_3D_OPENGL::reload( REPORTER* aStatusReporter, REPORTER* aWarningRepo
SHAPE_POLY_SET outerPolyTHT = m_boardAdapter.GetTH_ODPolys().CloneDropTriangulation();
// Include NPTH polygons so their barrel walls are also generated
if( m_boardAdapter.GetNPTH_ODPolys().OutlineCount() > 0 )
outerPolyTHT.BooleanAdd( m_boardAdapter.GetNPTH_ODPolys() );
outerPolyTHT.BooleanIntersection( m_boardAdapter.GetBoardPoly() );
m_outerThroughHoles = generateHoles( m_boardAdapter.GetTH_ODs().GetList(), outerPolyTHT,