diff --git a/src/libslic3r/SLAPrint.cpp b/src/libslic3r/SLAPrint.cpp index 4e051724e..9ed89f16e 100644 --- a/src/libslic3r/SLAPrint.cpp +++ b/src/libslic3r/SLAPrint.cpp @@ -624,8 +624,10 @@ void SLAPrint::process() auto& lyrs = levels[h]; // this initializes a new record lyrs.emplace_back(oslices[i], po.m_instances); + float fh = float(double(h) * SCALING_FACTOR); + // now for the public slice index: - SLAPrintObject::SliceRecord& sr = po.m_slice_index[h]; + SLAPrintObject::SliceRecord& sr = po.m_slice_index[fh]; // There should be only one slice layer for each print object assert(sr.model_slices_idx == EMPTY_SLICE); sr.model_slices_idx = i; @@ -641,7 +643,9 @@ void SLAPrint::process() auto& lyrs = levels[h]; lyrs.emplace_back(sslices[i], po.m_instances); - SLAPrintObject::SliceRecord& sr = po.m_slice_index[h]; + float fh = float(double(h) * SCALING_FACTOR); + + SLAPrintObject::SliceRecord& sr = po.m_slice_index[fh]; assert(sr.support_slices_idx == EMPTY_SLICE); sr.support_slices_idx = i; } diff --git a/src/libslic3r/SLAPrint.hpp b/src/libslic3r/SLAPrint.hpp index c29c4d1cc..93b88a7df 100644 --- a/src/libslic3r/SLAPrint.hpp +++ b/src/libslic3r/SLAPrint.hpp @@ -92,8 +92,8 @@ public: // levels of the model in scaled-clipper coordinates. The levels correspond // to the z coordinate of the object coordinate system. struct SliceRecord { - using Key = long long; - inline static float scale_back(Key h) { return float(h * SCALING_FACTOR); } + using Key = float; +// inline static float scale_back(Key h) { return float(h * SCALING_FACTOR); } using Idx = size_t; static const Idx NONE = Idx(-1); // this will be the max limit of size_t