diff --git a/src/libslic3r/SLA/SupportPointGenerator.cpp b/src/libslic3r/SLA/SupportPointGenerator.cpp index d506e7e0eb..72c089e776 100644 --- a/src/libslic3r/SLA/SupportPointGenerator.cpp +++ b/src/libslic3r/SLA/SupportPointGenerator.cpp @@ -146,19 +146,13 @@ static std::vector make_layers( SupportPointGenerator::MyLayer &layer = layers[layer_id]; const ExPolygons & islands = slices[layer_id]; - // FIXME WTF? - // It is used only for support point Z coordinate. - // Possibly some kind of big foot compensation ?? - const float height = (layer_id > 2 ? - heights[layer_id - 3] : - heights[0] - (heights[1] - heights[0])); layer.islands.reserve(islands.size()); for (const ExPolygon &island : islands) { float area = float(island.area() * SCALING_FACTOR * SCALING_FACTOR); if (area >= pixel_area) // FIXME this is not a correct centroid of a polygon with holes. layer.islands.emplace_back(layer, island, get_extents(island.contour), - unscaled(island.contour.centroid()), area, height); + unscaled(island.contour.centroid()), area); } }, 32 /*gransize*/); @@ -617,7 +611,10 @@ void SupportPointGenerator::uniformly_cover(const ExPolygons& islands, Structure poisson_samples.erase(poisson_samples.begin() + poisson_samples_target, poisson_samples.end()); } for (const Vec2f &pt : poisson_samples) { - m_output.emplace_back(float(pt(0)), float(pt(1)), structure.zlevel, m_config.head_diameter/2.f, flags & icfIsNew); + m_output.emplace_back( + float(pt(0)), float(pt(1)), structure.layer->print_z/*structure.zlevel*/, m_config.head_diameter / 2.f, + flags & icfIsNew + ); structure.supports_force_this_layer += m_config.support_force(); grid3d.insert(pt, &structure); } diff --git a/src/libslic3r/SLA/SupportPointGenerator.hpp b/src/libslic3r/SLA/SupportPointGenerator.hpp index c01e4ea7aa..61661b9f1f 100644 --- a/src/libslic3r/SLA/SupportPointGenerator.hpp +++ b/src/libslic3r/SLA/SupportPointGenerator.hpp @@ -57,8 +57,8 @@ public: // Keep data for one area(ExPlygon) on the layer struct Structure { - Structure(MyLayer &layer, const ExPolygon& poly, const BoundingBox &bbox, const Vec2f ¢roid, float area, float h) : - layer(&layer), polygon(&poly), bbox(bbox), centroid(centroid), area(area), zlevel(h) + Structure(MyLayer &layer, const ExPolygon& poly, const BoundingBox &bbox, const Vec2f ¢roid, float area) : + layer(&layer), polygon(&poly), bbox(bbox), centroid(centroid), area(area) #ifdef SLA_SUPPORTPOINTGEN_DEBUG , unique_id(std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch())) #endif /* SLA_SUPPORTPOINTGEN_DEBUG */ @@ -70,7 +70,6 @@ public: const BoundingBox bbox; const Vec2f centroid = Vec2f::Zero(); const float area = 0.f; - float zlevel = 0; // How well is this ExPolygon held to the print base? // Positive number, the higher the better. float supports_force_this_layer = 0.f;