1
0
Fork 0

wip: Working on better developer docs

This commit is contained in:
joostdecock 2021-09-25 17:05:18 +02:00
parent c16b212bb9
commit e0a261731f
25 changed files with 461 additions and 152 deletions

View file

@ -1,28 +1,38 @@
---
title: sampleMeasurement
title: Pattern.sampleMeasurement()
---
A pattern's `sampleMeasurement()` method will *sample* a given measurement,
which means to draft it in different iterations while adjusting the input value
of the given measurement.
In practice, it will draft 10 iterations of the pattern
while adapting the measurement between 90% and 110% of its original value.
<Tip>
The goal of measurement sampling is to understand the impact of a given measurement on a pattern.
</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)
```
```
Samples a measurement by drafting 10 variations of the pattern
while adapting the measurement between 90% and 110% of its original value.
The goal of measurement sampling is to understand the impact of a given measurement on a pattern.
## Pattern.sampleMeasurement() example
```js
import freesewing from "@freesewing/core"
import aaron from "@freesewing/aaron"
import Aaron from "@freesewing/aaron"
import models from "@freesewing/models"
let pattern = new aaron({
settings: {
embed: true,
measurements: models.manSize38
},
})
const pattern = new Aaron({ measurements: models.manSize38 })
let svg = pattern.sampleMeasurement("chestCircumference").render()
const svg = pattern.sampleMeasurement("chest").render()
```