Skip to content

irregular: faster periodic packings, feasible elements of the no-fit polygons, framed blocks limit - #830

Merged
fontanf merged 3 commits into
masterfrom
irregular-periodic-packings-nfp
Nov 8, 2026
Merged

fontanf merged 3 commits into
masterfrom
irregular-periodic-packings-nfp

Conversation

@fontanf

@fontanf fontanf commented Nov 8, 2026

Copy link
Copy Markdown
Owner
  • extern: update shape. Faster no-fit polygons (Reject the points outside the bounding box of the element in ShapeElement::contains shape#154, Fix rectangleguillotine soft trims #155, Fix bottom and left soft trims in rectangleguillotine #156): on the 62 no-fit polygons of the periodic packings of alma_02, 23.6 s → 12.8 s.
  • Periodic packings use the feasible elements and points of the no-fit polygons, the null-area translations where the items don't overlap, for example an item sliding in a slot of exactly its width. They are candidate translations of the lattice search and of the second item of the two-item unit cells. Only without item-item spacing: the inflated no-fit polygons have none. New test TabAndSlot. Also, each shape is inflated once per orientation instead of in every check of a candidate periodic packing.
  • Framed blocks limit in the tree search with periodic packings: per frame item type, the framed blocks saving the most space are kept, within 4 times the number of copies of the frame item type, found by framing the blocks by decreasing upper bound of their saving.
  • Doc: new page doc/internals/irregular/blocks.rst describing the blocks, shared by the tree search with periodic packings and the tree search with maximal spaces.

Faster no-fit polygons: ShapeElement::contains rejects the points outside the
bounding box of the element, and the computation of the feasible elements and
points skips the elements on the boundary of the no-fit polygon and checks the
last convex no-fit polygon found first.
…s in the periodic packings

- The feasible elements and points of the no-fit polygons, the null-area
  translations strictly inside their union where the items don't overlap, are
  candidate translations of the lattice search and of the second item of the
  two-item unit cells, unless they are strictly inside another no-fit polygon
  of the forbidden region. They are only kept without item-item spacing: the
  inflated no-fit polygons have none.
- Inflate each shape once per orientation instead of in every check of a
  candidate periodic packing.
…ackings

Limit the framed blocks of each frame item type: the sum, over its framed
blocks, of the maximum number of copies of the block times the number of
copies of the frame item type in the block, can't exceed 4 times the number
of copies of the frame item type. Keep the framed blocks saving the most
space, found by framing the blocks by decreasing upper bound of their saving,
until this bound is below the saving of the framed blocks kept.

Doc: move the description of the blocks to a new page, shared by the tree
search with periodic packings and the tree search with maximal spaces.
@fontanf
fontanf merged commit f0c6d2d into master Nov 8, 2026
8 checks passed
@fontanf
fontanf deleted the irregular-periodic-packings-nfp branch November 8, 2026 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant