2021-10-17 18:26:00 +02:00
|
|
|
---
|
|
|
|
title: Pattern.sampleMeasurement()
|
|
|
|
---
|
2021-08-25 16:09:31 +02:00
|
|
|
|
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
|
2021-08-25 16:09:31 +02:00
|
|
|
while adapting the measurement between 90% and 110% of its original value.
|
|
|
|
|
2021-09-25 17:05:18 +02:00
|
|
|
<Tip>
|
2021-08-25 16:09:31 +02:00
|
|
|
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
|
2021-08-25 16:09:31 +02:00
|
|
|
|
|
|
|
```js
|
2021-09-25 17:05:18 +02:00
|
|
|
import Aaron from "@freesewing/aaron"
|
2021-08-25 16:09:31 +02:00
|
|
|
import models from "@freesewing/models"
|
|
|
|
|
2021-09-25 17:05:18 +02:00
|
|
|
const pattern = new Aaron({ measurements: models.manSize38 })
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2021-09-25 17:05:18 +02:00
|
|
|
const svg = pattern.sampleMeasurement("chest").render()
|
2022-02-19 08:04:25 +01:00
|
|
|
```
|