mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-05 15:50:38 +08:00
Made Plater::arrange a little less noisy, noted TODO for the background process pause.
Also finished implemented bed_centerf()
This commit is contained in:
parent
66bca83b57
commit
6e9cd3bfdd
@ -373,12 +373,15 @@ void Plater::refresh_canvases() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Plater::arrange() {
|
void Plater::arrange() {
|
||||||
// pause background process
|
// TODO pause background process
|
||||||
Slic3r::Log::info(LogChannel, L"Called arrange()");
|
const Slic3r::BoundingBoxf bb {Slic3r::BoundingBoxf(this->config->get<ConfigOptionPoints>("bed_shape").values)};
|
||||||
auto bb {Slic3r::BoundingBoxf(this->config->get<ConfigOptionPoints>("bed_shape").values)};
|
bool success {this->model->arrange_objects(this->config->min_object_distance(), &bb)};
|
||||||
bool success {this->model->arrange_objects(5, &bb)};
|
|
||||||
|
|
||||||
|
if (success) {
|
||||||
GetFrame()->statusbar->SetStatusText(_("Objects were arranged."));
|
GetFrame()->statusbar->SetStatusText(_("Objects were arranged."));
|
||||||
|
} else {
|
||||||
|
GetFrame()->statusbar->SetStatusText(_("Arrange failed."));
|
||||||
|
}
|
||||||
this->on_model_change(true);
|
this->on_model_change(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ public:
|
|||||||
Plater(wxWindow* parent, const wxString& title, std::shared_ptr<Settings> _settings);
|
Plater(wxWindow* parent, const wxString& title, std::shared_ptr<Settings> _settings);
|
||||||
void add();
|
void add();
|
||||||
|
|
||||||
/// Arrange models
|
/// Arrange models via a simple packing mechanism based on bounding boxes.
|
||||||
void arrange();
|
void arrange();
|
||||||
|
|
||||||
/// Ask if there are any unsaved changes.
|
/// Ask if there are any unsaved changes.
|
||||||
@ -90,8 +90,9 @@ private:
|
|||||||
int get_object_index(size_t object_id);
|
int get_object_index(size_t object_id);
|
||||||
|
|
||||||
Slic3r::Pointf bed_centerf() {
|
Slic3r::Pointf bed_centerf() {
|
||||||
auto bed_shape { Slic3r::Polygon::new_scale(this->config->get<ConfigOptionPoints>("bed_shape").values) };
|
const auto& bed_shape { Slic3r::Polygon::new_scale(this->config->get<ConfigOptionPoints>("bed_shape").values) };
|
||||||
return Slic3r::Pointf();
|
const auto& bed_center {BoundingBox(bed_shape).center()};
|
||||||
|
return Slic3r::Pointf::new_unscale(bed_center);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Build thumbnails for the models
|
/// Build thumbnails for the models
|
||||||
|
Loading…
x
Reference in New Issue
Block a user