mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-16 05:36:03 +08:00
Fixed a crash when the number of perimeters is set to zero with Arachne.
This commit is contained in:
parent
c76c497234
commit
e631ac171a
@ -455,6 +455,9 @@ void removeColinearEdges(Polygons &thiss, const double max_deviation_angle = 0.0
|
|||||||
|
|
||||||
const std::vector<VariableWidthLines> &WallToolPaths::generate()
|
const std::vector<VariableWidthLines> &WallToolPaths::generate()
|
||||||
{
|
{
|
||||||
|
if (this->inset_count < 1)
|
||||||
|
return toolpaths;
|
||||||
|
|
||||||
const coord_t smallest_segment = Slic3r::Arachne::meshfix_maximum_resolution;
|
const coord_t smallest_segment = Slic3r::Arachne::meshfix_maximum_resolution;
|
||||||
const coord_t allowed_distance = Slic3r::Arachne::meshfix_maximum_deviation;
|
const coord_t allowed_distance = Slic3r::Arachne::meshfix_maximum_deviation;
|
||||||
const coord_t epsilon_offset = (allowed_distance / 2) - 1;
|
const coord_t epsilon_offset = (allowed_distance / 2) - 1;
|
||||||
|
@ -313,16 +313,8 @@ void PerimeterGenerator::process_arachne()
|
|||||||
ExPolygons last = offset_ex(surface.expolygon.simplify_p(m_scaled_resolution), - float(ext_perimeter_width / 2. - ext_perimeter_spacing / 2.));
|
ExPolygons last = offset_ex(surface.expolygon.simplify_p(m_scaled_resolution), - float(ext_perimeter_width / 2. - ext_perimeter_spacing / 2.));
|
||||||
Polygons last_p = to_polygons(last);
|
Polygons last_p = to_polygons(last);
|
||||||
|
|
||||||
coord_t bead_width_0 = ext_perimeter_spacing;
|
Arachne::WallToolPaths wallToolPaths(last_p, ext_perimeter_spacing, perimeter_spacing, coord_t(loop_number + 1), 0, *this->object_config, *this->print_config);
|
||||||
coord_t bead_width_x = perimeter_spacing;
|
|
||||||
coord_t wall_0_inset = 0;
|
|
||||||
|
|
||||||
Arachne::WallToolPaths wallToolPaths(last_p, bead_width_0, bead_width_x, coord_t(loop_number + 1), wall_0_inset, *this->object_config, *this->print_config);
|
|
||||||
wallToolPaths.generate();
|
|
||||||
|
|
||||||
std::vector<Arachne::VariableWidthLines> perimeters = wallToolPaths.getToolPaths();
|
std::vector<Arachne::VariableWidthLines> perimeters = wallToolPaths.getToolPaths();
|
||||||
if (perimeters.empty())
|
|
||||||
continue;
|
|
||||||
|
|
||||||
int start_perimeter = int(perimeters.size()) - 1;
|
int start_perimeter = int(perimeters.size()) - 1;
|
||||||
int end_perimeter = -1;
|
int end_perimeter = -1;
|
||||||
@ -357,7 +349,7 @@ void PerimeterGenerator::process_arachne()
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::vector<bool> processed(all_extrusions.size(), false); // Indicate that the extrusion was already processed.
|
std::vector<bool> processed(all_extrusions.size(), false); // Indicate that the extrusion was already processed.
|
||||||
Point current_position = all_extrusions.front()->junctions.front().p; // Some starting position.
|
Point current_position = all_extrusions.empty() ? Point::Zero() : all_extrusions.front()->junctions.front().p; // Some starting position.
|
||||||
std::vector<const Arachne::ExtrusionLine *> ordered_extrusions; // To store our result in. At the end we'll std::swap.
|
std::vector<const Arachne::ExtrusionLine *> ordered_extrusions; // To store our result in. At the end we'll std::swap.
|
||||||
ordered_extrusions.reserve(all_extrusions.size());
|
ordered_extrusions.reserve(all_extrusions.size());
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user