Files
OpenNest/OpenNest.Engine/RectanglePacking/Bin.cs
2026-03-06 13:02:12 -05:00

32 lines
625 B
C#

using System.Collections.Generic;
using System.Linq;
using OpenNest.Geometry;
namespace OpenNest.RectanglePacking
{
internal class Bin : Box
{
public Bin()
{
Items = new List<Item>();
}
public List<Item> Items { get; set; }
public double Density()
{
return Items.Sum(i => i.Area()) / Area();
}
public object Clone()
{
return new Bin
{
Location = this.Location,
Size = this.Size,
Items = new List<Item>(Items)
};
}
}
}