diff --git a/common/geometry/shape_poly_set.cpp b/common/geometry/shape_poly_set.cpp index a00a903d1a..3dd21d32aa 100644 --- a/common/geometry/shape_poly_set.cpp +++ b/common/geometry/shape_poly_set.cpp @@ -1882,11 +1882,15 @@ void SHAPE_POLY_SET::CacheTriangulation() { tmpSet.Fracture( PM_FAST ); - if( !tess.TesselatePolygon( tmpSet.Polygon( i ).front() ) ) + // After fracturing, we may have zero or one polygon + // Check for zero polygons before tesselating and break regardless + if( !tmpSet.OutlineCount() || !tess.TesselatePolygon( tmpSet.Polygon( i ).front() ) ) { m_triangulatedPolys.pop_back(); m_triangulationValid = false; } + + break; } } diff --git a/include/geometry/polygon_triangulation.h b/include/geometry/polygon_triangulation.h index 335eee49da..b419b45c6f 100644 --- a/include/geometry/polygon_triangulation.h +++ b/include/geometry/polygon_triangulation.h @@ -649,8 +649,6 @@ public: bool TesselatePolygon( const SHAPE_LINE_CHAIN& aPoly ) { - ClipperLib::Clipper c; - m_bbox = aPoly.BBox(); m_result.Clear();