1
0
Fork 0
freesewing/markdown/dev/tutorials/pattern-design/drawing-the-bib-outline/fr.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

2.1 KiB

title order
Dessiner le contour du bavoir 190

Avec notre encolure en place, attaquons-nous au contour du bavoir :

let width = measurements.head * options.widthRatio;
let length = measurements.head * options.lengthRatio;

points.topLeft = new Point(
  width / -2,
  points.top.y - (width / 2 - points.right.x)
);
points.topRight = points.topLeft.shift(0, width);
points.bottomLeft = points.topLeft.shift(-90, length);
points.bottomRight = points.topRight.shift(-90, length);

paths.rect = new Path()
  .move(points.topLeft)
  .line(points.bottomLeft)
  .line(points.bottomRight)
  .line(points.topRight)
  .line(points.topLeft)
  .close();

La première chose que nous avons faite est de créer les variables width (largeur) et length (longueur) afin de nous épargner un peu de dactylographie :

let width = measurements.head * options.widthRatio;
let length = measurements.head * options.lengthRatio;

La longueur et la largeur de votre bavoir sont tous les deux des facteurs du tour de tête (head circumference). De cette façon, la taille du bavoir s'adaptera à celle du bébé, et l'utilisateur pourra ajuster la longueur et la largeur en jouant avec les options que vous aurez ajouté au patron.

Une fois nos variables prêtes, nous ajoutons quelques nouveaux points, et un deuxième chemin nommé rect.

points.topLeft = new Point(
  width / -2,
  points.top.y - (width / 2 - points.right.x)
);
points.topRight = points.topLeft.shift(0, width);
points.bottomLeft = points.topLeft.shift(-90, length);
points.bottomRight = points.topRight.shift(-90, length);

paths.rect = new Path()
  .move(points.topLeft)
  .line(points.bottomLeft)
  .line(points.bottomRight)
  .line(points.topRight)
  .line(points.topLeft)
  .close();

Nous calculons le point topLeft (hautGauche) de façon à ce que le bord haut du bavoir et les côtés soient équidistants de l'encolure.

Vous n'étiez pas obligés de le faire. Mais cela paraît plus équilibré de cette façon :