mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-24 23:23:59 -06:00
Group hollowing result (including grid) into one struct
This commit is contained in:
parent
e57eca0289
commit
82954ba715
7 changed files with 133 additions and 67 deletions
|
@ -26,21 +26,19 @@ static Slic3r::TriangleMesh load_model(const std::string &obj_filename)
|
|||
}
|
||||
|
||||
|
||||
TEST_CASE("Negative 3D offset should produce smaller object.", "[Hollowing]")
|
||||
{
|
||||
Slic3r::TriangleMesh in_mesh = load_model("20mm_cube.obj");
|
||||
Benchmark bench;
|
||||
bench.start();
|
||||
|
||||
std::unique_ptr<Slic3r::TriangleMesh> out_mesh_ptr =
|
||||
Slic3r::sla::generate_interior(in_mesh);
|
||||
|
||||
bench.stop();
|
||||
|
||||
std::cout << "Elapsed processing time: " << bench.getElapsedSec() << std::endl;
|
||||
|
||||
if (out_mesh_ptr) in_mesh.merge(*out_mesh_ptr);
|
||||
in_mesh.require_shared_vertices();
|
||||
in_mesh.WriteOBJFile("merged_out.obj");
|
||||
TEST_CASE("Hollow two overlapping spheres") {
|
||||
using namespace Slic3r;
|
||||
|
||||
TriangleMesh sphere1 = make_sphere(10., 2 * PI / 20.), sphere2 = sphere1;
|
||||
|
||||
sphere1.translate(-5.f, 0.f, 0.f);
|
||||
sphere2.translate( 5.f, 0.f, 0.f);
|
||||
|
||||
sphere1.merge(sphere2);
|
||||
sphere1.require_shared_vertices();
|
||||
|
||||
sla::hollow_mesh(sphere1, sla::HollowingConfig{}, sla::HollowingFlags::hfRemoveInsideTriangles);
|
||||
|
||||
sphere1.WriteOBJFile("twospheres.obj");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue