mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-07 23:17:35 -06:00
Add the full source of BambuStudio
using version 1.0.10
This commit is contained in:
parent
30bcadab3e
commit
1555904bef
3771 changed files with 1251328 additions and 0 deletions
25
tests/libslic3r/test_meshboolean.cpp
Normal file
25
tests/libslic3r/test_meshboolean.cpp
Normal file
|
@ -0,0 +1,25 @@
|
|||
#include <catch2/catch.hpp>
|
||||
#include <test_utils.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() == Approx(sphere.volume()));
|
||||
|
||||
REQUIRE(! MeshBoolean::cgal::does_self_intersect(M));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue