Hollowing step in SLAPrint process, PrintConfig params added.

This commit is contained in:
tamasmeszaros 2019-11-06 13:38:43 +01:00
parent f913be2d93
commit bdf6f7342e
14 changed files with 311 additions and 65 deletions

View file

@ -98,6 +98,7 @@ ObjectList::ObjectList(wxWindow* parent) :
// ptSLA
CATEGORY_ICON[L("Supports")] = create_scaled_bitmap(nullptr, "support"/*"sla_supports"*/);
CATEGORY_ICON[L("Pad")] = create_scaled_bitmap(nullptr, "pad");
CATEGORY_ICON[L("Hollowing")] = create_scaled_bitmap(nullptr, "hollowing");
}
// create control

View file

@ -597,16 +597,20 @@ void GLGizmoHollow::on_update(const UpdateData& data)
void GLGizmoHollow::hollow_mesh(float offset, float adaptibility)
{
Slic3r::sla::Contour3D imesh{*m_mesh};
auto ptr = meshToVolume(imesh, {});
sla::Contour3D omesh = volumeToMesh(*ptr, -offset, adaptibility, true);
// Slic3r::sla::Contour3D imesh{*m_mesh};
// auto ptr = meshToVolume(imesh, {});
// sla::Contour3D omesh = volumeToMesh(*ptr, -offset, adaptibility, true);
if (omesh.empty())
// if (omesh.empty())
// return;
// imesh.merge(omesh);
TriangleMesh cavity = hollowed_interior(*m_mesh, double(offset), int(adaptibility));
if (cavity.empty())
return;
imesh.merge(omesh);
m_cavity_mesh.reset(new TriangleMesh);
*m_cavity_mesh = sla::to_triangle_mesh(imesh);
m_cavity_mesh.reset(new TriangleMesh(cavity));
m_cavity_mesh->merge(*m_mesh);
m_cavity_mesh.get()->require_shared_vertices();
m_mesh_raycaster.reset(new MeshRaycaster(*m_cavity_mesh.get()));
m_object_clipper.reset();
@ -616,7 +620,7 @@ void GLGizmoHollow::hollow_mesh(float offset, float adaptibility)
m_volume_with_cavity->indexed_vertex_array.load_mesh(*m_cavity_mesh.get());
m_volume_with_cavity->finalize_geometry(true);
m_volume_with_cavity->set_volume_transformation(m_model_object->volumes.front()->get_transformation());
m_volume_with_cavity->set_instance_transformation(m_model_object->instances[m_active_instance]->get_transformation());
m_volume_with_cavity->set_instance_transformation(m_model_object->instances[size_t(m_active_instance)]->get_transformation());
m_parent.toggle_model_objects_visibility(false, m_model_object, m_active_instance);
}

View file

@ -496,6 +496,8 @@ const std::vector<std::string>& Preset::sla_print_options()
"pad_object_connector_stride",
"pad_object_connector_width",
"pad_object_connector_penetration",
"hollowing_enable",
"hollowing_min_thickness",
"output_filename_format",
"default_sla_print_profile",
"compatible_printers",

View file

@ -3563,6 +3563,11 @@ void TabSLAPrint::build()
optgroup->append_single_option_line("pad_object_connector_stride");
optgroup->append_single_option_line("pad_object_connector_width");
optgroup->append_single_option_line("pad_object_connector_penetration");
page = add_options_page(_(L("Hollowing")), "hollowing");
optgroup = page->new_optgroup(_(L("Hollowing")));
optgroup->append_single_option_line("hollowing_enable");
optgroup->append_single_option_line("hollowing_min_thickness");
page = add_options_page(_(L("Advanced")), "wrench");
optgroup = page->new_optgroup(_(L("Slicing")));