mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-03 20:13:59 -06:00
Fix remove_bottom_points function
This commit is contained in:
parent
f202d11e35
commit
38239f09e3
4 changed files with 18 additions and 22 deletions
|
@ -29,13 +29,13 @@ struct SupportPoint
|
|||
float pos_y,
|
||||
float pos_z,
|
||||
float head_radius,
|
||||
bool new_island)
|
||||
bool new_island = false)
|
||||
: pos(pos_x, pos_y, pos_z)
|
||||
, head_front_radius(head_radius)
|
||||
, is_new_island(new_island)
|
||||
{}
|
||||
|
||||
SupportPoint(Vec3f position, float head_radius, bool new_island)
|
||||
SupportPoint(Vec3f position, float head_radius, bool new_island = false)
|
||||
: pos(position)
|
||||
, head_front_radius(head_radius)
|
||||
, is_new_island(new_island)
|
||||
|
|
|
@ -523,15 +523,12 @@ void SupportPointGenerator::uniformly_cover(const ExPolygons& islands, Structure
|
|||
}
|
||||
}
|
||||
|
||||
void remove_bottom_points(std::vector<SupportPoint> &pts, double gnd_lvl, double tolerance)
|
||||
void remove_bottom_points(std::vector<SupportPoint> &pts, float lvl)
|
||||
{
|
||||
// get iterator to the reorganized vector end
|
||||
auto endit =
|
||||
std::remove_if(pts.begin(), pts.end(),
|
||||
[tolerance, gnd_lvl](const sla::SupportPoint &sp) {
|
||||
double diff = std::abs(gnd_lvl -
|
||||
double(sp.pos(Z)));
|
||||
return diff <= tolerance;
|
||||
auto endit = std::remove_if(pts.begin(), pts.end(), [lvl]
|
||||
(const sla::SupportPoint &sp) {
|
||||
return sp.pos.z() <= lvl;
|
||||
});
|
||||
|
||||
// erase all elements after the new end
|
||||
|
|
|
@ -214,7 +214,7 @@ private:
|
|||
std::mt19937 m_rng;
|
||||
};
|
||||
|
||||
void remove_bottom_points(std::vector<SupportPoint> &pts, double gnd_lvl, double tolerance);
|
||||
void remove_bottom_points(std::vector<SupportPoint> &pts, float lvl);
|
||||
|
||||
}} // namespace Slic3r::sla
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue