Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortamasmeszaros <meszaros.q@gmail.com>2021-06-01 16:49:19 +0300
committertamasmeszaros <meszaros.q@gmail.com>2021-06-08 11:34:32 +0300
commitc8be2cdcebfe3406754e343372a13c990eaa6018 (patch)
treeb16fd60dcb2d71af1f22bb813205a6272b451037 /tests/libslic3r
parentc542e6e14beaf496a319570c41ff5082bb4b8fb7 (diff)
Added measuring sandbox for neighbors index creation
Diffstat (limited to 'tests/libslic3r')
-rw-r--r--tests/libslic3r/test_indexed_triangle_set.cpp46
1 files changed, 3 insertions, 43 deletions
diff --git a/tests/libslic3r/test_indexed_triangle_set.cpp b/tests/libslic3r/test_indexed_triangle_set.cpp
index ae493169a..6c5902fc7 100644
--- a/tests/libslic3r/test_indexed_triangle_set.cpp
+++ b/tests/libslic3r/test_indexed_triangle_set.cpp
@@ -4,15 +4,12 @@
#include "libslic3r/TriangleMesh.hpp"
-//#include "libnest2d/tools/benchmark.h"
-
TEST_CASE("Split empty mesh", "[its_split][its]") {
using namespace Slic3r;
indexed_triangle_set its;
- std::vector<indexed_triangle_set> res;
- its_split(its, std::back_inserter(res));
+ std::vector<indexed_triangle_set> res = its_split(its);
REQUIRE(res.empty());
}
@@ -22,8 +19,7 @@ TEST_CASE("Split simple mesh consisting of one part", "[its_split][its]") {
TriangleMesh cube = make_cube(10., 10., 10.);
- std::vector<indexed_triangle_set> res;
- its_split(cube.its, std::back_inserter(res));
+ std::vector<indexed_triangle_set> res = its_split(cube.its);
REQUIRE(res.size() == 1);
REQUIRE(res.front().indices.size() == cube.its.indices.size());
@@ -41,14 +37,7 @@ TEST_CASE("Split two merged spheres", "[its_split][its]") {
sphere1.merge(sphere2);
sphere1.require_shared_vertices();
-// Benchmark bench;
-
-// bench.start();
- auto index = its_create_neighbors_index(sphere1.its);
- std::vector<indexed_triangle_set> parts = its_split(sphere1.its, index);
-// bench.stop();
-
-// std::cout << "split took " << bench.getElapsedSec() << " seconds." << std::endl;
+ std::vector<indexed_triangle_set> parts = its_split(sphere1.its);
REQUIRE(parts.size() == 2);
@@ -60,32 +49,3 @@ TEST_CASE("Split two merged spheres", "[its_split][its]") {
#endif
}
-//TEST_CASE("Split two merged spheres TriangleMesh", "[its_split][its]") {
-// using namespace Slic3r;
-
-// TriangleMesh sphere1 = make_sphere(10., 2 * PI / 200.), sphere2 = sphere1;
-
-// sphere1.translate(-5.f, 0.f, 0.f);
-// sphere2.translate( 5.f, 0.f, 0.f);
-
-// sphere1.merge(sphere2);
-// sphere1.require_shared_vertices();
-
-// Benchmark bench;
-
-// bench.start();
-// TriangleMeshPtrs parts = sphere1.split();
-// for (auto &part : parts) part->require_shared_vertices();
-// bench.stop();
-
-// std::cout << "split took " << bench.getElapsedSec() << " seconds." << std::endl;
-
-// REQUIRE(parts.size() == 2);
-
-////#ifndef NDEBUG
-//// size_t part_idx = 0;
-//// for (auto &part : parts) {
-//// its_write_obj(part->its, (std::string("part_its") + std::to_string(part_idx++) + ".obj").c_str());
-//// }
-////#endif
-//}