Merge branch 'master' into fs_emboss
# Conflicts: # src/slic3r/GUI/Gizmos/GLGizmoSimplify.cpp
This commit is contained in:
commit
7df893177c
136 changed files with 7349 additions and 2066 deletions
|
@ -78,13 +78,13 @@ SCENARIO("set_speed emits values with fixed-point output.", "[GCodeWriter]") {
|
|||
}
|
||||
}
|
||||
WHEN("set_speed is called to set speed to 1") {
|
||||
THEN("Output string is G1 F1.000") {
|
||||
REQUIRE_THAT(writer.set_speed(1.0), Catch::Equals("G1 F1.000\n"));
|
||||
THEN("Output string is G1 F1") {
|
||||
REQUIRE_THAT(writer.set_speed(1.0), Catch::Equals("G1 F1\n"));
|
||||
}
|
||||
}
|
||||
WHEN("set_speed is called to set speed to 203.200022") {
|
||||
THEN("Output string is G1 F203.200") {
|
||||
REQUIRE_THAT(writer.set_speed(203.200022), Catch::Equals("G1 F203.200\n"));
|
||||
THEN("Output string is G1 F203.2") {
|
||||
REQUIRE_THAT(writer.set_speed(203.200022), Catch::Equals("G1 F203.2\n"));
|
||||
}
|
||||
}
|
||||
WHEN("set_speed is called to set speed to 203.200522") {
|
||||
|
|
|
@ -279,14 +279,32 @@ TEST_CASE("Simplify mesh by Quadric edge collapse to 5%", "[its]")
|
|||
CHECK(is_similar(its, mesh.its, cfg));
|
||||
}
|
||||
|
||||
bool exist_triangle_with_twice_vertices(const std::vector<stl_triangle_vertex_indices>& indices)
|
||||
{
|
||||
for (const auto &face : indices)
|
||||
if (face[0] == face[1] ||
|
||||
face[0] == face[2] ||
|
||||
face[1] == face[2]) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
TEST_CASE("Simplify trouble case", "[its]")
|
||||
{
|
||||
TriangleMesh tm = load_model("simplification.obj");
|
||||
REQUIRE_FALSE(tm.empty());
|
||||
float max_error = std::numeric_limits<float>::max();
|
||||
uint32_t wanted_count = 8;
|
||||
uint32_t wanted_count = 0;
|
||||
its_quadric_edge_collapse(tm.its, wanted_count, &max_error);
|
||||
CHECK(tm.its.indices.size() <= 8);
|
||||
CHECK(!exist_triangle_with_twice_vertices(tm.its.indices));
|
||||
}
|
||||
|
||||
TEST_CASE("Simplified cube should not be empty.", "[its]")
|
||||
{
|
||||
auto its = its_make_cube(1, 2, 3);
|
||||
float max_error = std::numeric_limits<float>::max();
|
||||
uint32_t wanted_count = 0;
|
||||
its_quadric_edge_collapse(its, wanted_count, &max_error);
|
||||
CHECK(!its.indices.empty());
|
||||
}
|
||||
|
||||
TEST_CASE("Neighbors in cube", "[its]")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue