mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-17 19:57:55 -06:00
Add test checking diference in volume before/after simplification
FIX warnings ..\src\libslic3r\QuadricEdgeCollapse.cpp(173): warning C4056: overflow in floating-point constant arithmetic ..\src\libslic3r\QuadricEdgeCollapse.cpp(232): warning C4056: overflow in floating-point constant arithmetic
This commit is contained in:
parent
e3cdeda673
commit
7c13cfa1d9
2 changed files with 16 additions and 1 deletions
|
@ -139,4 +139,19 @@ TEST_CASE("Reduce one edge by Quadric Edge Collapse", "[its]")
|
|||
(v[i] > v4[i] && v[i] < v2[i]);
|
||||
CHECK(is_between);
|
||||
}
|
||||
}
|
||||
|
||||
#include "test_utils.hpp"
|
||||
TEST_CASE("Symplify mesh by Quadric edge collapse to 5%", "[its]")
|
||||
{
|
||||
TriangleMesh mesh = load_model("frog_legs.obj");
|
||||
double original_volume = its_volume(mesh.its);
|
||||
size_t wanted_count = mesh.its.indices.size() * 0.05;
|
||||
REQUIRE_FALSE(mesh.empty());
|
||||
indexed_triangle_set its = mesh.its; // copy
|
||||
its_quadric_edge_collapse(its, wanted_count);
|
||||
// its_write_obj(its, "frog_legs_qec.obj");
|
||||
CHECK(its.indices.size() <= wanted_count);
|
||||
double volume = its_volume(its);
|
||||
CHECK(fabs(original_volume - volume) < 30.);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue