SLA backround processing pipeline invisible but runs.

This commit is contained in:
tamasmeszaros 2018-11-12 11:46:38 +01:00
parent e05063c8b1
commit 33eade5300
4 changed files with 26 additions and 13 deletions

View File

@ -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<std::string, NUM_STEPS> stepstr {
"",
"Starting",
"Filtering",
"Generate pinheads",
"Classification",

View File

@ -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<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::DontAlign> V;
Eigen::Matrix<int, Eigen::Dynamic, Eigen::Dynamic, Eigen::DontAlign> F;
Eigen::MatrixXd V;
Eigen::MatrixXi F;
// igl crashes with the following data types:
// Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::DontAlign> V;
// Eigen::Matrix<int, Eigen::Dynamic, Eigen::Dynamic, Eigen::DontAlign> F;
};
using PointSet = Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::DontAlign>; //Eigen::MatrixXd;
//using PointSet = Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::DontAlign>; //Eigen::MatrixXd;
using PointSet = Eigen::MatrixXd;
/* ************************************************************************** */
/* TODO: May not be needed: */

View File

@ -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<double, Eigen::Dynamic, 1, Eigen::DontAlign> dists;
Eigen::Matrix<int, Eigen::Dynamic, 1, Eigen::DontAlign> I;
Eigen::VectorXd dists;
Eigen::VectorXi I;
// Eigen::Matrix<double, Eigen::Dynamic, 1, Eigen::DontAlign> dists;
// Eigen::Matrix<int, Eigen::Dynamic, 1, Eigen::DontAlign> I;
PointSet C;
igl::point_mesh_squared_distance( points, mesh.V, mesh.F, dists, I, C);

View File

@ -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() {}