Class SheetPacker
- Namespace
- GeometryHelper.Packing
- Assembly
- GeometryHelper.dll
Packs boxes onto sheets of paper: each group of boxes as one block, the blocks from the upper left of the first sheet, and onto a new sheet beside it when the one before is full.
public static class SheetPacker
- Inheritance
-
SheetPacker
- Inherited Members
Remarks
The boxes are only moved, never turned or resized. A box that is turned is packed by the upright box round it, and keeps its turn.
The boxes of a group are laid out together first, as GroupLayout says, and the block they make goes onto a sheet whole: the groups keep their boxes together, at Spacing from one another, and GroupSpacing from other groups. A group too large for one sheet is split, in its order, into blocks that each go onto one. The blocks are placed by the maximal rectangles method, each where its top is highest and then its left side furthest left, so that a sheet fills from its upper left corner as the eye reads it.
The result is judged as it came out: a box reported Placed lies inside the usable area of its sheet and clear of every other box, but the boxes of its own group kept as they stood. The same boxes and options give the same result, and the boxes, the sheet and the options are only read.
Methods
- Pack(IReadOnlyList<GeoRectangle2[]>, Sheet)
Packs the boxes onto sheets like the one given, with the default options.
- Pack(IReadOnlyList<GeoRectangle2[]>, Sheet, PackOptions)
Packs the boxes onto sheets like the one given.