452{
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
476 for (VD::const_edge_iterator edge =
m_vd.edges().begin(); edge !=
m_vd.edges().end(); edge += 2)
477 if (edge->is_primary() && edge->is_finite() &&
481
482 this->
edge_data(*edge).first.active =
true;
483 }
484
485
486 ThickPolyline reverse_polyline;
487 for (VD::const_edge_iterator seed_edge =
m_vd.edges().begin(); seed_edge !=
m_vd.edges().end(); seed_edge += 2)
488 if (EdgeData &seed_edge_data = this->
edge_data(*seed_edge).first; seed_edge_data.active) {
489
490 seed_edge_data.active = false;
491
492
493 ThickPolyline polyline;
494 polyline.points.emplace_back(seed_edge->vertex0()->x(), seed_edge->vertex0()->y());
495 polyline.points.emplace_back(seed_edge->vertex1()->x(), seed_edge->vertex1()->y());
496 polyline.width.emplace_back(seed_edge_data.width_start);
497 polyline.width.emplace_back(seed_edge_data.width_end);
498
500 assert(polyline.width.size() == polyline.points.size() * 2 - 2);
501
502
503 reverse_polyline.clear();
505 polyline.points.insert(polyline.points.begin(), reverse_polyline.points.rbegin(), reverse_polyline.points.rend());
506 polyline.width.insert(polyline.width.begin(), reverse_polyline.width.rbegin(), reverse_polyline.width.rend());
507 polyline.endpoints.first = reverse_polyline.endpoints.second;
508 assert(polyline.width.size() == polyline.points.size() * 2 - 2);
509
510
511 if (polyline.first_point() == polyline.last_point()) {
512 polyline.endpoints.first = false;
513 polyline.endpoints.second = false;
514 }
515
516
517 polylines->emplace_back(std::move(polyline));
518 }
519
520 #ifdef SLIC3R_DEBUG
521 {
522 static int iRun = 0;
524 printf("Thick lines: ");
525 for (ThickPolylines::const_iterator it = polylines->begin(); it != polylines->end(); ++ it) {
527 for (ThickLines::const_iterator it2 = lines.begin(); it2 != lines.end(); ++ it2) {
528 printf("%f,%f ", it2->a_width, it2->b_width);
529 }
530 }
531 printf("\n");
532 }
533 #endif
534}
VertexCategory vertex_category(const VD::vertex_type &v)
Definition VoronoiOffset.hpp:72
void annotate_inside_outside(VD &vd, const Lines &lines)
Definition VoronoiOffset.cpp:650
std::string debug_out_path(const char *name,...)
Definition utils.cpp:218
static void dump_voronoi_to_svg(const char *path, const Geometry::VoronoiDiagram &vd, const Points &points, const Lines &lines, const Polygons &offset_curves=Polygons(), const Lines &helper_lines=Lines(), double scale=0)
Definition VoronoiVisualUtils.hpp:296
std::vector< ThickLine > ThickLines
Definition Line.hpp:19