1
0
Fork 0
freesewing/sites/dev/docs/reference/api
2025-05-24 09:07:30 +02:00
..
attributes chore: Port FreeSewing.dev to docusaurus 2024-09-28 13:13:48 +02:00
defs chore: Port FreeSewing.dev to docusaurus 2024-09-28 13:13:48 +02:00
design fix(dev): One-liner admonitions 2024-09-29 07:14:59 +02:00
part fix(dev/docs): Add expand setting 2025-05-24 09:07:30 +02:00
path fix(dev:docs): Dimension macro, boundary box, and typo fixes 2025-05-19 17:20:45 -07:00
pattern [dev] fix: Broken links 2025-05-04 18:55:10 +02:00
point fix(dev:docs): Minor change to Point.shiftFractionTowards() 2025-05-24 08:47:07 +02:00
snippet fix(dev:docs): Dimension macro, boundary box, and typo fixes 2025-05-19 17:20:45 -07:00
stack fix(dev): One-liner admonitions 2024-09-29 07:14:59 +02:00
store fix(dev): One-liner admonitions 2024-09-29 07:14:59 +02:00
svg fix(dev:docs): Improve SVG signatures 2025-05-19 17:25:17 -07:00
utils fix(reference:api): Revert incorrect Example formatting (#367) 2025-05-19 08:04:05 +02:00
readme.mdx chore: Port FreeSewing.dev to docusaurus 2024-09-28 13:13:48 +02:00

---
title: Core API
---

This is the documentation for FreeSewing's core library, published as `@freesewing/core` on NPM.
It's a complete toolbox for parametric design with a primary focus on
sewing patterns, but can be utilized for a variety of similar 2D design tasks.

:::tip

##### Looking to get started?

You are currently browsing the reference documentation.
Please refer to our [tutorials](/tutorials) to get started.

:::

## Core API Documentation

<ReadMore recurse />

## Named exports

In general, software published under the FreeSewing namespaces prefers named
exports over default exports, and the `@freesewing/core` package provides several of them.
I have grouped them below in different categories:

- [Constructors](#constructors)
- [Constants](#constants)
- [Utilities](#utilities)

### Constructors

| Named export | Description |
| ------------ | ------------|
| `Attributes` | The [Attributes](/reference/api/attributes) constructor |
| `Design`     | The [Design](/reference/api/design) constructor |
| `Pattern`    | The [Pattern](/reference/api/pattern) constructor |
| `Point`      | The [Point](/reference/api/point) constructor |
| `Path`       | The [Path](/reference/api/path) constructor |
| `Part`       | The [Part](/reference/api/part) constructor |
| `Snippet`    | The [Snippet](/reference/api/snippet) constructor |
| `Store`      | The [Store](/reference/api/store) constructor |

### Constants

| Named export   | Description |
| -------------- | ------------|
| `cbqc`         | The [cubic Bézier quarter circle](https://pomax.github.io/bezierinfo/#circles_cubic) constant: `0.55191502449351` |
| `hidePresets`  | Presets you can use to [configure your part `hide` option](/reference/api/part/config/hide). |
| `goldenRatio`  | The [golden ratio](https://en.wikipedia.org/wiki/Golden_ratio) constant: `1.618034` |
| `version`      | The version of `@freesewing/core` |

:::note RELATED

The `cbqc` cubic Bézier quarter circle constant is used to draw circles
using Bézier curves.
An approximate quarter circle curve is:

```js
const quarterCircle = new Path()
  .move(new Point(0, radius))
  .curve(new Point(cbqc, radius),
    new Point(radius, cbqc),
    new Point(radius, 0))
```

:::

### Utilities

| Named export | Description |
| ------------ | ------------|
| `beamIntersectsCircle`    | See the [beamIntersectsCircle](/reference/api/utils/beamintersectscircle) documentation |
| `beamIntersectsCurve`     | See the [beamIntersectsCurve](/reference/api/utils/beamintersectscurve) documentation |
| `beamIntersectsX`         | See the [beamIntersectsX](/reference/api/utils/beamintersectsx) documentation |
| `beamIntersectsY`         | See the [beamIntersectsY](/reference/api/utils/beamintersectsy) documentation |
| `beamsIntersect`          | See the [beamsIntersect](/reference/api/utils/beamsintersect) documentation |
| `Bezier`                  | A re-export of [the bezier-js dependency](https://www.npmjs.com/package/bezier-js) |
| `capitalize`              | See the [capitalize](/reference/api/utils/capitalize) documentation |
| `circlesIntersect`        | See the [circlesIntersect](/reference/api/utils/circlesintersect) documentation |
| `curveEdge`               | See the [curveEdge](/reference/api/utils/curveedge) documentation |
| `curveIntersectsX`        | See the [curveIntersectsX](/reference/api/utils/curveintersectsx) documentation |
| `curveIntersectsY`        | See the [curveIntersectsY](/reference/api/utils/curveintersectsy) documentation |
| `curvesIntersect`         | See the [curvesIntersect](/reference/api/utils/curvesintersect) documentation |
| `deg2rad`                 | See the [deg2rad](/reference/api/utils/deg2rad) documentation |
| `generateStackTransform`  | See the [generateStackTransform](/reference/api/utils/generatestacktransform) documentation |
| `getTransformedBounds`    | See the [getTransformedBounds](/reference/api/utils/gettransformedbounds) documentation |
| `lineIntersectsCircle`    | See the [lineIntersectsCircle](/reference/api/utils/lineintersectscircle) documentation |
| `lineIntersectsCurve`     | See the [lineIntersectsCurve](/reference/api/utils/lineintersectscurve) documentation |
| `linesIntersect`          | See the [linesIntersect](/reference/api/utils/linesintersect) documentation |
| `mergeIi18n`              | See the [mergeI18n](/reference/api/utils/mergei18n) documentation |
| `mergeOptions`            | See the [mergeOptions](/reference/api/utils/mergeoptions) documentation |
| `pctBasedOn`              | See the [pctBasedOn](/reference/api/utils/pctbasedon) documentation |
| `pointOnBeam`             | See the [pointOnBeam](/reference/api/utils/pointonbeam) documentation |
| `pointOnCurve`            | See the [pointOnCurve](/reference/api/utils/pointoncurve) documentation |
| `pointOnLine`             | See the [pointOnLine](/reference/api/utils/pointonline) documentation |
| `rad2deg`                 | See the [rad2deg](/reference/api/utils/rad2deg) documentation |
| `round`                   | See the [round](/reference/api/utils/round) documentation |
| `splitCurve`              | See the [splitCurve](/reference/api/utils/splitcurve) documentation |
| `stretchToScale`          | See the [stretchToScale](/reference/api/utils/stretchtoscale) documentation |
| `units`                   | See the [units](/reference/api/utils/units) documentation |