2022-02-17 11:48:17 +00:00
|
|
|
#include <catch2/catch.hpp>
|
|
|
|
#include <test_utils.hpp>
|
|
|
|
|
|
|
|
#include "libslic3r/SLAPrint.hpp"
|
2022-04-20 09:04:11 +00:00
|
|
|
#include "libslic3r/Format/SLAArchiveWriter.hpp"
|
2022-02-17 11:48:17 +00:00
|
|
|
|
|
|
|
#include <boost/filesystem.hpp>
|
|
|
|
|
|
|
|
using namespace Slic3r;
|
|
|
|
|
|
|
|
TEST_CASE("Archive export test", "[sla_archives]") {
|
|
|
|
constexpr const char *PNAME = "20mm_cube";
|
|
|
|
|
2022-04-20 09:04:11 +00:00
|
|
|
for (auto &archname : SLAArchiveWriter::registered_archives()) {
|
2022-02-17 11:48:17 +00:00
|
|
|
INFO(std::string("Testing archive type: ") + archname);
|
|
|
|
SLAPrint print;
|
|
|
|
SLAFullPrintConfig fullcfg;
|
|
|
|
|
|
|
|
auto m = Model::read_from_file(TEST_DATA_DIR PATH_SEPARATOR + std::string(PNAME) + ".obj", nullptr);
|
|
|
|
|
|
|
|
fullcfg.set("sla_archive_format", archname);
|
2022-02-18 13:29:09 +00:00
|
|
|
fullcfg.set("supports_enable", false);
|
|
|
|
fullcfg.set("pad_enable", false);
|
2022-02-17 11:48:17 +00:00
|
|
|
|
|
|
|
DynamicPrintConfig cfg;
|
|
|
|
cfg.apply(fullcfg);
|
|
|
|
|
2022-02-17 13:05:45 +00:00
|
|
|
print.set_status_callback([](const PrintBase::SlicingStatus&) {});
|
2022-02-17 11:48:17 +00:00
|
|
|
print.apply(m, cfg);
|
|
|
|
print.process();
|
|
|
|
|
|
|
|
ThumbnailsList thumbnails;
|
2022-04-20 09:04:11 +00:00
|
|
|
auto outputfname = std::string("output.") + SLAArchiveWriter::get_extension(archname);
|
2022-02-17 11:48:17 +00:00
|
|
|
|
|
|
|
print.export_print(outputfname, thumbnails, PNAME);
|
|
|
|
|
|
|
|
// Not much can be checked about the archives...
|
|
|
|
REQUIRE(boost::filesystem::exists(outputfname));
|
|
|
|
}
|
|
|
|
}
|