mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 23:46:24 -06:00
ENH: unify multi-object copy with single copy
Also adapt empty cell stride with object size plus 1mm. Change-Id: I47ac98bede196d636ebb3da549c16e393756de0a
This commit is contained in:
parent
b71917b28c
commit
9edc90704a
3 changed files with 17 additions and 14 deletions
|
@ -4074,15 +4074,15 @@ double GLCanvas3D::get_size_proportional_to_max_bed_size(double factor) const
|
|||
}
|
||||
|
||||
//BBS
|
||||
std::vector<Vec2f> GLCanvas3D::get_empty_cells(const Vec2f start_point)
|
||||
std::vector<Vec2f> GLCanvas3D::get_empty_cells(const Vec2f start_point, const Vec2f step)
|
||||
{
|
||||
PartPlate* plate = wxGetApp().plater()->get_partplate_list().get_curr_plate();
|
||||
BoundingBoxf3 build_volume = plate->get_build_volume();
|
||||
Vec2d vmin(build_volume.min.x(), build_volume.min.y()), vmax(build_volume.max.x(), build_volume.max.y());
|
||||
BoundingBoxf bbox(vmin, vmax);
|
||||
std::vector<Vec2f> cells;
|
||||
for (float x = bbox.min.x(); x < bbox.max.x(); x+=10)
|
||||
for (float y = bbox.min.y(); y < bbox.max.y(); y += 10)
|
||||
for (float x = bbox.min.x(); x < bbox.max.x(); x += step(0))
|
||||
for (float y = bbox.min.y(); y < bbox.max.y(); y += step(1))
|
||||
{
|
||||
cells.emplace_back(x, y);
|
||||
}
|
||||
|
@ -4124,9 +4124,9 @@ std::vector<Vec2f> GLCanvas3D::get_empty_cells(const Vec2f start_point)
|
|||
return cells;
|
||||
}
|
||||
|
||||
Vec2f GLCanvas3D::get_nearest_empty_cell(const Vec2f start_point)
|
||||
Vec2f GLCanvas3D::get_nearest_empty_cell(const Vec2f start_point, const Vec2f step)
|
||||
{
|
||||
std::vector<Vec2f> empty_cells = get_empty_cells(start_point);
|
||||
std::vector<Vec2f> empty_cells = get_empty_cells(start_point, step);
|
||||
if (!empty_cells.empty())
|
||||
return empty_cells.front();
|
||||
else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue