Custom support generation now ignores triangles with upward-pointing normal

This commit is contained in:
Lukas Matena 2020-04-22 14:01:29 +02:00
parent 1e12863ceb
commit a40d60ce08

View file

@ -2667,6 +2667,10 @@ void PrintObject::project_and_append_custom_supports(
for (int i=0; i<3; ++i) for (int i=0; i<3; ++i)
facet[i] = tr2 * tr1 * mesh.its.vertices[mesh.its.indices[facet_idx](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. // Sort the three vertices according to z-coordinate.
std::sort(facet.begin(), facet.end(), std::sort(facet.begin(), facet.end(),
[](const Vec3f& pt1, const Vec3f&pt2) { [](const Vec3f& pt1, const Vec3f&pt2) {