2018-08-14 10:22:48 +02:00
|
|
|
import freesewing from "freesewing";
|
2019-01-26 20:21:48 +01:00
|
|
|
import plugins from "@freesewing/plugin-bundle";
|
2018-08-14 10:22:48 +02:00
|
|
|
|
|
|
|
import config from "../config/config";
|
|
|
|
import { version } from "../package.json";
|
|
|
|
|
2018-08-14 16:07:36 +02:00
|
|
|
import pointAttr from "./point.attr";
|
|
|
|
import pointDist from "./point.dist";
|
|
|
|
import pointDx from "./point.dx";
|
|
|
|
import pointDy from "./point.dy";
|
|
|
|
import pointAngle from "./point.angle";
|
|
|
|
import pointRotate from "./point.rotate";
|
|
|
|
import pointCopy from "./point.copy";
|
|
|
|
import pointFlipX from "./point.flipx";
|
|
|
|
import pointFlipY from "./point.flipy";
|
|
|
|
import pointShift from "./point.shift";
|
|
|
|
import pointShiftTowards from "./point.shifttowards";
|
|
|
|
import pointShiftFractionTowards from "./point.shiftfractiontowards";
|
|
|
|
import pointShiftOutwards from "./point.shiftoutwards";
|
2018-09-06 16:22:23 +02:00
|
|
|
import pointTranslate from "./point.translate";
|
2018-08-14 16:07:36 +02:00
|
|
|
import pointSitsOn from "./point.sitson";
|
|
|
|
import pointClone from "./point.clone";
|
|
|
|
|
2019-01-26 20:21:48 +01:00
|
|
|
import draftPathAttr from "./pathAttr";
|
|
|
|
|
2018-08-14 16:07:36 +02:00
|
|
|
import pathOps from "./path.ops";
|
|
|
|
import pathOffset from "./path.offset";
|
|
|
|
import pathLength from "./path.length";
|
|
|
|
import pathStart from "./path.start";
|
|
|
|
import pathEnd from "./path.end";
|
|
|
|
import pathClone from "./path.clone";
|
|
|
|
import pathJoin from "./path.join";
|
|
|
|
import pathReverse from "./path.reverse";
|
|
|
|
import pathShiftAlong from "./path.shiftalong";
|
|
|
|
import pathShiftFractionAlong from "./path.shiftfractionalong";
|
2018-08-20 16:28:56 +02:00
|
|
|
import pathEdge from "./path.edge";
|
2018-09-04 15:23:40 +02:00
|
|
|
import pathTrim from "./path.trim";
|
2018-08-23 15:59:05 +02:00
|
|
|
import pathIntersectsX from "./path.intersectsx";
|
|
|
|
import pathIntersectsY from "./path.intersectsy";
|
2018-08-21 16:33:47 +02:00
|
|
|
import pathIntersects from "./path.intersects";
|
|
|
|
import pathDivide from "./path.divide";
|
2018-08-23 15:59:05 +02:00
|
|
|
import pathSplit from "./path.split";
|
2018-09-06 16:22:23 +02:00
|
|
|
import pathTranslate from "./path.translate";
|
2018-08-23 15:59:05 +02:00
|
|
|
|
|
|
|
import utilsLinesIntersect from "./utils.linesintersect";
|
|
|
|
import utilsBeamsIntersect from "./utils.beamsintersect";
|
|
|
|
import utilsBeamIntersectsX from "./utils.beamintersectsx";
|
|
|
|
import utilsBeamIntersectsY from "./utils.beamintersectsy";
|
|
|
|
import utilsLineIntersectsCurve from "./utils.lineintersectscurve";
|
|
|
|
import utilsCurvesIntersect from "./utils.curvesintersect";
|
|
|
|
import utilsPointOnBeam from "./utils.pointonbeam";
|
|
|
|
import utilsPointOnLine from "./utils.pointonline";
|
|
|
|
import utilsPointOnCurve from "./utils.pointoncurve";
|
|
|
|
import utilsCirclesIntersect from "./utils.circlesintersect";
|
|
|
|
import utilsBeamIntersectsCircle from "./utils.beamintersectscircle";
|
|
|
|
import utilsLineIntersectsCircle from "./utils.lineintersectscircle";
|
2018-08-14 10:22:48 +02:00
|
|
|
|
2018-08-28 15:37:33 +02:00
|
|
|
import pluginGrainline from "./plugin.grainline";
|
|
|
|
import pluginCutonfold from "./plugin.cutonfold";
|
|
|
|
import pluginDimension from "./plugin.dimension";
|
|
|
|
import pluginLogo from "./plugin.logo";
|
|
|
|
import pluginTitle from "./plugin.title";
|
|
|
|
import pluginScalebox from "./plugin.scalebox";
|
|
|
|
|
2018-08-17 20:05:58 +02:00
|
|
|
import settingsSa from "./settings.sa";
|
|
|
|
|
2019-01-26 20:21:48 +01:00
|
|
|
// Constructor
|
|
|
|
const Examples = function(settings) {
|
|
|
|
freesewing.Pattern.call(this, config);
|
|
|
|
this.use(plugins).apply(settings);
|
2019-01-26 17:50:36 +01:00
|
|
|
|
2019-01-26 20:21:48 +01:00
|
|
|
return this;
|
2018-08-14 10:22:48 +02:00
|
|
|
};
|
|
|
|
|
2019-01-26 20:21:48 +01:00
|
|
|
// Set up inheritance
|
|
|
|
Examples.prototype = Object.create(freesewing.Pattern.prototype);
|
|
|
|
Examples.prototype.constructor = Examples;
|
2018-08-14 16:07:36 +02:00
|
|
|
|
2019-01-26 20:21:48 +01:00
|
|
|
// Attach per-part draft methods to prototype
|
|
|
|
Examples.prototype.draftPathAttr = draftPathAttr;
|
2018-08-17 20:05:58 +02:00
|
|
|
|
2018-08-14 16:07:36 +02:00
|
|
|
// Add custom snippet
|
2019-01-26 20:21:48 +01:00
|
|
|
//pattern.on("preRender", function(next) {
|
|
|
|
// this.defs += `
|
|
|
|
//<g id="x">
|
|
|
|
// <path d="M -1.1 -1.1 L 1.1 1.1 M 1.1 -1.1 L -1.1 1.1" class="note"></path>
|
|
|
|
// <circle cy="0" cx="0" r="1.8" class="note"></circle>
|
|
|
|
//</g>
|
|
|
|
//`;
|
|
|
|
// next();
|
|
|
|
//});
|
|
|
|
|
|
|
|
export default Examples;
|