mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-17 19:57:55 -06:00
Added measuring sandbox for neighbors index creation
This commit is contained in:
parent
c542e6e14b
commit
c8be2cdceb
11 changed files with 988 additions and 266 deletions
|
@ -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
|
||||
//}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue