mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-15 12:35: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
|
// 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) {
|
for (VD::const_edge_iterator edge = this->vd.edges().begin(); edge != this->vd.edges().end(); ++edge) {
|
||||||
if (edge->is_infinite()) continue;
|
if (edge->is_infinite()) continue;
|
||||||
|
|
||||||
ThickPolyline polyline;
|
ThickPolyline polyline;
|
||||||
polyline.points.push_back(Point( edge->vertex0()->x(), edge->vertex0()->y() ));
|
polyline.points.push_back(Point( edge->vertex0()->x(), edge->vertex0()->y() ));
|
||||||
polyline.points.push_back(Point( edge->vertex1()->x(), edge->vertex1()->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);
|
polylines->push_back(polyline);
|
||||||
|
|
||||||
|
svg.draw(polyline);
|
||||||
}
|
}
|
||||||
|
svg.Close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
@ -43,13 +43,7 @@ class MedialAxis {
|
|||||||
void build(Polylines* polylines);
|
void build(Polylines* polylines);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class VD : public voronoi_diagram<double> {
|
typedef voronoi_diagram<double> VD;
|
||||||
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;
|
|
||||||
};
|
|
||||||
VD vd;
|
VD vd;
|
||||||
std::set<const VD::edge_type*> edges, valid_edges;
|
std::set<const VD::edge_type*> edges, valid_edges;
|
||||||
std::map<const VD::edge_type*, std::pair<coordf_t,coordf_t> > thickness;
|
std::map<const VD::edge_type*, std::pair<coordf_t,coordf_t> > thickness;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user