diff --git a/src/libslic3r/GCode/SeamPlacer.cpp b/src/libslic3r/GCode/SeamPlacer.cpp index 9738a00161..44b1fcff1e 100644 --- a/src/libslic3r/GCode/SeamPlacer.cpp +++ b/src/libslic3r/GCode/SeamPlacer.cpp @@ -750,35 +750,36 @@ void SeamPlacer::apply_custom_seam(const Polygon& polygon, size_t po_idx, } } -//////////////////////// -// std::ostringstream os; -// os << std::setw(3) << std::setfill('0') << layer_id; -// int a = scale_(30.); -// SVG svg("custom_seam" + os.str() + ".svg", BoundingBox(Point(-a, -a), Point(a, a))); -// //if (! m_enforcers[po_idx].empty()) -// // svg.draw(m_enforcers[po_idx][layer_id].polys, "blue"); -// //if (! m_blockers[po_idx].empty()) -// // svg.draw(m_blockers[po_idx][layer_id].polys, "red"); +#if 0 + std::ostringstream os; + os << std::setw(3) << std::setfill('0') << layer_id; + int a = scale_(30.); + SVG svg("custom_seam" + os.str() + ".svg", BoundingBox(Point(-a, -a), Point(a, a))); + if (! m_enforcers[po_idx].empty()) + svg.draw(m_enforcers[po_idx][layer_id].polys, "blue"); + if (! m_blockers[po_idx].empty()) + svg.draw(m_blockers[po_idx][layer_id].polys, "red"); + + if (! blockers_idxs.empty()) { + ; + } + size_t min_idx = std::min_element(penalties.begin(), penalties.end()) - penalties.begin(); -// size_t min_idx = std::min_element(penalties.begin(), penalties.end()) - penalties.begin(); - -// //svg.draw(polygon.points[idx_min], "red", 6e5); -// for (size_t i=0; i 0.) continue; + // The algorithm does not process vertical triangles, but it should for seam. + // In that case, tilt the triangle a bit so the projection does not degenerate. + if (seam && z_comp == 0.f) + facet[0].x() += float(EPSILON); + // Sort the three vertices according to z-coordinate. std::sort(facet.begin(), facet.end(), [](const Vec3f& pt1, const Vec3f&pt2) {