pyboxbuilder.preview.remove_top_layers¶
- pyboxbuilder.preview.remove_top_layers(placements: collections.abc.Sequence[Piece], count: int) list[Piece][source]¶
Drop the top
countvertical layers from a set of placements.A box is removed when its top surface rises above the cut, so a tall box spanning into a removed layer goes with it rather than being sliced.
- Parameters:¶
- placements: collections.abc.Sequence[Piece]¶
Objects carrying
positionandsize3-tuples.- count: int¶
How many layers to remove from the top.
0keeps everything; a count at or above the number of layers removes everything.
- Returns:¶
The surviving placements, in their original order.
- Raises:¶
ValueError – If
countis negative.