From 0afac71b27310543ec3a1da1f5973a4eeef53687 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Tue, 20 Feb 2024 08:56:59 +0100 Subject: [PATCH] 3D viewer: fix the case of circles having a thickness > radius/2 Fixes #17035 https://gitlab.com/kicad/code/kicad/-/issues/17035 --- 3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp b/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp index be41355b19..dc1e4d5dbb 100644 --- a/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp +++ b/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp @@ -3,7 +3,7 @@ * * Copyright (C) 2015-2016 Mario Luzeiro * Copyright (C) 2023 CERN - * Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2024 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -610,7 +610,7 @@ void BOARD_ADAPTER::addShape( const PCB_SHAPE* aShape, CONTAINER_2D_BASE* aConta float innerR3DU = TO_3DU( aShape->GetRadius() ) - linewidth3DU / 2.0; float outerR3DU = TO_3DU( aShape->GetRadius() ) + linewidth3DU / 2.0; - if( aShape->IsFilled() ) + if( aShape->IsFilled() || innerR3DU <= 0.0 ) addFILLED_CIRCLE_2D( aContainer, center3DU, outerR3DU, *aOwner ); else addRING_2D( aContainer, center3DU, innerR3DU, outerR3DU, *aOwner );