From 05ad74490e3d1f9c44a39a4fb6d3b59739fcb3ab Mon Sep 17 00:00:00 2001 From: Natalia Sayang Date: Wed, 20 Mar 2024 00:49:55 +0000 Subject: [PATCH] Minor pattern tutorial edits --- .../part2/avoiding-overlap/en.md | 34 +++--------------- .../part2/creating-the-closure/en.md | 36 ++++++++----------- .../pattern-design/part2/draft-method/en.md | 2 ++ .../part2/drawing-the-straps/en.md | 18 +++------- .../part2/rounding-the-corners/en.md | 2 -- .../part2/shaping-the-straps/en.md | 6 ++++ 6 files changed, 32 insertions(+), 66 deletions(-) diff --git a/markdown/dev/tutorials/pattern-design/part2/avoiding-overlap/en.md b/markdown/dev/tutorials/pattern-design/part2/avoiding-overlap/en.md index 684d36ddc77..1b1017a45a3 100644 --- a/markdown/dev/tutorials/pattern-design/part2/avoiding-overlap/en.md +++ b/markdown/dev/tutorials/pattern-design/part2/avoiding-overlap/en.md @@ -142,15 +142,6 @@ function draftBib({ 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() - .addClass('fabric') - /* * Shape the straps */ @@ -203,11 +194,8 @@ function draftBib({ } } // highlight-end + /* - * Always draw your path at the end - * after you've manipulated your points - */ - /* * Now, adapt our `rect` path so it's no longer a rectangle: */ paths.rect = new Path() @@ -227,7 +215,7 @@ function draftBib({ Once we have our list of points to rotate, we can rotate them. How far? Until the strap no longer overlaps. -```src/bib.mjs +```design/src/bib.mjs function draftBib({ Path, Point, @@ -312,15 +300,6 @@ function draftBib({ 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() - .addClass('fabric') - /* * Shape the straps */ @@ -372,6 +351,7 @@ function draftBib({ } } + // highlight-start /* * This is the list of points we need to rotate * to move our strap out of the way @@ -427,15 +407,10 @@ function draftBib({ hide: false, classes: 'contrast dotted', }) - + // highlight-end /* - * Always draw your path at the end - * after you've manipulated your points - */ - /* * Now, adapt our `rect` path so it's no longer a rectangle: */ - paths.rect = new Path() .move(points.edgeTop) .curve(points.edgeTopLeftCp, points.edgeLeftCp, points.edgeLeft) @@ -444,7 +419,6 @@ function draftBib({ .line(points.edgeRight) .curve(points.edgeRightCp, points.edgeTopRightCp, points.edgeTop) .close() - // highlight-end return part } diff --git a/markdown/dev/tutorials/pattern-design/part2/creating-the-closure/en.md b/markdown/dev/tutorials/pattern-design/part2/creating-the-closure/en.md index 5e82b6e65b2..298fb527992 100644 --- a/markdown/dev/tutorials/pattern-design/part2/creating-the-closure/en.md +++ b/markdown/dev/tutorials/pattern-design/part2/creating-the-closure/en.md @@ -115,15 +115,6 @@ function draftBib({ 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() - .addClass('fabric') - /* * Shape the straps */ @@ -139,18 +130,6 @@ function draftBib({ ) points.edgeTopRightCp = points.edgeTopLeftCp.flipX() - /* - * Now, adapt our `rect` path so it's no longer a rectangle: - */ - 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() - // highlight-start // Round the straps const strap = points.edgeTop.dy(points.top) @@ -174,7 +153,22 @@ function draftBib({ hide: false }) // highlight-end + + /* + * Now, adapt our `rect` path so it's no longer a rectangle: + */ + 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() + return part } ``` + +Notice that we always draw our path at the end after we've manipulated our points. \ No newline at end of file diff --git a/markdown/dev/tutorials/pattern-design/part2/draft-method/en.md b/markdown/dev/tutorials/pattern-design/part2/draft-method/en.md index 36aad0f4f89..22fdbb3f67c 100644 --- a/markdown/dev/tutorials/pattern-design/part2/draft-method/en.md +++ b/markdown/dev/tutorials/pattern-design/part2/draft-method/en.md @@ -63,10 +63,12 @@ Change the function to look like this: ```design/src/bib.mjs function draftBib({ +// highlight-start Path, Point, paths, points, +// highlight-end part, }) { diff --git a/markdown/dev/tutorials/pattern-design/part2/drawing-the-straps/en.md b/markdown/dev/tutorials/pattern-design/part2/drawing-the-straps/en.md index 1b5b85d3468..509f6e1a8dc 100644 --- a/markdown/dev/tutorials/pattern-design/part2/drawing-the-straps/en.md +++ b/markdown/dev/tutorials/pattern-design/part2/drawing-the-straps/en.md @@ -104,19 +104,6 @@ function draftBib({ points.bottomLeft = points.topLeft.shift(-90, length) points.bottomRight = points.topRight.shift(-90, length) - // strikeout-start - /* Remove this path - paths.rect = new Path() - .move(points.topLeft) - .line(points.bottomLeft) - .line(points.bottomRight) - .line(points.topRight) - .line(points.topLeft) - .close() - .addClass('fabric') - */ - // strikeout-end - /* * Shape the straps */ @@ -180,6 +167,11 @@ function draftBib({ } } + /* + * This is the list of points we need to rotate + * to move our strap out of the way + */ + const rotateThese = [ "edgeTopLeftCp", "edgeTop", diff --git a/markdown/dev/tutorials/pattern-design/part2/rounding-the-corners/en.md b/markdown/dev/tutorials/pattern-design/part2/rounding-the-corners/en.md index 6b889b73227..26189ce4eef 100644 --- a/markdown/dev/tutorials/pattern-design/part2/rounding-the-corners/en.md +++ b/markdown/dev/tutorials/pattern-design/part2/rounding-the-corners/en.md @@ -8,8 +8,6 @@ We already know how to round corners, we'll have the `round` macro take care of With our corners rounded, we should also update our path. Fortunately, we merely have to update the start of it. -We'll rename `paths.rect` to `paths.seam`. - ```design/src/bib.mjs function draftBib({ diff --git a/markdown/dev/tutorials/pattern-design/part2/shaping-the-straps/en.md b/markdown/dev/tutorials/pattern-design/part2/shaping-the-straps/en.md index e291b121287..ee607993267 100644 --- a/markdown/dev/tutorials/pattern-design/part2/shaping-the-straps/en.md +++ b/markdown/dev/tutorials/pattern-design/part2/shaping-the-straps/en.md @@ -102,6 +102,10 @@ function draftBib({ points.bottomLeft = points.topLeft.shift(-90, length) points.bottomRight = points.topRight.shift(-90, length) +// strikeout-start +/* +* Remove this path + paths.rect = new Path() .move(points.topLeft) .line(points.bottomLeft) @@ -110,6 +114,8 @@ function draftBib({ .line(points.topLeft) .close() .addClass('fabric') +*/ +// strikeout-end // highlight-start /*