diff --git a/xs/src/libslic3r/BoundingBox.cpp b/xs/src/libslic3r/BoundingBox.cpp index 66beaa3d5..08be120b6 100644 --- a/xs/src/libslic3r/BoundingBox.cpp +++ b/xs/src/libslic3r/BoundingBox.cpp @@ -1,5 +1,6 @@ #include "BoundingBox.hpp" #include +#include namespace Slic3r { @@ -125,6 +126,7 @@ template void BoundingBoxBase::merge(const Pointfs &points); template void BoundingBoxBase::merge(const BoundingBoxBase &bb) { + assert(bb.defined || bb.min.x >= bb.max.x || bb.min.y >= bb.max.y); if (bb.defined) { if (this->defined) { this->min.x = std::min(bb.min.x, this->min.x); @@ -162,6 +164,7 @@ template void BoundingBox3Base::merge(const Pointf3s &points); template void BoundingBox3Base::merge(const BoundingBox3Base &bb) { + assert(bb.defined || bb.min.x >= bb.max.x || bb.min.y >= bb.max.y || bb.min.z >= bb.max.z); if (bb.defined) { if (this->defined) { this->min.z = std::min(bb.min.z, this->min.z); diff --git a/xs/src/libslic3r/GCode.cpp b/xs/src/libslic3r/GCode.cpp index 478864e74..c0b0d59f7 100644 --- a/xs/src/libslic3r/GCode.cpp +++ b/xs/src/libslic3r/GCode.cpp @@ -710,7 +710,6 @@ bool GCode::_do_export(Print &print, FILE *file) // Just wait for a bit to let the user check, that the priming succeeded. fprintf(file, "M117 Verify extruder priming\nM0 S10\nM117 Printing\n"); } - write(file, this->unretract()); } else write(file, WipeTowerIntegration::prime_single_color_print(print, initial_extruder_id, *this)); } diff --git a/xs/src/libslic3r/PrintObject.cpp b/xs/src/libslic3r/PrintObject.cpp index 9bf74bee7..475a320bf 100644 --- a/xs/src/libslic3r/PrintObject.cpp +++ b/xs/src/libslic3r/PrintObject.cpp @@ -1253,7 +1253,8 @@ void PrintObject::_slice() goto end; delete layer; this->layers.pop_back(); - this->layers.back()->upper_layer = nullptr; + if (! this->layers.empty()) + this->layers.back()->upper_layer = nullptr; } end: ; diff --git a/xs/src/libslic3r/TriangleMesh.cpp b/xs/src/libslic3r/TriangleMesh.cpp index f2f05a841..38d89938a 100644 --- a/xs/src/libslic3r/TriangleMesh.cpp +++ b/xs/src/libslic3r/TriangleMesh.cpp @@ -574,6 +574,7 @@ BoundingBoxf3 TriangleMesh::bounding_box() const { BoundingBoxf3 bb; + bb.defined = true; bb.min.x = this->stl.stats.min.x; bb.min.y = this->stl.stats.min.y; bb.min.z = this->stl.stats.min.z;