From a775bf2978a6a1091549bcab1229c365ae63cf3e Mon Sep 17 00:00:00 2001 From: PavelMikus Date: Wed, 2 Mar 2022 15:54:03 +0100 Subject: [PATCH] improved enforcers blockers oversampling, renamed parameter --- src/libslic3r/GCode/SeamPlacerNG.cpp | 8 ++++---- src/libslic3r/GCode/SeamPlacerNG.hpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libslic3r/GCode/SeamPlacerNG.cpp b/src/libslic3r/GCode/SeamPlacerNG.cpp index 6dab7ac41..68c9f64dc 100644 --- a/src/libslic3r/GCode/SeamPlacerNG.cpp +++ b/src/libslic3r/GCode/SeamPlacerNG.cpp @@ -481,11 +481,11 @@ void process_perimeter_polygon(const Polygon &orig_polygon, float z_coord, std:: orig_point = true; } - if (global_model_info.is_enforced(position, SeamPlacer::enforcer_blocker_sqr_distance_tolerance)) { + if (global_model_info.is_enforced(position, SeamPlacer::enforcer_blocker_distance_tolerance)) { type = EnforcedBlockedSeamPoint::Enforced; } - if (global_model_info.is_blocked(position, SeamPlacer::enforcer_blocker_sqr_distance_tolerance)) { + if (global_model_info.is_blocked(position, SeamPlacer::enforcer_blocker_distance_tolerance)) { type = EnforcedBlockedSeamPoint::Blocked; } @@ -495,7 +495,7 @@ void process_perimeter_polygon(const Polygon &orig_polygon, float z_coord, std:: if (global_model_info.is_enforced(position, distance_to_next) || global_model_info.is_blocked(position, distance_to_next)) { Vec3f vec_to_next = (pos_of_next - position).normalized(); - float step_size = SeamPlacer::enforcer_blocker_sqr_distance_tolerance; + float step_size = SeamPlacer::enforcer_blocker_distance_tolerance / 2.0f; float step = step_size; while (step < distance_to_next) { oversampled_points.push(position + vec_to_next * step); @@ -929,7 +929,7 @@ void SeamPlacer::align_seam_points(const PrintObject *po, const Comparator &comp } // find coefficients of polynomial fit. Z coord is treated as parameter along which to fit both X and Y coords. - std::vector coefficients = polyfit(points, 3); + std::vector coefficients = polyfit(points, 4); // Do alignment - compute fitted point for each point in the string from its Z coord, and store the position into // Perimeter structure of the point; also set flag aligned to true diff --git a/src/libslic3r/GCode/SeamPlacerNG.hpp b/src/libslic3r/GCode/SeamPlacerNG.hpp index 092f70749..682fc0d25 100644 --- a/src/libslic3r/GCode/SeamPlacerNG.hpp +++ b/src/libslic3r/GCode/SeamPlacerNG.hpp @@ -111,7 +111,7 @@ public: static constexpr float polygon_local_angles_arm_distance = 1.0f; // If enforcer or blocker is closer to the seam candidate than this limit, the seam candidate is set to Blocer or Enforcer - static constexpr float enforcer_blocker_sqr_distance_tolerance = 0.1f; + static constexpr float enforcer_blocker_distance_tolerance = 0.1f; // When searching for seam clusters for alignment: // seam_align_tolerable_dist - if seam is closer to the previous seam position projected to the current layer than this value,