1
0
Fork 0
freesewing/markdown/dev/tutorials/pattern-design/your-first-part/en.md
Joost De Cock b34a2ee2ed feat: Flat import of markdown repo
This is a flat (without history) import of (some of) the content
from our markdown module.

We've imported this without history because the repo contains our
blog posts and showcases posts content prior to porting them to strapi.

Since this contains many images, it would balloon the size of this repo
to import the full history.

Instead, please refer to the history of the (archived) markdown repo
at: https://github.com/freesewing/markdown
2021-08-25 16:09:31 +02:00

1.8 KiB

title order
Your first part 120

Much like garments themselves, patterns are made up of parts.

Most patterns will have multiple parts. A sleeve, a back part, the collar, and so on. Our pattern is very simple, and only has one part: the bib.

The pattern that's been created for us also just has one part to get you started. It's called box and it draws a box. If you click on the Draft your pattern button in your browser, you'll get to see it:

The default pattern with its box part

Since we only need one part, we'll rename this box part, and call it bib.

Rename the box part to bib

First, update the configuration file in config/index.js. Update the parts array with bib, rather than box:

parts: ["bib"],

When that's done, rename the src/box.js file into src/bib.js.

Then, in the src/index.js file, change the import accordingly:

// Change this line
//import draftBox from "./box";

// Into this
import draftBib from "./bib";

Finally, still in the src/index.js file, update the draftmethod:

// Change this line
//Pattern.prototype.draftBox = draftBox;

// Into this
Pattern.prototype.draftBib = draftBib;
Always use draftPartname

FreeSewing will expect for each part to find a method named DraftPartname.

If you have a part named sleeve you should have a method called draftSleeve() that drafts that part.

In our case, we have a part named bib so we're using draftBib() as the method that drafts it.

Congratulations, your pattern now has a bib part, rather than a box part. It still looks the same though:

This bib part is where we'll do some real work. But first, we have some more configuration to do.