I do not want to add the rebuild() call to the update function itself since there may be other changes to the build volume before we should rebuild (such as raft).
Contributes to issue CURA-2625.
Requires some multi-levelled trickery to get the event listeners working. This also assumes that the per-object stack decorator is not deleted at any point unless the mesh is deleted (which is currently a correct assumption). If that ever changes though, the harm is just that the update function is still listening on the deleted decorator's stack.
Contributes to issue CURA-2625.
Because the new object may use an extruder that wasn't used so far, and if you remove an object it may remove the need for a certain extruder.
Contributes to issue CURA-2625.
It's a bit counter-intuitive, so let me explain. The total build volume is defined as the rectangle around the union of the areas that all extruders can reach. The nozzle offset for the left extruder though is 0,0, so what should the border on the right side be? It should be 18 since there is a nozzle to the right of the left nozzle which has a relative x-offset of 18mm. Therefore we need to compute the relative offsets with each of the other nozzles and create sort of a bounding box around it, and the distance to the edge of that bounding box is the unreachable border on each of the sides.
Contributes to issue CURA-2625.
These disallowed areas are only at nozzle-height, not at head-height. They therefore won't move along with the nozzle offset.
Contributes to issue CURA-2625.
In single extrusion, the machine_nozzle_offset_x and machine_nozzle_offset_y were not defined in the used extruder stacks, because the used extruder stack is the global stack.
Contributes to issue CURA-2625.
Otherwise just a string gets added, which gives an error when the disallowed areas are being built as meshes. The front-end runs again, though the disallowed areas seem to be wrong now.
Contributes to issue CURA-2625.
The results are checked for intersection in the main update function, and then it crashes because the main function doesn't expect per-extruder disallowed areas yet from the rest.
Contributes to issue CURA-2625.
This computes the disallowed areas of the machine, the disallowed border and the prime tower per extruder. The prime locations are not yet calculated per extruder, but I'd like to extract it to a function before I try that.
Warning: Cura will not run at this stage. Please await the next commits.
Contributes to issue CURA-2625.
This way we can offset it with the nozzle offset and it would still cover all the way to the edge. The disallowed areas are clipped to the build volume anyway.
Contributes to issue CURA-2625.
This function is named as if it could later include other printed pieces, but it is meant to only include pieces that have normal bed adhesion, so not the prime locations.
Contributes to issue CURA-2625.
It's much easier to create, more obvious code, and better approximates the area that we seek to use for our prime location.
Contributes to issue CURA-2625.
The check for collisions is only at the end, and after that it adds the polygon itself. We should keep the code closer together to make it more readable.
Contributes to issue CURA-2625.
Because we have 'areas', 'disallowed_areas', 'self._disallowed_areas', 'disallowed_polygons', and so on. This should reduce the confusion a bit.
Contributes to issue CURA-2625.
This is not used, unless you take multi-threading into account. In that case though, the actual disallowed areas are only updated at the end of this function, and the _has_errors variable is updated right before then as well, so this way the variable is in an invalid state for a smaller amount of time.
Contributes to issue CURA-2625.
These disallowed areas will have to move or get duplicated according to which nozzles are used. Eventually we'll want to compute these with their Minkowski additions only when needed (the skirt size changes), not when the used extruders change. This is also part of an effort to make this disallowed area computation a bit better structured. The behaviour should be the same.
Contributes to issue CURA-2625.
Platform adhesion and shields all go around the support, the expanded support. Support expansion is almost like an expansion of the mesh itself, except that infill wipe distance and such don't apply to it.
Contributes to issue CURA-2407.