mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-11-30 17:05:35 -05:00
By layer: order As object list copies by their list position sort_object_instances_by_model_order() keyed every instance on its object's index when it initialized the order, so all copies of an object tied. print.objects() does not list the copies in list order either: copies with a different rotation live in separate PrintObjects, ordered by transformation, so the ties were broken by that grouping and the copies printed as 2, 4, 6, 1, 3, 5. std::sort reordering the ties made it worse from 17 instances up. Number the instances by their position in the model's object and instance lists instead. No order key repeats, so a plain sort is enough; the renumber after it compacts this print's instances to 1..n. The other intra-layer orders and the by-object path are unaffected. The new test rotates every second copy, which fails on every platform before this change, MSVC included.
OrcaSlicer tests
Building, running and writing tests is documented on the wiki, under How to Test.
Two files here rather than there, because coding agents only read what is in the repository: