Allow auto-rotation of objects not completely inside bed.

Don't use SLAPrintObject as the input for optimization. Use ModelObject and pass the print config to the optimization in RotoptimizeJob::prepare()
This commit is contained in:
tamasmeszaros 2021-03-26 18:22:53 +01:00
parent 5443f77489
commit 773116b777
4 changed files with 77 additions and 37 deletions

View file

@ -4,18 +4,16 @@
#include "PlaterJob.hpp"
#include "libslic3r/SLA/Rotfinder.hpp"
#include "libslic3r/PrintConfig.hpp"
namespace Slic3r {
class SLAPrintObject;
namespace GUI {
class RotoptimizeJob : public PlaterJob
{
using FindFn = std::function<Vec2d(const SLAPrintObject & po,
float accuracy,
sla::RotOptimizeStatusCB statuscb)>;
using FindFn = std::function<Vec2d(const ModelObject & mo,
const sla::RotOptimizeParams &params)>;
struct FindMethod { std::string name; FindFn findfn; };
@ -26,6 +24,9 @@ class RotoptimizeJob : public PlaterJob
size_t m_method_id = 0;
float m_accuracy = 0.75;
DynamicPrintConfig m_default_print_cfg;
protected:
void prepare() override;