Table of Contents

Class SheetPacker

Namespace
GeometryHelper.Packing
Assembly
GeometryHelper.dll

Packs boxes, or polygons, onto sheets of paper: each group as one block, the blocks from the upper left of the first sheet, or the corner StartCorner names, and onto a new sheet beside it when the one before is full.

public static class SheetPacker
Inheritance
SheetPacker
Inherited Members

Remarks

A view cut to a polygon (by VPCLIP in AutoCAD, say) is packed by that polygon: the overloads that take GeoPolygon2 lay it out by its true shape, so that an L- or U-shaped view lets another stand in its notch. What follows is about boxes; the polygons are placed by the same rule, highest top and then furthest left.

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. From another StartCorner the packing is the mirror image of that one, the same boxes on the same sheets.

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<GeoPolygon2[]>, Sheet)

Packs the polygons onto sheets like the one given, by their own shape, with the default options.

Pack(IReadOnlyList<GeoPolygon2[]>, Sheet, PackOptions)

Packs the polygons onto sheets like the one given, by their own shape: a polygon with a notch lets another stand in it.

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.