test_hollowing.cpp 519 B

123456789101112131415161718192021
  1. #include <iostream>
  2. #include <fstream>
  3. #include <catch2/catch.hpp>
  4. #include "libslic3r/SLA/Hollowing.hpp"
  5. TEST_CASE("Hollow two overlapping spheres") {
  6. using namespace Slic3r;
  7. TriangleMesh sphere1 = make_sphere(10., 2 * PI / 20.), sphere2 = sphere1;
  8. sphere1.translate(-5.f, 0.f, 0.f);
  9. sphere2.translate( 5.f, 0.f, 0.f);
  10. sphere1.merge(sphere2);
  11. sla::hollow_mesh(sphere1, sla::HollowingConfig{}, sla::HollowingFlags::hfRemoveInsideTriangles);
  12. sphere1.WriteOBJFile("twospheres.obj");
  13. }