ExBoxPacker.Rotation (ExBoxPacker v0.2.0)

Copy Markdown View Source

Allowed rotation modes for an item, mirroring BoxPacker's Rotation enum.

  • :never — the item is packed exactly as supplied (1 permutation)
  • :keep_flat — the item may rotate in the horizontal plane only (2 permutations)
  • :best_fit — the item may take any of its 6 orthogonal orientations

Summary

Functions

Number of orientation permutations allowed (matches BoxPacker's enum integer values: 1/2/6).

Types

t()

@type t() :: :never | :keep_flat | :best_fit

Functions

permutation_count(atom)

@spec permutation_count(t()) :: 1 | 2 | 6

Number of orientation permutations allowed (matches BoxPacker's enum integer values: 1/2/6).

valid?(rotation)

@spec valid?(term()) :: boolean()

values()

@spec values() :: [t()]