mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-05 14:51:06 +00:00
Generated with include-what-you-use and applied conservatively. Only OrcaSlicer's own headers, the ones under src/ and tests/, are removed or forward-declared; standard-library and third-party includes are left alone. An include is removed only when both the Release and the Debug configuration leave it unused, never from inside a conditional block, and never from a file with platform-specific blocks, which only gain includes. Files whose only use of a header sits behind a feature or debug macro (libvgcode's OpenGL ES and marker code, the ARACHNE/TESTS_EXPORT_SVGS debug output) keep their includes. clonable_ptr.hpp gains #pragma once; it had no include guard and was only safe while Config.hpp was its sole includer.
27 lines
846 B
C++
27 lines
846 B
C++
#include <catch2/catch_all.hpp>
|
|
#include <catch2/catch_test_macros.hpp>
|
|
#include <catch2/catch_approx.hpp>
|
|
|
|
#include <libslic3r/TriangleMesh.hpp>
|
|
#include <libslic3r/MeshBoolean.hpp>
|
|
|
|
using namespace Slic3r;
|
|
|
|
TEST_CASE("CGAL and TriangleMesh conversions", "[MeshBoolean]") {
|
|
TriangleMesh sphere = make_sphere(1.);
|
|
|
|
auto cgalmesh_ptr = MeshBoolean::cgal::triangle_mesh_to_cgal(sphere);
|
|
|
|
REQUIRE(cgalmesh_ptr);
|
|
REQUIRE(! MeshBoolean::cgal::does_self_intersect(*cgalmesh_ptr));
|
|
|
|
TriangleMesh M = MeshBoolean::cgal::cgal_to_triangle_mesh(*cgalmesh_ptr);
|
|
|
|
REQUIRE(M.its.vertices.size() == sphere.its.vertices.size());
|
|
REQUIRE(M.its.indices.size() == sphere.its.indices.size());
|
|
|
|
REQUIRE(M.volume() == Catch::Approx(sphere.volume()));
|
|
|
|
REQUIRE(! MeshBoolean::cgal::does_self_intersect(M));
|
|
}
|