Account handle the z levels with and without the pad.

New method in support tree to query the needed elevation for the model and its supports.
This commit is contained in:
tamasmeszaros 2018-11-16 11:34:19 +01:00
parent d45739fa15
commit c5ccfeae3e
4 changed files with 46 additions and 14 deletions

View file

@ -150,8 +150,8 @@ void SLAPrint::process()
po.m_supportdata.reset(new SLAPrintObject::SupportData());
po.m_supportdata->emesh = sla::to_eigenmesh(po.transformed_mesh());
// TODO: transform support points appropriately
po.m_supportdata->support_points = sla::support_points(mo);
po.m_supportdata->support_points =
sla::to_point_set(po.transformed_support_points());
}
// for(SLAPrintObject *po : pobjects) {
@ -454,4 +454,17 @@ const TriangleMesh &SLAPrintObject::transformed_mesh() const {
return m_transformed_rmesh;
}
std::vector<Vec3d> SLAPrintObject::transformed_support_points() const
{
assert(m_model_object != nullptr);
auto& spts = m_model_object->sla_support_points;
// this could be cached as well
std::vector<Vec3d> ret; ret.reserve(spts.size());
for(auto& sp : spts) ret.emplace_back( trafo() * Vec3d(sp.cast<double>()));
return ret;
}
} // namespace Slic3r