ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE -> Extended debug output to investigate issues on Mac and Linux

This commit is contained in:
Enrico Turri 2019-11-29 14:24:24 +01:00
parent 1d5db5cf7a
commit 40498eee44
3 changed files with 33 additions and 5 deletions

View file

@ -349,6 +349,10 @@ std::vector<coordf_t> layer_height_profile_adaptive(
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
std::cout << "profile size: " << layer_height_profile.size() << std::endl;
for (size_t i = 0; i < layer_height_profile.size(); i += 2)
{
std::cout << 1 + i / 2 << ") " << layer_height_profile[i] << " - " << layer_height_profile[i + 1] << std::endl;
}
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
return layer_height_profile;

View file

@ -37,15 +37,33 @@ void SlicingAdaptive::prepare()
m_mesh = m_object->raw_mesh();
const ModelInstance* first_instance = m_object->instances.front();
m_mesh.transform(first_instance->get_matrix(), first_instance->is_left_handed());
for (stl_facet& facet : m_mesh.stl.facet_start)
{
facet.normal.normalize();
}
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
std::cout << "transform: " << std::endl;
std::cout << "position: " << to_string(first_instance->get_offset()) << std::endl;
std::cout << "rotation: " << to_string(first_instance->get_rotation()) << std::endl;
std::cout << "mesh box: " << to_string(m_mesh.bounding_box().min) << " - " << to_string(m_mesh.bounding_box().max) << std::endl;
std::cout << "mesh center: " << to_string(m_mesh.bounding_box().center()) << std::endl;
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
// for (stl_facet& facet : m_mesh.stl.facet_start)
// {
// facet.normal.normalize();
// }
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
// 1) Collect faces from mesh.
m_faces.reserve(m_mesh.stl.stats.number_of_facets);
for (const stl_facet& face : m_mesh.stl.facet_start)
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
for (stl_facet& face : m_mesh.stl.facet_start)
{
face.normal.normalize();
m_faces.emplace_back(&face);
}
// for (const stl_facet& face : m_mesh.stl.facet_start)
// m_faces.emplace_back(&face);
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
#else
// 1) Collect faces of all meshes.
int nfaces_total = 0;