MaxRectsPacker

binpacking.MaxRectsPacker (Class)
Implements: IOccupancy

Instance Members

binWidth: Int

binHeight: Int

binAllowFlip: Bool

usedRectangles: Array<Rect>

freeRectangles: Array<Rect>

insert(width: Int, height: Int, method: FreeRectChoiceHeuristic): Rect
Name Type
width Int
height Int
method FreeRectChoiceHeuristic
Returns
Rect

occupancy(): Float
Returns
Float

new(?width: Int = 0, ?height: Int = 0, ?allowFlip: Bool = true): Void
Name Type Default
width Int 0
height Int 0
allowFlip Bool true

Private Members

scoreRect(width: Int, height: Int, method: FreeRectChoiceHeuristic): MaxRectsPackerRectScore
Name Type
width Int
height Int
method FreeRectChoiceHeuristic
Returns
MaxRectsPackerRectScore

contactPointScoreNode(x: Int, y: Int, width: Int, height: Int): Int
Name Type
x Int
y Int
width Int
height Int
Returns
Int

findPositionForNewNodeBottomLeft(width: Int, height: Int, result: MaxRectsPackerBestFitPosition): MaxRectsPackerBestFitPosition
Name Type
width Int
height Int
result MaxRectsPackerBestFitPosition
Returns
MaxRectsPackerBestFitPosition

findPositionForNewNodeBestShortSideFit(width: Int, height: Int, result: MaxRectsPackerBestFitPosition): MaxRectsPackerBestFitPosition
Name Type
width Int
height Int
result MaxRectsPackerBestFitPosition
Returns
MaxRectsPackerBestFitPosition

findPositionForNewNodeBestLongSideFit(width: Int, height: Int, result: MaxRectsPackerBestFitPosition): MaxRectsPackerBestFitPosition
Name Type
width Int
height Int
result MaxRectsPackerBestFitPosition
Returns
MaxRectsPackerBestFitPosition

findPositionForNewNodeBestAreaFit(width: Int, height: Int, result: MaxRectsPackerBestFitPosition): MaxRectsPackerBestFitPosition
Name Type
width Int
height Int
result MaxRectsPackerBestFitPosition
Returns
MaxRectsPackerBestFitPosition

findPositionForNewNodeContactPoint(width: Int, height: Int, result: MaxRectsPackerBestFitPosition): MaxRectsPackerBestFitPosition
Name Type
width Int
height Int
result MaxRectsPackerBestFitPosition
Returns
MaxRectsPackerBestFitPosition

splitFreeNode(freeNode: Rect, usedNode: Rect): Bool
Name Type
freeNode Rect
usedNode Rect
Returns
Bool

pruneFreeList(): Void

commonIntervalLength(i1start: Float, i1end: Float, i2start: Float, i2end: Float): Float
Name Type
i1start Float
i1end Float
i2start Float
i2end Float
Returns
Float