Table of Contents

Struct PackPlacement

Namespace
GeometryHelper.Packing
Assembly
GeometryHelper.dll

Where one box or polygon goes: which sheet, how far it moves, and the shape moved there.

public readonly struct PackPlacement : IEquatable<PackPlacement>
Implements
Inherited Members

Remarks

Boxes and polygons are only moved, never turned or resized. The move is the same for every point of what the shape stands for, so adding Translation to any point of it, the origin of a drawing view or the insertion point of a block, puts it where its shape goes, as long as the shape was given in the same coordinates as that point.

Constructors

PackPlacement(int, GeoVector2, GeoRectangle2, GeoPolygon2, bool)

Initializes a new instance of the PackPlacement struct for a polygon.

PackPlacement(int, GeoVector2, GeoRectangle2, bool)

Initializes a new instance of the PackPlacement struct for a box, whose ViewPolygon is then the box itself as a polygon of four points.

Properties

Placed

Gets whether the box found a place: inside the usable area of its sheet and clear of every other box, but the boxes of its own group kept as they stood. False for a box larger than the usable area of a sheet, or not at finite coordinates.

SheetIndex

Gets which sheet the box goes on: nought for the first, one more for each sheet after it, as GetFrame(int) counts them; -1 for a box that goes on none.

Translation

Gets how far the box moves, in the units of the boxes, the sheets lying where Origin and NewSheet lay them; zero for a box that goes on none.

ViewBox

Gets the box moved by Translation, the same size and as turned as it was given; the box as given for one that goes on none.

ViewPolygon

Gets the shape moved by Translation: the polygon given to Pack(IReadOnlyList<GeoPolygon2[]>, Sheet, PackOptions), moved, whose ViewBox is the upright box round it; for a box, its four corners, lower left first and counter-clockwise, so that a result of either kind is read the same way. The shape as given for one that goes on none.

Methods

Equals(PackPlacement)

Indicates whether this placement is the same as another: the same sheet, move, box, shape and verdict, exactly.

Equals(object)
GetHashCode()
ToString()

Operators

operator ==(PackPlacement, PackPlacement)

Compares two placements for equality.

operator !=(PackPlacement, PackPlacement)

Compares two placements for inequality.