mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-05 00:40:39 +08:00

- Support multiple wipe towers - Arrange to grid directly within the arrange algorithm - Suporrt arranging just the current bed - Support fill bed with instances - Add arrange selected on current bed - Add arrange current bed keyboard shortcuts - Fix cut not arranging properly (set instance bed after cut to the active bed, use arrange current bed selection only after cut) - Fix shift-D on arrange - Add window with options to the bed arrange button
36 lines
980 B
C++
36 lines
980 B
C++
#include <catch2/catch.hpp>
|
|
|
|
#include <libslic3r/MultipleBeds.hpp>
|
|
#include <numeric>
|
|
|
|
using namespace Slic3r;
|
|
TEST_CASE("Conversion between grid coords and index", "[MultipleBeds]")
|
|
{
|
|
std::vector<BedsGrid::Index> original_indices(10);
|
|
std::iota(original_indices.begin(), original_indices.end(), 0);
|
|
|
|
// Add indexes covering the whole int positive range.
|
|
const int n{100};
|
|
std::generate_n(std::back_inserter(original_indices), n, [i = 1]() mutable {
|
|
return std::numeric_limits<int>::max() / n * i++;
|
|
});
|
|
|
|
std::vector<BedsGrid::GridCoords> coords;
|
|
std::transform(
|
|
original_indices.begin(),
|
|
original_indices.end(),
|
|
std::back_inserter(coords),
|
|
BedsGrid::index2grid_coords
|
|
);
|
|
|
|
std::vector<BedsGrid::Index> indices;
|
|
std::transform(
|
|
coords.begin(),
|
|
coords.end(),
|
|
std::back_inserter(indices),
|
|
BedsGrid::grid_coords2index
|
|
);
|
|
|
|
CHECK(original_indices == indices);
|
|
}
|