mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 20:15:55 +08:00
Minor changes to MedialAxis code
This commit is contained in:
parent
27b2f0d6c3
commit
357b6bbd55
@ -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;
|
||||
}
|
||||
*/
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user