Merge branch 'master' of https://github.com/prusa3d/Slic3r into et_bug_fixes
This commit is contained in:
commit
2557341366
@ -13,7 +13,7 @@ class SpiralVase {
|
||||
SpiralVase(const PrintConfig &config)
|
||||
: enable(false), _config(&config)
|
||||
{
|
||||
this->_reader.z() = this->_config->z_offset;
|
||||
this->_reader.z() = (float)this->_config->z_offset;
|
||||
this->_reader.apply_config(*this->_config);
|
||||
};
|
||||
std::string process_layer(const std::string &gcode);
|
||||
|
@ -43,7 +43,7 @@ public:
|
||||
}
|
||||
bool cmd_is(const char *cmd_test) const {
|
||||
const char *cmd = GCodeReader::skip_whitespaces(m_raw.c_str());
|
||||
int len = strlen(cmd_test);
|
||||
size_t len = strlen(cmd_test);
|
||||
return strncmp(cmd, cmd_test, len) == 0 && GCodeReader::is_end_of_word(cmd[len]);
|
||||
}
|
||||
bool extruding(const GCodeReader &reader) const { return this->cmd_is("G1") && this->dist_E(reader) > 0; }
|
||||
|
@ -549,11 +549,18 @@ void Model::reset_auto_extruder_id()
|
||||
|
||||
std::string Model::propose_export_file_name() const
|
||||
{
|
||||
std::string input_file;
|
||||
for (const ModelObject *model_object : this->objects)
|
||||
for (ModelInstance *model_instance : model_object->instances)
|
||||
if (model_instance->is_printable())
|
||||
return model_object->name.empty() ? model_object->input_file : model_object->name;
|
||||
return std::string();
|
||||
if (model_instance->is_printable()) {
|
||||
input_file = model_object->name.empty() ? model_object->input_file : model_object->name;
|
||||
if (! input_file.empty())
|
||||
goto end;
|
||||
// Other instances will produce the same name, skip them.
|
||||
break;
|
||||
}
|
||||
end:
|
||||
return input_file;
|
||||
}
|
||||
|
||||
ModelObject::~ModelObject()
|
||||
|
@ -67,20 +67,9 @@ std::string PrintBase::output_filename(const std::string &format, const std::str
|
||||
std::string PrintBase::output_filepath(const std::string &path) const
|
||||
{
|
||||
// if we were supplied no path, generate an automatic one based on our first object's input file
|
||||
if (path.empty()) {
|
||||
if (path.empty())
|
||||
// get the first input file name
|
||||
std::string input_file;
|
||||
for (const ModelObject *model_object : m_model.objects) {
|
||||
for (ModelInstance *model_instance : model_object->instances)
|
||||
if (model_instance->is_printable()) {
|
||||
input_file = model_object->input_file;
|
||||
break;
|
||||
}
|
||||
if (! input_file.empty())
|
||||
break;
|
||||
}
|
||||
return (boost::filesystem::path(input_file).parent_path() / this->output_filename()).make_preferred().string();
|
||||
}
|
||||
return (boost::filesystem::path(m_model.propose_export_file_name()).parent_path() / this->output_filename()).make_preferred().string();
|
||||
|
||||
// if we were supplied a directory, use it and append our automatically generated filename
|
||||
boost::filesystem::path p(path);
|
||||
|
Loading…
Reference in New Issue
Block a user