Clipper optimization:

1) Removed the already commented-out scaling / unscaling when doing
   "safe offsetting"
2) Removed some of the "safe offsetting" at calls where it never was used.
3) Reworked Clipper & ClipperUtils to pass Polygons / ExPolygons / Surfaces
   as input parameters without conversion to ClipperLib::Paths. This
   should save a lot of memory allocation and copying.
4) Reworked conversions from ClipperLib::Paths & PolyTree to Polygons /
   ExPolygons to use the move operator to avoid many unnecessary allocations.
5) Reworked some "union with safe ofsetting" to "offset_ex", which should
   be cheaper.
This commit is contained in:
Vojtech Bubnik 2021-04-30 11:49:57 +02:00
parent b327314b02
commit 9fbba855ef
15 changed files with 616 additions and 722 deletions

View file

@ -1799,9 +1799,9 @@ void TriangleMeshSlicer::make_expolygons(const Polygons &loops, const float clos
// append to the supplied collection
if (safety_offset > 0)
expolygons_append(*slices, offset2_ex(union_ex(loops, false), +safety_offset, -safety_offset));
expolygons_append(*slices, offset2_ex(union_ex(loops), +safety_offset, -safety_offset));
else
expolygons_append(*slices, union_ex(loops, false));
expolygons_append(*slices, union_ex(loops));
}
void TriangleMeshSlicer::make_expolygons(std::vector<IntersectionLine> &lines, const float closing_radius, ExPolygons* slices) const