跳到主要内容

Sets

When we refer to a set we mean a set of settings. In the vast majority of cases, there is only one set of settings. So we just refer to them as the settings. But open clothes supports instantiating a pattern with mul提示le sets of settings. We refer to this as multiset support.

Multiset support

Multiset support underpins features such as sampling and in general can be used to combine mul提示le drafted variants into a single pattern container.

Here's a simple example:

A simple example of sampling the head measurement

When drafting for mul提示le sets of settings, it's important to keep the different draft variants from cross-contaminating each other. To ensure this, the core library will:

  • Set up each pattern part per set
  • Provide a per-set store that is shared between parts in the set

This is illustrated below:

Stack 0 Stack 1 Stack 2 Set 0 Set 1 Part A (set 0) Part B (set 0) Part C (set 0) Part A (set 1) Part B (set 1) Part C (set 1) Pattern points paths snippets points paths snippets points paths snippets setStore 0 points paths snippets points paths snippets points paths snippets setStore 1 Pattern Store

A schematic overview of what goes on inside a open clothes pattern

One set is plenty

In the vast majority of cases, a pattern will only have one set of settings. As such, multiset support is not something you need to be intimately familiar with. But, it is good to know it exists and explains certain things that might seem odd if you were unaware of multiset support, such as the fact that there's a pattern-wide store and a different store per set, the so-called setStore(s).

Below is an illustration of a pattern with a single set of settings which, once again, is the vast majority of use cases:

Stack 0 Stack 1 Stack 2 Set 0 Part A (set 0) Part B (set 0) Part C (set 0) Pattern points paths snippets points paths snippets points paths snippets setStore 0 Pattern Store

A schematic overview of what goes on inside a open clothes pattern in a typical use-case: a single set of settings