From a40d60ce089c52c5e0789259b099faa9a72b9344 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Wed, 22 Apr 2020 14:01:29 +0200 Subject: [PATCH] Custom support generation now ignores triangles with upward-pointing normal --- src/libslic3r/PrintObject.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index 1af273f86..360c690f8 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -2667,6 +2667,10 @@ void PrintObject::project_and_append_custom_supports( for (int i=0; i<3; ++i) facet[i] = tr2 * tr1 * mesh.its.vertices[mesh.its.indices[facet_idx](i)]; + // Ignore triangles with upward-pointing normal. + if ((facet[1]-facet[0]).cross(facet[2]-facet[0]).z() > 0.) + continue; + // Sort the three vertices according to z-coordinate. std::sort(facet.begin(), facet.end(), [](const Vec3f& pt1, const Vec3f&pt2) {