Important performance optimization: union Thicken() polygons individually, not en masse
This commit is contained in:
@@ -253,11 +253,15 @@ static void OffsetSpansWithObrounds(const CArea& area, TPolyPolygon &pp_new, dou
|
||||
{
|
||||
Clipper c;
|
||||
c.StrictlySimple(CArea::m_clipper_simple);
|
||||
|
||||
pp_new.clear();
|
||||
|
||||
for(std::list<CCurve>::const_iterator It = area.m_curves.begin(); It != area.m_curves.end(); It++)
|
||||
{
|
||||
c.Clear();
|
||||
c.AddPaths(pp_new, ptSubject, true);
|
||||
pp_new.clear();
|
||||
pts_for_AddVertex.clear();
|
||||
|
||||
const CCurve& curve = *It;
|
||||
const CVertex* prev_vertex = NULL;
|
||||
for(std::list<CVertex>::const_iterator It2 = curve.m_vertices.begin(); It2 != curve.m_vertices.end(); It2++)
|
||||
@@ -278,10 +282,9 @@ static void OffsetSpansWithObrounds(const CArea& area, TPolyPolygon &pp_new, dou
|
||||
}
|
||||
prev_vertex = &vertex;
|
||||
}
|
||||
c.Execute(ctUnion, pp_new, pftNonZero, pftNonZero);
|
||||
}
|
||||
|
||||
pp_new.clear();
|
||||
c.Execute(ctUnion, pp_new, pftNonZero, pftNonZero);
|
||||
|
||||
// reverse all the resulting polygons
|
||||
TPolyPolygon copy = pp_new;
|
||||
|
||||
Reference in New Issue
Block a user