mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-05-14 13:02:39 -07:00
add mesh simplification.
SPE-1072 Working but flipped normals with the interior. Testing on treefrog passed Oversampling for hollowed mesh should not be less than 3x Flip back normals after simplify and remove redundant test code.
This commit is contained in:
@@ -11,6 +11,7 @@ add_executable(${_TEST_NAME}_tests
|
||||
test_placeholder_parser.cpp
|
||||
test_polygon.cpp
|
||||
test_stl.cpp
|
||||
test_meshsimplify.cpp
|
||||
)
|
||||
|
||||
if (TARGET OpenVDB::openvdb)
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
|
||||
#include <libnest2d/tools/benchmark.h>
|
||||
|
||||
#include <libslic3r/SimplifyMesh.hpp>
|
||||
|
||||
#if defined(WIN32) || defined(_WIN32)
|
||||
#define PATH_SEPARATOR R"(\)"
|
||||
#else
|
||||
@@ -23,6 +25,7 @@ static Slic3r::TriangleMesh load_model(const std::string &obj_filename)
|
||||
return mesh;
|
||||
}
|
||||
|
||||
|
||||
TEST_CASE("Negative 3D offset should produce smaller object.", "[Hollowing]")
|
||||
{
|
||||
Slic3r::TriangleMesh in_mesh = load_model("20mm_cube.obj");
|
||||
@@ -40,3 +43,4 @@ TEST_CASE("Negative 3D offset should produce smaller object.", "[Hollowing]")
|
||||
in_mesh.require_shared_vertices();
|
||||
in_mesh.WriteOBJFile("merged_out.obj");
|
||||
}
|
||||
|
||||
|
||||
11
tests/libslic3r/test_meshsimplify.cpp
Normal file
11
tests/libslic3r/test_meshsimplify.cpp
Normal file
@@ -0,0 +1,11 @@
|
||||
#include <catch2/catch.hpp>
|
||||
#include <test_utils.hpp>
|
||||
|
||||
//#include <libslic3r/MeshSimplify.hpp>
|
||||
|
||||
//TEST_CASE("Mesh simplification", "[mesh_simplify]") {
|
||||
// Simplify::load_obj(TEST_DATA_DIR PATH_SEPARATOR "zaba.obj");
|
||||
// Simplify::simplify_mesh_lossless();
|
||||
// Simplify::write_obj("zaba_simplified.obj");
|
||||
//}
|
||||
|
||||
Reference in New Issue
Block a user