mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 06:55:53 +08:00
SPE-1270 - Added check for print not exceeding max print height into BackgroundSlicingProcess::process_fff()
This commit is contained in:
parent
98e94c3329
commit
f8a6ce82d2
@ -23,6 +23,7 @@
|
|||||||
#include "libslic3r/Format/SL1.hpp"
|
#include "libslic3r/Format/SL1.hpp"
|
||||||
#include "libslic3r/Thread.hpp"
|
#include "libslic3r/Thread.hpp"
|
||||||
#include "libslic3r/libslic3r.h"
|
#include "libslic3r/libslic3r.h"
|
||||||
|
#include "libslic3r/BuildVolume.hpp"
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
@ -144,7 +145,21 @@ std::string BackgroundSlicingProcess::output_filepath_for_project(const boost::f
|
|||||||
void BackgroundSlicingProcess::process_fff()
|
void BackgroundSlicingProcess::process_fff()
|
||||||
{
|
{
|
||||||
assert(m_print == m_fff_print);
|
assert(m_print == m_fff_print);
|
||||||
m_print->process();
|
|
||||||
|
// Checks that the print does not exceed the max print height
|
||||||
|
const BuildVolume& build_volume = GUI::wxGetApp().mainframe->m_plater->build_volume();
|
||||||
|
auto objects = m_fff_print->objects();
|
||||||
|
for (auto obj : objects) {
|
||||||
|
std::vector<coordf_t> layer_height_profile;
|
||||||
|
PrintObject::update_layer_height_profile(*obj->model_object(), obj->slicing_parameters(), layer_height_profile);
|
||||||
|
auto layers = generate_object_layers(obj->slicing_parameters(), layer_height_profile);
|
||||||
|
if (!layers.empty() && layers.back() > build_volume.max_print_height()) {
|
||||||
|
throw Slic3r::SlicingError("The print is taller than the maximum allowed height. You might want to reduce the size of your model"
|
||||||
|
" or change current print settings and retry.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
m_print->process();
|
||||||
wxCommandEvent evt(m_event_slicing_completed_id);
|
wxCommandEvent evt(m_event_slicing_completed_id);
|
||||||
// Post the Slicing Finished message for the G-code viewer to update.
|
// Post the Slicing Finished message for the G-code viewer to update.
|
||||||
// Passing the timestamp
|
// Passing the timestamp
|
||||||
|
Loading…
x
Reference in New Issue
Block a user