✨ Added tutorial pattern
This commit is contained in:
parent
a1e9badc2c
commit
7d9e41ec6f
28 changed files with 11984 additions and 0 deletions
39
packages/tutorial/src/step6.js
Normal file
39
packages/tutorial/src/step6.js
Normal file
|
@ -0,0 +1,39 @@
|
|||
export default function(part) {
|
||||
let { Point, points, Path, paths, measurements, options } = part.shorthand();
|
||||
|
||||
let width = measurements.headCircumference * options.widthRatio;
|
||||
let length = measurements.headCircumference * options.lengthRatio;
|
||||
|
||||
points.edgeLeft = new Point(points.topLeft.x, points.left.y);
|
||||
points.edgeRight = new Point(points.topRight.x, points.right.y);
|
||||
points.edgeTop = new Point(0, points.topLeft.y);
|
||||
|
||||
points.edgeLeftCp = points.edgeLeft.shiftFractionTowards(points.topLeft, 0.5);
|
||||
points.edgeRightCp = points.edgeLeftCp.flipX();
|
||||
points.edgeTopLeftCp = points.edgeTop.shiftFractionTowards(
|
||||
points.topLeft,
|
||||
0.5
|
||||
);
|
||||
points.edgeTopRightCp = points.edgeTopLeftCp.flipX();
|
||||
|
||||
paths.rect = new Path()
|
||||
.move(points.edgeTop)
|
||||
.curve(points.edgeTopLeftCp, points.edgeLeftCp, points.edgeLeft)
|
||||
.line(points.bottomLeft)
|
||||
.line(points.bottomRight)
|
||||
.line(points.edgeRight)
|
||||
.curve(points.edgeRightCp, points.edgeTopRightCp, points.edgeTop)
|
||||
.close();
|
||||
|
||||
// Complete?
|
||||
if (complete) {
|
||||
if (sa) {
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
}
|
||||
}
|
||||
|
||||
return part;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue