ExBoxPacker.ConstrainedPlacementItem protocol (ExBoxPacker v0.2.0)

Copy Markdown View Source

Optional protocol for items with custom placement rules (e.g. max quantity per box, no stacking). can_be_packed?/8 is consulted for each candidate placement; return false to forbid it. Implementing this slows packing. Port of BoxPacker's ConstrainedPlacementItem.

Summary

Types

t()

All the types that implement this protocol.

Types

t()

@type t() :: term()

All the types that implement this protocol.

Functions

can_be_packed?(item, packed_box, x, y, z, width, length, depth)

@spec can_be_packed?(
  t(),
  ExBoxPacker.Result.PackedBox.t(),
  integer(),
  integer(),
  integer(),
  integer(),
  integer(),
  integer()
) :: boolean()