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 to get started.
Core API Documentation
- Design
Path
- Path._curve()
- Path.addClass()
- Path.addText()
- Path.asPathString()
- Path.asRenderProps()
- Path.attr()
- Path.bbox()
- Path.clean()
- Path.clone()
- Path.close()
- Path.combine()
- Path.curve()
- Path.curve_()
- Path.divide()
- Path.edge()
- Path.end()
- Path.hide()
- Path.insop()
- Path.intersects()
- Path.intersectsX()
- Path.intersectsY()
- Path.join()
- Path.length()
- Path.line()
- Path.move()
- Path.noop()
- Path.offset()
- Path.reverse()
- Path.rotate()
- Path.roughLength()
- Path.setClass()
- Path.setHidden()
- Path.setText()
- Path.shiftAlong()
- Path.shiftFractionAlong()
- Path.smurve()
- Path.smurve_()
- Path.split()
- Path.start()
- Path.translate()
- Path.trim()
- Path.unhide()
Point
- Point.addCircle()
- Point.addText()
- Point.angle()
- Point.asRenderProps()
- Point.attr()
- Point.clone()
- Point.copy()
- Point.dist()
- Point.dx()
- Point.dy()
- Point.flipX()
- Point.flipY()
- Point.rotate()
- Point.setCircle()
- Point.setText()
- Point.shift()
- Point.shiftFractionTowards()
- Point.shiftOutwards()
- Point.shiftTowards()
- Point.sitsOn()
- Point.sitsRoughlyOn()
- Point.slope()
- Point.translate()
utils
- utils.applyTransformToPoint()
- utils.beamIntersectsCircle()
- utils.beamIntersectsCurve()
- utils.beamIntersectsX()
- utils.beamIntersectsY()
- utils.beamsIntersect()
- utils.capitalize()
- utils.circlesIntersect()
- utils.combineTransform()
- utils.curveEdge()
- utils.curveIntersectsX()
- utils.curveIntersectsY()
- utils.curvesIntersect()
- utils.deg2rad()
- utils.generateStackTransform()
- utils.getTransformedBounds()
- utils.lineIntersectsCircle()
- utils.lineIntersectsCurve()
- utils.linesIntersect()
- utils.mergeI18n()
- utils.mergeOptions()
- utils.pctBasedOn()
- utils.pointOnBeam()
- utils.pointOnCurve()
- utils.pointOnLine()
- utils.rad2deg()
- utils.round()
- utils.splitCurve()
- utils.stretchToScale()
- utils.units()
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
Named export | Description |
---|---|
Attributes | The Attributes constructor |
Design | The Design constructor |
Pattern | The Pattern constructor |
Point | The Point constructor |
Path | The Path constructor |
Part | The Part constructor |
Snippet | The Snippet constructor |
Store | The Store constructor |
Constants
Named export | Description |
---|---|
cbqc | The cubic Bézier quarter circle constant: 0.55191502449351 |
hidePresets | Presets you can use to configure your part hide option. |
goldenRatio | The golden ratio constant: 1.618034 |
version | The version of @freesewing/core |
RELATED
The cbqc
cubic Bézier quarter circle constant is used to draw circles
using Bézier curves.
An approximate quarter circle curve is:
Javascript
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 documentation |
beamIntersectsCurve | See the beamIntersectsCurve documentation |
beamIntersectsX | See the beamIntersectsX documentation |
beamIntersectsY | See the beamIntersectsY documentation |
beamsIntersect | See the beamsIntersect documentation |
Bezier | A re-export of the bezier-js dependency |
capitalize | See the capitalize documentation |
circlesIntersect | See the circlesIntersect documentation |
curveEdge | See the curveEdge documentation |
curveIntersectsX | See the curveIntersectsX documentation |
curveIntersectsY | See the curveIntersectsY documentation |
curvesIntersect | See the curvesIntersect documentation |
deg2rad | See the deg2rad documentation |
generateStackTransform | See the generateStackTransform documentation |
getTransformedBounds | See the getTransformedBounds documentation |
lineIntersectsCircle | See the lineIntersectsCircle documentation |
lineIntersectsCurve | See the lineIntersectsCurve documentation |
linesIntersect | See the linesIntersect documentation |
mergeIi18n | See the mergeI18n documentation |
mergeOptions | See the mergeOptions documentation |
pctBasedOn | See the pctBasedOn documentation |
pointOnBeam | See the pointOnBeam documentation |
pointOnCurve | See the pointOnCurve documentation |
pointOnLine | See the pointOnLine documentation |
rad2deg | See the rad2deg documentation |
round | See the round documentation |
splitCurve | See the splitCurve documentation |
stretchToScale | See the stretchToScale documentation |
units | See the units documentation |