update src and test

This commit is contained in:
QIDI TECH
2025-03-22 09:44:19 +08:00
parent b15deeb656
commit 7e7d699e43
151 changed files with 36981 additions and 1531 deletions

View File

@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include "libslic3r/Model.hpp"
#include "libslic3r/Format/3mf.hpp"

View File

@@ -1,5 +1,6 @@
#include <algorithm>
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/catch_approx.hpp>
#include <test_utils.hpp>
#include <libslic3r/TriangleMesh.hpp>
@@ -7,6 +8,7 @@
#include <libslic3r/AABBTreeLines.hpp>
using namespace Slic3r;
using namespace Catch;
TEST_CASE("Building a tree over a box, ray caster and closest query", "[AABBIndirect]")
{

View File

@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <libslic3r/libslic3r.h>
#include <libslic3r/AnyPtr.hpp>

View File

@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include "libslic3r/Arachne/WallToolPaths.hpp"
#include "libslic3r/ClipperUtils.hpp"

View File

@@ -1,4 +1,5 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/catch_approx.hpp>
#include <test_utils.hpp>
#include <random>
@@ -12,6 +13,7 @@
#include <libslic3r/libslic3r.h>
using namespace Slic3r;
using namespace Catch;
TEST_CASE("arc basics", "[ArcWelder]") {
using namespace Slic3r::Geometry;

View File

@@ -1,4 +1,8 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/catch_template_test_macros.hpp>
#include <catch2/catch_approx.hpp>
#include <algorithm>
#include "libslic3r/BoundingBox.hpp"
#include "libslic3r/AStar.hpp"
@@ -6,6 +10,7 @@
#include "libslic3r/PointGrid.hpp"
using namespace Slic3r;
using namespace Catch;
TEST_CASE("Testing basic invariants of AStar", "[AStar]") {
struct DummyTracer {

View File

@@ -1,4 +1,5 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/catch_approx.hpp>
#include <iostream>
#include <boost/filesystem.hpp>
@@ -8,6 +9,7 @@
#include "libslic3r/SVG.hpp"
using namespace Slic3r;
using namespace Catch;
// #define TESTS_EXPORT_SVGS

View File

@@ -1,4 +1,5 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/catch_approx.hpp>
#include <numeric>
#include <iostream>
@@ -9,6 +10,7 @@
#include "libslic3r/SVG.hpp"
using namespace Slic3r;
using namespace Catch;
SCENARIO("Various Clipper operations - xs/t/11_clipper.t", "[ClipperUtils]") {
// CCW oriented contour

View File

@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include "libslic3r/libslic3r.h"
#include "libslic3r/Color.hpp"

View File

@@ -1,4 +1,6 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/matchers/catch_matchers.hpp>
#include <catch2/matchers/catch_matchers_vector.hpp>
#include "libslic3r/Config.hpp"
#include "libslic3r/PrintConfig.hpp"

View File

@@ -1,10 +1,13 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/catch_approx.hpp>
#include <test_utils.hpp>
#include <libslic3r/Geometry/Curves.hpp>
#include <libslic3r/Utils.hpp>
#include <libslic3r/SVG.hpp>
using namespace Catch;
TEST_CASE("Curves: cubic b spline fit test", "[Curves]") {
using namespace Slic3r;
using namespace Slic3r::Geometry;

View File

@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <libslic3r/CutSurface.hpp>
#include <libslic3r/TriangleMesh.hpp> // its_make_cube + its_merge

View File

@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <iostream>
#include <boost/filesystem.hpp>

View File

@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <libslic3r/Emboss.hpp>
#include <libslic3r/SVG.hpp> // only debug visualization

View File

@@ -1,10 +1,12 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/catch_approx.hpp>
#include "libslic3r/Point.hpp"
#include "libslic3r/Polygon.hpp"
#include "libslic3r/ExPolygon.hpp"
using namespace Slic3r;
using namespace Catch;
static inline bool points_close(const Point &p1, const Point &p2)
{

View File

@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include "libslic3r/Point.hpp"
#include "libslic3r/BoundingBox.hpp"

View File

@@ -1,6 +1,6 @@
#include <iostream>
#include <fstream>
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include "libslic3r/SLA/Hollowing.hpp"

View File

@@ -1,6 +1,7 @@
#include <iostream>
#include <fstream>
#include <catch2/catch.hpp>
#include <random>
#include <catch2/catch_test_macros.hpp>
#include "libslic3r/TriangleMesh.hpp"

View File

@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include "libslic3r/BoundingBox.hpp"
#include "libslic3r/JumpPointSearch.hpp"

View File

@@ -1,4 +1,5 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <algorithm>
#include "libslic3r/KDTreeIndirect.hpp"
#include "libslic3r/Execution/ExecutionSeq.hpp"

View File

@@ -2,11 +2,13 @@
#include "libslic3r/Geometry.hpp"
#include "libslic3r/Point.hpp"
#include "libslic3r/SVG.hpp"
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/catch_approx.hpp>
#include <libslic3r/LayerRegion.hpp>
using namespace Slic3r;
using namespace Slic3r::Algorithm;
using namespace Catch;
constexpr bool export_svgs = false;

View File

@@ -1,8 +1,10 @@
/**
* Ported from xs/t/10_line.t
*/
#include <catch2/catch_test_macros.hpp>
#include <catch2/generators/catch_generators.hpp>
#include <catch2/catch.hpp>
#include <libslic3r/Line.hpp>
#include <libslic3r/Line.hpp>
#include "test_utils.hpp"
@@ -37,7 +39,7 @@ TEST_CASE("Parallel lines under angles", "[Line]") {
CHECK(line.parallel_to(line.direction()));
INFO("Line is parallel to its direction + PI");
line.parallel_to(line.direction() + M_PI);
INFO("line is parallel to its direction - PI")
INFO("line is parallel to its direction - PI");
line.parallel_to(line.direction() - M_PI);
SECTION("Line is parallel within epsilon") {

View File

@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <test_utils.hpp>
#include <fstream>

View File

@@ -1,10 +1,12 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/catch_approx.hpp>
#include <test_utils.hpp>
#include <libslic3r/TriangleMesh.hpp>
#include <libslic3r/MeshBoolean.hpp>
using namespace Slic3r;
using namespace Catch;
TEST_CASE("CGAL and TriangleMesh conversions", "[MeshBoolean]") {
TriangleMesh sphere = make_sphere(1.);

View File

@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <libslic3r/MultipleBeds.hpp>
#include <numeric>

View File

@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include "libslic3r/Point.hpp"
#include "libslic3r/MutablePolygon.hpp"

View File

@@ -1,6 +1,8 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <queue>
#include <random>
#include <algorithm>
#include "libslic3r/MutablePriorityQueue.hpp"

View File

@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <test_utils.hpp>
#include <libslic3r/Optimize/BruteforceOptimizer.hpp>

View File

@@ -1,9 +1,11 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/catch_approx.hpp>
#include "libslic3r/PlaceholderParser.hpp"
#include "libslic3r/PrintConfig.hpp"
using namespace Slic3r;
using namespace Catch;
SCENARIO("Placeholder parser scripting", "[PlaceholderParser]") {
PlaceholderParser parser;

View File

@@ -2,7 +2,7 @@
#define NOMINMAX
#endif
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <numeric>

View File

@@ -5,11 +5,13 @@
* and cross product uses doubles
*/
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/matchers/catch_matchers_all.hpp>
#include <libslic3r/Point.hpp>
#include "test_utils.hpp"
using namespace Slic3r;
using namespace Catch;
TEST_CASE("Nearest point", "[Point]") {
const Point point{10, 15};

View File

@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include "libslic3r/Point.hpp"
#include "libslic3r/Polygon.hpp"

View File

@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include "libslic3r/Point.hpp"
#include "libslic3r/Polyline.hpp"

View File

@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <igl/qslim.h>
#include <test_utils.hpp>

View File

@@ -1,4 +1,5 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/catch_approx.hpp>
#include <libslic3r/libslic3r.h>
#include <libslic3r/Algorithm/RegionExpansion.hpp>
@@ -8,6 +9,7 @@
#include <libslic3r/SVG.cpp>
using namespace Slic3r;
using namespace Catch;
//#define DEBUG_TEMP_DIR "d:\\temp\\"

View File

@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <string_view>
#include "libslic3r/StaticMap.hpp"

View File

@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include "libslic3r/Model.hpp"
#include "libslic3r/Format/STL.hpp"

View File

@@ -1,9 +1,12 @@
#include "libslic3r/Point.hpp"
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/catch_approx.hpp>
#include <catch2/matchers/catch_matchers_floating_point.hpp>
#include <libslic3r/SupportSpotsGenerator.hpp>
using namespace Slic3r;
using namespace SupportSpotsGenerator;
using namespace Catch;
namespace Rectangle {
const float width = 10;

View File

@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <test_utils.hpp>

View File

@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include "libslic3r/Time.hpp"

View File

@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <libslic3r/Triangulation.hpp>
#include <libslic3r/SVG.hpp> // only debug visualization

View File

@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include "libslic3r/libslic3r.h"

View File

@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <libslic3r/Polygon.hpp>
#include <libslic3r/Polyline.hpp>
@@ -6,6 +6,7 @@
#include <libslic3r/Geometry/VoronoiOffset.hpp>
#include <numeric>
#include <random>
//#define VORONOI_DEBUG_OUT