Minor changes to MedialAxis code

This commit is contained in:
Alessandro Ranellucci 2016-12-21 19:48:39 +01:00
parent 27b2f0d6c3
commit 357b6bbd55
2 changed files with 8 additions and 7 deletions

View File

@ -474,14 +474,21 @@ MedialAxis::build(ThickPolylines* polylines)
/*
// DEBUG: dump all Voronoi edges
{
SVG svg("voronoi.svg");
svg.draw(*this->expolygon);
for (VD::const_edge_iterator edge = this->vd.edges().begin(); edge != this->vd.edges().end(); ++edge) {
if (edge->is_infinite()) continue;
ThickPolyline polyline;
polyline.points.push_back(Point( edge->vertex0()->x(), edge->vertex0()->y() ));
polyline.points.push_back(Point( edge->vertex1()->x(), edge->vertex1()->y() ));
polyline.width.push_back(this->max_width);
polyline.width.push_back(this->max_width);
polylines->push_back(polyline);
svg.draw(polyline);
}
svg.Close();
return;
}
*/

View File

@ -43,13 +43,7 @@ class MedialAxis {
void build(Polylines* polylines);
private:
class VD : public voronoi_diagram<double> {
public:
typedef double coord_type;
typedef boost::polygon::point_data<coordinate_type> point_type;
typedef boost::polygon::segment_data<coordinate_type> segment_type;
typedef boost::polygon::rectangle_data<coordinate_type> rect_type;
};
typedef voronoi_diagram<double> VD;
VD vd;
std::set<const VD::edge_type*> edges, valid_edges;
std::map<const VD::edge_type*, std::pair<coordf_t,coordf_t> > thickness;