From a9a99de93926d19d8e3fac93d706a3e3f5b81f7b Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Mon, 31 Aug 2020 10:37:42 +0200 Subject: [PATCH] Enable all tests for support point generator --- tests/sla_print/sla_supptgen_tests.cpp | 29 +++++++++++++------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/tests/sla_print/sla_supptgen_tests.cpp b/tests/sla_print/sla_supptgen_tests.cpp index 1d7a3ebee..024f115b0 100644 --- a/tests/sla_print/sla_supptgen_tests.cpp +++ b/tests/sla_print/sla_supptgen_tests.cpp @@ -105,26 +105,25 @@ TEST_CASE("Overhanging edge should be supported", "[SupGen]") { REQUIRE(min_point_distance(pts) >= cfg.minimal_distance); } -// FIXME: Not working yet -//TEST_CASE("Hollowed cube should be supported from the inside", "[SupGen][Hollowed]") { -// TriangleMesh mesh = make_cube(20., 20., 20.); +TEST_CASE("Hollowed cube should be supported from the inside", "[SupGen][Hollowed]") { + TriangleMesh mesh = make_cube(20., 20., 20.); -// hollow_mesh(mesh, HollowingConfig{}); + hollow_mesh(mesh, HollowingConfig{}); -// mesh.WriteOBJFile("cube_hollowed.obj"); + mesh.WriteOBJFile("cube_hollowed.obj"); -// auto bb = mesh.bounding_box(); -// auto h = float(bb.max.z() - bb.min.z()); -// Vec3f mv = bb.center().cast() - Vec3f{0.f, 0.f, 0.5f * h}; -// mesh.translate(-mv); -// mesh.require_shared_vertices(); + auto bb = mesh.bounding_box(); + auto h = float(bb.max.z() - bb.min.z()); + Vec3f mv = bb.center().cast() - Vec3f{0.f, 0.f, 0.5f * h}; + mesh.translate(-mv); + mesh.require_shared_vertices(); -// sla::SupportPointGenerator::Config cfg; -// sla::SupportPoints pts = calc_support_pts(mesh, cfg); -// sla::remove_bottom_points(pts, mesh.bounding_box().min.z() + EPSILON); + sla::SupportPointGenerator::Config cfg; + sla::SupportPoints pts = calc_support_pts(mesh, cfg); + sla::remove_bottom_points(pts, mesh.bounding_box().min.z() + EPSILON); -// REQUIRE(!pts.empty()); -//} + REQUIRE(!pts.empty()); +} TEST_CASE("Two parallel plates should be supported", "[SupGen][Hollowed]") {