Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnrico Turri <enricoturri@seznam.cz>2018-04-12 13:56:42 +0300
committerEnrico Turri <enricoturri@seznam.cz>2018-04-12 13:56:42 +0300
commitb062cddeea4f6ef11557b6bb533a046076ba177d (patch)
tree37a4a7e3378760f3925386b1f7d6af4ac9071c25 /xs/src/libslic3r/Model.cpp
parentd789b5c0df5042516c66729fa9f63d63907d9180 (diff)
Fixed object cutting
Diffstat (limited to 'xs/src/libslic3r/Model.cpp')
-rw-r--r--xs/src/libslic3r/Model.cpp30
1 files changed, 3 insertions, 27 deletions
diff --git a/xs/src/libslic3r/Model.cpp b/xs/src/libslic3r/Model.cpp
index 561106713..bda49421d 100644
--- a/xs/src/libslic3r/Model.cpp
+++ b/xs/src/libslic3r/Model.cpp
@@ -863,33 +863,9 @@ void ModelObject::cut(coordf_t z, Model* model) const
lower->add_volume(*volume);
} else {
TriangleMesh upper_mesh, lower_mesh;
- // TODO: shouldn't we use object bounding box instead of per-volume bb?
- coordf_t cut_z = z + volume->mesh.bounding_box().min.z;
- if (false) {
-// if (volume->mesh.has_multiple_patches()) {
- // Cutting algorithm does not work on intersecting meshes.
- // As we are not sure whether the meshes don't intersect,
- // we rather split the mesh into multiple non-intersecting pieces.
- TriangleMeshPtrs meshptrs = volume->mesh.split();
- for (TriangleMeshPtrs::iterator mesh = meshptrs.begin(); mesh != meshptrs.end(); ++mesh) {
- printf("Cutting mesh patch %d of %d\n", int(mesh - meshptrs.begin()), int(meshptrs.size()));
- (*mesh)->repair();
- TriangleMeshSlicer tms(*mesh);
- if (mesh == meshptrs.begin()) {
- tms.cut(cut_z, &upper_mesh, &lower_mesh);
- } else {
- TriangleMesh upper_mesh_this, lower_mesh_this;
- tms.cut(cut_z, &upper_mesh_this, &lower_mesh_this);
- upper_mesh.merge(upper_mesh_this);
- lower_mesh.merge(lower_mesh_this);
- }
- delete *mesh;
- }
- } else {
- printf("Cutting mesh patch\n");
- TriangleMeshSlicer tms(&volume->mesh);
- tms.cut(cut_z, &upper_mesh, &lower_mesh);
- }
+ printf("Cutting mesh patch\n");
+ TriangleMeshSlicer tms(&volume->mesh);
+ tms.cut(z, &upper_mesh, &lower_mesh);
upper_mesh.repair();
lower_mesh.repair();