From b9ea049ff4a488aac6bc8f591a5ee33e2db4a0d2 Mon Sep 17 00:00:00 2001 From: Filip Sykala - NTB T15p Date: Wed, 13 Jul 2022 14:50:32 +0200 Subject: [PATCH] Fix: shape point without projection --- src/libslic3r/CutSurface.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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