mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-07-15 13:01:50 +08:00
Make extrusion_entities_append_paths appends loop if first_point() == last_point()
This commit is contained in:
parent
4a540e9a34
commit
b07d2461d3
@ -287,10 +287,16 @@ inline void extrusion_entities_append_paths(ExtrusionEntitiesPtr &dst, Polylines
|
|||||||
dst.reserve(dst.size() + polylines.size());
|
dst.reserve(dst.size() + polylines.size());
|
||||||
for (Polyline &polyline : polylines)
|
for (Polyline &polyline : polylines)
|
||||||
if (polyline.is_valid()) {
|
if (polyline.is_valid()) {
|
||||||
|
if (polyline.points.back() == polyline.points.front()) {
|
||||||
|
ExtrusionPath path(role, mm3_per_mm, width, height);
|
||||||
|
path.polyline.points = polyline.points;
|
||||||
|
dst.emplace_back(new ExtrusionLoop(std::move(path)));
|
||||||
|
} else {
|
||||||
ExtrusionPath *extrusion_path = new ExtrusionPath(role, mm3_per_mm, width, height);
|
ExtrusionPath *extrusion_path = new ExtrusionPath(role, mm3_per_mm, width, height);
|
||||||
dst.push_back(extrusion_path);
|
dst.push_back(extrusion_path);
|
||||||
extrusion_path->polyline = polyline;
|
extrusion_path->polyline = polyline;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void extrusion_entities_append_paths(ExtrusionEntitiesPtr &dst, Polylines &&polylines, ExtrusionRole role, double mm3_per_mm, float width, float height)
|
inline void extrusion_entities_append_paths(ExtrusionEntitiesPtr &dst, Polylines &&polylines, ExtrusionRole role, double mm3_per_mm, float width, float height)
|
||||||
@ -298,10 +304,16 @@ inline void extrusion_entities_append_paths(ExtrusionEntitiesPtr &dst, Polylines
|
|||||||
dst.reserve(dst.size() + polylines.size());
|
dst.reserve(dst.size() + polylines.size());
|
||||||
for (Polyline &polyline : polylines)
|
for (Polyline &polyline : polylines)
|
||||||
if (polyline.is_valid()) {
|
if (polyline.is_valid()) {
|
||||||
|
if (polyline.points.back() == polyline.points.front()) {
|
||||||
|
ExtrusionPath path(role, mm3_per_mm, width, height);
|
||||||
|
path.polyline.points = polyline.points;
|
||||||
|
dst.emplace_back(new ExtrusionLoop(std::move(path)));
|
||||||
|
} else {
|
||||||
ExtrusionPath *extrusion_path = new ExtrusionPath(role, mm3_per_mm, width, height);
|
ExtrusionPath *extrusion_path = new ExtrusionPath(role, mm3_per_mm, width, height);
|
||||||
dst.push_back(extrusion_path);
|
dst.push_back(extrusion_path);
|
||||||
extrusion_path->polyline = std::move(polyline);
|
extrusion_path->polyline = std::move(polyline);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
polylines.clear();
|
polylines.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user