This commit is contained in:
Filip Sykala 2021-10-21 08:36:38 +02:00
parent b04bd6a8ad
commit 7f848b0603
3 changed files with 12 additions and 9 deletions

Binary file not shown.

View File

@ -94,13 +94,14 @@ Vec3d calc_hit_point(const igl::Hit &h, indexed_triangle_set &its)
} }
} // namespace Private } // namespace Private
/* TEST_CASE("Emboss text", "[Emboss]") #include <libslic3r/Utils.hpp>
TEST_CASE("Emboss text", "[Emboss]")
{ {
const char *font_name = "C:/windows/fonts/arialbd.ttf"; std::string font_path = std::string(TEST_DATA_DIR) + "/fonts/NotoSans-Regular.ttf";
char letter = '%'; char letter = '%';
float flatness = 2.; float flatness = 2.;
std::optional<Emboss::Font> font = Emboss::load_font(font_name); std::optional<Emboss::Font> font = Emboss::load_font(font_path.c_str());
REQUIRE(font.has_value()); REQUIRE(font.has_value());
std::optional<Emboss::Glyph> glyph = Emboss::letter2glyph(*font, letter, flatness); std::optional<Emboss::Glyph> glyph = Emboss::letter2glyph(*font, letter, flatness);
@ -114,7 +115,7 @@ Vec3d calc_hit_point(const igl::Hit &h, indexed_triangle_set &its)
indexed_triangle_set its = Emboss::polygons2model(shape, projection); indexed_triangle_set its = Emboss::polygons2model(shape, projection);
CHECK(!its.indices.empty()); CHECK(!its.indices.empty());
}*/ }
TEST_CASE("Test hit point", "[AABBTreeIndirect]") TEST_CASE("Test hit point", "[AABBTreeIndirect]")
{ {

View File

@ -39,12 +39,14 @@ Vec3d calc_normal(const Vec3i &triangle, const std::vector<Vec3f> &vertices)
TEST_CASE("Add TriangleMeshes", "[MeshBoolean]") TEST_CASE("Add TriangleMeshes", "[MeshBoolean]")
{ {
TriangleMesh tm1 = make_sphere(1.6, 1.6); TriangleMesh tm1 = make_sphere(1.6, 1.6);
size_t init_size = tm1.its.indices.size();
Vec3f move(5, -3, 7); Vec3f move(5, -3, 7);
move.normalize(); move.normalize();
tm1.translate(0.3 * move); tm1.translate(0.3 * move);
its_write_obj(tm1.its, "tm1.obj"); //its_write_obj(tm1.its, "tm1.obj");
TriangleMesh tm2 = make_cube(1., 1., 1.); TriangleMesh tm2 = make_cube(1., 1., 1.);
its_write_obj(tm2.its, "tm2.obj"); //its_write_obj(tm2.its, "tm2.obj");
MeshBoolean::cgal::plus(tm1, tm2); MeshBoolean::cgal::plus(tm1, tm2);
its_write_obj(tm1.its, "test_add.obj"); //its_write_obj(tm1.its, "test_add.obj");
CHECK(tm1.its.indices.size() > init_size);
} }