All Projects â†’ semibran â†’ pack

semibran / pack

Licence: MIT license
📦 lightweight rectangle packing algorithm

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to pack

eco-dqn
Implementation of ECO-DQN as reported in "Exploratory Combinatorial Optimization with Reinforcement Learning".
Stars: ✭ 49 (+58.06%)
Mutual labels:  combinatorial-optimization
graph-convnet-tsp
Code for the paper 'An Efficient Graph Convolutional Network Technique for the Travelling Salesman Problem' (INFORMS Annual Meeting Session 2019)
Stars: ✭ 196 (+532.26%)
Mutual labels:  combinatorial-optimization
bp3d
Golang package for 3d bin packing problem
Stars: ✭ 50 (+61.29%)
Mutual labels:  bin-packing
adversarial-code-generation
Source code for the ICLR 2021 work "Generating Adversarial Computer Programs using Optimized Obfuscations"
Stars: ✭ 16 (-48.39%)
Mutual labels:  combinatorial-optimization
submodlib
Summarize Massive Datasets using Submodular Optimization
Stars: ✭ 36 (+16.13%)
Mutual labels:  combinatorial-optimization
GHOST
General meta-Heuristic Optimization Solving Toolkit
Stars: ✭ 28 (-9.68%)
Mutual labels:  combinatorial-optimization
ThinkMatch
Code & pretrained models of novel deep graph matching methods.
Stars: ✭ 639 (+1961.29%)
Mutual labels:  combinatorial-optimization
sinkhorn-policy-gradient.pytorch
Code accompanying the paper "Learning Permutations with Sinkhorn Policy Gradient"
Stars: ✭ 36 (+16.13%)
Mutual labels:  combinatorial-optimization
Rectangle-Bin-Packing
👜 Haxe algorithms for 2D rectangular bin packing
Stars: ✭ 32 (+3.23%)
Mutual labels:  bin-packing
ecole
Extensible Combinatorial Optimization Learning Environments
Stars: ✭ 249 (+703.23%)
Mutual labels:  combinatorial-optimization
mxfactorial
a payment application intended for deployment by the united states treasury
Stars: ✭ 36 (+16.13%)
Mutual labels:  combinatorial-optimization
libnfporb
Implementation of a robust no-fit polygon generation in a C++ library using an orbiting approach
Stars: ✭ 85 (+174.19%)
Mutual labels:  bin-packing
conjure
Conjure: The Automated Constraint Modelling Tool
Stars: ✭ 84 (+170.97%)
Mutual labels:  combinatorial-optimization
3dbinpacking
A python library for 3D Bin Packing
Stars: ✭ 203 (+554.84%)
Mutual labels:  bin-packing
vpsolver
Arc-flow Vector Packing Solver (VPSolver)
Stars: ✭ 86 (+177.42%)
Mutual labels:  bin-packing
Muuri
Infinite responsive, sortable, filterable and draggable layouts
Stars: ✭ 9,797 (+31503.23%)
Mutual labels:  bin-packing
bin-packing
😔 Failed to implement some kind layout in browser.
Stars: ✭ 53 (+70.97%)
Mutual labels:  bin-packing
nest2D
Nest2D is a 2D bin packaging tool for python.
Stars: ✭ 42 (+35.48%)
Mutual labels:  bin-packing
genstar
Generation of Synthetic Populations Library
Stars: ✭ 17 (-45.16%)
Mutual labels:  combinatorial-optimization
gym-forest
Reinforcement learning environment for the classical synthesis of quantum programs.
Stars: ✭ 25 (-19.35%)
Mutual labels:  combinatorial-optimization

pack

lightweight rectangle packer

View the demo!

boxes

pack is a box packing algorithm which attempts to determine the most compact configuration for a set of rectangles. To this end, it employs the first-fit decreasing (FFD) algorithm to place the boxes, using the length of the layout's shortest side length as a heuristic.

Unlike traditional bin packing algorithms, the boxes here are placed in a single container that grows appropriately as they are packed inside. This property makes it ideal for assembling spritesheets given a list of images.

usage

npm

pack(sizes) -> layout

Arranges a list of { width, height } pairs into the most compact layout possible. The result will be reminiscent of the following data structure:

var layout = {
  width: 13,
  height: 8,
  rects: [
    { x: 0, y: 0, width: 5, height: 3 },
    { x: 0, y: 3, width: 6, height: 5 }
    { x: 6, y: 0, width: 5, height: 4 },
    { x: 11, y: 0, width: 2, height: 4 },
    { x: 6, y: 4, width: 7, height: 4 },
    { x: 5, y: 0, width: 1, height: 3 },
  ]
}

kudos

  • leo - for donating the package name

license

MIT © Brandon Semilla

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].