Avoid drawing null-arcs in 3d viewer

An arc with no radius or no angle is not visible and should be avoided

Fixes https://gitlab.com/kicad/code/kicad/issues/14271

(cherry picked from commit 72ebe5a429)
This commit is contained in:
Seth Hillbrand 2023-03-13 11:47:02 -07:00
parent e20614660b
commit 3568ff72bf
1 changed files with 4 additions and 0 deletions

View File

@ -275,6 +275,10 @@ void BOARD_ADAPTER::createTrack( const PCB_TRACK* aTrack, CONTAINER_2D_BASE* aDs
int arcsegcount = GetArcToSegmentCount( radius, ARC_HIGH_DEF, arc_angle ); int arcsegcount = GetArcToSegmentCount( radius, ARC_HIGH_DEF, arc_angle );
int circlesegcount; int circlesegcount;
// Avoid arcs that cannot be drawn
if( radius < std::numeric_limits<double>::min() || arc_angle.IsZero() )
break;
// We need a circle to segment count. However, the arc angle can be small, and the // We need a circle to segment count. However, the arc angle can be small, and the
// radius very big. so we calculate a reasonable value for circlesegcount. // radius very big. so we calculate a reasonable value for circlesegcount.
if( arcsegcount <= 1 ) // The arc will be approximated by a segment if( arcsegcount <= 1 ) // The arc will be approximated by a segment