Cura/cura/Arranging
Ghostkeeper 9dba4d554f
Fix segfault when arranging without any disallowed areas
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.
2021-04-14 00:32:50 +02:00
..
__init__.py Move all arranging related code into a subfolder 2018-01-03 15:05:06 +01:00
Arrange.py Transfer deprecated decorator on __init__ of Arrange 2020-10-13 18:06:44 +02:00
ArrangeObjectsAllBuildPlatesJob.py Converted comments in dir Cura/cura/Arranging to rst style 2020-04-23 12:13:24 +02:00
ArrangeObjectsJob.py Close "Finding Location" message if arrange crashes 2020-10-16 11:10:02 +02:00
Nest2DArrange.py Fix segfault when arranging without any disallowed areas 2021-04-14 00:32:50 +02:00
ShapeArray.py Added type ignore since it does accept it 2021-04-07 17:15:22 +02:00