Merged 2.5.0-beta1 into master (NO CONFLICTS FIXED)

This commit is contained in:
Lukas Matena 2022-08-15 13:41:34 +02:00
commit bce2b148f4
99 changed files with 22989 additions and 14036 deletions

View file

@ -323,8 +323,6 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig* config)
toggle_field("wall_transition_filter_deviation", have_arachne);
toggle_field("wall_transition_angle", have_arachne);
toggle_field("wall_distribution_count", have_arachne);
toggle_field("wall_split_middle_threshold", have_arachne);
toggle_field("wall_add_middle_threshold", have_arachne);
toggle_field("min_feature_size", have_arachne);
toggle_field("min_bead_width", have_arachne);
toggle_field("thin_walls", !have_arachne);

File diff suppressed because it is too large Load diff

View file

@ -54,7 +54,11 @@ enum FileType
{
FT_STL,
FT_OBJ,
<<<<<<< HEAD
FT_OBJECT,
=======
FT_STEP,
>>>>>>> master_250
FT_AMF,
FT_3MF,
FT_GCODE,

View file

@ -2070,6 +2070,8 @@ void ObjectList::split()
Expand(parent);
changed_object(obj_idx);
// update printable state for new volumes on canvas3D
wxGetApp().plater()->canvas3D()->update_instance_printable_state_for_object(obj_idx);
}
void ObjectList::merge(bool to_multipart_object)
@ -2183,8 +2185,12 @@ void ObjectList::merge(bool to_multipart_object)
const Vec3d mirror = transformation.get_mirror();
const Vec3d rotation = transformation.get_rotation();
if (object->id() == (*m_objects)[obj_idxs.front()]->id())
if (object->id() == (*m_objects)[obj_idxs.front()]->id()) {
new_object->add_instance();
new_object->instances[0]->printable = false;
}
new_object->instances[0]->printable |= object->instances[0]->printable;
const Transform3d& volume_offset_correction = transformation.get_matrix();
// merge volumes
@ -2249,6 +2255,9 @@ void ObjectList::merge(bool to_multipart_object)
add_object_to_list(m_objects->size() - 1);
select_item(m_objects_model->GetItemById(m_objects->size() - 1));
update_selections_on_canvas();
// update printable state for new volumes on canvas3D
wxGetApp().plater()->canvas3D()->update_instance_printable_state_for_object(int(model->objects.size()) - 1);
}
// merge all parts to the one single object
// all part's settings will be lost

View file

@ -293,6 +293,7 @@ void GLGizmoBase::Grabber::render(float size, const ColorRGBA& render_color, boo
raycasters[i]->set_transform(elements_matrices[i]);
}
}
<<<<<<< HEAD
#endif // ENABLE_RAYCAST_PICKING
}
@ -532,3 +533,61 @@ std::string GLGizmoBase::get_name(bool include_shortcut) const
} // namespace GUI
} // namespace Slic3r
=======
}
std::string GLGizmoBase::format(float value, unsigned int decimals) const
{
return Slic3r::string_printf("%.*f", decimals, value);
}
void GLGizmoBase::set_dirty() {
m_dirty = true;
}
void GLGizmoBase::render_input_window(float x, float y, float bottom_limit)
{
on_render_input_window(x, y, bottom_limit);
if (m_first_input_window_render) {
// imgui windows that don't have an initial size needs to be processed once to get one
// and are not rendered in the first frame
// so, we forces to render another frame the first time the imgui window is shown
// https://github.com/ocornut/imgui/issues/2949
m_parent.set_as_dirty();
m_parent.request_extra_frame();
m_first_input_window_render = false;
}
}
std::string GLGizmoBase::get_name(bool include_shortcut) const
{
int key = get_shortcut_key();
std::string out = on_get_name();
if (include_shortcut && key >= WXK_CONTROL_A && key <= WXK_CONTROL_Z)
out += std::string(" [") + char(int('A') + key - int(WXK_CONTROL_A)) + "]";
return out;
}
// Produce an alpha channel checksum for the red green blue components. The alpha channel may then be used to verify, whether the rgb components
// were not interpolated by alpha blending or multi sampling.
unsigned char picking_checksum_alpha_channel(unsigned char red, unsigned char green, unsigned char blue)
{
// 8 bit hash for the color
unsigned char b = ((((37 * red) + green) & 0x0ff) * 37 + blue) & 0x0ff;
// Increase enthropy by a bit reversal
b = (b & 0xF0) >> 4 | (b & 0x0F) << 4;
b = (b & 0xCC) >> 2 | (b & 0x33) << 2;
b = (b & 0xAA) >> 1 | (b & 0x55) << 1;
// Flip every second bit to increase the enthropy even more.
b ^= 0x55;
return b;
}
} // namespace GUI
} // namespace Slic3r
>>>>>>> master_250

View file

