8000 GitHub - spicescode/bp3d: Golang package for 3d bin packing problem
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

spicescode/bp3d

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bp3d

3D Bin Packing implementation based on this paper. The code is based on binpacking by bom-d-van but modified to allow flexible bins and use float64 instead of int.

Install

go get github.com/gedex/bp3d

Usage

p := bp3d.NewPacker()

// Add bins.
p.AddBin(bp3d.NewBin("Small Bin", 10, 15, 20, 100))
p.AddBin(bp3d.NewBin("Medium Bin", 100, 150, 200, 1000))

// Add items.
p.AddItem(bp3d.NewItem("Item 1", 2, 2, 1, 2))
p.AddItem(bp3d.NewItem("Item 2", 3, 3, 2, 3))

// Pack items to bins.
if err := p.Pack(); err != nil {
	log.Fatal(err)
}

// Each bin, b, in p.Bins might have packed items in b.Items

See example/example.go

Credit

License

MIT

About

Golang package for 3d bin packing problem

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 97.5%
  • Makefile 2.5%
0