From abf34c3b6dbc4c70ea5867ac13216bd533b6bd5f Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Wed, 2 Jan 2019 11:52:15 +0100 Subject: [PATCH] Debug logs during SLA processing --- src/libslic3r/SLA/SLASupportTreeIGL.cpp | 1 - src/libslic3r/SLAPrint.cpp | 13 ++++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/SLA/SLASupportTreeIGL.cpp b/src/libslic3r/SLA/SLASupportTreeIGL.cpp index 6d4a770aa..8971b6ede 100644 --- a/src/libslic3r/SLA/SLASupportTreeIGL.cpp +++ b/src/libslic3r/SLA/SLASupportTreeIGL.cpp @@ -192,7 +192,6 @@ PointSet normals(const PointSet& points, const EigenMesh3D& emesh, auto lend = std::unique(neighnorms.begin(), neighnorms.end(), [](const Vec3d& n1, const Vec3d& n2) { // Compare normals for equivalence. This is controvers stuff. - // We will go for the third significant digit precision. auto deq = [](double a, double b) { return std::abs(a-b) < 1e-3; }; return deq(n1(X), n2(X)) && deq(n1(Y), n2(Y)) && deq(n1(Z), n2(Z)); }); diff --git a/src/libslic3r/SLAPrint.cpp b/src/libslic3r/SLAPrint.cpp index 85b63a24c..e2a256b72 100644 --- a/src/libslic3r/SLAPrint.cpp +++ b/src/libslic3r/SLAPrint.cpp @@ -502,6 +502,9 @@ void SLAPrint::process() po.m_supportdata.reset(new SLAPrintObject::SupportData()); po.m_supportdata->emesh = sla::to_eigenmesh(po.transformed_mesh()); + BOOST_LOG_TRIVIAL(debug) + << "Support point count " << mo.sla_support_points.size(); + // If there are no points on the front-end, we will do the // autoplacement. Otherwise we will just blindly copy the frontend data // into the backend cache. @@ -581,8 +584,16 @@ void SLAPrint::process() // Create the unified mesh auto rc = SlicingStatus::RELOAD_SCENE; - report_status(*this, -1, L("Visualizing supports")); po.m_supportdata->support_tree_ptr->merged_mesh(); + + // Check the mesh for later troubleshooting. + + BOOST_LOG_TRIVIAL(debug) << "Processed support point count " + << po.m_supportdata->support_points.rows(); + + if(po.support_mesh().empty()) + BOOST_LOG_TRIVIAL(warning) << "Support mesh is empty"; + report_status(*this, -1, L("Visualizing supports"), rc); } catch(sla::SLASupportsStoppedException&) { // no need to rethrow