@ -420,6 +420,7 @@ void GLGizmoCut::update_contours()
for (size_t i = 0; i < model_object->volumes.size(); ++i) {
volumes_idxs[i] = model_object->volumes[i]->id();
volumes_trafos[i] = model_object->volumes[i]->get_matrix();
<<<<<<< HEAD
}
bool trafos_match = volumes_trafos.size() == m_cut_contours.volumes_trafos.size();
@ -430,8 +431,14 @@ void GLGizmoCut::update_contours()
break;
}
}
=======
>>>>>>> master_250
}
bool trafos_match = std::equal(volumes_trafos.begin(), volumes_trafos.end(),
m_cut_contours.volumes_trafos.begin(), m_cut_contours.volumes_trafos.end(),
[](const Transform3d& a, const Transform3d& b) { return a.isApprox(b); });
if (0.0 < m_cut_z && m_cut_z < m_max_z) {
if (m_cut_contours.cut_z != m_cut_z || m_cut_contours.object_id != model_object->id() ||
m_cut_contours.instance_idx != instance_idx || m_cut_contours.volumes_idxs != volumes_idxs ||

View file

@ -80,7 +80,7 @@ void KBShortcutsDialog::fill_shortcuts()
{ ctrl + alt + "S", L("Save project as (3mf)") },
{ ctrl + "R", L("(Re)slice") },
// File>Import
{ ctrl + "I", L("Import STL/OBJ/AMF/3MF without config, keep plater") },
{ ctrl + "I", L("Import STL/OBJ/AMF/3MF/STEP without config, keep plater") },
{ ctrl + "L", L("Import Config from ini/amf/3mf/gcode") },
{ ctrl + alt + "L", L("Load Config from ini/amf/3mf/gcode and merge") },
// File>Export

View file

@ -1212,7 +1212,7 @@ void MainFrame::init_menubar_as_editor()
fileMenu->AppendSeparator();
wxMenu* import_menu = new wxMenu();
append_menu_item(import_menu, wxID_ANY, _L("Import STL/OBJ/AM&F/3MF") + dots + "\tCtrl+I", _L("Load a model"),
append_menu_item(import_menu, wxID_ANY, _L("Import STL/OBJ/AM&F/3MF/STEP") + dots + "\tCtrl+I", _L("Load a model"),
[this](wxCommandEvent&) { if (m_plater) m_plater->add_model(); }, "import_plater", nullptr,
[this](){return m_plater != nullptr; }, this);

View file

@ -246,11 +246,14 @@ public:
GetBtnsListCtrl()->Rescale();
}
<<<<<<< HEAD
void OnColorsChanged()
{
GetBtnsListCtrl()->OnColorsChanged();
}
=======
>>>>>>> master_250
void OnNavigationKey(wxNavigationKeyEvent& event)
{
if (event.IsWindowChange()) {

View file

@ -2401,9 +2401,20 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
const auto loading = _L("Loading") + dots;
// Create wxProgressDialog on heap, see the linux ifdef below.
auto progress_dlg = new wxProgressDialog(loading, "", 100, find_toplevel_parent(q), wxPD_AUTO_HIDE);
// The situation with wxProgressDialog is quite interesting here.
// On Linux (only), there are issues when FDM/SLA is switched during project file loading (disabling of controls,
// see a comment below). This can be bypassed by creating the wxProgressDialog on heap and destroying it
// when loading a project file. However, creating the dialog on heap causes issues on macOS, where it does not
// appear at all. Therefore, we create the dialog on stack on Win and macOS, and on heap on Linux, which
// is the only system that needed the workarounds in the first place.
#ifdef __linux__
auto progress_dlg = new wxProgressDialog(loading, "", 100, find_toplevel_parent(q), wxPD_APP_MODAL | wxPD_AUTO_HIDE);
Slic3r::ScopeGuard([&progress_dlg](){ if (progress_dlg) progress_dlg->Destroy(); progress_dlg = nullptr; });
#else
wxProgressDialog progress_dlg_stack(loading, "", 100, find_toplevel_parent(q), wxPD_APP_MODAL | wxPD_AUTO_HIDE);
wxProgressDialog* progress_dlg = &progress_dlg_stack;
#endif
wxBusyCursor busy;
@ -3118,6 +3129,8 @@ void Plater::priv::split_object()
for (size_t idx : idxs)
{
get_selection().add_object((unsigned int)idx, false);
// update printable state for new volumes on canvas3D
q->canvas3D()->update_instance_printable_state_for_object(idx);
}
}
}
@ -5551,7 +5564,7 @@ void ProjectDropDialog::on_dpi_changed(const wxRect& suggested_rect)
bool Plater::load_files(const wxArrayString& filenames)
{
const std::regex pattern_drop(".*[.](stl|obj|amf|3mf|prusa)", std::regex::icase);
const std::regex pattern_drop(".*[.](stl|obj|amf|3mf|prusa|step|stp)", std::regex::icase);
const std::regex pattern_gcode_drop(".*[.](gcode|g)", std::regex::icase);
std::vector<fs::path> paths;

View file

@ -1604,8 +1604,6 @@ void TabPrint::build()
optgroup->append_single_option_line("clip_multipart_objects");
optgroup = page->new_optgroup(L("Arachne perimeter generator"));
optgroup->append_single_option_line("wall_add_middle_threshold");
optgroup->append_single_option_line("wall_split_middle_threshold");
optgroup->append_single_option_line("wall_transition_angle");
optgroup->append_single_option_line("wall_transition_filter_deviation");
optgroup->append_single_option_line("wall_transition_length");