1
0
Fork 0
freesewing/markdown/dev/reference/api/pattern/samplemeasurement/en.md

38 lines
1.1 KiB
Markdown
Raw Normal View History

---
title: Pattern.sampleMeasurement()
---
2022-02-20 14:35:50 +01:00
A pattern's `sampleMeasurement()` method will _sample_ a given measurement,
2021-09-25 17:05:18 +02:00
which means to draft it in different iterations while adjusting the input value
of the given measurement.
2022-02-19 08:04:25 +01:00
In practice, it will draft 10 iterations of the pattern
while adapting the measurement between 90% and 110% of its original value.
2021-09-25 17:05:18 +02:00
<Tip>
The goal of measurement sampling is to understand the impact of a given measurement on a pattern.
2021-09-25 17:05:18 +02:00
</Tip>
<Note>This method is chainable as it returns the Pattern object</Note>
<Tip>
The goal of option sampling is to verify the impact of an option on the pattern, and verify that
its min and max boundaries are correct and its default value is sensible.
</Tip>
## Pattern.sampleMeasurement() signature
```js
Pattern pattern.sampleMeasurement(string measurement)
```
## Pattern.sampleMeasurement() example
```js
2021-09-25 17:05:18 +02:00
import Aaron from "@freesewing/aaron"
import models from "@freesewing/models"
2021-09-25 17:05:18 +02:00
const pattern = new Aaron({ measurements: models.manSize38 })
2021-09-25 17:05:18 +02:00
const svg = pattern.sampleMeasurement("chest").render()
2022-02-19 08:04:25 +01:00
```