Marked the unsafe ClipperUtils offset functions with CLIPPERUTILS_UNSAFE_OFFSET

Replaced some of the unsafe offset functions with safe variants.
Please test the
1) print bed from STL function
2) concentric infill
This commit is contained in:
Vojtech Bubnik 2021-04-13 13:28:21 +02:00
parent 2791139002
commit c1179fc2c7
8 changed files with 55 additions and 16 deletions

View file

@ -217,6 +217,28 @@ inline Polygons to_polygons(const ExPolygons &src)
return polygons;
}
inline ConstPolygonPtrs to_polygon_ptrs(const ExPolygon &src)
{
ConstPolygonPtrs polygons;
polygons.reserve(src.holes.size() + 1);
polygons.emplace_back(&src.contour);
for (const Polygon &hole : src.holes)
polygons.emplace_back(&hole);
return polygons;
}
inline ConstPolygonPtrs to_polygon_ptrs(const ExPolygons &src)
{
ConstPolygonPtrs polygons;
polygons.reserve(number_polygons(src));
for (const ExPolygon &expoly : src) {
polygons.emplace_back(&expoly.contour);
for (const Polygon &hole : expoly.holes)
polygons.emplace_back(&hole);
}
return polygons;
}
inline Polygons to_polygons(ExPolygon &&src)
{
Polygons polygons;