Documentation ¶
Index ¶
- Variables
- type Axis
- type Bin
- type BinSlice
- type Dimension
- type Item
- func (i *Item) GetDepth() float64
- func (i *Item) GetDimension() (d Dimension)
- func (i *Item) GetHeight() float64
- func (i *Item) GetName() string
- func (i *Item) GetVolume() float64
- func (i *Item) GetWeight() float64
- func (i *Item) GetWidth() float64
- func (i *Item) Intersect(i2 *Item) bool
- func (i *Item) String() string
- type ItemSlice
- type Packer
- type Pivot
- type RotationType
Constants ¶
This section is empty.
Variables ¶
View Source
var RotationTypeStrings = [...]string{
"RotationType_WHD (w,h,d)",
"RotationType_HWD (h,w,d)",
"RotationType_HDW (h,d,w)",
"RotationType_DHW (d,h,w)",
"RotationType_DWH (d,w,h)",
"RotationType_WDH (w,d,h)",
}
Functions ¶
This section is empty.
Types ¶
type Bin ¶
type Bin struct { Name string Width float64 Height float64 Depth float64 MaxWeight float64 Items []*Item // Items that packed in this bin }
Bin represents a container in which items will be put into.
type Item ¶
type Item struct { Name string Width float64 Height float64 Depth float64 Weight float64 // Used during packer.Pack() RotationType RotationType Position Pivot }
func NewItem ¶
NewItem returns an Item named name, with width w, height h, depth h, and weight w. The quantity defaults to one.
func (*Item) GetDimension ¶
type Packer ¶
type Packer struct { Bins []*Bin Items []*Item UnfitItems []*Item // items that don't fit to any bin }
func (*Packer) FindFittedBin ¶
FindFittedBin finds bin in which item i will be fitted into.
type RotationType ¶
type RotationType int
const ( RotationType_WHD RotationType = iota RotationType_HWD RotationType_HDW RotationType_DHW RotationType_DWH RotationType_WDH )
func (RotationType) String ¶
func (rt RotationType) String() string
Click to show internal directories.
Click to hide internal directories.