Skip to main content

Part options

The options property on the part configuration object list the part's options:

const part = {
name: 'example.front',
options: {
chestEase: { pct: 12, min: 0, max: 25 },
},
draft: ({ part }) => part
}

The use case for options

One of the things that sets FreeSewing apart is that sewing patterns are not static. Each pattern is generated on the spot to accommodate the input provided by the user. Input that typically includes their measurements.

This bespoke approach is sort of our thing at FreeSewing, but why stop there? There's a lot of things that can be left up to the user and taken into consideration when drafting the pattern. Things like how many buttons to use, whether or not to include pockets, shape of the collar, and so on. The only limit really is the creativity of the designer.

The options section in a part's configuration is what makes this possible.

Types of options

These are the types of options supported by the FreeSewing core library:

  1. boolean options are for yes/no choices
  2. constant options are used as feature flags or to hard-code certain values yet still allow them to be changed when the part is extended
  3. counter options are for integer values
  4. degree options are for degrees
  5. list options are for a list of possible choices
  6. millimeter options are supported but not recommended (see warning below)
  7. percentage options are for percentages (and can optionally be snapped percentage options)

These options can be extended with additional, optional information to help with their use outside of the core.

tip

In parametric design, percentage options are by far the most common. They also have the most features and flexibility.

warning

While our core library supports millimeter (mm) options, we do not allow them in designs contributed to FreeSewing.org as they are a red flag for poor parametric design.

If you believe you need mm options, look into snapped percentage options instead.