Refactoring and performance optimization for support trees in SLA

This commit is contained in:
tamasmeszaros 2022-05-11 12:08:32 +02:00
parent 60cd7d4561
commit d23f9d7674
36 changed files with 2995 additions and 2627 deletions

View file

@ -8,7 +8,6 @@
#include <libslic3r/TriangleMeshSlicer.hpp>
#include <libslic3r/SLA/SupportTreeMesher.hpp>
#include <libslic3r/SLA/Concurrency.hpp>
namespace {
@ -43,7 +42,7 @@ TEST_CASE("Support point generator should be deterministic if seeded",
"[SLASupportGeneration], [SLAPointGen]") {
TriangleMesh mesh = load_model("A_upsidedown.obj");
sla::IndexedMesh emesh{mesh};
AABBMesh emesh{mesh};
sla::SupportTreeConfig supportcfg;
sla::SupportPointGenerator::Config autogencfg;
@ -126,33 +125,69 @@ TEST_CASE("WingedPadAroundObjectIsValid", "[SLASupportGeneration]") {
for (auto &fname : AROUND_PAD_TEST_OBJECTS) test_pad(fname, padcfg);
}
TEST_CASE("ElevatedSupportGeometryIsValid", "[SLASupportGeneration]") {
TEST_CASE("DefaultSupports::ElevatedSupportGeometryIsValid", "[SLASupportGeneration]") {
sla::SupportTreeConfig supportcfg;
supportcfg.object_elevation_mm = 10.;
for (auto fname : SUPPORT_TEST_MODELS) test_supports(fname, supportcfg);
}
TEST_CASE("FloorSupportGeometryIsValid", "[SLASupportGeneration]") {
TEST_CASE("DefaultSupports::FloorSupportGeometryIsValid", "[SLASupportGeneration]") {
sla::SupportTreeConfig supportcfg;
supportcfg.object_elevation_mm = 0;
for (auto &fname: SUPPORT_TEST_MODELS) test_supports(fname, supportcfg);
}
TEST_CASE("ElevatedSupportsDoNotPierceModel", "[SLASupportGeneration]") {
TEST_CASE("DefaultSupports::ElevatedSupportsDoNotPierceModel", "[SLASupportGeneration]") {
sla::SupportTreeConfig supportcfg;
supportcfg.object_elevation_mm = 10.;
for (auto fname : SUPPORT_TEST_MODELS)
test_support_model_collision(fname, supportcfg);
}
TEST_CASE("DefaultSupports::FloorSupportsDoNotPierceModel", "[SLASupportGeneration]") {
sla::SupportTreeConfig supportcfg;
supportcfg.object_elevation_mm = 0;
for (auto fname : SUPPORT_TEST_MODELS)
test_support_model_collision(fname, supportcfg);
}
TEST_CASE("FloorSupportsDoNotPierceModel", "[SLASupportGeneration]") {
//TEST_CASE("CleverSupports::ElevatedSupportGeometryIsValid", "[SLASupportGeneration][Clever]") {
// sla::SupportTreeConfig supportcfg;
// supportcfg.object_elevation_mm = 10.;
// supportcfg.tree_type = sla::SupportTreeType::Clever;
// for (auto fname : SUPPORT_TEST_MODELS) test_supports(fname, supportcfg);
//}
//TEST_CASE("CleverSupports::FloorSupportGeometryIsValid", "[SLASupportGeneration][Clever]") {
// sla::SupportTreeConfig supportcfg;
// supportcfg.object_elevation_mm = 0;
// supportcfg.tree_type = sla::SupportTreeType::Clever;
// for (auto &fname: SUPPORT_TEST_MODELS) test_supports(fname, supportcfg);
//}
TEST_CASE("CleverSupports::ElevatedSupportsDoNotPierceModel", "[SLASupportGeneration][Clever]") {
sla::SupportTreeConfig supportcfg;
supportcfg.object_elevation_mm = 10.;
supportcfg.tree_type = sla::SupportTreeType::Clever;
for (auto fname : SUPPORT_TEST_MODELS)
test_support_model_collision(fname, supportcfg);
}
TEST_CASE("CleverSupports::FloorSupportsDoNotPierceModel", "[SLASupportGeneration][Clever]") {
sla::SupportTreeConfig supportcfg;
supportcfg.object_elevation_mm = 0;
supportcfg.tree_type = sla::SupportTreeType::Clever;
for (auto fname : SUPPORT_TEST_MODELS)
test_support_model_collision(fname, supportcfg);
}