Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbubnikv <bubnikv@gmail.com>2019-10-23 16:07:53 +0300
committerbubnikv <bubnikv@gmail.com>2019-10-23 16:07:53 +0300
commit18bbefcd61681c064fcd445d4ba052f16f89835a (patch)
treeca509e0f8278af068e958fd227f2187b2e0ed9e3 /src
parentcf94482731746fda6bbd83c5aa5862105549c319 (diff)
parent8961e68f5ed2b2fe969c61cd06158c7384c9dbdb (diff)
Merge branch 'master' of https://github.com/Prusa3d/PrusaSlicer
Diffstat (limited to 'src')
-rw-r--r--src/libslic3r/Format/AMF.cpp21
-rw-r--r--src/libslic3r/GCode.cpp36
-rw-r--r--src/libslic3r/GCode/Analyzer.cpp24
-rw-r--r--src/libslic3r/GCode/Analyzer.hpp3
-rw-r--r--src/qhull/CMakeLists.txt4
-rw-r--r--src/slic3r/GUI/GUI_ObjectManipulation.cpp6
6 files changed, 74 insertions, 20 deletions
diff --git a/src/libslic3r/Format/AMF.cpp b/src/libslic3r/Format/AMF.cpp
index 2d77d3daa..181d6cb99 100644
--- a/src/libslic3r/Format/AMF.cpp
+++ b/src/libslic3r/Format/AMF.cpp
@@ -584,8 +584,16 @@ void AMFParserContext::endElement(const char * /* name */)
stl_get_size(&stl);
mesh.repair();
m_volume->set_mesh(std::move(mesh));
- // pass false if the mesh offset has been already taken from the data
- m_volume->center_geometry_after_creation(m_volume->source.input_file.empty());
+ if (m_volume->source.input_file.empty() && (m_volume->type() == ModelVolumeType::MODEL_PART))
+ {
+ m_volume->source.object_idx = (int)m_model.objects.size() - 1;
+ m_volume->source.volume_idx = (int)m_model.objects.back()->volumes.size() - 1;
+ m_volume->center_geometry_after_creation();
+ }
+ else
+ // pass false if the mesh offset has been already taken from the data
+ m_volume->center_geometry_after_creation(m_volume->source.input_file.empty());
+
m_volume->calculate_convex_hull();
m_volume_facets.clear();
m_volume = nullptr;
@@ -799,6 +807,15 @@ bool load_amf_file(const char *path, DynamicPrintConfig *config, Model *model)
if (result)
ctx.endDocument();
+ for (ModelObject* o : model->objects)
+ {
+ for (ModelVolume* v : o->volumes)
+ {
+ if (v->source.input_file.empty() && (v->type() == ModelVolumeType::MODEL_PART))
+ v->source.input_file = path;
+ }
+ }
+
return result;
}
diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp
index 3a72657c3..26d9c90f8 100644
--- a/src/libslic3r/GCode.cpp
+++ b/src/libslic3r/GCode.cpp
@@ -778,22 +778,26 @@ void GCode::_do_export(Print &print, FILE *file)
{
m_silent_time_estimator.reset();
m_silent_time_estimator.set_dialect(print.config().gcode_flavor);
- m_silent_time_estimator.set_max_acceleration((float)print.config().machine_max_acceleration_extruding.values[1]);
- m_silent_time_estimator.set_retract_acceleration((float)print.config().machine_max_acceleration_retracting.values[1]);
- m_silent_time_estimator.set_minimum_feedrate((float)print.config().machine_min_extruding_rate.values[1]);
- m_silent_time_estimator.set_minimum_travel_feedrate((float)print.config().machine_min_travel_rate.values[1]);
- m_silent_time_estimator.set_axis_max_acceleration(GCodeTimeEstimator::X, (float)print.config().machine_max_acceleration_x.values[1]);
- m_silent_time_estimator.set_axis_max_acceleration(GCodeTimeEstimator::Y, (float)print.config().machine_max_acceleration_y.values[1]);
- m_silent_time_estimator.set_axis_max_acceleration(GCodeTimeEstimator::Z, (float)print.config().machine_max_acceleration_z.values[1]);
- m_silent_time_estimator.set_axis_max_acceleration(GCodeTimeEstimator::E, (float)print.config().machine_max_acceleration_e.values[1]);
- m_silent_time_estimator.set_axis_max_feedrate(GCodeTimeEstimator::X, (float)print.config().machine_max_feedrate_x.values[1]);
- m_silent_time_estimator.set_axis_max_feedrate(GCodeTimeEstimator::Y, (float)print.config().machine_max_feedrate_y.values[1]);
- m_silent_time_estimator.set_axis_max_feedrate(GCodeTimeEstimator::Z, (float)print.config().machine_max_feedrate_z.values[1]);
- m_silent_time_estimator.set_axis_max_feedrate(GCodeTimeEstimator::E, (float)print.config().machine_max_feedrate_e.values[1]);
- m_silent_time_estimator.set_axis_max_jerk(GCodeTimeEstimator::X, (float)print.config().machine_max_jerk_x.values[1]);
- m_silent_time_estimator.set_axis_max_jerk(GCodeTimeEstimator::Y, (float)print.config().machine_max_jerk_y.values[1]);
- m_silent_time_estimator.set_axis_max_jerk(GCodeTimeEstimator::Z, (float)print.config().machine_max_jerk_z.values[1]);
- m_silent_time_estimator.set_axis_max_jerk(GCodeTimeEstimator::E, (float)print.config().machine_max_jerk_e.values[1]);
+ /* "Stealth mode" values can be just a copy of "normal mode" values
+ * (when they aren't input for a printer preset).
+ * Thus, use back value from values, instead of second one, which could be absent
+ */
+ m_silent_time_estimator.set_max_acceleration((float)print.config().machine_max_acceleration_extruding.values.back());
+ m_silent_time_estimator.set_retract_acceleration((float)print.config().machine_max_acceleration_retracting.values.back());
+ m_silent_time_estimator.set_minimum_feedrate((float)print.config().machine_min_extruding_rate.values.back());
+ m_silent_time_estimator.set_minimum_travel_feedrate((float)print.config().machine_min_travel_rate.values.back());
+ m_silent_time_estimator.set_axis_max_acceleration(GCodeTimeEstimator::X, (float)print.config().machine_max_acceleration_x.values.back());
+ m_silent_time_estimator.set_axis_max_acceleration(GCodeTimeEstimator::Y, (float)print.config().machine_max_acceleration_y.values.back());
+ m_silent_time_estimator.set_axis_max_acceleration(GCodeTimeEstimator::Z, (float)print.config().machine_max_acceleration_z.values.back());
+ m_silent_time_estimator.set_axis_max_acceleration(GCodeTimeEstimator::E, (float)print.config().machine_max_acceleration_e.values.back());
+ m_silent_time_estimator.set_axis_max_feedrate(GCodeTimeEstimator::X, (float)print.config().machine_max_feedrate_x.values.back());
+ m_silent_time_estimator.set_axis_max_feedrate(GCodeTimeEstimator::Y, (float)print.config().machine_max_feedrate_y.values.back());
+ m_silent_time_estimator.set_axis_max_feedrate(GCodeTimeEstimator::Z, (float)print.config().machine_max_feedrate_z.values.back());
+ m_silent_time_estimator.set_axis_max_feedrate(GCodeTimeEstimator::E, (float)print.config().machine_max_feedrate_e.values.back());
+ m_silent_time_estimator.set_axis_max_jerk(GCodeTimeEstimator::X, (float)print.config().machine_max_jerk_x.values.back());
+ m_silent_time_estimator.set_axis_max_jerk(GCodeTimeEstimator::Y, (float)print.config().machine_max_jerk_y.values.back());
+ m_silent_time_estimator.set_axis_max_jerk(GCodeTimeEstimator::Z, (float)print.config().machine_max_jerk_z.values.back());
+ m_silent_time_estimator.set_axis_max_jerk(GCodeTimeEstimator::E, (float)print.config().machine_max_jerk_e.values.back());
if (print.config().single_extruder_multi_material) {
// As of now the fields are shown at the UI dialog in the same combo box as the ramming values, so they
// are considered to be active for the single extruder multi-material printers only.
diff --git a/src/libslic3r/GCode/Analyzer.cpp b/src/libslic3r/GCode/Analyzer.cpp
index 78f6c6806..3f0b8735f 100644
--- a/src/libslic3r/GCode/Analyzer.cpp
+++ b/src/libslic3r/GCode/Analyzer.cpp
@@ -285,6 +285,11 @@ void GCodeAnalyzer::_process_gcode_line(GCodeReader&, const GCodeReader::GCodeLi
_processM108orM135(line);
break;
}
+ case 132: // Recall stored home offsets
+ {
+ _processM132(line);
+ break;
+ }
case 401: // Repetier: Store x, y and z position
{
_processM401(line);
@@ -504,6 +509,25 @@ void GCodeAnalyzer::_processM108orM135(const GCodeReader::GCodeLine& line)
}
}
+void GCodeAnalyzer::_processM132(const GCodeReader::GCodeLine& line)
+{
+ // This command is used by Makerbot to load the current home position from EEPROM
+ // see: https://github.com/makerbot/s3g/blob/master/doc/GCodeProtocol.md
+ // Using this command to reset the axis origin to zero helps in fixing: https://github.com/prusa3d/PrusaSlicer/issues/3082
+
+ if (line.has_x())
+ _set_axis_origin(X, 0.0f);
+
+ if (line.has_y())
+ _set_axis_origin(Y, 0.0f);
+
+ if (line.has_z())
+ _set_axis_origin(Z, 0.0f);
+
+ if (line.has_e())
+ _set_axis_origin(E, 0.0f);
+}
+
void GCodeAnalyzer::_processM401(const GCodeReader::GCodeLine& line)
{
if (m_gcode_flavor != gcfRepetier)
diff --git a/src/libslic3r/GCode/Analyzer.hpp b/src/libslic3r/GCode/Analyzer.hpp
index e90175c49..df4f6f652 100644
--- a/src/libslic3r/GCode/Analyzer.hpp
+++ b/src/libslic3r/GCode/Analyzer.hpp
@@ -182,6 +182,9 @@ private:
// Set tool (MakerWare and Sailfish flavor)
void _processM108orM135(const GCodeReader::GCodeLine& line);
+ // Recall stored home offsets
+ void _processM132(const GCodeReader::GCodeLine& line);
+
// Repetier: Store x, y and z position
void _processM401(const GCodeReader::GCodeLine& line);
diff --git a/src/qhull/CMakeLists.txt b/src/qhull/CMakeLists.txt
index 9ca0bdff2..ab9aba9af 100644
--- a/src/qhull/CMakeLists.txt
+++ b/src/qhull/CMakeLists.txt
@@ -18,11 +18,13 @@ if(Qhull_FOUND)
message(STATUS "Using qhull from system.")
if(SLIC3R_STATIC)
+ slic3r_remap_configs("Qhull::qhullcpp;Qhull::qhullstatic_r" RelWithDebInfo Release)
target_link_libraries(qhull INTERFACE Qhull::qhullcpp Qhull::qhullstatic_r)
else()
+ slic3r_remap_configs("Qhull::qhullcpp;Qhull::qhull_r" RelWithDebInfo Release)
target_link_libraries(qhull INTERFACE Qhull::qhullcpp Qhull::qhull_r)
endif()
-
+
else(Qhull_FOUND)
project(qhull)
diff --git a/src/slic3r/GUI/GUI_ObjectManipulation.cpp b/src/slic3r/GUI/GUI_ObjectManipulation.cpp
index 0b3f2b098..4ecab8a0f 100644
--- a/src/slic3r/GUI/GUI_ObjectManipulation.cpp
+++ b/src/slic3r/GUI/GUI_ObjectManipulation.cpp
@@ -632,7 +632,11 @@ void ObjectManipulation::update_reset_buttons_visibility()
show_drop_to_bed = (std::abs(min_z) > EPSILON);
}
- wxGetApp().CallAfter([this, show_rotation, show_scale, show_drop_to_bed]{
+ wxGetApp().CallAfter([this, show_rotation, show_scale, show_drop_to_bed] {
+ // There is a case (under OSX), when this function is called after the Manipulation panel is hidden
+ // So, let check if Manipulation panel is still shown for this moment
+ if (!this->IsShown())
+ return;
m_reset_rotation_button->Show(show_rotation);
m_reset_scale_button->Show(show_scale);
m_drop_to_bed_button->Show(show_drop_to_bed);