mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 01:15:53 +08:00
Libnest2D test fix
This commit is contained in:
parent
b4666e8174
commit
f3591d2a85
@ -424,9 +424,10 @@ R"raw(<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|||||||
TEST(GeometryAlgorithms, BottomLeftStressTest) {
|
TEST(GeometryAlgorithms, BottomLeftStressTest) {
|
||||||
using namespace libnest2d;
|
using namespace libnest2d;
|
||||||
|
|
||||||
|
const Coord SCALE = 1000000;
|
||||||
auto& input = prusaParts();
|
auto& input = prusaParts();
|
||||||
|
|
||||||
Box bin(210, 250);
|
Box bin(210*SCALE, 250*SCALE);
|
||||||
BottomLeftPlacer placer(bin);
|
BottomLeftPlacer placer(bin);
|
||||||
|
|
||||||
auto it = input.begin();
|
auto it = input.begin();
|
||||||
@ -440,20 +441,20 @@ TEST(GeometryAlgorithms, BottomLeftStressTest) {
|
|||||||
bool valid = true;
|
bool valid = true;
|
||||||
|
|
||||||
if(result.size() == 2) {
|
if(result.size() == 2) {
|
||||||
Item& r1 = result[0];
|
Item& r1 = result[0];
|
||||||
Item& r2 = result[1];
|
Item& r2 = result[1];
|
||||||
valid = !Item::intersects(r1, r2) || Item::touches(r1, r2);
|
valid = !Item::intersects(r1, r2) || Item::touches(r1, r2);
|
||||||
valid = (valid && !r1.isInside(r2) && !r2.isInside(r1));
|
valid = (valid && !r1.isInside(r2) && !r2.isInside(r1));
|
||||||
if(!valid) {
|
if(!valid) {
|
||||||
std::cout << "error index: " << i << std::endl;
|
std::cout << "error index: " << i << std::endl;
|
||||||
exportSVG(result, bin, i);
|
exportSVG(result, bin, i);
|
||||||
}
|
}
|
||||||
// ASSERT_TRUE(valid);
|
ASSERT_TRUE(valid);
|
||||||
} else {
|
} else {
|
||||||
std::cout << "something went terribly wrong!" << std::endl;
|
std::cout << "something went terribly wrong!" << std::endl;
|
||||||
|
FAIL();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
placer.clearItems();
|
placer.clearItems();
|
||||||
it++;
|
it++;
|
||||||
i++;
|
i++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user