2019-05-02 14:33:34 +02:00
|
|
|
import freesewing from "@freesewing/core";
|
2019-01-26 20:21:48 +01:00
|
|
|
import plugins from "@freesewing/plugin-bundle";
|
2019-01-27 12:54:18 +01:00
|
|
|
import config from "../config/";
|
2019-05-02 14:33:34 +02:00
|
|
|
// Path API
|
2019-05-25 11:11:46 +02:00
|
|
|
import draftPath_move from "./path_move";
|
|
|
|
import draftPath_line from "./path_line";
|
|
|
|
import draftPath_curve from "./path_curve";
|
|
|
|
import draftPath__curve from "./path__curve";
|
|
|
|
import draftPath_curve_ from "./path_curve_";
|
|
|
|
import draftPath_close from "./path_close";
|
2019-01-28 14:34:55 +01:00
|
|
|
import draftPath_ops from "./path_ops";
|
2019-01-27 10:45:10 +01:00
|
|
|
import draftPath_attr from "./path_attr";
|
|
|
|
import draftPath_clone from "./path_clone";
|
2019-01-27 12:54:18 +01:00
|
|
|
import draftPath_divide from "./path_divide";
|
|
|
|
import draftPath_edge from "./path_edge";
|
|
|
|
import draftPath_end from "./path_end";
|
|
|
|
import draftPath_intersects from "./path_intersects";
|
|
|
|
import draftPath_intersectsx from "./path_intersectsx";
|
|
|
|
import draftPath_intersectsy from "./path_intersectsy";
|
|
|
|
import draftPath_join from "./path_join";
|
|
|
|
import draftPath_length from "./path_length";
|
|
|
|
import draftPath_offset from "./path_offset";
|
|
|
|
import draftPath_reverse from "./path_reverse";
|
|
|
|
import draftPath_shiftalong from "./path_shiftalong";
|
|
|
|
import draftPath_shiftfractionalong from "./path_shiftfractionalong";
|
|
|
|
import draftPath_split from "./path_split";
|
|
|
|
import draftPath_start from "./path_start";
|
|
|
|
import draftPath_translate from "./path_translate";
|
|
|
|
import draftPath_trim from "./path_trim";
|
2019-05-02 14:33:34 +02:00
|
|
|
// Plugins
|
2019-01-27 12:54:18 +01:00
|
|
|
import draftPlugin_cutonfold from "./plugin_cutonfold";
|
|
|
|
import draftPlugin_dimension from "./plugin_dimension";
|
|
|
|
import draftPlugin_grainline from "./plugin_grainline";
|
|
|
|
import draftPlugin_logo from "./plugin_logo";
|
|
|
|
import draftPlugin_scalebox from "./plugin_scalebox";
|
|
|
|
import draftPlugin_title from "./plugin_title";
|
2019-05-02 14:33:34 +02:00
|
|
|
// Point API
|
2019-01-27 12:54:18 +01:00
|
|
|
import draftPoint_angle from "./point_angle";
|
|
|
|
import draftPoint_attr from "./point_attr";
|
|
|
|
import draftPoint_clone from "./point_clone";
|
|
|
|
import draftPoint_copy from "./point_copy";
|
|
|
|
import draftPoint_dist from "./point_dist";
|
|
|
|
import draftPoint_dx from "./point_dx";
|
|
|
|
import draftPoint_dy from "./point_dy";
|
|
|
|
import draftPoint_flipx from "./point_flipx";
|
|
|
|
import draftPoint_flipy from "./point_flipy";
|
|
|
|
import draftPoint_shift from "./point_shift";
|
|
|
|
import draftPoint_shiftfractiontowards from "./point_shiftfractiontowards";
|
|
|
|
import draftPoint_shifttowards from "./point_shifttowards";
|
|
|
|
import draftPoint_shiftoutwards from "./point_shiftoutwards";
|
|
|
|
import draftPoint_sitson from "./point_sitson";
|
2019-05-25 11:11:46 +02:00
|
|
|
import draftPoint_sitsroughlyon from "./point_sitsroughlyon";
|
2019-01-27 12:54:18 +01:00
|
|
|
import draftPoint_rotate from "./point_rotate";
|
|
|
|
import draftPoint_translate from "./point_translate";
|
2019-05-02 14:33:34 +02:00
|
|
|
// Utils API
|
2019-01-27 12:54:18 +01:00
|
|
|
import draftUtils_linesintersect from "./utils_linesintersect";
|
|
|
|
import draftUtils_beamsintersect from "./utils_beamsintersect";
|
|
|
|
import draftUtils_beamintersectsx from "./utils_beamintersectsx";
|
|
|
|
import draftUtils_beamintersectsy from "./utils_beamintersectsy";
|
|
|
|
import draftUtils_lineintersectscurve from "./utils_lineintersectscurve";
|
|
|
|
import draftUtils_curvesintersect from "./utils_curvesintersect";
|
|
|
|
import draftUtils_pointonbeam from "./utils_pointonbeam";
|
|
|
|
import draftUtils_pointonline from "./utils_pointonline";
|
|
|
|
import draftUtils_pointoncurve from "./utils_pointoncurve";
|
|
|
|
import draftUtils_circlesintersect from "./utils_circlesintersect";
|
|
|
|
import draftUtils_beamintersectscircle from "./utils_beamintersectscircle";
|
|
|
|
import draftUtils_lineintersectscircle from "./utils_lineintersectscircle";
|
2019-02-19 18:38:22 +01:00
|
|
|
import draftUtils_curveintersectsx from "./utils_curveintersectsx";
|
|
|
|
import draftUtils_curveintersectsy from "./utils_curveintersectsy";
|
|
|
|
import draftUtils_splitcurve from "./utils_splitcurve";
|
2019-05-02 14:33:34 +02:00
|
|
|
// Various
|
2019-01-27 12:54:18 +01:00
|
|
|
import draftSettings_sa from "./settings_sa";
|
2019-05-20 16:25:55 +02:00
|
|
|
import draftSnippet from "./snippet";
|
2019-02-04 18:32:45 +01:00
|
|
|
import draftSnippet_attr from "./snippet_attr";
|
|
|
|
import draftSnippet_clone from "./snippet_clone";
|
2019-05-18 17:17:44 +02:00
|
|
|
// Docs illustrations
|
|
|
|
import draftDocs_overview from "./docs_overview";
|
2019-05-20 16:25:55 +02:00
|
|
|
import draftDocs_coords from "./docs_coords";
|
2019-02-04 18:32:45 +01:00
|
|
|
|
2019-02-16 11:08:16 +01:00
|
|
|
// Create design
|
2019-05-02 14:33:34 +02:00
|
|
|
const Pattern = new freesewing.Design(config, plugins);
|
2018-08-14 16:07:36 +02:00
|
|
|
|
2019-02-16 11:08:16 +01:00
|
|
|
// Attach draft methods to prototype
|
2019-05-02 14:33:34 +02:00
|
|
|
let methods = {
|
2019-05-25 11:11:46 +02:00
|
|
|
draftPath_move,
|
|
|
|
draftPath_line,
|
|
|
|
draftPath_curve,
|
|
|
|
draftPath__curve,
|
|
|
|
draftPath_curve_,
|
|
|
|
draftPath_close,
|
|
|
|
draftPath_ops,
|
2019-05-02 14:33:34 +02:00
|
|
|
draftPath_attr,
|
|
|
|
draftPath_clone,
|
|
|
|
draftPath_divide,
|
|
|
|
draftPath_edge,
|
|
|
|
draftPath_end,
|
|
|
|
draftPath_intersects,
|
|
|
|
draftPath_intersectsx,
|
|
|
|
draftPath_intersectsy,
|
|
|
|
draftPath_join,
|
|
|
|
draftPath_length,
|
|
|
|
draftPath_offset,
|
|
|
|
draftPath_ops,
|
|
|
|
draftPath_reverse,
|
|
|
|
draftPath_shiftalong,
|
|
|
|
draftPath_shiftfractionalong,
|
|
|
|
draftPath_split,
|
|
|
|
draftPath_start,
|
|
|
|
draftPath_translate,
|
|
|
|
draftPath_trim,
|
|
|
|
draftPlugin_cutonfold,
|
|
|
|
draftPlugin_dimension,
|
|
|
|
draftPlugin_grainline,
|
|
|
|
draftPlugin_logo,
|
|
|
|
draftPlugin_scalebox,
|
|
|
|
draftPlugin_title,
|
|
|
|
draftPoint_angle,
|
|
|
|
draftPoint_attr,
|
|
|
|
draftPoint_clone,
|
|
|
|
draftPoint_copy,
|
|
|
|
draftPoint_dist,
|
|
|
|
draftPoint_dx,
|
|
|
|
draftPoint_dy,
|
|
|
|
draftPoint_flipx,
|
|
|
|
draftPoint_flipy,
|
|
|
|
draftPoint_shift,
|
|
|
|
draftPoint_shiftfractiontowards,
|
|
|
|
draftPoint_shifttowards,
|
|
|
|
draftPoint_shiftoutwards,
|
|
|
|
draftPoint_sitson,
|
2019-05-25 11:11:46 +02:00
|
|
|
draftPoint_sitsroughlyon,
|
2019-05-02 14:33:34 +02:00
|
|
|
draftPoint_rotate,
|
|
|
|
draftPoint_translate,
|
|
|
|
draftSettings_sa,
|
2019-05-20 16:25:55 +02:00
|
|
|
draftSnippet,
|
2019-05-02 14:33:34 +02:00
|
|
|
draftSnippet_attr,
|
|
|
|
draftSnippet_clone,
|
|
|
|
draftUtils_linesintersect,
|
|
|
|
draftUtils_beamsintersect,
|
|
|
|
draftUtils_beamintersectsx,
|
|
|
|
draftUtils_beamintersectsy,
|
|
|
|
draftUtils_lineintersectscurve,
|
|
|
|
draftUtils_curvesintersect,
|
|
|
|
draftUtils_pointonbeam,
|
|
|
|
draftUtils_pointonline,
|
|
|
|
draftUtils_pointoncurve,
|
|
|
|
draftUtils_circlesintersect,
|
|
|
|
draftUtils_beamintersectscircle,
|
|
|
|
draftUtils_lineintersectscircle,
|
|
|
|
draftUtils_curveintersectsx,
|
|
|
|
draftUtils_curveintersectsy,
|
2019-05-18 17:17:44 +02:00
|
|
|
draftUtils_splitcurve,
|
2019-05-20 16:25:55 +02:00
|
|
|
draftDocs_overview,
|
|
|
|
draftDocs_coords
|
2019-05-02 14:33:34 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
for (let m of Object.keys(methods)) Pattern.prototype[m] = methods[m];
|
|
|
|
|
|
|
|
export default Pattern;
|