@mark1russell7/packing 0.2.4 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -46,6 +46,20 @@ pack(rects, outer, { strategy: "shelf", fit: "best" });
46
46
  - `fit: "best"`: each rectangle goes on the shelf with the least height left over above it.
47
47
  - With a `fit`, the shelves open only in the free spans of each container shape. `docs/PACKER.md` tells the rules.
48
48
 
49
+ Since 0.2.5, `packMaxRects` and the strategy `maxrects` pack with a list of maximal free rectangles. `MAXRECTS_RULES` lists the rules of the option `rule`.
50
+
51
+ ```ts
52
+ pack(rects, outer, { strategy: "maxrects", rule: "cp" });
53
+ ```
54
+
55
+ - `rule: "bssf"` (the default): the free rectangle with the smallest leftover short side. Its move is `move.bssf`.
56
+ - `rule: "blsf"`: the free rectangle with the smallest leftover long side. Its move is `move.blsf`.
57
+ - `rule: "baf"`: the free rectangle with the smallest leftover area. Its move is `move.baf`.
58
+ - `rule: "bl"`: the highest place, then the leftmost place. Its move is `move.split`, a box that cuts 2 free rectangles or more.
59
+ - `rule: "cp"`: the place that touches the most length of edges. Its move is `move.cp`.
60
+ - The move of each rule other than `bl` counts a box when the rule chooses a place that `bl` does not choose.
61
+ - A shape that is not a rectangle gets bands. The option `bandHeight` sets their largest height. The default is the height divided by `MAXRECTS_BANDS`.
62
+
49
63
  Both functions also work alone, in an outer rectangle with a width that you set. They do not change the width.
50
64
 
51
65
  A `locked` rectangle keeps its position. `packSkyline` and `packShelf` put the other rectangles around it. `packRows` only keeps its position.
@@ -112,10 +126,11 @@ output.size; // the size of the container
112
126
  checkHard(input, output); // { "no-overlap": 0, "in-container": 0, "locked-kept": 0, complete: 0 }
