fix(markdown): Move caption to children
This commit is contained in:
parent
76d13e3fa3
commit
7bebd8cf07
96 changed files with 304 additions and 213 deletions
|
@ -11,10 +11,9 @@ pattern is generated by FreeSewing.
|
||||||
This illustration is a good starting point to gain a better
|
This illustration is a good starting point to gain a better
|
||||||
understanding of the structure of a FreeSewing pattern:
|
understanding of the structure of a FreeSewing pattern:
|
||||||
|
|
||||||
<Example
|
<Example part="docs_overview">
|
||||||
part="docs_overview"
|
A schematic overview of FreeSewing
|
||||||
caption="A schematic overview of FreeSewing"
|
</Example>
|
||||||
/>
|
|
||||||
|
|
||||||
If we look at our image, it can be divided into three areas:
|
If we look at our image, it can be divided into three areas:
|
||||||
|
|
||||||
|
@ -24,7 +23,7 @@ If we look at our image, it can be divided into three areas:
|
||||||
|
|
||||||
Let's take a closer look at everything that is contained within our central **Pattern** box:
|
Let's take a closer look at everything that is contained within our central **Pattern** box:
|
||||||
|
|
||||||
<ReadMore list />
|
<ReadMore />
|
||||||
|
|
||||||
<Note>
|
<Note>
|
||||||
|
|
||||||
|
|
|
@ -3,11 +3,9 @@ title: Parts
|
||||||
order: 20
|
order: 20
|
||||||
---
|
---
|
||||||
|
|
||||||
<Example
|
<Example part="docs_overview" options={{focus: "Part"}}>
|
||||||
part="docs_overview"
|
Parts divide your pattern into re-usable components
|
||||||
caption="Parts divide your pattern into re-usable components"
|
</Example>
|
||||||
options={{focus: "Part"}}
|
|
||||||
/>
|
|
||||||
|
|
||||||
Parts are a container for the points, paths, and snippets of (a part of) your pattern.
|
Parts are a container for the points, paths, and snippets of (a part of) your pattern.
|
||||||
They are also re-usable by other patterns, which makes them a powerful tool to build
|
They are also re-usable by other patterns, which makes them a powerful tool to build
|
||||||
|
|
|
@ -3,11 +3,9 @@ title: Paths
|
||||||
order: 40
|
order: 40
|
||||||
---
|
---
|
||||||
|
|
||||||
<Example
|
<Example part="docs_overview" options={{focus: "Paths"}}>
|
||||||
part="docs_overview"
|
Paths are the lines and curves of your pattern
|
||||||
caption="Paths are the lines and curves of your pattern"
|
</Example>
|
||||||
options={{focus: "Paths"}}
|
|
||||||
/>
|
|
||||||
|
|
||||||
Paths are the lines and curves that make up your pattern.
|
Paths are the lines and curves that make up your pattern.
|
||||||
|
|
||||||
|
|
|
@ -3,11 +3,9 @@ title: Pattern
|
||||||
order: 80
|
order: 80
|
||||||
---
|
---
|
||||||
|
|
||||||
<Example
|
<Example part="docs_overview" options={{focus: "Pattern"}}>
|
||||||
part="docs_overview"
|
The pattern you create will be a constructor for instances of your pattern
|
||||||
caption="The pattern you create will be a constructor for instances of your pattern"
|
</Example>
|
||||||
options={{focus: "Pattern"}}
|
|
||||||
/>
|
|
||||||
|
|
||||||
Last but not least, we've arrived at the level of the pattern itself.
|
Last but not least, we've arrived at the level of the pattern itself.
|
||||||
The pattern is a container that holds all your parts, along with the configuration
|
The pattern is a container that holds all your parts, along with the configuration
|
||||||
|
|
|
@ -3,11 +3,9 @@ title: Points
|
||||||
order: 30
|
order: 30
|
||||||
---
|
---
|
||||||
|
|
||||||
<Example
|
<Example part="docs_overview" options={{focus: "Points"}}>
|
||||||
part="docs_overview"
|
Points store coordinates
|
||||||
caption="Points store coordinates"
|
</Example>
|
||||||
options={{focus: "Points"}}
|
|
||||||
/>
|
|
||||||
|
|
||||||
Developing a pattern with FreeSewing is similar to doing it on paper.
|
Developing a pattern with FreeSewing is similar to doing it on paper.
|
||||||
But instead of using a pencil and paper, you'll be writing code.
|
But instead of using a pencil and paper, you'll be writing code.
|
||||||
|
|
|
@ -3,11 +3,9 @@ title: Snippets
|
||||||
order: 50
|
order: 50
|
||||||
---
|
---
|
||||||
|
|
||||||
<Example
|
<Example part="docs_overview" options={{focus: "Snippets"}}>
|
||||||
part="docs_overview"
|
Snippets are little embelishments that go on your pattern
|
||||||
caption="Snippets are little embelishments that go on your pattern"
|
</Example>
|
||||||
options={{focus: "Snippets"}}
|
|
||||||
/>
|
|
||||||
|
|
||||||
Snippets are little embellishments you can use and re-use on your pattern.
|
Snippets are little embellishments you can use and re-use on your pattern.
|
||||||
They are typically used for things like logos or buttons.
|
They are typically used for things like logos or buttons.
|
||||||
|
@ -20,8 +18,7 @@ Each snippet must have:
|
||||||
Since our example image does not have any snippets in it, here's another example
|
Since our example image does not have any snippets in it, here's another example
|
||||||
of a `button`, `buttonhole`, and `logo` snippet added to a FreeSewing pattern:
|
of a `button`, `buttonhole`, and `logo` snippet added to a FreeSewing pattern:
|
||||||
|
|
||||||
<Example
|
<Example part="snippet">
|
||||||
part="snippet"
|
An example of the use of snippets
|
||||||
caption="An example of the use of snippets"
|
</Example>
|
||||||
/>
|
|
||||||
|
|
||||||
|
|
|
@ -3,11 +3,9 @@ title: Store
|
||||||
order: 60
|
order: 60
|
||||||
---
|
---
|
||||||
|
|
||||||
<Example
|
<Example part="docs_overview" options={{focus: "Store"}}>
|
||||||
part="docs_overview"
|
The store provides pattern-wide key/value storage
|
||||||
caption="The store provides pattern-wide key/value storage"
|
</Example>
|
||||||
options={{focus: "Store"}}
|
|
||||||
/>
|
|
||||||
|
|
||||||
The store provides key-value storage that is shared across your pattern.
|
The store provides key-value storage that is shared across your pattern.
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,9 @@ The coordinate system in FreeSewing -- and in SVG -- follows the same rules as t
|
||||||
You start at the top-left, and as you go to the right, the X-coordinate will increase.
|
You start at the top-left, and as you go to the right, the X-coordinate will increase.
|
||||||
As you go down the Y-coordinate will increase.
|
As you go down the Y-coordinate will increase.
|
||||||
|
|
||||||
<Example part="docs_coords" caption="The SVG coordinate system" />
|
<Example part="docs_coords">
|
||||||
|
The SVG coordinate system
|
||||||
|
</Example>
|
||||||
|
|
||||||
The image above illustrates both the X-axis and Y-axis.
|
The image above illustrates both the X-axis and Y-axis.
|
||||||
On the X-axis, `20` is further to the right than `10`.
|
On the X-axis, `20` is further to the right than `10`.
|
||||||
|
|
|
@ -27,4 +27,7 @@ See [Using attributes](/howtos/code/attributes/) for details on how to set attri
|
||||||
|
|
||||||
Below is an example of the available snippets, and the use of the `data-scale` and `data-rotate` attributes:
|
Below is an example of the available snippets, and the use of the `data-scale` and `data-rotate` attributes:
|
||||||
|
|
||||||
<Example pattern="rendertest" caption="Overview of available snippets" options={{ colors: false, text: false, macros: false, circles: false, widthHd: false }} />
|
<Example pattern="rendertest" options={{ colors: false, text: false, macros: false, circles: false, widthHd: false }}>
|
||||||
|
Overview of available snippets
|
||||||
|
</Example>
|
||||||
|
|
||||||
|
|
|
@ -16,10 +16,9 @@ points.anchor = new Point(100, 25)
|
||||||
.attr("data-text-class", "center");
|
.attr("data-text-class", "center");
|
||||||
```
|
```
|
||||||
|
|
||||||
<Example
|
<Example part="point_attr">
|
||||||
part="point_attr"
|
Text inserted in a FreeSewing pattern
|
||||||
caption="Text inserted in a FreeSewing pattern"
|
</Example>
|
||||||
/>
|
|
||||||
|
|
||||||
<Note>
|
<Note>
|
||||||
|
|
||||||
|
@ -46,7 +45,7 @@ paths.example = new Path()
|
||||||
.attr("data-text-class", "text-xs center");
|
.attr("data-text-class", "text-xs center");
|
||||||
```
|
```
|
||||||
|
|
||||||
<Example
|
<Example part="path_attr">
|
||||||
part="path_attr"
|
Text on a path
|
||||||
caption="Text on a path"
|
</Example>
|
||||||
/>
|
|
||||||
|
|
|
@ -12,5 +12,7 @@ to the radius of the circle you want to draw.
|
||||||
|
|
||||||
In addition, all attributes that have a `data-circle-` prefix will apply to the circle, rather than the point.
|
In addition, all attributes that have a `data-circle-` prefix will apply to the circle, rather than the point.
|
||||||
|
|
||||||
<Example pattern="rendertest" caption="Circles" options={{ colors: false, text: false, macros: false, snippets: false, widthHd: false }} />
|
<Example pattern="rendertest" options={{ colors: false, text: false, macros: false, snippets: false, widthHd: false }}>
|
||||||
|
Circles
|
||||||
|
</Example>
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,9 @@ title: bartack
|
||||||
The `bartack` macro allows you to add a *bartack* marker to your sewing pattern.
|
The `bartack` macro allows you to add a *bartack* marker to your sewing pattern.
|
||||||
It is provided by the [bartack plugin](/reference/plugins/bartack/).
|
It is provided by the [bartack plugin](/reference/plugins/bartack/).
|
||||||
|
|
||||||
<Example part="plugin_bartack" caption="Example of the bartack macro" />
|
<Example part="plugin_bartack">
|
||||||
|
Example of the bartack macro
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
points.a = new Point(15, 15)
|
points.a = new Point(15, 15)
|
||||||
|
|
|
@ -6,7 +6,9 @@ The `bartackAlong` macro allows you to add a *bartack* marker to your sewing pat
|
||||||
More specifically, a bartack along a path.
|
More specifically, a bartack along a path.
|
||||||
It is provided by the [bartack plugin](/reference/plugins/bartack/).
|
It is provided by the [bartack plugin](/reference/plugins/bartack/).
|
||||||
|
|
||||||
<Example part="plugin_bartackalong" caption="Example of the bartackAlong macro" />
|
<Example part="plugin_bartackalong">
|
||||||
|
Example of the bartackAlong macro
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
points.a = new Point(15, 15)
|
points.a = new Point(15, 15)
|
||||||
|
|
|
@ -6,7 +6,9 @@ The `bartackFractionAlong` macro allows you to add a *bartack* marker to your se
|
||||||
More specifically, a bartack along a fraction of a path.
|
More specifically, a bartack along a fraction of a path.
|
||||||
It is provided by the [bartack plugin](/reference/plugins/bartack/).
|
It is provided by the [bartack plugin](/reference/plugins/bartack/).
|
||||||
|
|
||||||
<Example part="plugin_bartackfractionalong" caption="Example of the bartackFractionAlong macro" />
|
<Example part="plugin_bartackfractionalong">
|
||||||
|
Example of the bartackFractionAlong macro
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
points.a = new Point(15, 15)
|
points.a = new Point(15, 15)
|
||||||
|
|
|
@ -5,7 +5,9 @@ title: cutonfold
|
||||||
The `cutonfold` macro adds a *cut on fold* indicator to your pattern.
|
The `cutonfold` macro adds a *cut on fold* indicator to your pattern.
|
||||||
It is provided by the [cutonfold plugin](/reference/plugins/cutonfold).
|
It is provided by the [cutonfold plugin](/reference/plugins/cutonfold).
|
||||||
|
|
||||||
<Example part="plugin_cutonfold" caption="Example of the cut on fold indicator added by this macro" />
|
<Example part="plugin_cutonfold">
|
||||||
|
Example of the cut on fold indicator added by this macro
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
macro('cutonfold', {
|
macro('cutonfold', {
|
||||||
|
|
|
@ -5,7 +5,9 @@ title: grainline
|
||||||
The `grainline` macro adds a *grainline* indicator to your pattern.
|
The `grainline` macro adds a *grainline* indicator to your pattern.
|
||||||
It is provided by the [grainline plugin](/reference/plugins/grainline/).
|
It is provided by the [grainline plugin](/reference/plugins/grainline/).
|
||||||
|
|
||||||
<Example part="plugin_grainline" caption="Example of the grainline indicator added by this macro" />
|
<Example part="plugin_grainline">
|
||||||
|
Example of the grainline indicator added by this macro
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
macro("grainline", {
|
macro("grainline", {
|
||||||
|
|
|
@ -5,10 +5,9 @@ title: hd
|
||||||
The `hd` macro adds a *horizontal dimension* to your pattern.
|
The `hd` macro adds a *horizontal dimension* to your pattern.
|
||||||
It is provided by the [dimension plugin](/reference/plugins/dimension/).
|
It is provided by the [dimension plugin](/reference/plugins/dimension/).
|
||||||
|
|
||||||
<Example
|
<Example part="point_dx">
|
||||||
part="point_dx"
|
An example of a horizontal dimension
|
||||||
caption="An example of a horizontal dimension"
|
</Example>
|
||||||
/>
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
macro('hd', {
|
macro('hd', {
|
||||||
|
|
|
@ -5,10 +5,9 @@ title: ld
|
||||||
The `ld` macro adds a *linear dimension* to your pattern.
|
The `ld` macro adds a *linear dimension* to your pattern.
|
||||||
It is provided by the [dimension plugin](/reference/plugins/dimension/).
|
It is provided by the [dimension plugin](/reference/plugins/dimension/).
|
||||||
|
|
||||||
<Example
|
<Example part="point_dist">
|
||||||
part="point_dist"
|
An example of a linear dimension
|
||||||
caption="An example of a linear dimension"
|
</Example>
|
||||||
/>
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
macro('ld', {
|
macro('ld', {
|
||||||
|
|
|
@ -8,7 +8,9 @@ users to verify their pattern is printed to scale.
|
||||||
The `miniscale` macro is provided by the [scalebox plugin](/reference/plugins/scalebox).
|
The `miniscale` macro is provided by the [scalebox plugin](/reference/plugins/scalebox).
|
||||||
It is the mini version of [the scalebox macro](/reference/macros/scalebox/).
|
It is the mini version of [the scalebox macro](/reference/macros/scalebox/).
|
||||||
|
|
||||||
<Example part="plugin_scalebox" caption="Example of a scalebox (left) and miniscale (right)" />
|
<Example part="plugin_scalebox">
|
||||||
|
Example of a scalebox (left) and miniscale (right)
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
macro('miniscale', {
|
macro('miniscale', {
|
||||||
|
|
|
@ -5,7 +5,9 @@ title: mirror
|
||||||
The `mirror` macro allows you to mirror points and/or paths around a mirror line.
|
The `mirror` macro allows you to mirror points and/or paths around a mirror line.
|
||||||
It is provided by the [mirror plugin](/reference/plugins/mirror/).
|
It is provided by the [mirror plugin](/reference/plugins/mirror/).
|
||||||
|
|
||||||
<Example part="plugin_mirror" caption="Example of the mirror plugin" />
|
<Example part="plugin_mirror">
|
||||||
|
Example of the mirror plugin
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
points.a = new Point(5,5)
|
points.a = new Point(5,5)
|
||||||
|
|
|
@ -5,7 +5,9 @@ title: pd
|
||||||
The `pd` macro adds a *path dimension* to your pattern, indicating the length of a path.
|
The `pd` macro adds a *path dimension* to your pattern, indicating the length of a path.
|
||||||
It is provided by the [dimension plugin](/reference/plugins/dimension/).
|
It is provided by the [dimension plugin](/reference/plugins/dimension/).
|
||||||
|
|
||||||
<Example part="path_length" caption="Example of a multiple path dimensions" />
|
<Example part="path_length"><
|
||||||
|
Example of a multiple path dimensions
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
macro('pd', {
|
macro('pd', {
|
||||||
|
|
|
@ -6,7 +6,9 @@ The `round` macro rounds a corner. It is provided by the [round plugin](/referen
|
||||||
|
|
||||||
Note that this is only intended for 90 degree corners.
|
Note that this is only intended for 90 degree corners.
|
||||||
|
|
||||||
<Example part="plugin_round" caption="Example of corners rounded with the round plugin" />
|
<Example part="plugin_round">
|
||||||
|
Example of corners rounded with the round plugin
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
macro('round', {
|
macro('round', {
|
||||||
|
|
|
@ -7,7 +7,9 @@ users to verify their pattern is printed to scale.
|
||||||
|
|
||||||
The `scalebox` macro is provided by the [scalebox plugin](/reference/plugins/scalebox).
|
The `scalebox` macro is provided by the [scalebox plugin](/reference/plugins/scalebox).
|
||||||
|
|
||||||
<Example part="plugin_scalebox" caption="Example of the scalebox added by this macro" />
|
<Example part="plugin_scalebox">
|
||||||
|
Example of the scalebox added by this macro
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
macro('scalebox', {
|
macro('scalebox', {
|
||||||
|
|
|
@ -24,7 +24,9 @@ So the only purpose of this method is to save your some typing.
|
||||||
|
|
||||||
</Tip>
|
</Tip>
|
||||||
|
|
||||||
<Example part="path__curve" caption="Example of the Path._curve() method" />
|
<Example part="path__curve">
|
||||||
|
Example of the Path.\_curve() method
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Path, paths } = part.shorthand();
|
let { Point, points, Path, paths } = part.shorthand();
|
||||||
|
|
|
@ -16,7 +16,9 @@ This allows you to chain different calls together as in the example below.
|
||||||
|
|
||||||
If the third parameter is set to `true` it will call `this.attributes.set()` instead, thereby overwriting the value of the attribute.
|
If the third parameter is set to `true` it will call `this.attributes.set()` instead, thereby overwriting the value of the attribute.
|
||||||
|
|
||||||
<Example part="path_attr" caption="Example of the Path.attr() method" />
|
<Example part="path_attr">
|
||||||
|
Example of the Path.attr() method
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Path, paths } = part.shorthand();
|
let { Point, points, Path, paths } = part.shorthand();
|
||||||
|
|
|
@ -9,7 +9,9 @@ Path path.clone()
|
||||||
|
|
||||||
Returns a new Path that is a deep copy of this path.
|
Returns a new Path that is a deep copy of this path.
|
||||||
|
|
||||||
<Example part="path_clone" caption="Example of the Path.clone() method" />
|
<Example part="path_clone">
|
||||||
|
Example of the Path.clone() method
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Path, paths } = part.shorthand();
|
let { Point, points, Path, paths } = part.shorthand();
|
||||||
|
|
|
@ -8,7 +8,9 @@ Path path.close()
|
||||||
|
|
||||||
Closes a path by drawing a straight line from the current position to the path's start.
|
Closes a path by drawing a straight line from the current position to the path's start.
|
||||||
|
|
||||||
<Example part="path_close" caption="Example of the Path.close() method" />
|
<Example part="path_close">
|
||||||
|
Example of the Path.close() method
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Path, paths } = part.shorthand();
|
let { Point, points, Path, paths } = part.shorthand();
|
||||||
|
|
|
@ -8,7 +8,9 @@ Path path.curve(Point cp1, Point cp2, Point to)
|
||||||
|
|
||||||
Draws a cubic Bezier curve from the current position via two control points to a given endpoint.
|
Draws a cubic Bezier curve from the current position via two control points to a given endpoint.
|
||||||
|
|
||||||
<Example part="path_curve" caption="Example of the Path.curve() method" />
|
<Example part="path_curve">
|
||||||
|
Example of the Path.curve() method
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Path, paths } = part.shorthand();
|
let { Point, points, Path, paths } = part.shorthand();
|
||||||
|
|
|
@ -24,7 +24,9 @@ So the only purpose of this method is to save your some typing;
|
||||||
|
|
||||||
</Tip>
|
</Tip>
|
||||||
|
|
||||||
<Example part="path_curve_" caption="Example of the Path.curve_() method" />
|
<Example part="path_curve_">
|
||||||
|
Example of the Path.curve\_() method
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Path, paths } = part.shorthand();
|
let { Point, points, Path, paths } = part.shorthand();
|
||||||
|
|
|
@ -9,7 +9,9 @@ array path.divide()
|
||||||
Breaks a path apart in an array of atomic paths. An atomic path is a path that can't be divided further and is
|
Breaks a path apart in an array of atomic paths. An atomic path is a path that can't be divided further and is
|
||||||
always made up of one move + one drawing operation.
|
always made up of one move + one drawing operation.
|
||||||
|
|
||||||
<Example part="path_divide" caption="Example of the Path.divide() method" />
|
<Example part="path_divide">
|
||||||
|
Example of the Path.divide() method
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Path, paths } = part.shorthand();
|
let { Point, points, Path, paths } = part.shorthand();
|
||||||
|
|
|
@ -17,7 +17,9 @@ Returns the Point object at the edge of the path you specify. Edge must be one o
|
||||||
- `bottomLeft`
|
- `bottomLeft`
|
||||||
- `bottomRight`
|
- `bottomRight`
|
||||||
|
|
||||||
<Example part="path_edge" caption="Example of the Path.edge() method" />
|
<Example part="path_edge">
|
||||||
|
Example of the Path.edge() method
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Path, paths, Snippet, snippets } = part.shorthand();
|
let { Point, points, Path, paths, Snippet, snippets } = part.shorthand();
|
||||||
|
|
|
@ -8,7 +8,9 @@ Point path.end()
|
||||||
|
|
||||||
Returns the Point object at the end of the path.
|
Returns the Point object at the end of the path.
|
||||||
|
|
||||||
<Example part="path_end" caption="Example of the Path.end() method" />
|
<Example part="path_end">
|
||||||
|
Example of the Path.end() method
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Path, paths, Snippet, snippets } = part.shorthand();
|
let { Point, points, Path, paths, Snippet, snippets } = part.shorthand();
|
||||||
|
|
|
@ -19,7 +19,9 @@ If you do know, use one of the intersection methods in [Utils](/reference/api/ut
|
||||||
|
|
||||||
</Tip>
|
</Tip>
|
||||||
|
|
||||||
<Example part="path_intersects" caption="Example of the Path.intersects() method" />
|
<Example part="path_intersects">
|
||||||
|
Example of the Path.intersects() method
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Path, paths, Snippet, snippets } = part.shorthand();
|
let { Point, points, Path, paths, Snippet, snippets } = part.shorthand();
|
||||||
|
|
|
@ -8,7 +8,9 @@ array|false path.intersectsX(float x)
|
||||||
|
|
||||||
Returns the Point object(s) where the path intersects with a given X-value.
|
Returns the Point object(s) where the path intersects with a given X-value.
|
||||||
|
|
||||||
<Example part="path_intersectsx" caption="Example of the Path.intersectsX() method" />
|
<Example part="path_intersectsx">
|
||||||
|
Example of the Path.intersectsX() method
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Path, paths, Snippet, snippets } = part.shorthand();
|
let { Point, points, Path, paths, Snippet, snippets } = part.shorthand();
|
||||||
|
|
|
@ -8,7 +8,9 @@ array|false path.intersectsY(float y)
|
||||||
|
|
||||||
Returns the Point object(s) where the path intersects with a given Y-value.
|
Returns the Point object(s) where the path intersects with a given Y-value.
|
||||||
|
|
||||||
<Example part="path_intersectsy" caption="Example of the Path.intersectsY() method" />
|
<Example part="path_intersectsy">
|
||||||
|
Example of the Path.intersectsY() method
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Path, paths, Snippet, snippets } = part.shorthand();
|
let { Point, points, Path, paths, Snippet, snippets } = part.shorthand();
|
||||||
|
|
|
@ -14,7 +14,9 @@ You cannot join a closed path to another path
|
||||||
|
|
||||||
</Warning>
|
</Warning>
|
||||||
|
|
||||||
<Example part="path_join" caption="Example of the Path.join() method" />
|
<Example part="path_join">
|
||||||
|
Example of the Path.join() method
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Path, paths } = part.shorthand();
|
let { Point, points, Path, paths } = part.shorthand();
|
||||||
|
|
|
@ -8,7 +8,9 @@ float path.length()
|
||||||
|
|
||||||
Returns the length of the path.
|
Returns the length of the path.
|
||||||
|
|
||||||
<Example part="path_length" caption="Example of the Path.length() method" />
|
<Example part="path_length">
|
||||||
|
Example of the Path.length() method
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Path, paths, macro } = part.shorthand();
|
let { Point, points, Path, paths, macro } = part.shorthand();
|
||||||
|
|
|
@ -8,7 +8,9 @@ Path path.line(Point to)
|
||||||
|
|
||||||
Draws a straight line from the current position to a given point.
|
Draws a straight line from the current position to a given point.
|
||||||
|
|
||||||
<Example part="path_line" caption="Example of the Path.line() method" />
|
<Example part="path_line">
|
||||||
|
Example of the Path.line() method
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Path, paths } = part.shorthand();
|
let { Point, points, Path, paths } = part.shorthand();
|
||||||
|
|
|
@ -30,7 +30,9 @@ paths.example = new Path()
|
||||||
</Tip>
|
</Tip>
|
||||||
|
|
||||||
|
|
||||||
<Example part="path_move" caption="Example of the Path.move() method" />
|
<Example part="path_move">
|
||||||
|
Example of the Path.move() method
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Path, paths } = part.shorthand();
|
let { Point, points, Path, paths } = part.shorthand();
|
||||||
|
|
|
@ -8,7 +8,9 @@ Path path.offset(float distance)
|
||||||
|
|
||||||
Returns a new Path that is offset by distance from the original path.
|
Returns a new Path that is offset by distance from the original path.
|
||||||
|
|
||||||
<Example part="path_offset" caption="Example of the Path.offset() method" />
|
<Example part="path_offset">
|
||||||
|
Example of the Path.offset() method
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Path, paths } = part.shorthand();
|
let { Point, points, Path, paths } = part.shorthand();
|
||||||
|
|
|
@ -17,7 +17,9 @@ If you want a deep copy, including the attributes, use `Path.clone().reverse()`.
|
||||||
|
|
||||||
</Note>
|
</Note>
|
||||||
|
|
||||||
<Example part="path_reverse" caption="Example of the Path.reverse() method" />
|
<Example part="path_reverse">
|
||||||
|
Example of the Path.reverse() method
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Path, paths } = part.shorthand();
|
let { Point, points, Path, paths } = part.shorthand();
|
||||||
|
|
|
@ -8,7 +8,9 @@ Point path.shiftAlong(float distance[, int stepsPerMm=25])
|
||||||
|
|
||||||
Returns a point that lies at distance travelled along the path.
|
Returns a point that lies at distance travelled along the path.
|
||||||
|
|
||||||
<Example part="path_shiftalong" caption="Example of the Path.shiftAlong() method" />
|
<Example part="path_shiftalong">
|
||||||
|
Example of the Path.shiftAlong() method
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Path, paths, Snippet, snippets } = part.shorthand();
|
let { Point, points, Path, paths, Snippet, snippets } = part.shorthand();
|
||||||
|
|
|
@ -8,10 +8,9 @@ Point path.shiftFractionAlong(float fraction[, int stepsPerMm=25])
|
||||||
|
|
||||||
Returns a point that lies at fraction of the length of the path travelled along the path.
|
Returns a point that lies at fraction of the length of the path travelled along the path.
|
||||||
|
|
||||||
<Example
|
<Example part="path_shiftfractionalong">
|
||||||
part="path_shiftfractionalong"
|
Example of the Path.shiftFractionAlong() method
|
||||||
caption="Example of the Path.shiftFractionAlong() method"
|
</Example>
|
||||||
/>
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Path, paths, Snippet, snippets } = part.shorthand();
|
let { Point, points, Path, paths, Snippet, snippets } = part.shorthand();
|
||||||
|
|
|
@ -8,10 +8,9 @@ array path.split(Point splitPoint)
|
||||||
|
|
||||||
Splits a path in two halves, on a point along that path that you pass it.
|
Splits a path in two halves, on a point along that path that you pass it.
|
||||||
|
|
||||||
<Example
|
<Example part="path_split">
|
||||||
part="path_split"
|
Example of the Path.split() method
|
||||||
caption="Example of the Path.split() method"
|
</Example>
|
||||||
/>
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Path, paths, Snippet, snippets } = part.shorthand();
|
let { Point, points, Path, paths, Snippet, snippets } = part.shorthand();
|
||||||
|
|
|
@ -8,10 +8,9 @@ Point path.start()
|
||||||
|
|
||||||
Returns the Point object at the start of the path.
|
Returns the Point object at the start of the path.
|
||||||
|
|
||||||
<Example
|
<Example part="path_start">
|
||||||
part="path_start"
|
Example of the Path.start() method
|
||||||
caption="Example of the Path.start() method"
|
</Example>
|
||||||
/>
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Path, paths, Snippet, snippets } = part.shorthand();
|
let { Point, points, Path, paths, Snippet, snippets } = part.shorthand();
|
||||||
|
|
|
@ -10,10 +10,9 @@ Returns a path with
|
||||||
[a translate transform](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/transform#Translate)
|
[a translate transform](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/transform#Translate)
|
||||||
applied.
|
applied.
|
||||||
|
|
||||||
<Example
|
<Example part="path_translate">
|
||||||
part="path_translate"
|
Example of the Path.translate() method
|
||||||
caption="Example of the Path.translate() method"
|
</Example>
|
||||||
/>
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Path, paths, macro } = part.shorthand();
|
let { Point, points, Path, paths, macro } = part.shorthand();
|
||||||
|
|
|
@ -28,10 +28,9 @@ You can see an example of this
|
||||||
|
|
||||||
</Warning>
|
</Warning>
|
||||||
|
|
||||||
<Example
|
<Example part="path_trim">
|
||||||
part="path_trim"
|
Example of the Path.trim() method
|
||||||
caption="Example of the Path.trim() method"
|
</Example>
|
||||||
/>
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Path, paths } = part.shorthand();
|
let { Point, points, Path, paths } = part.shorthand();
|
||||||
|
|
|
@ -13,10 +13,9 @@ float point.angle(Point pointB)
|
||||||
|
|
||||||
## Point.angle() Example
|
## Point.angle() Example
|
||||||
|
|
||||||
<Example
|
<Example part="point_angle">
|
||||||
part="point_angle"
|
An example of the Point.angle() method
|
||||||
caption="An example of the Point.angle() method"
|
</Example>
|
||||||
/>
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Path, paths } = part.shorthand();
|
let { Point, points, Path, paths } = part.shorthand();
|
||||||
|
|
|
@ -22,10 +22,9 @@ If the third parameter is set to `true` it will call [`this.attributes.set()`](/
|
||||||
|
|
||||||
## Point.attr() example
|
## Point.attr() example
|
||||||
|
|
||||||
<Example
|
<Example part="point_attr">
|
||||||
part="point_attr"
|
An example of the Point.attr() method
|
||||||
caption="An example of the Point.attr() method"
|
</Example>
|
||||||
/>
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points } = part.shorthand();
|
let { Point, points } = part.shorthand();
|
||||||
|
|
|
@ -21,10 +21,9 @@ The [`Point.copy()`](reference/api/point/copy/) method will only copy the point'
|
||||||
|
|
||||||
## Point.clone() example
|
## Point.clone() example
|
||||||
|
|
||||||
<Example
|
<Example part="point_clone">
|
||||||
part="point_clone"
|
An example of the Point.clone() method
|
||||||
caption="An example of the Point.clone() method"
|
</Example>
|
||||||
/>
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Snippet, snippets } = part.shorthand();
|
let { Point, points, Snippet, snippets } = part.shorthand();
|
||||||
|
|
|
@ -21,10 +21,9 @@ To also copy the attributes, use [`Point.clone()`](reference/api/point/clone/) i
|
||||||
|
|
||||||
## Point.copy() example
|
## Point.copy() example
|
||||||
|
|
||||||
<Example
|
<Example part="point_copy">
|
||||||
part="point_copy"
|
An example of the Point.copy() method
|
||||||
caption="An example of the Point.copy() method"
|
</Example>
|
||||||
/>
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Snippet, snippets } = part.shorthand();
|
let { Point, points, Snippet, snippets } = part.shorthand();
|
||||||
|
|
7
markdown/dev/reference/api/point/dist/en.md
vendored
7
markdown/dev/reference/api/point/dist/en.md
vendored
|
@ -12,10 +12,9 @@ float point.dist(Point point)
|
||||||
|
|
||||||
## Point.dist() example
|
## Point.dist() example
|
||||||
|
|
||||||
<Example
|
<Example part="point_dist">
|
||||||
part="point_dist"
|
An example of the Point.dist() method
|
||||||
caption="An example of the Point.dist() method"
|
</Example>
|
||||||
/>
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Path, paths } = part.shorthand()
|
let { Point, points, Path, paths } = part.shorthand()
|
||||||
|
|
|
@ -12,10 +12,9 @@ float point.dx(Point point)
|
||||||
|
|
||||||
## Point.dx() example
|
## Point.dx() example
|
||||||
|
|
||||||
<Example
|
<Example part="point_dx">
|
||||||
part="point_dx"
|
An example of the Point.dx() method
|
||||||
caption="An example of the Point.dx() method"
|
</Example>
|
||||||
/>
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Path, paths } = part.shorthand()
|
let { Point, points, Path, paths } = part.shorthand()
|
||||||
|
|
|
@ -12,10 +12,9 @@ float point.dy(Point point)
|
||||||
|
|
||||||
## Point.dy() example
|
## Point.dy() example
|
||||||
|
|
||||||
<Example
|
<Example part="point_dy">
|
||||||
part="point_dy"
|
An example of the Point.dy() method
|
||||||
caption="An example of the Point.dy() method"
|
</Example>
|
||||||
/>
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Path, paths } = part.shorthand()
|
let { Point, points, Path, paths } = part.shorthand()
|
||||||
|
|
|
@ -13,10 +13,9 @@ Point point.flipX(Point mirror = false)
|
||||||
|
|
||||||
## Point.flipX() example
|
## Point.flipX() example
|
||||||
|
|
||||||
<Example
|
<Example part="point_flipx">
|
||||||
part="point_flipx"
|
An example of the Point.flipX() method
|
||||||
caption="An example of the Point.flipX() method"
|
</Example>
|
||||||
/>
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Path, paths } = part.shorthand();
|
let { Point, points, Path, paths } = part.shorthand();
|
||||||
|
|
|
@ -13,10 +13,9 @@ Point point.flipY(Point mirror = false)
|
||||||
|
|
||||||
## Point.flipY() example
|
## Point.flipY() example
|
||||||
|
|
||||||
<Example
|
<Example part="point_flipy">
|
||||||
part="point_flipy"
|
An example of the Point.flipY() method
|
||||||
caption="An example of the Point.flipY() method"
|
</Example>
|
||||||
/>
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Path, paths } = part.shorthand();
|
let { Point, points, Path, paths } = part.shorthand();
|
||||||
|
|
|
@ -15,10 +15,9 @@ Point point.rotate(float angle, Point center)
|
||||||
|
|
||||||
## Point.rotate() example
|
## Point.rotate() example
|
||||||
|
|
||||||
<Example
|
<Example part="point_rotate">
|
||||||
part="point_rotate"
|
An example of the4Point.rotate() method
|
||||||
caption="An example of the Point.rotate() method"
|
</Example>
|
||||||
/>
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Path, paths, Snippet, snippets } = part.shorthand();
|
let { Point, points, Path, paths, Snippet, snippets } = part.shorthand();
|
||||||
|
|
|
@ -13,10 +13,9 @@ Point point.shift(float angle, float distance)
|
||||||
|
|
||||||
## Point.shift() example
|
## Point.shift() example
|
||||||
|
|
||||||
<Example
|
<Example part="point_shift">
|
||||||
part="point_shift"
|
An example of the Point.shift() method
|
||||||
caption="An example of the Point.shift() method"
|
</Example>
|
||||||
/>
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, macro } = part.shorthand();
|
let { Point, points, macro } = part.shorthand();
|
||||||
|
|
|
@ -18,10 +18,9 @@ Point point.shiftFractionTowards(Point target, float fraction)
|
||||||
|
|
||||||
## Point.shiftFractionTowards() example
|
## Point.shiftFractionTowards() example
|
||||||
|
|
||||||
<Example
|
<Example part="point_shiftfractiontowards">
|
||||||
part="point_shiftfractiontowards"
|
An example of the Point.shiftFractionTowards() method
|
||||||
caption="An example of the Point.shiftFractionTowards() method"
|
</Example>
|
||||||
/>
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Path, paths, macro } = part.shorthand();
|
let { Point, points, Path, paths, macro } = part.shorthand();
|
||||||
|
|
|
@ -12,10 +12,9 @@ Point point.shiftOutwards(Point target, float distance)
|
||||||
|
|
||||||
## Point.shiftOutwards() example
|
## Point.shiftOutwards() example
|
||||||
|
|
||||||
<Example
|
<Example part="point_shiftoutwards">
|
||||||
part="point_shiftoutwards"
|
An example of the Point.shiftOutwards() method
|
||||||
caption="An example of the Point.shiftOutwards() method"
|
</Example>
|
||||||
/>
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Path, paths, macro } = part.shorthand();
|
let { Point, points, Path, paths, macro } = part.shorthand();
|
||||||
|
|
|
@ -14,10 +14,9 @@ Point point.shiftTowards(Point target, float distance)
|
||||||
|
|
||||||
## Point.shiftTowards() example
|
## Point.shiftTowards() example
|
||||||
|
|
||||||
<Example
|
<Example part="point_shifttowards">
|
||||||
part="point_shifttowards"
|
An example of the Point.shiftTowards() method
|
||||||
caption="An example of the Point.shiftTowards() method"
|
</Example>
|
||||||
/>
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Path, paths, macro } = part.shorthand();
|
let { Point, points, Path, paths, macro } = part.shorthand();
|
||||||
|
|
|
@ -24,10 +24,9 @@ bool point.sitsOn(Point check)
|
||||||
|
|
||||||
## Point.sitsOn() example
|
## Point.sitsOn() example
|
||||||
|
|
||||||
<Example
|
<Example part="point_sitson">
|
||||||
part="point_sitson"
|
An example of the Point.sitsOn() method
|
||||||
caption="An example of the Point.sitsOn() method"
|
</Example>
|
||||||
/>
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Snippet, snippets } = part.shorthand();
|
let { Point, points, Snippet, snippets } = part.shorthand();
|
||||||
|
|
|
@ -21,10 +21,9 @@ that this one rounds things down to the nearest integer (thus mm) before checkin
|
||||||
|
|
||||||
## Point.sitsRoughlyOn() example
|
## Point.sitsRoughlyOn() example
|
||||||
|
|
||||||
<Example
|
<Example part="point_sitsroughlyon">
|
||||||
part="point_sitsroughlyon"
|
An example of the Point.sitsRoughlyOn() method
|
||||||
caption="An example of the Point.sitsRoughlyOn() method"
|
</Example>
|
||||||
/>
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Snippet, snippets } = part.shorthand();
|
let { Point, points, Snippet, snippets } = part.shorthand();
|
||||||
|
|
|
@ -19,10 +19,9 @@ Positive values for `deltaX` will move the point to the right. Positive values f
|
||||||
|
|
||||||
## Point.translate() example
|
## Point.translate() example
|
||||||
|
|
||||||
<Example
|
<Example part="point_translate">
|
||||||
part="point_translate"
|
An example of the Point.translate() method
|
||||||
caption="An example of the Point.translate() method"
|
</Example>
|
||||||
/>
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Snippet, snippets, macro } = part.shorthand();
|
let { Point, points, Snippet, snippets, macro } = part.shorthand();
|
||||||
|
|
|
@ -16,10 +16,9 @@ but returns the Snippet object. This allows you to chain different calls togeth
|
||||||
If the third parameter is set to `true` it will call [`Attributes.set()`](./attributes#set) instead,
|
If the third parameter is set to `true` it will call [`Attributes.set()`](./attributes#set) instead,
|
||||||
thereby overwriting the value of the attribute.
|
thereby overwriting the value of the attribute.
|
||||||
|
|
||||||
<Example
|
<Example part="snippet_attr">
|
||||||
part="snippet_attr"
|
An example of the Snippet.attr() method
|
||||||
caption="An example of the Snippet.attr() method"
|
</Example>
|
||||||
/>
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Snippet, snippets } = part.shorthand();
|
let { Point, points, Snippet, snippets } = part.shorthand();
|
||||||
|
|
|
@ -8,10 +8,10 @@ Snippet snippet.clone()
|
||||||
|
|
||||||
Returns a new Snippets object that is a deep copy of this one.
|
Returns a new Snippets object that is a deep copy of this one.
|
||||||
|
|
||||||
<Example
|
<Example part="snippet_clone">
|
||||||
part="snippet_clone"
|
An example of the Snippet.clone() method
|
||||||
caption="An example of the Snippet.clone() method"
|
</Example>
|
||||||
/>
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Snippet, snippets } = part.shorthand();
|
let { Point, points, Snippet, snippets } = part.shorthand();
|
||||||
|
|
|
@ -9,5 +9,7 @@ provided by [plugin-buttons](/reference/plugins/buttons/).
|
||||||
snippets.demo = new Snippet('button', points.anchor)
|
snippets.demo = new Snippet('button', points.anchor)
|
||||||
```
|
```
|
||||||
|
|
||||||
<Example part="snippets_button" caption="An example of the button snippet" />
|
<Example part="snippets_button">
|
||||||
|
An example of the button snippet
|
||||||
|
</Example>
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,9 @@ provided by [plugin-buttons](/reference/plugins/buttons/).
|
||||||
snippets.demo = new Snippet('buttonhole-end', points.anchor)
|
snippets.demo = new Snippet('buttonhole-end', points.anchor)
|
||||||
```
|
```
|
||||||
|
|
||||||
<Example part="snippets_buttonhole_end" caption="An example of the buttonhole-end snippet" />
|
<Example part="snippets_buttonhole_end">
|
||||||
|
An example of the buttonhole-end snippet
|
||||||
|
</Example>
|
||||||
|
|
||||||
<Note>
|
<Note>
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,10 @@ provided by [plugin-buttons](/reference/plugins/buttons/).
|
||||||
snippets.demo = new Snippet('buttonhole-start', points.anchor)
|
snippets.demo = new Snippet('buttonhole-start', points.anchor)
|
||||||
```
|
```
|
||||||
|
|
||||||
<Example part="snippets_buttonhole_start" caption="An example of the buttonhole-start snippet" />
|
<Example part="snippets_buttonhole_start">
|
||||||
|
An example of the buttonhole-start snippet
|
||||||
|
</Example>
|
||||||
|
|
||||||
|
|
||||||
<Note>
|
<Note>
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,9 @@ provided by [plugin-buttons](/reference/plugins/buttons/).
|
||||||
snippets.demo = new Snippet('buttonhole', points.anchor)
|
snippets.demo = new Snippet('buttonhole', points.anchor)
|
||||||
```
|
```
|
||||||
|
|
||||||
<Example part="snippets_buttonhole" caption="An example of the buttonhole snippet" />
|
<Example part="snippets_buttonhole">
|
||||||
|
An example of the buttonhole snippet
|
||||||
|
</Example>
|
||||||
|
|
||||||
<Note>
|
<Note>
|
||||||
|
|
||||||
|
|
|
@ -9,5 +9,7 @@ provided by [plugin-logo](/reference/plugins/logo/).
|
||||||
snippets.demo = new Snippet('logo', points.anchor)
|
snippets.demo = new Snippet('logo', points.anchor)
|
||||||
```
|
```
|
||||||
|
|
||||||
<Example part="snippets_logo" caption="An example of the logo snippet" />
|
<Example part="snippets_logo">
|
||||||
|
An example of the logo snippet
|
||||||
|
</Example>
|
||||||
|
|
||||||
|
|
|
@ -8,5 +8,7 @@ provided by [plugin-theme](/reference/plugins/theme/).
|
||||||
```js
|
```js
|
||||||
snippets.demo = new Snippet('bnotch', points.anchor)
|
snippets.demo = new Snippet('bnotch', points.anchor)
|
||||||
```
|
```
|
||||||
<Example part="snippets_notch" caption="An example of the notch snippet" />
|
<Example part="snippets_notch">
|
||||||
|
An example of the notch snippet
|
||||||
|
</Example>
|
||||||
|
|
||||||
|
|
|
@ -10,5 +10,7 @@ It is provided by [plugin-buttons](/reference/plugins/buttons/).
|
||||||
snippets.demo = new Snippet('snap-socket', points.anchor)
|
snippets.demo = new Snippet('snap-socket', points.anchor)
|
||||||
```
|
```
|
||||||
|
|
||||||
<Example part="snippets_snapsocket" caption="An example of the snap-socket snippet" />
|
<Example part="snippets_snapsocket">
|
||||||
|
An example of the snap-socket snippet
|
||||||
|
</Example>
|
||||||
|
|
||||||
|
|
|
@ -10,5 +10,7 @@ It is provided by [plugin-buttons](/reference/plugins/buttons/).
|
||||||
snippets.demo = new Snippet('snap-stud', points.anchor)
|
snippets.demo = new Snippet('snap-stud', points.anchor)
|
||||||
```
|
```
|
||||||
|
|
||||||
<Example part="snippets_snapstud" caption="An example of the snap-stud snippet" />
|
<Example part="snippets_snapstud">
|
||||||
|
An example of the snap-stud snippet
|
||||||
|
</Example>
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,9 @@ Set sort to:
|
||||||
- `x` : The point with the lowest X-coordinate will go first (left to right)
|
- `x` : The point with the lowest X-coordinate will go first (left to right)
|
||||||
- `y` : The point with the lowest Y-coordinate will go first (top to bottom)
|
- `y` : The point with the lowest Y-coordinate will go first (top to bottom)
|
||||||
|
|
||||||
<Example part="utils_beamintersectscircle" caption="A Utils.beamIntersectsCircle() example" />
|
<Example part="utils_beamintersectscircle">
|
||||||
|
A Utils.beamIntersectsCircle() example
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let {
|
let {
|
||||||
|
|
|
@ -9,7 +9,9 @@ Point | false utils.beamIntersectsX(Point A, Point B, float X)
|
||||||
Finds the intersection between an endless line and a given X-value. Returns a [Point](#point) object
|
Finds the intersection between an endless line and a given X-value. Returns a [Point](#point) object
|
||||||
for the intersection, or `false` there is no intersection.
|
for the intersection, or `false` there is no intersection.
|
||||||
|
|
||||||
<Example part="utils_beamintersectsx" caption="A Utils.beamIntersectsX() example" />
|
<Example part="utils_beamintersectsx">
|
||||||
|
A Utils.beamIntersectsX() example
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let {
|
let {
|
||||||
|
|
|
@ -9,7 +9,9 @@ Point | false utils.beamIntersectsY(Point A, Point B, float Y)
|
||||||
Finds the intersection between an endless line and a given Y-value. Returns a [Point](#point) object
|
Finds the intersection between an endless line and a given Y-value. Returns a [Point](#point) object
|
||||||
for the intersection, or `false` there is no intersection.
|
for the intersection, or `false` there is no intersection.
|
||||||
|
|
||||||
<Example part="utils_beamintersectsy" caption="A Utils.beamIntersectsY() example" />
|
<Example part="utils_beamintersectsy">
|
||||||
|
A Utils.beamIntersectsY() example
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let {
|
let {
|
||||||
|
|
|
@ -14,7 +14,9 @@ Point | false utils.beamsIntersect(
|
||||||
Finds the intersection between two endless lines (beams). Returns a [Point](#point) object
|
Finds the intersection between two endless lines (beams). Returns a [Point](#point) object
|
||||||
for the intersection, or `false` if the lines don't intersect.
|
for the intersection, or `false` if the lines don't intersect.
|
||||||
|
|
||||||
<Example part="utils_beamsintersect" caption="A Utils.beamIntersect() example" />
|
<Example part="utils_beamsintersect">
|
||||||
|
A Utils.beamIntersect() example
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let {
|
let {
|
||||||
|
|
|
@ -22,7 +22,9 @@ Set sort to:
|
||||||
- `x` : The point with the lowest X-coordinate will go first (left to right)
|
- `x` : The point with the lowest X-coordinate will go first (left to right)
|
||||||
- `y` : The point with the lowest Y-coordinate will go first (top to bottom)
|
- `y` : The point with the lowest Y-coordinate will go first (top to bottom)
|
||||||
|
|
||||||
<Example part="utils_circlesintersect" caption="A Utils.circlesIntersect() example" />
|
<Example part="utils_circlesintersect">
|
||||||
|
A Utils.circlesIntersect() example
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let { Point, points, Snippet, snippets, utils } = part.shorthand();
|
let { Point, points, Snippet, snippets, utils } = part.shorthand();
|
||||||
|
|
|
@ -16,7 +16,9 @@ array | false utils.curvesIntersect(
|
||||||
|
|
||||||
Finds the intersections between two curves described by 4 points each.
|
Finds the intersections between two curves described by 4 points each.
|
||||||
|
|
||||||
<Example part="utils_curvesintersect" caption="A Utils.curvesIntersect() example" />
|
<Example part="utils_curvesintersect">
|
||||||
|
A Utils.curvesIntersect() example
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let {
|
let {
|
||||||
|
|
|
@ -23,7 +23,9 @@ Set sort to:
|
||||||
- `x` : The point with the lowest X-coordinate will go first (left to right)
|
- `x` : The point with the lowest X-coordinate will go first (left to right)
|
||||||
- `y` : The point with the lowest Y-coordinate will go first (top to bottom)
|
- `y` : The point with the lowest Y-coordinate will go first (top to bottom)
|
||||||
|
|
||||||
<Example part="utils_lineintersectscircle" caption="A Utils.lineIntersectsCircle() example" />
|
<Example part="utils_lineintersectscircle">
|
||||||
|
A Utils.lineIntersectsCircle() example
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let {
|
let {
|
||||||
|
|
|
@ -16,7 +16,9 @@ array | false utils.lineIntersectsCurve(
|
||||||
Finds the intersection between a line segment from point `from` to point `to`
|
Finds the intersection between a line segment from point `from` to point `to`
|
||||||
and a curve described by points `start`, `cp1`, `cp2, and `end`.
|
and a curve described by points `start`, `cp1`, `cp2, and `end`.
|
||||||
|
|
||||||
<Example part="utils_lineintersectscurve" caption="A Utils.lineIntersectsCurve() example" />
|
<Example part="utils_lineintersectscurve">
|
||||||
|
A Utils.lineIntersectsCurve() example
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let {
|
let {
|
||||||
|
|
|
@ -14,7 +14,9 @@ Point | false utils.linesIntersect(
|
||||||
Finds the intersection between two line segments. Returns a [Point](#point) object
|
Finds the intersection between two line segments. Returns a [Point](#point) object
|
||||||
for the intersection, or `false` if the lines don't intersect.
|
for the intersection, or `false` if the lines don't intersect.
|
||||||
|
|
||||||
<Example part="utils_linesintersect" caption="A Utils.linesIntersect() example" />
|
<Example part="utils_linesintersect">
|
||||||
|
A Utils.linesIntersect() example
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let {
|
let {
|
||||||
|
|
|
@ -26,7 +26,9 @@ When that happens, you can lower the precision so you get what you expect.
|
||||||
|
|
||||||
</Note>
|
</Note>
|
||||||
|
|
||||||
<Example part="utils_pointonbeam" caption="A Utils.pointOnBeam() example" />
|
<Example part="utils_pointonbeam">
|
||||||
|
A Utils.pointOnBeam() example
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let {
|
let {
|
||||||
|
|
|
@ -20,7 +20,9 @@ Keep in mind that calculations with Bezier curves are often aproximations.
|
||||||
|
|
||||||
</Note>
|
</Note>
|
||||||
|
|
||||||
<Example part="utils_pointoncurve" caption="A Utils.pointOnCurve() example" />
|
<Example part="utils_pointoncurve">
|
||||||
|
A Utils.pointOnCurve() example
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let {
|
let {
|
||||||
|
|
|
@ -15,7 +15,9 @@ Returns `true` if the point `check` lies on a line segment from point `from` to
|
||||||
|
|
||||||
The fourth parameter controls the precision. See [pointOnBeam](#utilspointonbeam).
|
The fourth parameter controls the precision. See [pointOnBeam](#utilspointonbeam).
|
||||||
|
|
||||||
<Example part="utils_pointonline" caption="A Utils.pointOnLine() example" />
|
<Example part="utils_pointonline">
|
||||||
|
A Utils.pointOnLine() example
|
||||||
|
</Example>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let {
|
let {
|
||||||
|
|
|
@ -47,7 +47,10 @@ While we're at it, let's add a point where the closure's snap should go:
|
||||||
points.snapLeft = points.top.shiftFractionTowards(points.edgeTop, 0.5)
|
points.snapLeft = points.top.shiftFractionTowards(points.edgeTop, 0.5)
|
||||||
```
|
```
|
||||||
|
|
||||||
<Example pattern="tutorial" part="step8" caption="The right part looks a bit wonky now, but we'll get to that" />
|
<Example pattern="tutorial" part="step8">
|
||||||
|
The right part looks a bit wonky now, but we'll get to that
|
||||||
|
</Example>
|
||||||
|
|
||||||
|
|
||||||
Now let's mirror this on the other side, and replace our `neck` and `rect` paths with a new path.
|
Now let's mirror this on the other side, and replace our `neck` and `rect` paths with a new path.
|
||||||
|
|
||||||
|
|
|
@ -64,5 +64,7 @@ paths.neck = new Path()
|
||||||
.close()
|
.close()
|
||||||
```
|
```
|
||||||
|
|
||||||
<Example pattern="tutorial" part="step4" caption="And now you have a complete neck opening" />
|
<Example pattern="tutorial" part="step4">
|
||||||
|
And now you have a complete neck opening
|
||||||
|
</Example>
|
||||||
|
|
||||||
|
|
|
@ -172,7 +172,10 @@ macro("scalebox", { at: points.scalebox })
|
||||||
|
|
||||||
And with that, our pattern is now *complete*:
|
And with that, our pattern is now *complete*:
|
||||||
|
|
||||||
<Example pattern="tutorial" part="step11" caption="We used attributes to add color, dashes, text on a path and even opacity" />
|
<Example pattern="tutorial" part="step11">
|
||||||
|
We used attributes to add color, dashes, text on a path and even opacity
|
||||||
|
</Example>
|
||||||
|
|
||||||
|
|
||||||
We're not done yet though. There's one more thing the user can ask for: a *paperless* pattern.
|
We're not done yet though. There's one more thing the user can ask for: a *paperless* pattern.
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,9 @@ macro("round", {
|
||||||
|
|
||||||
<Note> You can find more information on the `round` macro in [the macros docs](/reference/api/macros/round/).</Note>
|
<Note> You can find more information on the `round` macro in [the macros docs](/reference/api/macros/round/).</Note>
|
||||||
|
|
||||||
<Example pattern="tutorial" part="step7" caption="Pretty good, but how are we going to fit it over the baby's head?" />
|
<Example pattern="tutorial" part="step7">
|
||||||
|
Pretty good, but how are we going to fit it over the baby's head?
|
||||||
|
</Example>
|
||||||
|
|
||||||
Like our neck opening, we've only drawn half since we can simply copy the points to the other side.
|
Like our neck opening, we've only drawn half since we can simply copy the points to the other side.
|
||||||
|
|
||||||
|
|
|
@ -63,5 +63,8 @@ and the sides are equidistant from the neck neck opening.
|
||||||
|
|
||||||
You didn't have to do that. But it looks nicely balanced this way:
|
You didn't have to do that. But it looks nicely balanced this way:
|
||||||
|
|
||||||
<Example pattern="tutorial" part="step5" caption="Note how the neck opening is the same distance from the left, right, and top edge" />
|
<Example pattern="tutorial" part="step5">
|
||||||
|
Note how the neck opening is the same distance from the left, right, and top edge
|
||||||
|
</Example>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -113,7 +113,10 @@ macro("round", {
|
||||||
|
|
||||||
With that out of the way, our bib now looks like this:
|
With that out of the way, our bib now looks like this:
|
||||||
|
|
||||||
<Example pattern="tutorial" part="step9" caption="That is looking a lot like a bib" />
|
<Example pattern="tutorial" part="step9">
|
||||||
|
That is looking a lot like a bib
|
||||||
|
</Example>
|
||||||
|
|
||||||
|
|
||||||
<Note>
|
<Note>
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,9 @@ if (paperless) {
|
||||||
|
|
||||||
There's a lot going on, but it's mostly repetition. To see what that did to your pattern, you have to enable *paperless mode* in your developing environment; you can find the option under *Pattern options* on the right. Let's look at the end result, and discuss:
|
There's a lot going on, but it's mostly repetition. To see what that did to your pattern, you have to enable *paperless mode* in your developing environment; you can find the option under *Pattern options* on the right. Let's look at the end result, and discuss:
|
||||||
|
|
||||||
<Example pattern="tutorial" part="bib" caption="Your paperless bib" settings={{paperless: true}} />
|
<Example pattern="tutorial" part="bib" setting={{paperless: true }}>
|
||||||
|
Your paperless bib
|
||||||
|
</Example>
|
||||||
|
|
||||||
We used the `hd` macro to add two horizontal dimensions:
|
We used the `hd` macro to add two horizontal dimensions:
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,9 @@ and keep the rest of the path as it was.
|
||||||
|
|
||||||
The shape our bib is now completed:
|
The shape our bib is now completed:
|
||||||
|
|
||||||
<Example pattern="tutorial" part="step10" caption="That is looking a lot like a bib" />
|
<Example pattern="tutorial" part="step10">
|
||||||
|
That is looking a lot like a bib
|
||||||
|
</Example>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -44,5 +44,7 @@ paths.rect = new Path()
|
||||||
|
|
||||||
All of a sudden, things are starting to look like a bib:
|
All of a sudden, things are starting to look like a bib:
|
||||||
|
|
||||||
<Example pattern="tutorial" part="step6" caption="Pretty good, but how are we going to fit it over the baby's head?" />
|
<Example pattern="tutorial" part="step6">
|
||||||
|
Pretty good, but how are we going to fit it over the baby's head?
|
||||||
|
</Example>
|
||||||
|
|
||||||
|
|
|
@ -70,6 +70,9 @@ In our case, we have a part named `bib` so we're using `draftBib()` as the metho
|
||||||
Congratulations, your pattern now has a `bib` part, rather than a `box` part.
|
Congratulations, your pattern now has a `bib` part, rather than a `box` part.
|
||||||
It still looks the same though:
|
It still looks the same though:
|
||||||
|
|
||||||
<Example pattern="tutorial" part="step1" caption="Our bib part, which is the renamed box part" />
|
<Example pattern="tutorial" part="step1">
|
||||||
|
Our bib part, which is the renamed box part
|
||||||
|
</Example>
|
||||||
|
|
||||||
|
|
||||||
This `bib` part is where we'll do some real work. But first, we have some more configuration to do.
|
This `bib` part is where we'll do some real work. But first, we have some more configuration to do.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue