1
0
Fork 0
freesewing/markdown/dev/guides/best-practices/go-counter-clockwise/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.2 KiB

title order
Construct paths counter-clockwise 70

Construct your paths counter-clockwise. You have to pick a direction anyway, and going counter-clockwise is a bit of a convention.

This applies both to naming points (specifically the control points of curves) and the order in which you define your points.

Obviously, the order in which you add points to your code needs to take a backseat to the logic of your code. But typically what you're doing is constructing an outline of (a part of) a garment.

So pick a point, and make your way around counter-clockwise.

When naming control points for curves, re-use the name of the point they are attached to and add Cp1 to the control point before and Cp2 to the control point after the point if , once again, you'd follow your path counter-clockwise.

For example:

part.paths.seam = new Path()
  .move(points.hemCenter)
  .line(points.hemSide)
  .line(points.waistSide)
  .curve(points.waistSideCp2, points.armholeCp1, points.armhole)
This convention helps with Path.offset() too

Constructing a path counter-clockwise will also ensure that the path offset goes outwards rather than inwards.