mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-27 10:41:15 -06:00
WIP still with arrange return value.
This commit is contained in:
parent
b5215dae1b
commit
e81f8a5fd9
8 changed files with 78 additions and 79 deletions
|
|
@ -5739,7 +5739,7 @@ const SLAPrint* GLCanvas3D::sla_print() const
|
|||
return (m_process == nullptr) ? nullptr : m_process->sla_print();
|
||||
}
|
||||
|
||||
void GLCanvas3D::WipeTowerInfo::apply_arrange_result(Vec2d offset, double rotation_rads)
|
||||
void GLCanvas3D::WipeTowerInfo::apply_arrange_result(Vec2d offset, double rotation_rads, unsigned /*bed_num*/)
|
||||
{
|
||||
m_pos = offset;
|
||||
m_rotation = rotation_rads;
|
||||
|
|
|
|||
|
|
@ -624,9 +624,9 @@ public:
|
|||
return !std::isnan(m_pos.x()) && !std::isnan(m_pos.y());
|
||||
}
|
||||
|
||||
virtual void apply_arrange_result(Vec2d offset, double rotation_rads) final;
|
||||
virtual void apply_arrange_result(Vec2d offset, double rotation_rads, unsigned /*bed_num*/) override;
|
||||
|
||||
virtual std::tuple<Polygon, Vec2crd, double> get_arrange_polygon() const final
|
||||
virtual std::tuple<Polygon, Vec2crd, double> get_arrange_polygon() const override
|
||||
{
|
||||
Polygon p({
|
||||
{coord_t(0), coord_t(0)},
|
||||
|
|
|
|||
|
|
@ -2482,33 +2482,35 @@ arrangement::BedShapeHint Plater::priv::get_bed_shape_hint() const {
|
|||
return bedshape;
|
||||
}
|
||||
|
||||
void Plater::priv::ExclusiveJobGroup::ArrangeJob::process() {
|
||||
static const auto arrangestr = _(L("Arranging"));
|
||||
|
||||
// FIXME: I don't know how to obtain the minimum distance, it depends
|
||||
// on printer technology. I guess the following should work but it crashes.
|
||||
double dist = 6; // PrintConfig::min_object_distance(config);
|
||||
if (plater().printer_technology == ptFFF) {
|
||||
dist = PrintConfig::min_object_distance(plater().config);
|
||||
}
|
||||
|
||||
coord_t min_obj_distance = scaled(dist);
|
||||
void Plater::priv::ExclusiveJobGroup::ArrangeJob::process() {
|
||||
auto count = unsigned(m_selected.size());
|
||||
arrangement::BedShapeHint bedshape = plater().get_bed_shape_hint();
|
||||
plater().model.arrange_objects(6.f, nullptr);
|
||||
// static const auto arrangestr = _(L("Arranging"));
|
||||
|
||||
try {
|
||||
arrangement::arrange(m_selected, m_unselected, min_obj_distance,
|
||||
bedshape,
|
||||
[this, count](unsigned st) {
|
||||
if (st > 0) // will not finalize after last one
|
||||
update_status(count - st, arrangestr);
|
||||
},
|
||||
[this]() { return was_canceled(); });
|
||||
} catch (std::exception & /*e*/) {
|
||||
GUI::show_error(plater().q,
|
||||
_(L("Could not arrange model objects! "
|
||||
"Some geometries may be invalid.")));
|
||||
}
|
||||
// // FIXME: I don't know how to obtain the minimum distance, it depends
|
||||
// // on printer technology. I guess the following should work but it crashes.
|
||||
// double dist = 6; // PrintConfig::min_object_distance(config);
|
||||
// if (plater().printer_technology == ptFFF) {
|
||||
// dist = PrintConfig::min_object_distance(plater().config);
|
||||
// }
|
||||
|
||||
// coord_t min_obj_distance = scaled(dist);
|
||||
// auto count = unsigned(m_selected.size());
|
||||
// arrangement::BedShapeHint bedshape = plater().get_bed_shape_hint();
|
||||
|
||||
// try {
|
||||
// arrangement::arrange(m_selected, m_unselected, min_obj_distance,
|
||||
// bedshape,
|
||||
// [this, count](unsigned st) {
|
||||
// if (st > 0) // will not finalize after last one
|
||||
// update_status(count - st, arrangestr);
|
||||
// },
|
||||
// [this]() { return was_canceled(); });
|
||||
// } catch (std::exception & /*e*/) {
|
||||
// GUI::show_error(plater().q,
|
||||
// _(L("Could not arrange model objects! "
|
||||
// "Some geometries may be invalid.")));
|
||||
// }
|
||||
|
||||
// finalize just here.
|
||||
update_status(int(count),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue