From 831de96a81f284c22f35ff8ec25273638bb1d91e Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Tue, 15 Jan 2019 14:25:28 +0100 Subject: [PATCH] Solving issue with first empty layer. --- src/libslic3r/SLA/SLASupportTree.cpp | 2 +- src/libslic3r/SLAPrint.cpp | 4 +--- src/libslic3r/SLAPrint.hpp | 8 ++++++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/libslic3r/SLA/SLASupportTree.cpp b/src/libslic3r/SLA/SLASupportTree.cpp index c2fcb3c3a..59d03039a 100644 --- a/src/libslic3r/SLA/SLASupportTree.cpp +++ b/src/libslic3r/SLA/SLASupportTree.cpp @@ -1746,7 +1746,7 @@ SlicedSupports SLASupportTree::slice(float layerh, float init_layerh) const const Pad& pad = m_impl->pad(); if(!pad.empty()) gndlvl -= float(get_pad_elevation(pad.cfg)); - std::vector heights = {gndlvl}; + std::vector heights; heights.reserve(size_t(modelh/layerh) + 1); for(float h = gndlvl + init_layerh; h < gndlvl + modelh; h += layerh) { diff --git a/src/libslic3r/SLAPrint.cpp b/src/libslic3r/SLAPrint.cpp index 5cddadb5b..1383acc40 100644 --- a/src/libslic3r/SLAPrint.cpp +++ b/src/libslic3r/SLAPrint.cpp @@ -732,9 +732,7 @@ void SLAPrint::process() po.m_supportdata->level_ids.reserve(sslices.size()); for(int i = 0; i < int(sslices.size()); ++i) { - int a = i == 0 ? 0 : 1; - int b = i == 0 ? 0 : i - 1; - LevelID h = sminZ + a * sih + b * slh; + LevelID h = sminZ + sih + i * slh; po.m_supportdata->level_ids.emplace_back(h); float fh = float(double(h) * SCALING_FACTOR); diff --git a/src/libslic3r/SLAPrint.hpp b/src/libslic3r/SLAPrint.hpp index 9fab4d550..21503c6f6 100644 --- a/src/libslic3r/SLAPrint.hpp +++ b/src/libslic3r/SLAPrint.hpp @@ -148,8 +148,16 @@ private: // Which steps have to be performed. Implicitly: all std::vector m_stepmask; + + // Individual 2d slice polygons from lower z to higher z levels std::vector m_model_slices; + + // Exact (float) height levels mapped to the slices. Each record contains + // the index to the model and the support slice vectors. SliceIndex m_slice_index; + + // The height levels corrected and scaled up in integer values. This will + // be used at rasterization. std::vector m_level_ids; // Caching the transformed (m_trafo) raw mesh of the object