Пример #1
0
void
Slic3rMultiPoints_to_ClipperPaths(const T &input, ClipperLib::Paths &output)
{
    output.clear();
    for (typename T::const_iterator it = input.begin(); it != input.end(); ++it) {
        ClipperLib::Path p;
        Slic3rMultiPoint_to_ClipperPath(*it, p);
        output.push_back(p);
    }
}
void Grasp_Calculator::double_polygon_to_path(DPolygon2D double_polygon, ClipperLib::Paths &int_polygon)
{
    ClipperLib::cInt factor = 100000;
    ClipperLib::Path int_poly;
    int_polygon.clear();
    for (std::vector<DoublePoint2D>::iterator p2d = double_polygon.begin(); p2d != double_polygon.end(); ++p2d)
    {
        ClipperLib::IntPoint p;
        p.X = (ClipperLib::cInt)(factor * p2d->x);
        p.Y = (ClipperLib::cInt)(factor * p2d->y);
        int_poly.push_back(p);
    }
    int_polygon.push_back(int_poly);
}