Issue before was the following: when placing objects within a grid cell there is a margin around the object. This margin comes from both the integer rounding of the cell and the defined min distance between objects. When trying to place object near the buildplate border we marked any cell that is not fully within the buildplate area as an invalid cell to place objects in. This was however too strict; there is the aforementioned margin around the object, and if only this margin would be outside the buildplate it is perfectly fine to place object in that cell.
CURA-7951
By default, the alignment would cause the entire mass of objects to have its center of gravity to be at the origin, including any fixed object. So there was an unwanted 'whole space' translation that we didn't take into account could occur beforehand. Fortunately, there's an option to just set it not to re-translate the whole space. It's unlcear to me how this would've worked in 5.2.2 and prior (and it did ... somehow), since we didn't change anything, including that default, as far as I can see. Anyway, the arrange function can handle 'fixed' objects again (as in loading them in one by one, or loading in a whole bunch of files instead of just 'arrange all').
CURA-10476 -- should fix#14838
These are for our testers to be able to test the new message types. Later they will be added to all messages that need them.
Contributes to issue CURA-7278.
So libnest2d is giving a segfault when it's being triggered without any disallowed areas. This is because we then give a single disallowed area for the border around the build plate, and give this disallowed area 0 vertices. Because libnest2d doesn't do defensive coding here, it's going to crash, taking Cura along with it. The crash is in libnest2d's function 'libnest2d::_Item<ClipperLib::Polygon>::rightmostTopVertex()'.
This segfault started happening recently in Cura. However it only happens when there are no disallowed areas. Steps to reproduce the error are:
- Use Custom FFF Printer.
- Set the Adhesion Type setting to 'None'.
- Load any two models.
I tracked the segfault down to this commit: 74ddbaab4b . That commit by itself is slightly mysterious but looks fine to me. It did give the hint that this segfault might be caused by empty polygons though. So for that reason, I figured that filtering out the empty polygons here in the arranger might fix it; and indeed it does. Passing empty polygons as fixed/disallowed areas is useless and invalid anyway. Apparently libnest2d doesn't deal well with it, but we might as well not send those polygons over then.