Merge branch 'master' of https://github.com/prusa3d/Slic3r into euler_angles

This commit is contained in:
Enrico Turri 2019-01-11 12:55:35 +01:00
commit 92b8d797f8
6 changed files with 40 additions and 26 deletions

View file

@ -27,6 +27,7 @@ option(SLIC3R_GUI "Compile Slic3r with GUI components (OpenGL, wxWidgets)"
option(SLIC3R_FHS "Assume Slic3r is to be installed in a FHS directory structure" 0)
option(SLIC3R_WX_STABLE "Build against wxWidgets stable (3.0) as oppsed to dev (3.1) on Linux" 0)
option(SLIC3R_PROFILE "Compile Slic3r with an invasive Shiny profiler" 0)
option(SLIC3R_PCH "Use precompiled headers" 1)
option(SLIC3R_MSVC_COMPILE_PARALLEL "Compile on Visual Studio in parallel" 1)
option(SLIC3R_MSVC_PDB "Generate PDB files on MSVC in Release mode" 1)
option(SLIC3R_PERL_XS "Compile XS Perl module and enable Perl unit and integration tests" 0)
@ -37,6 +38,15 @@ option(SLIC3R_SYNTAXONLY "Only perform source code correctness checking,
option(SLIC3R_BUILD_SANDBOXES "Build development sandboxes" OFF)
option(SLIC3R_BUILD_TESTS "Build unit tests" OFF)
# Print out the SLIC3R_* cache options
get_cmake_property(_cache_vars CACHE_VARIABLES)
list (SORT _cache_vars)
foreach (_cache_var ${_cache_vars})
if("${_cache_var}" MATCHES "^SLIC3R_")
message(STATUS "${_cache_var}: ${${_cache_var}}")
endif ()
endforeach()
if (MSVC)
if (SLIC3R_MSVC_COMPILE_PARALLEL)
add_compile_options(/MP)
@ -46,7 +56,6 @@ if (MSVC)
add_compile_options(-bigobj -Zm316)
endif ()
# Display and check CMAKE_PREFIX_PATH
message(STATUS "SLIC3R_STATIC: ${SLIC3R_STATIC}")
if (NOT "${CMAKE_PREFIX_PATH}" STREQUAL "")
@ -65,8 +74,6 @@ foreach (DIR ${PREFIX_PATH_CHECK})
endif ()
endforeach ()
message(STATUS "SLIC3R_FHS: ${SLIC3R_FHS}")
# Add our own cmake module path.
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules/)

View file

@ -171,7 +171,7 @@ add_library(libslic3r STATIC
SLA/SLASpatIndex.hpp
)
if (NOT SLIC3R_SYNTAXONLY)
if (SLIC3R_PCH AND NOT SLIC3R_SYNTAXONLY)
add_precompiled_header(libslic3r pchheader.hpp FORCEINCLUDE)
endif ()

View file

@ -13,6 +13,7 @@
#include "PrintExport.hpp"
#include <algorithm>
#include <limits>
#include <unordered_set>
#include <boost/filesystem/path.hpp>
#include <boost/log/trivial.hpp>
@ -1282,16 +1283,20 @@ std::string Print::validate() const
}
}
{
// find the smallest nozzle diameter
std::vector<unsigned int> extruders = this->extruders();
if (extruders.empty())
return L("The supplied settings will cause an empty print.");
std::vector<double> nozzle_diameters;
for (unsigned int extruder_id : extruders)
nozzle_diameters.push_back(m_config.nozzle_diameter.get_at(extruder_id));
double min_nozzle_diameter = *std::min_element(nozzle_diameters.begin(), nozzle_diameters.end());
{
// find the smallest nozzle diameter
std::vector<unsigned int> extruders = this->extruders();
if (extruders.empty())
return L("The supplied settings will cause an empty print.");
// Find the smallest used nozzle diameter and the number of unique nozzle diameters.
double min_nozzle_diameter = std::numeric_limits<double>::max();
double max_nozzle_diameter = 0;
for (unsigned int extruder_id : extruders) {
double dmr = m_config.nozzle_diameter.get_at(extruder_id);
min_nozzle_diameter = std::min(min_nozzle_diameter, dmr);
max_nozzle_diameter = std::max(max_nozzle_diameter, dmr);
}
#if 0
// We currently allow one to assign extruders with a higher index than the number
@ -1304,7 +1309,7 @@ std::string Print::validate() const
for (PrintObject *object : m_objects) {
if (object->config().raft_layers > 0 || object->config().support_material.value) {
if ((object->config().support_material_extruder == 0 || object->config().support_material_interface_extruder == 0) && nozzle_diameters.size() > 1) {
if ((object->config().support_material_extruder == 0 || object->config().support_material_interface_extruder == 0) && max_nozzle_diameter - min_nozzle_diameter > EPSILON) {
// The object has some form of support and either support_material_extruder or support_material_interface_extruder
// will be printed with the current tool without a forced tool change. Play safe, assert that all object nozzles
// are of the same diameter.

View file

@ -128,6 +128,6 @@ add_library(libslic3r_gui STATIC
)
target_link_libraries(libslic3r_gui libslic3r avrdude imgui)
if (NOT SLIC3R_SYNTAXONLY)
if (SLIC3R_PCH AND NOT SLIC3R_SYNTAXONLY)
add_precompiled_header(libslic3r_gui pchheader.hpp FORCEINCLUDE)
endif ()

View file

@ -166,7 +166,7 @@ public:
auto *opt = cfg.option<ConfigOptionEnum<PrinterTechnology>>("printer_technology");
// The following assert may trigger when importing some legacy profile,
// but it is safer to keep it here to capture the cases where the "printer_technology" key is queried, where it should not.
assert(opt != nullptr);
// assert(opt != nullptr);
return (opt == nullptr) ? ptFFF : opt->value;
}
PrinterTechnology printer_technology() const { return Preset::printer_technology(this->config); }

View file

@ -172,8 +172,8 @@ void Tab::create_preset_tab()
m_mode_sizer = new PrusaModeSizer(panel);
m_hsizer = new wxBoxSizer(wxHORIZONTAL);
sizer->Add(m_hsizer, 0, wxBOTTOM, 3);
m_hsizer->Add(m_presets_choice, 1, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, 3);
sizer->Add(m_hsizer, 0, wxEXPAND | wxBOTTOM, 3);
m_hsizer->Add(m_presets_choice, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, 3);
m_hsizer->AddSpacer(4);
m_hsizer->Add(m_btn_save_preset, 0, wxALIGN_CENTER_VERTICAL);
m_hsizer->AddSpacer(4);
@ -185,8 +185,12 @@ void Tab::create_preset_tab()
m_hsizer->Add(m_undo_btn, 0, wxALIGN_CENTER_VERTICAL);
m_hsizer->AddSpacer(32);
m_hsizer->Add(m_question_btn, 0, wxALIGN_CENTER_VERTICAL);
m_hsizer->AddStretchSpacer(32);
m_hsizer->Add(m_mode_sizer, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
// m_hsizer->AddStretchSpacer(32);
// StretchSpacer has a strange behavior under OSX, so
// There is used just additional sizer for m_mode_sizer with right alignment
auto mode_sizer = new wxBoxSizer(wxVERTICAL);
mode_sizer->Add(m_mode_sizer, 1, wxALIGN_RIGHT);
m_hsizer->Add(mode_sizer, 1, wxALIGN_CENTER_VERTICAL | wxRIGHT, wxOSX ? 15 : 5);
//Horizontal sizer to hold the tree and the selected page.
m_hsizer = new wxBoxSizer(wxHORIZONTAL);
@ -681,18 +685,16 @@ void Tab::update_visibility()
page->update_visibility(mode);
update_page_tree_visibility();
m_hsizer->Layout();
Refresh();
// update mode for ModeSizer
m_mode_sizer->SetMode(mode);
Layout();
Thaw();
// to update tree items color
wxTheApp->CallAfter([this]() {
update_changed_tree_ui();
});
// update mode for ModeSizer
m_mode_sizer->SetMode(mode);
}
Field* Tab::get_field(const t_config_option_key& opt_key, int opt_index/* = -1*/) const