Merge branch 'master' into lm_sla_supports_auto2

This commit is contained in:
Lukas Matena 2019-02-19 10:15:16 +01:00
commit 023b788777
44 changed files with 3347 additions and 2635 deletions

View file

@ -1333,6 +1333,8 @@ void Transformation::set_rotation(const Vec3d& rotation)
void Transformation::set_rotation(Axis axis, double rotation)
{
rotation = angle_to_0_2PI(rotation);
if (is_approx(std::abs(rotation), 2.0 * (double)PI))
rotation = 0.0;
if (m_rotation(axis) != rotation)
{

View file

@ -1445,7 +1445,7 @@ int ModelVolume::extruder_id() const
int extruder_id = -1;
if (this->is_model_part()) {
const ConfigOption *opt = this->config.option("extruder");
if (opt == nullptr)
if ((opt == nullptr) || (opt->getInt() == 0))
opt = this->object->config.option("extruder");
extruder_id = (opt == nullptr) ? 0 : opt->getInt();
}

View file

@ -1137,6 +1137,9 @@ std::string Print::validate() const
// Apply the same transformations we apply to the actual meshes when slicing them.
object->model_object()->instances.front()->transform_polygon(&convex_hull);
// Grow convex hull with the clearance margin.
// FIXME: Arrangement has different parameters for offsetting (jtMiter, limit 2)
// which causes that the warning will be showed after arrangement with the
// appropriate object distance. Even if I set this to jtMiter the warning still shows up.
convex_hull = offset(convex_hull, scale_(m_config.extruder_clearance_radius.value)/2, jtRound, scale_(0.1)).front();
// Now we check that no instance of convex_hull intersects any of the previously checked object instances.
for (const Point &copy : object->m_copies) {

View file

@ -42,22 +42,27 @@ namespace Slic3r {
static boost::log::trivial::severity_level logSeverity = boost::log::trivial::error;
void set_logging_level(unsigned int level)
static boost::log::trivial::severity_level level_to_boost(unsigned level)
{
switch (level) {
// Report fatal errors only.
case 0: logSeverity = boost::log::trivial::fatal; break;
case 0: return boost::log::trivial::fatal;
// Report fatal errors and errors.
case 1: logSeverity = boost::log::trivial::error; break;
case 1: return boost::log::trivial::error;
// Report fatal errors, errors and warnings.
case 2: logSeverity = boost::log::trivial::warning; break;
case 2: return boost::log::trivial::warning;
// Report all errors, warnings and infos.
case 3: logSeverity = boost::log::trivial::info; break;
case 3: return boost::log::trivial::info;
// Report all errors, warnings, infos and debugging.
case 4: logSeverity = boost::log::trivial::debug; break;
case 4: return boost::log::trivial::debug;
// Report everyting including fine level tracing information.
default: logSeverity = boost::log::trivial::trace; break;
default: return boost::log::trivial::trace;
}
}
void set_logging_level(unsigned int level)
{
logSeverity = level_to_boost(level);
boost::log::core::get()->set_filter
(
@ -73,6 +78,7 @@ unsigned get_logging_level()
case boost::log::trivial::warning : return 2;
case boost::log::trivial::info : return 3;
case boost::log::trivial::debug : return 4;
case boost::log::trivial::trace : return 5;
default: return 1;
}
}
@ -88,21 +94,7 @@ static struct RunOnInit {
void trace(unsigned int level, const char *message)
{
boost::log::trivial::severity_level severity = boost::log::trivial::trace;
switch (level) {
// Report fatal errors only.
case 0: severity = boost::log::trivial::fatal; break;
// Report fatal errors and errors.
case 1: severity = boost::log::trivial::error; break;
// Report fatal errors, errors and warnings.
case 2: severity = boost::log::trivial::warning; break;
// Report all errors, warnings and infos.
case 3: severity = boost::log::trivial::info; break;
// Report all errors, warnings, infos and debugging.
case 4: severity = boost::log::trivial::debug; break;
// Report everyting including fine level tracing information.
default: severity = boost::log::trivial::trace; break;
}
boost::log::trivial::severity_level severity = level_to_boost(level);
BOOST_LOG_STREAM_WITH_PARAMS(::boost::log::trivial::logger::get(),\
(::boost::log::keywords::severity = severity)) << message;