mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-12-02 01:43:36 -05:00
Fix objects printing in the wrong place when identical objects share sliced layers (#17183)
`is_print_object_the_same` now also compares `center_offset()`. Two objects with the same transform can have different offsets, because the offset comes from each object's first instance. Before, the object that took over the other's layers printed shifted.
This commit is contained in:
1 parent
7906d7e02a
commit
0f15db8b83
2 files changed
+53
No files matched your search
@@ -3449,6 +3449,10 @@ void Print::process(long long *time_cost_with_cache, bool use_cache)
|
||||
auto is_print_object_the_same = [](const PrintObject* object1, const PrintObject* object2) -> bool{
|
||||
if (object1->trafo().matrix() != object2->trafo().matrix())
|
||||
return false;
|
||||
// Layers are stored relative to center_offset(), which comes from the first instance of each ModelObject, so it
|
||||
// can differ between objects with the same trafo. Sharing the layers would then print the object in the wrong place.
|
||||
if (object1->center_offset() != object2->center_offset())
|
||||
return false;
|
||||
const ModelObject* model_obj1 = object1->model_object();
|
||||
const ModelObject* model_obj2 = object2->model_object();
|
||||
if (model_obj1->volumes.size() != model_obj2->volumes.size())
|
||||
|
||||
Reference in new issue
Block a user