diff --git a/src/libslic3r/CutSurface.cpp b/src/libslic3r/CutSurface.cpp index 15cd32445e..73a4449d15 100644 --- a/src/libslic3r/CutSurface.cpp +++ b/src/libslic3r/CutSurface.cpp @@ -2747,9 +2747,11 @@ std::vector priv::select_patches( const VCutAOIs &cuts) { std::vector in_distances(patches.size(), {false}); - for (const ProjectionDistance &d : best_distances) + for (const ProjectionDistance &d : best_distances) { + // exist valid projection for shape point? + if (d.patch_index == std::numeric_limits::max()) continue; in_distances[d.patch_index] = true; - + } // For sure of the bounding boxes intersection const double bb_extension = 1e-10; const Vec3d bb_ext(bb_extension, bb_extension, bb_extension); @@ -2763,7 +2765,9 @@ std::vector priv::select_patches( std::vector patch_indices; std::vector result(patches.size(), {false}); - for (const ProjectionDistance &d : best_distances) { + for (const ProjectionDistance &d : best_distances) { + // exist valid projection for shape point? + if (d.patch_index == std::numeric_limits::max()) continue; if (result[d.patch_index]) continue; // Add all connected patches // This is way to add patche without source shape point