1
0
Fork 0
freesewing/markdown/dev/reference/api/en.md

89 lines
4.9 KiB
Markdown
Raw Normal View History

---
title: Core API
---
2021-09-25 17:05:18 +02:00
This is the documentation for FreeSewing's core library, published as `@freesewing/core` on NPM.
2022-02-19 08:04:25 +01:00
It's a complete toolbox for parametric design with a primary focus on
2021-09-25 17:05:18 +02:00
sewing patterns, but can be utilized for a variety of similar 2D design tasks.
2022-09-20 18:09:28 +02:00
<Tip>
2021-09-25 17:05:18 +02:00
2022-09-20 18:09:28 +02:00
##### Looking to get started?
2021-09-25 17:05:18 +02:00
2022-09-20 18:09:28 +02:00
You are currently browsing the reference documentation.
Please refer to our [tutorials](/tutorials) to get started.
2022-09-20 18:09:28 +02:00
</Tip>
2021-09-25 17:05:18 +02:00
## Core API Documentation
<ReadMore recurse />
2022-09-20 18:09:28 +02:00
## 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
2022-09-20 18:09:28 +02:00
| Named export | Description |
| ------------ | ------------|
| `Attributes` | The [Attributes](/reference/api/attributes) constructor |
| `Design` | The [Design](/reference/api/design) constructor |
2022-09-20 18:09:28 +02:00
| `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 Bezier Quarter Circle constant: `0.55191502449351` FIXME: include link |
| `hidePresets` | Presets you can use to [configure your part `hide` option](/reference/api/part/config/hide). |
| `goldenRatio` | The golden ratio constant: `1.618034` FIXME: include link |
| `version` | The version of `@freesewing/core` |
2022-09-20 18:09:28 +02:00
### Utilities
2022-09-20 18:09:28 +02:00
| Named export | Description |
| ------------ | ------------|
2022-10-18 18:10:59 +02:00
| `beamIntersectsCircle` | See the [beamIntersectsCircle](/reference/api/utils/beamintersectscircle) documentation |
2023-04-28 17:49:19 +00:00
| `beamIntersectsCurve` | See the [beamIntersectsCurve](/reference/api/utils/beamintersectscurve) documentation |
2022-10-18 18:10:59 +02:00
| `beamIntersectsX` | See the [beamIntersectsX](/reference/api/utils/beamintersectsx) documentation |
| `beamIntersectsY` | See the [beamIntersectsY](/reference/api/utils//beamintersectsy) documentation |
2022-09-20 18:09:28 +02:00
| `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) |
2022-09-20 18:09:28 +02:00
| `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 |
2022-10-18 18:10:59 +02:00
| `curveIntersectsX` | See the [curveIntersectsX](/reference/api/utils/curveintersectsx) documentation |
| `curveIntersectsY` | See the [curveIntersectsY](/reference/api/utils/curveintersectsy) documentation |
2022-09-20 18:09:28 +02:00
| `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 |
2022-10-18 18:10:59 +02:00
| `lineIntersectsCircle` | See the [lineIntersectsCircle](/reference/api/utils/lineintersectscircle) documentation |
| `lineIntersectsCurve` | See the [lineIntersectsCurve](/reference/api/utils/lineintersectscurve) documentation |
2022-09-20 18:09:28 +02:00
| `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 |
2022-09-20 18:09:28 +02:00
| `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 |
2022-09-20 18:09:28 +02:00
| `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 |