2021-10-17 18:26:00 +02:00
|
|
|
---
|
2021-08-25 16:09:31 +02:00
|
|
|
title: Adding measurements
|
|
|
|
order: 130
|
2021-10-17 18:26:00 +02:00
|
|
|
---
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2022-02-20 14:35:50 +01:00
|
|
|
FreeSewing is all about _made-to-measure_ sewing patterns;
|
2021-08-25 16:16:51 +02:00
|
|
|
we are going to draft our pattern according to the measurements provided to us.
|
2021-08-25 16:09:31 +02:00
|
|
|
|
|
|
|
Which begs the question, which measurements?
|
|
|
|
|
2022-10-09 23:47:32 +02:00
|
|
|
It is you, as the pattern designer, who decides which measurements are used
|
|
|
|
to draft your pattern. For our bib, the only measurement we need is the
|
|
|
|
_head circumference_.
|
2021-08-25 16:09:31 +02:00
|
|
|
|
|
|
|
So let's add it as a required measurement.
|
|
|
|
|
2022-10-09 23:47:32 +02:00
|
|
|
## Adding required measurements
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2022-10-09 23:47:32 +02:00
|
|
|
In our `bib.mjs` file, on the `bib` object, we'll add a new key called
|
|
|
|
`measurements` that will hold a list (an array) of all required measurements
|
|
|
|
for this part.
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2022-10-09 23:47:32 +02:00
|
|
|
We are going to use *the official name* of the measurement. For head
|
|
|
|
circumference, that name is `head`.
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2022-10-09 23:47:32 +02:00
|
|
|
```design/src/bib.mjs
|
|
|
|
function draftBib({ part }) {
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2022-10-09 23:47:32 +02:00
|
|
|
return part
|
|
|
|
}
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2022-10-09 23:47:32 +02:00
|
|
|
export const bib = {
|
|
|
|
name: 'tutorial.bib',
|
|
|
|
draft: draftBib,
|
|
|
|
// Add this line:
|
|
|
|
measurements: ['head'],
|
|
|
|
}
|
|
|
|
```
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2022-10-09 23:47:32 +02:00
|
|
|
Now everybody knows this part requires the `head` measurement.
|
2021-08-25 16:09:31 +02:00
|
|
|
|
|
|
|
This change will also get picked up by the development environment, and you'll now see this screen:
|
|
|
|
|
|
|
|

|
|
|
|
|
2022-02-19 08:04:25 +01:00
|
|
|
Since it's just one measurement, let's simply enter a value by hand.
|
2021-08-25 16:09:31 +02:00
|
|
|
For example `38` as 38cm is a realistic head circumference measurement for a baby.
|
|
|
|
|
2022-07-02 22:52:31 +02:00
|
|
|
Enter `38` in the box, and click on **Draft Design** in the sidebar under the **View** heading.
|
|
|
|
This brings you back to our work in progress:
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2022-10-09 23:47:32 +02:00
|
|
|
|
|
|
|
## Notes
|
|
|
|
|
|
|
|
### Why using standard measurements names matters
|
|
|
|
|
|
|
|
In principle, you can use any name you want for your measurements.
|
|
|
|
Our core library really doesn't care.
|
|
|
|
|
|
|
|
However, if everybody uses their own (names for) measurements, then people
|
|
|
|
aren't able to re-use their measurements across designs.
|
|
|
|
|
|
|
|
So if you have any intention at all to play nice with the FreeSewing ecosystem,
|
|
|
|
please make sure to re-use the names of existing measurements, rather than
|
|
|
|
invent your own.
|
|
|
|
|
|
|
|
See our [best practices](/guides/best-practices/reuse-measurements) on this
|
|
|
|
topic for details.
|
|
|
|
|
|
|
|
|