diff --git a/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp b/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp index 71f3518aa3..39c7883dd5 100644 --- a/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp +++ b/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp @@ -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 circlesegcount; + // Avoid arcs that cannot be drawn + if( radius < std::numeric_limits::min() || arc_angle.IsZero() ) + break; + // 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. if( arcsegcount <= 1 ) // The arc will be approximated by a segment