113
127
  ```
114
128
 
115
- - The registry `strategies` has `rows`, `skyline`, `shelf` and `push`. `strategy(id)` gives one, and `packWith(id, input, options, seed)` packs with it.
129
+ - The registry `strategies` has `rows`, `skyline`, `shelf`, `push` and `maxrects`. `strategy(id)` gives one, and `packWith(id, input, options, seed)` packs with it.
116
130
  - `fixed` is `size`, `width`, `height` or `none`. A fixed height turns the axes. The value `none` uses the size search `logSweep`, which wraps `packFree`.
117
131
  - Each strategy declares its cells in `supports`. `cellOf(input)` gives the cell of an input. A strategy throws `UnsupportedCell` for an input outside its cells.
118
- - The strategies of this version do not turn items, read groups or pack shapes. A turnable item, a group or a shape gives `UnsupportedCell`.
132
+ - Only `maxrects` accepts a turnable item, and it turns items only with `rotate: true`. The other strategies give `UnsupportedCell` for a turnable item.
133
+ - No strategy reads groups or packs shapes. A group or a shape gives `UnsupportedCell`.
119
134
  - `checkHard` counts the breaks of the hard rules: `no-overlap`, `in-container`, `locked-kept` and `complete`. It reads the true shape of each obstacle, as `packHard` of `@mark1russell7/layout-contract` does.
120
135
  - `fromRects` and `toRects` connect the interface to the `Rect` objects.
121
136
 
package/build/index.d.ts CHANGED
@@ -142,6 +142,58 @@ interface FreeSpace {
142
142
  * frame is the corner of the container, moved in by the inset and out by half the gap. `FreeSpace` tells the methods.
143
143
  */
144
144
  export declare function freeSpace(input: PackInput): FreeSpace;
145
+ /**
146
+ * The rules of `maxrects` to choose a free rectangle for a box.
147
+ *
148
+ * - `bssf`: the best short side fit. The smaller leftover side is the smallest.
149
+ * - `blsf`: the best long side fit. The larger leftover side is the smallest.
150
+ * - `baf`: the best area fit. The leftover area is the smallest.
151
+ * - `bl`: the bottom-left rule. The bottom edge of the box is the highest, then the left edge is the leftmost.
152
+ * - `cp`: the contact point rule. The box touches the most length of the edges of the frame, the boxes and the obstacles.
153
+ */
154
+ export declare const MAXRECTS_RULES: readonly ["bssf", "blsf", "baf", "bl", "cp"];
155
+ /** A rule of `maxrects`: `bssf`, `blsf`, `baf`, `bl` or `cp`. `MAXRECTS_RULES` tells each rule. */
156
+ type MaxRectsRule = (typeof MAXRECTS_RULES)[number];
157
+ /** The number of bands that the default band height gives. The default band height is the height to cut divided by this number. */
158
+ export declare const MAXRECTS_BANDS = 128;
159
+ /** The options of `packMaxRects` */
160
+ interface MaxRectsOptions {
161
+ /** The order of the rectangles before the packing. The default is `height-desc`. */
162
+ sortOrder?: SortOrder;
163
+ /**
164
+ * The free space of the container: `freeSpace` of the input. Without it, or when it is plain, the free rectangles are
165
+ * exact: the outer rectangle less the locked rectangles. Another space gives an inner approximation with bands.
166
+ */
167
+ space?: FreeSpace;
168
+ /** The rule to choose a free rectangle. The default is `bssf`. */
169
+ rule?: MaxRectsRule;
170
+ /**
171
+ * The largest height of a band of the approximation of a space that is not plain. The bands have equal heights. The
172
+ * default is the height to cut divided by `MAXRECTS_BANDS`. A fixed height cuts the height. A free height cuts to the
173
+ * lowest edge of the obstacles that are not rectangles.
174
+ */
175
+ bandHeight?: number;
176
+ /** The rectangles that can turn by 90 degrees. Without it, no rectangle turns. A locked rectangle does not turn. */
177
+ turnable?: ReadonlySet<unknown>;
178
+ /**
179
+ * The rectangles that the packing turned. Each call turns back the rectangles of this set first, and then it clears the
180
+ * set. Thus a size search can pack the same rectangles many times.
181
+ */
182
+ turned?: Set<unknown>;
183
+ }
184
+ /**
185
+ * This function packs rectangles into an outer rectangle with MaxRects of Jylänki (2010). It keeps the list of the maximal
186
+ * free rectangles, and it does not change the width of the outer rectangle.
187
+ *
188
+ * - Each box goes to the top-left corner of the free rectangle that `options.rule` chooses. `MAXRECTS_RULES` tells the rules.
189
+ * - A tie goes to the higher place, then to the place on the left, then to the first free rectangle of the list.
190
+ * - A `locked` rectangle keeps its position, and the free rectangles go around it.
191
+ * - With a space that is not plain, the free rectangles start from bands of the outline. `MaxRectsOptions` tells the bands.
192
+ * - Without `fixedSize`, the height of the outer rectangle grows to the content. With `fixedSize`, a box that does not fit
193
+ * is not packed: its `wasPacked` stays `false`.
194
+ * - The default sort order is `height-desc`. The order of the array of the caller stays.
195
+ */
196
+ export declare function packMaxRects<T>(rects: Rect<T>[], outer: Rect<T>, options?: MaxRectsOptions): Rect<T>;
145
197
  /**
146
198
  * The rule of a shelf packing to choose the shelf of a rectangle. `packShelf` tells each rule.
147
199
  *
@@ -195,12 +247,20 @@ interface PackOptions {
195
247
  /** The options of `pack` */
196
248
  interface PackLayoutOptions extends PackOptions {
197
249
  /**
198
- * The packing: `rows` (the default), `skyline` or `shelf`. `skyline` and `shelf` pack around locked rectangles.
199
- * Use `shelf` with the sort order `input` to keep the order of the array around locked rectangles.
250
+ * The packing: `rows` (the default), `skyline`, `shelf` or `maxrects`. `skyline`, `shelf` and `maxrects` pack around
251
+ * locked rectangles. Use `shelf` with the sort order `input` to keep the order of the array around locked rectangles.
200
252
  */
201
- strategy?: "rows" | "skyline" | "shelf";
253
+ strategy?: "rows" | "skyline" | "shelf" | "maxrects";
202
254
  /** The rule of `shelf` to choose a shelf. Only `shelf` reads it. `ShelfOptions` tells it. Without it, `shelf` packs as in 0.2.3. */
203
255
  fit?: ShelfFit;
256
+ /** The rule of `maxrects` to choose a free rectangle. Only `maxrects` reads it. The default is `bssf`. */
257
+ rule?: MaxRectsRule;
258
+ /** The largest height of a band of `maxrects` in a space that is not plain. Only `maxrects` reads it. `MaxRectsOptions` tells it. */
259
+ bandHeight?: number;
260
+ /** The rectangles that `maxrects` can turn by 90 degrees. Only `maxrects` reads it. */
261
+ turnable?: ReadonlySet<unknown>;
262
+ /** The rectangles that `maxrects` turned. Only `maxrects` reads it. `MaxRectsOptions` tells it. */
263
+ turned?: Set<unknown>;
204
264
  }
205
265
  /**
206
266
  * This function packs rectangles into an outer rectangle of a given width with a guillotine row packing. It does
@@ -219,7 +279,7 @@ export declare function packRows<T>(rects: Rect<T>[], outer: Rect<T>, options?:
219
279
  * This width is not less than the width of the widest rectangle. The height grows until all rectangles fit.
220
280
  * - With `fixedWidth`, the width stays. A rectangle wider than that width goes on its own row and overflows.
221
281
  * - With `fixedSize`, a rectangle that does not fit is not packed: its `wasPacked` stays `false`.
222
- * - `options.strategy` selects `packRows` (the default), `packSkyline` or `packShelf` after the width is set.
282
+ * - `options.strategy` selects `packRows` (the default), `packSkyline`, `packShelf` or `packMaxRects` after the width is set.
223
283
  */
224
284
  export declare function pack<T>(rects: Rect<T>[], outer?: Rect<T>, options?: PackLayoutOptions): Rect<T>;
225
285
  /**
@@ -621,6 +681,18 @@ interface LayoutStrategyOptions {
621
681
  */
622
682
  fit?: ShelfFit;
623
683
  }
684
+ /** The options of the strategy `maxrects`. The strategy does not read `fit`. */
685
+ interface MaxRectsStrategyOptions extends LayoutStrategyOptions {
686
+ /** The rule to choose a free rectangle: `bssf` (the default), `blsf`, `baf`, `bl` or `cp`. `MAXRECTS_RULES` tells each rule. */
687
+ rule: MaxRectsRule;
688
+ /** The value `true` lets each turnable item that is not locked turn by 90 degrees. The default is `false`. */
689
+ rotate: boolean;
690
+ /**
691
+ * The largest height of a band of the approximation of a container that is not a plain rectangle. `MaxRectsOptions`
692
+ * tells the default.
693
+ */
694
+ bandHeight?: number;
695
+ }
624
696
  /** The options of the strategy `push`. */
625
697
  interface PushStrategyOptions {
626
698
  /** The order of the items that the cascade does not place. */
@@ -645,9 +717,18 @@ export declare const skyline: Strategy<LayoutStrategyOptions>;
645
717
  * The option `fit` selects a shelf rule of roadmap item k21: `next`, `first` or `best`. The default has no `fit`.
646
718
  */
647
719
  export declare const shelf: Strategy<LayoutStrategyOptions>;
720
+ /**
721
+ * The strategy `maxrects` uses `packMaxRects`: the MaxRects packer of roadmap item k24. It keeps the list of the maximal
722
+ * free rectangles, and the option `rule` chooses the free rectangle for each item. The default rule is `bssf`.
723
+ *
724
+ * - The free rectangles go around the locked items and the fixed obstacles. A plain rectangle container gives exact free
725
+ * rectangles. Another shape gives an inner approximation with horizontal bands.
726
+ * - With `rotate`, each turnable item that is not locked can turn by 90 degrees. Groups and item shapes throw `UnsupportedCell`.
727
+ */
728
+ export declare const maxrects: Strategy<MaxRectsStrategyOptions>;
648
729
  /**
649
730
  * The size search `log-sweep` uses `packFree` of 0.1.2: widths on a log scale, then the widths near the best width. It
650
- * wraps `rows`, `skyline` and `shelf`. The objective is the area of the frame times `1 + aspectWeight * aspectError`.
731
+ * wraps `rows`, `skyline`, `shelf` and `maxrects`. The objective is the area of the frame times `1 + aspectWeight * aspectError`.
651
732
  */
652
733
  export declare const logSweep: SizeSearch;
653
734
  /**
@@ -871,5 +952,5 @@ interface Corpus {
871
952
  * `RangeError` for an unknown generator, a different version or 2 inputs with the same id.
872
953
  */
873
954
  export declare function corpus(name: string, specs: readonly CorpusSpec[]): Corpus;
874
- export { type Cell, type ChangeMeasures, type ContainerTest, type Corpus, type CorpusCell, type CorpusEntry, type CorpusGenerator, type CorpusManifest, type CorpusSpec, type CountScale, DEFAULT_TOLERANCE, type Dimension, type DimensionValue, type Direction, EPS, type EdgeCase, type EdgeCaseParams, type FreeSpace, type FreeSpan, type FreeWidthOptions, type FreeWidthResult, type FreeWidthTry, type GeneratedInput, type GeneratorParams, type GeneratorStamp, type Item, type LayoutContainer, type LayoutEdge, type LayoutInput, type LayoutMeasures, type LayoutStrategyOptions, type Margin, type MeasureFamily, type MeasureId, type MeasureOptions, type MeasureSpec, type MetricsOptions, type Obstacle, type ObstacleLayout, type PackContext, type PackHard, type PackInput, type PackLayoutOptions, type PackOptions, type PackOutput, type PackingMetrics, type Placement, type Port, type PushOptions, type PushStrategyOptions, RECORD_EPS, type RectGridParams, type RectScatteredParams, type Region, type ShelfFit, type ShelfOptions, type Side, type Sides, type SizeDistribution, type SizeSearch, type SkylineOptions, type SortOrder, type SpaceRect, type StageTrace, type Strategy, type Supports, type Tolerance, type UiParams, checkInput, turnPoint, turnPort, turnRegion };
955
+ export { type Cell, type ChangeMeasures, type ContainerTest, type Corpus, type CorpusCell, type CorpusEntry, type CorpusGenerator, type CorpusManifest, type CorpusSpec, type CountScale, DEFAULT_TOLERANCE, type Dimension, type DimensionValue, type Direction, EPS, type EdgeCase, type EdgeCaseParams, type FreeSpace, type FreeSpan, type FreeWidthOptions, type FreeWidthResult, type FreeWidthTry, type GeneratedInput, type GeneratorParams, type GeneratorStamp, type Item, type LayoutContainer, type LayoutEdge, type LayoutInput, type LayoutMeasures, type LayoutStrategyOptions, type Margin, type MaxRectsOptions, type MaxRectsRule, type MaxRectsStrategyOptions, type MeasureFamily, type MeasureId, type MeasureOptions, type MeasureSpec, type MetricsOptions, type Obstacle, type ObstacleLayout, type PackContext, type PackHard, type PackInput, type PackLayoutOptions, type PackOptions, type PackOutput, type PackingMetrics, type Placement, type Port, type PushOptions, type PushStrategyOptions, RECORD_EPS, type RectGridParams, type RectScatteredParams, type Region, type ShelfFit, type ShelfOptions, type Side, type Sides, type SizeDistribution, type SizeSearch, type SkylineOptions, type SortOrder, type SpaceRect, type StageTrace, type Strategy, type Supports, type Tolerance, type UiParams, checkInput, turnPoint, turnPort, turnRegion };
875
956
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":["Item","Sides","ContractMeasureSpec","Direction","ContainerTest","PackHard","LayoutContainer","LayoutEdge","LayoutInput"],"sources":["../src/vector.ts","../src/rect.ts","../src/order.ts","../src/contract.ts","../src/space.ts","../src/shelf.ts","../src/pack.ts","../src/skyline.ts","../src/free.ts","../src/push.ts","../src/metrics.ts","../src/measures.ts","../src/strategy.ts","../src/adapters.ts","../src/convert.ts","../src/registry.ts","../src/check.ts","../src/layout-input.ts","../src/generators.ts","../src/corpus.ts"],"mappings":";;qBACa;;EAIX,YAAY,YAAO;;MAMf;MACA,EAAE;;MAEF;MACA,EAAE;;EAGN,IAAI,WAAW;;EAMf,MAAM,GAAG;;EAMT,IAAI,OAAO,SAAS;;EAKpB;;EAKA,SAAS;;EAKT,MAAM,KAAK,QAAQ,KAAK,SAAS;;SAQ1B,GAAG,iBAAiB;;SAKpB,IAAI,SAAS,WAAW;;SASxB,IAAI,SAAS,WAAW;;aASpB,YAAY;;;qBCxEZ,KAAK;;;EAKhB,KAAK;;EAEL;;EAEA;;EAEA;;;;;EAKA;;MAGI,YAAY;;MAEZ,QAAQ;;EAGZ;;EAEA;;EAGA,WAAW;;EAOX,YAAY,QAAQ;;EAMpB;;SAGO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O,cAAc,gBAAgB,eAAe"}
1
+ {"version":3,"file":"index.d.ts","names":["Item","Sides","ContractMeasureSpec","Direction","ContainerTest","PackHard","LayoutContainer","LayoutEdge","LayoutInput"],"sources":["../src/vector.ts","../src/rect.ts","../src/order.ts","../src/contract.ts","../src/space.ts","../src/maxrects.ts","../src/shelf.ts","../src/pack.ts","../src/skyline.ts","../src/free.ts","../src/push.ts","../src/metrics.ts","../src/measures.ts","../src/strategy.ts","../src/adapters.ts","../src/convert.ts","../src/registry.ts","../src/check.ts","../src/layout-input.ts","../src/generators.ts","../src/corpus.ts"],"mappings":";;qBACa;;EAIX,YAAY,YAAO;;MAMf;MACA,EAAE;;MAEF;MACA,EAAE;;EAGN,IAAI,WAAW;;EAMf,MAAM,GAAG;;EAMT,IAAI,OAAO,SAAS;;EAKpB;;EAKA,SAAS;;EAKT,MAAM,KAAK,QAAQ,KAAK,SAAS;;SAQ1B,GAAG,iBAAiB;;SAKpB,IAAI,SAAS,WAAW;;SASxB,IAAI,SAAS,WAAW;;aASpB,YAAY;;;qBCxEZ,KAAK;;;EAKhB,KAAK;;EAEL;;EAEA;;EAEA;;;;;EAKA;;MAGI,YAAY;;MAEZ,QAAQ;;EAGZ;;EAEA;;EAGA,WAAW;;EAOX,YAAY,QAAQ;;EAMpB;;SAGO,OAAO,GAAG,OAAO,KAAK,OAAO,KAAK;;SAKlC,SAAS,GAAG,OAAO,KAAK,OAAO,KAAK;;SAKpC,YAAY,GAAG,OAAO,KAAK;;SAK3B,SAAS,GAAG,OAAO,KAAK;;SAKxB,UAAU,GAAG,OAAO,KAAK;;;;;;KC/DtB;;qBAGC,sBAAsB;;wBAGnB,aAAa,OAAO,aAAa,GAAG,GAAG,KAAK,IAAI,GAAG,KAAK;;wBCiBxD,SAAS,MAAM,KAAKA,oBAAkBC;;;;;;;wBAWtC,SAAS,MAAMD,SAAOA;;UC/BrB;WACN;WACA;;;UAIM;WACN;WACA;WACA;WACA;;;;;;;;;;;UAYM;;WAEN;;WA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