1
0
Fork 0
freesewing/sites/dev/docs/reference/api/path/join
Joost De Cock ab3204f9f1 chore: Port FreeSewing.dev to docusaurus
The replaces the NextJS site powering FreeSewing.dev with a Docusaurus
setup. It's part of my efforts to simplify FreeSewing's setup so we can
focus on our core value proposition.
2024-09-28 13:13:48 +02:00
..
readme.mdx chore: Port FreeSewing.dev to docusaurus 2024-09-28 13:13:48 +02:00

---
title: Path.join()
---

The `Path.join()` method joins this path with one or more other paths.

Any gaps in the path (caused by move operations) will be filled-in with a line.
If that's not what you want, you should use
[`Path.combine()`](/reference/api/path/combine) instead.


## Signature

```js
Path path.join(path other)
```

## Examples

<Example caption="Example of the Path.join() method">
```js
({ Point, points, Path, paths, part }) => {

  points.A1 = new Point(0, 0)
  points.A2 = new Point(60, 0)
  points.B1 = new Point(0, 10)
  points.B2 = new Point(60, 10)
  points.C1 = new Point(0, 20)
  points.C2 = new Point(60, 20)

  paths.path1 = new Path()
    .move(points.A1)
    .line(points.A2)
    .setClass("various")

  paths.path2 = new Path()
    .move(points.B1)
    .line(points.B2)
    .setClass("note")

  paths.path3 = new Path()
    .move(points.C1)
    .line(points.C2)
    .setClass("canvas")

  paths.joint = paths.path1
    .join(paths.path2, paths.path3)
    .setClass("lining dotted")

  return part
}
```
</Example>


## Notes

- `Path.join()` is _variadic_, so you can pass multiple paths to join
- You cannot join a closed path to another path