Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLukas Matena <lukasmatena@seznam.cz>2020-04-22 15:01:29 +0300
committerLukas Matena <lukasmatena@seznam.cz>2020-04-22 15:01:29 +0300
commita40d60ce089c52c5e0789259b099faa9a72b9344 (patch)
tree83465e93e053b303dcf79322e364eff64e236094 /src
parent1e12863ceb4809f08d97932fa1f93e5a583787cf (diff)
Custom support generation now ignores triangles with upward-pointing normal
Diffstat (limited to 'src')
-rw-r--r--src/libslic3r/PrintObject.cpp4
1 files changed, 4 insertions, 0 deletions
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) {