diff --git a/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp b/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp index 90b759059e..7a84a5056b 100644 --- a/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp +++ b/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp @@ -827,6 +827,8 @@ void CINFO3D_VISU::AddShapeWithClearanceToContainer( const DRAWSEGMENT* aDrawSeg aDrawSegment->TransformShapeWithClearanceToPolygon( polyList, aClearanceValue, segcountforcircle, correctionFactor ); + polyList.Simplify( SHAPE_POLY_SET::PM_FAST ); + if( polyList.IsEmpty() ) // Just for caution break; @@ -850,6 +852,10 @@ void CINFO3D_VISU::AddSolidAreasShapesToContainer( const ZONE_CONTAINER* aZoneCo { // Copy the polys list because we have to simplify it SHAPE_POLY_SET polyList = SHAPE_POLY_SET(aZoneContainer->GetFilledPolysList()); + polyList.Simplify( SHAPE_POLY_SET::PM_FAST ); + + if( polyList.IsEmpty() ) + return; // This convert the poly in outline and holes Convert_shape_line_polygon_to_triangles( polyList, @@ -857,7 +863,6 @@ void CINFO3D_VISU::AddSolidAreasShapesToContainer( const ZONE_CONTAINER* aZoneCo m_biuTo3Dunits, *aZoneContainer ); - // add filled areas outlines, which are drawn with thick lines segments // ///////////////////////////////////////////////////////////////////////// for( int i = 0; i < polyList.OutlineCount(); ++i )