test_hollowing.cpp 558 B

12345678910111213141516171819202122
  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. sphere1.require_shared_vertices();
  12. sla::hollow_mesh(sphere1, sla::HollowingConfig{}, sla::HollowingFlags::hfRemoveInsideTriangles);
  13. sphere1.WriteOBJFile("twospheres.obj");
  14. }