Voronoi图的边界。提升Voronoi

时间:2017-01-17 08:14:48

标签: c++ boost voronoi boost-polygon

随着提升,我得到了Voronoi图

#include<boost\polygon\voronoi.hpp>
#include <vector>
using namespace std;
using namespace boost::polygon;

typedef int coordinate_type;
typedef point_data<coordinate_type> point_type;
typedef voronoi_diagram<double> VD;

int main(int argc, char* argv[])
{
    vector<point_type> points;

    points.push_back(point_type(4, 1));
    points.push_back(point_type(5, 4));
    points.push_back(point_type(5, 5));
    points.push_back(point_type(2, 6));
    points.push_back(point_type(3, 4));
    points.push_back(point_type(0, 7));
    points.push_back(point_type(2, 5));
    points.push_back(point_type(8, 9));
    points.push_back(point_type(0, 4));
    points.push_back(point_type(2, 7));

    VD vd;  construct_voronoi(points.begin(), points.end(), &vd);
    return 0;
}

这是我得到的Given

如何使用boost为Voronoi图添加边框? Desired

0 个答案:

没有答案