diff --git a/src/libslic3r/SLA/SLASupportTree.cpp b/src/libslic3r/SLA/SLASupportTree.cpp index 7adaea1f4..d689324c0 100644 --- a/src/libslic3r/SLA/SLASupportTree.cpp +++ b/src/libslic3r/SLA/SLASupportTree.cpp @@ -924,6 +924,11 @@ bool SLASupportTree::generate(const PointSet &points, //... }; + // Debug: + for(int pn = 0; pn < points.rows(); ++pn) { + std::cout << "p " << pn << " " << points.row(pn) << std::endl; + } + auto filterfn = [] ( const SupportConfig& cfg, const PointSet& points, @@ -1511,7 +1516,7 @@ bool SLASupportTree::generate(const PointSet &points, auto progress = [&ctl, &pc, &pc_prev] () { static const std::array stepstr { - "", + "Starting", "Filtering", "Generate pinheads", "Classification", diff --git a/src/libslic3r/SLA/SLASupportTree.hpp b/src/libslic3r/SLA/SLASupportTree.hpp index f9691b19f..3a1c5ef68 100644 --- a/src/libslic3r/SLA/SLASupportTree.hpp +++ b/src/libslic3r/SLA/SLASupportTree.hpp @@ -74,13 +74,16 @@ struct Controller { /// An index-triangle structure for libIGL functions. Also serves as an /// alternative (raw) input format for the SLASupportTree struct EigenMesh3D { -// Eigen::MatrixXd V; -// Eigen::MatrixXi F; - Eigen::Matrix V; - Eigen::Matrix F; + Eigen::MatrixXd V; + Eigen::MatrixXi F; + + // igl crashes with the following data types: +// Eigen::Matrix V; +// Eigen::Matrix F; }; -using PointSet = Eigen::Matrix; //Eigen::MatrixXd; +//using PointSet = Eigen::Matrix; //Eigen::MatrixXd; +using PointSet = Eigen::MatrixXd; /* ************************************************************************** */ /* TODO: May not be needed: */ diff --git a/src/libslic3r/SLA/SLASupportTreeIGL.cpp b/src/libslic3r/SLA/SLASupportTreeIGL.cpp index 7de4d196d..c95dcef34 100644 --- a/src/libslic3r/SLA/SLASupportTreeIGL.cpp +++ b/src/libslic3r/SLA/SLASupportTreeIGL.cpp @@ -84,11 +84,11 @@ size_t SpatIndex::size() const } PointSet normals(const PointSet& points, const EigenMesh3D& mesh) { -// Eigen::VectorXd dists; -// Eigen::VectorXi I; #ifdef IGL_COMPATIBLE - Eigen::Matrix dists; - Eigen::Matrix I; + Eigen::VectorXd dists; + Eigen::VectorXi I; +// Eigen::Matrix dists; +// Eigen::Matrix I; PointSet C; igl::point_mesh_squared_distance( points, mesh.V, mesh.F, dists, I, C); diff --git a/src/libslic3r/SLAPrint.cpp b/src/libslic3r/SLAPrint.cpp index 939b9ff34..213c3a5c6 100644 --- a/src/libslic3r/SLAPrint.cpp +++ b/src/libslic3r/SLAPrint.cpp @@ -66,14 +66,17 @@ void SLAPrint::clear() SLAPrint::ApplyStatus SLAPrint::apply(const Model &model, const DynamicPrintConfig &config) { - if (m_objects.empty()) - return APPLY_STATUS_UNCHANGED; +// if (m_objects.empty()) +// return APPLY_STATUS_UNCHANGED; // Grab the lock for the Print / PrintObject milestones. tbb::mutex::scoped_lock lock(this->cancel_mutex()); + if(m_objects.empty() && model.objects.empty()) + return APPLY_STATUS_UNCHANGED; // Temporary quick fix, just invalidate everything. { + std::cout << "deleting object cache " << std::endl; for (SLAPrintObject *print_object : m_objects) { print_object->invalidate_all_steps(); delete print_object; @@ -89,7 +92,7 @@ SLAPrint::ApplyStatus SLAPrint::apply(const Model &model, //TODO m_objects.emplace_back(new SLAPrintObject(this, model_object)); } - } + } return APPLY_STATUS_INVALIDATED; } @@ -200,6 +203,8 @@ SLAPrintObject::SLAPrintObject(SLAPrint *print, ModelObject *model_object): m_stepmask(slaposCount, true) { m_supportdata->emesh = sla::to_eigenmesh(*m_model_object); + m_supportdata->support_points = sla::support_points(*m_model_object); + std::cout << "support points copied " << m_supportdata->support_points.rows() << std::endl; } SLAPrintObject::~SLAPrintObject() {}