mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-16 18:05:55 +08:00
fix seam placer when each object has its own layers
use layer_z instead of layer_id
This commit is contained in:
parent
f138405bba
commit
9f9f544bb9
@ -863,14 +863,14 @@ void SeamPlacer::apply_custom_seam(const Polygon& polygon, size_t po_idx,
|
||||
|
||||
|
||||
|
||||
std::optional<Point> SeamHistory::get_last_seam(const PrintObject* po, size_t layer_id, const BoundingBox& island_bb)
|
||||
std::optional<Point> SeamHistory::get_last_seam(const PrintObject* po, coord_t layer_z, const BoundingBox& island_bb)
|
||||
{
|
||||
assert(layer_id >= m_layer_id);
|
||||
if (layer_id > m_layer_id) {
|
||||
assert(layer_z >= m_layer_z);
|
||||
if (layer_z > m_layer_z) {
|
||||
// Get seam was called for different layer than last time.
|
||||
m_data_last_layer = m_data_this_layer;
|
||||
m_data_this_layer.clear();
|
||||
m_layer_id = layer_id;
|
||||
m_layer_z = layer_z;
|
||||
}
|
||||
|
||||
|
||||
@ -918,7 +918,7 @@ void SeamHistory::add_seam(const PrintObject* po, const Point& pos, const Boundi
|
||||
|
||||
void SeamHistory::clear()
|
||||
{
|
||||
m_layer_id = 0;
|
||||
m_layer_z = 0;
|
||||
m_data_last_layer.clear();
|
||||
m_data_this_layer.clear();
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ namespace EdgeGrid { class Grid; }
|
||||
class SeamHistory {
|
||||
public:
|
||||
SeamHistory() { clear(); }
|
||||
std::optional<Point> get_last_seam(const PrintObject* po, size_t layer_id, const BoundingBox& island_bb);
|
||||
std::optional<Point> get_last_seam(const PrintObject* po, coord_t layer_z, const BoundingBox& island_bb);
|
||||
void add_seam(const PrintObject* po, const Point& pos, const BoundingBox& island_bb);
|
||||
void clear();
|
||||
|
||||
@ -32,7 +32,7 @@ private:
|
||||
|
||||
std::map<const PrintObject*, std::vector<SeamPoint>> m_data_last_layer;
|
||||
std::map<const PrintObject*, std::vector<SeamPoint>> m_data_this_layer;
|
||||
size_t m_layer_id;
|
||||
coord_t m_layer_z;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user