Merge branch 'lm_230beta3_fixes'

This commit is contained in:
Vojtech Bubnik 2020-12-16 13:51:09 +01:00
commit 4d459f37de
7 changed files with 124 additions and 52 deletions

View file

@ -413,14 +413,11 @@ namespace Slic3r {
std::string WipeTowerIntegration::prime(GCode& gcodegen)
{
assert(m_layer_idx == 0);
std::string gcode;
for (const WipeTower::ToolChangeResult& tcr : m_priming) {
if (! tcr.extrusions.empty())
gcode += append_tcr(gcodegen, tcr, tcr.new_tool);
}
return gcode;
}
@ -1243,18 +1240,30 @@ void GCode::_do_export(Print& print, FILE* file, ThumbnailsGeneratorCallback thu
bbox_print.merge(get_wipe_tower_extrusions_extents(print, twolayers_printz));
BoundingBoxf bbox_prime(get_wipe_tower_priming_extrusions_extents(print));
bbox_prime.offset(0.5f);
// Beep for 500ms, tone 800Hz. Yet better, play some Morse.
_write(file, this->retract());
_write(file, "M300 S800 P500\n");
if (bbox_prime.overlap(bbox_print)) {
// Wait for the user to remove the priming extrusions, otherwise they would
// get covered by the print.
_write(file, "M1 Remove priming towers and click button.\n");
}
else {
// Just wait for a bit to let the user check, that the priming succeeded.
//TODO Add a message explaining what the printer is waiting for. This needs a firmware fix.
_write(file, "M1 S10\n");
bool overlap = bbox_prime.overlap(bbox_print);
if (print.config().gcode_flavor == gcfMarlin) {
_write(file, this->retract());
_write(file, "M300 S800 P500\n"); // Beep for 500ms, tone 800Hz.
if (overlap) {
// Wait for the user to remove the priming extrusions.
_write(file, "M1 Remove priming towers and click button.\n");
} else {
// Just wait for a bit to let the user check, that the priming succeeded.
//TODO Add a message explaining what the printer is waiting for. This needs a firmware fix.
_write(file, "M1 S10\n");
}
} else {
// This is not Marlin, M1 command is probably not supported.
// (See https://github.com/prusa3d/PrusaSlicer/issues/5441.)
if (overlap) {
print.active_step_add_warning(PrintStateBase::WarningLevel::CRITICAL,
L("Your print is very close to the priming regions. "
"Make sure there is no collision."));
} else {
// Just continue printing, no action necessary.
}
}
}
print.throw_if_canceled();

View file

@ -1042,8 +1042,6 @@ void ModelObject::convert_units(ModelObjectPtrs& new_objects, bool from_imperial
int vol_idx = 0;
for (ModelVolume* volume : volumes)
{
volume->supported_facets.clear();
volume->seam_facets.clear();
if (!volume->mesh().empty()) {
TriangleMesh mesh(volume->mesh());
mesh.require_shared_vertices();
@ -1060,6 +1058,9 @@ void ModelObject::convert_units(ModelObjectPtrs& new_objects, bool from_imperial
vol->source.object_idx = (int)new_objects.size();
vol->source.volume_idx = vol_idx;
vol->supported_facets.assign(volume->supported_facets);
vol->seam_facets.assign(volume->seam_facets);
// Perform conversion only if the target "imperial" state is different from the current one.
// This check supports conversion of "mixed" set of volumes, each with different "imperial" state.
if (//vol->source.is_converted_from_inches != from_imperial &&