Bugfix: thin walls forming a closed loop had overlapping segments at their endpoints. #1948 #1875

This commit is contained in:
Alessandro Ranellucci 2014-05-21 15:03:31 +02:00
parent a8b6e32767
commit 08279ec5d8
4 changed files with 43 additions and 22 deletions

View file

@ -123,6 +123,21 @@ MedialAxis::build(Polylines* polylines)
construct_voronoi(this->lines.begin(), this->lines.end(), &this->vd);
/*
// DEBUG: dump all Voronoi edges
{
for (VD::const_edge_iterator edge = this->vd.edges().begin(); edge != this->vd.edges().end(); ++edge) {
if (edge->is_infinite()) continue;
Polyline polyline;
polyline.points.push_back(Point( edge->vertex0()->x(), edge->vertex0()->y() ));
polyline.points.push_back(Point( edge->vertex1()->x(), edge->vertex1()->y() ));
polylines->push_back(polyline);
}
return;
}
*/
// collect valid edges (i.e. prune those not belonging to MAT)
// note: this keeps twins, so it contains twice the number of the valid edges
this->edges.clear();