mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 02:22:17 +00:00
WIP: Reworked slicing
1) Slicing code moved to TriangleMeshSlicer.cpp,hpp from TriangleMesh.cpp,hpp 2) Refactored to use as little as possible of admesh.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "sla_test_utils.hpp"
|
||||
#include "libslic3r/TriangleMeshSlicer.hpp"
|
||||
#include "libslic3r/SLA/AGGRaster.hpp"
|
||||
|
||||
void test_support_model_collision(const std::string &obj_filename,
|
||||
@@ -94,8 +95,6 @@ void test_supports(const std::string &obj_filename,
|
||||
mesh.require_shared_vertices();
|
||||
}
|
||||
|
||||
TriangleMeshSlicer slicer{&mesh};
|
||||
|
||||
auto bb = mesh.bounding_box();
|
||||
double zmin = bb.min.z();
|
||||
double zmax = bb.max.z();
|
||||
@@ -103,7 +102,7 @@ void test_supports(const std::string &obj_filename,
|
||||
auto layer_h = 0.05f;
|
||||
|
||||
out.slicegrid = grid(float(gnd), float(zmax), layer_h);
|
||||
slicer.slice(out.slicegrid, SlicingMode::Regular, CLOSING_RADIUS, &out.model_slices, []{});
|
||||
slice_mesh(mesh, out.slicegrid, CLOSING_RADIUS, out.model_slices);
|
||||
sla::cut_drainholes(out.model_slices, out.slicegrid, CLOSING_RADIUS, drainholes, []{});
|
||||
|
||||
// Create the special index-triangle mesh with spatial indexing which
|
||||
@@ -470,7 +469,7 @@ sla::SupportPoints calc_support_pts(
|
||||
std::vector<ExPolygons> slices;
|
||||
auto bb = cast<float>(mesh.bounding_box());
|
||||
std::vector<float> heights = grid(bb.min.z(), bb.max.z(), 0.1f);
|
||||
slice_mesh(mesh, heights, slices, CLOSING_RADIUS, [] {});
|
||||
slice_mesh(mesh, heights, CLOSING_RADIUS, slices);
|
||||
|
||||
// Prepare the support point calculator
|
||||
sla::IndexedMesh emesh{mesh};
|
||||
|
||||
Reference in New Issue
Block a user