Example #1
0
 private void ApplyHorizontalOrientation()
 {
     BinShape.ApplyHorizontalOrientation();
     foreach (var shape in Items)
     {
         shape.ApplyHorizontalOrientation();
     }
 }
Example #2
0
        public bool IsPositionFeasible(TItem item, TPos position)
        {
            //In this case feasability is defined as following: 1. the item fits into the bin-borders; 2. the point is supported by something; 3. the item does not collide with another already packed item
            if (!BinShape.Encloses(position, item))
            {
                return(false);
            }

            foreach (var id in GetLayerItemIDs(item, position))
            {
                if (Items[id].Overlaps(Positions[id], position, item))
                {
                    return(false);
                }
            }

            return(true);
        }