Ultimaker / CuraEngine

Powerful, fast and robust engine for converting 3D models into g-code instructions for 3D printers. It is part of the larger open source project Cura.
https://ultimaker.com/en/products/cura-software
GNU Affero General Public License v3.0
1.68k stars 881 forks source link

CURA-11873 interleaved prime tower bad raft #2078

Closed wawanbreton closed 4 months ago

wawanbreton commented 4 months ago

The recent addition of the "interleaved" prime tower didn't really consider the use of the raft, which can use various extruders combinations. This PR fixes cases were some prime tower layers were completely missing while printing the raft, resulting in unusable interleaved prime tower.

The first 2 commits do some code simplification that is now possible due to the changed prime tower raft a few months ago. Before that, the prime tower had a regular raft below it, which is not the case anymore. The last 2 commits actually handle the prime tower generation, properly taking care of the raft.

CURA-11873

wawanbreton commented 4 months ago

Does it make sense to re-use some of that code?

Yes it does ! I did it where it was possible, but maybe there are other parts of the code where it could also be used. I will try to keep that in mind. I also simplified your actual implementation now that I have added specific methods to retrieve the numbers of layers.