1
0
Fork 0
freesewing/packages/brian/src/back.js

81 lines
1.7 KiB
JavaScript
Raw Normal View History

2018-07-24 10:16:31 +00:00
import * as F from "freesewing";
import base from "./base";
var back = {
draft: function(part) {
2018-07-24 10:16:31 +00:00
let {
measurements,
options,
points,
paths,
snippets,
macro,
final,
paperless
} = F.utils.shorthand(part);
base.draft(part);
paths.seam = new F.path()
.move(points.cbNeck)
.line(points.cbHips)
.line(points.hips)
.line(points.armhole)
.curve(points.armholeCp1, points.armholeCp2, points.armholeHollow)
2018-07-24 10:16:31 +00:00
.curve(
points.armholeHollowCp1,
points.armholeHollowCp2,
points.armholePitch
)
.curve(points.armholePitchCp1, points.armholePitchCp2, points.shoulder)
.line(points.neck)
.curve(points.neckCp1, points.cbNeck, points.cbNeck)
2018-07-24 10:16:31 +00:00
.close();
2018-07-19 14:43:27 +00:00
// Final?
var decorate = function(part) {
2018-07-24 10:16:31 +00:00
macro("cutonfold", {
from: points.cbNeck,
to: points.cbHips,
grainline: true
});
points.title = new F.point(
points.armholePitch.x / 2,
points.armholePitch.y
);
macro("title", { at: points.title, nr: 2 });
points.logo = points.title.shift(-90, 100);
snippets.logo = new F.snippet("logo", points.logo);
2018-07-26 13:43:45 +00:00
console.log("path offset");
points.t1 = new F.point(100, 400);
points.t2 = new F.point(200, 400);
points.t3 = new F.point(200, 500);
points.t4 = new F.point(100, 500);
paths.test = new F.path()
.move(points.t1)
.line(points.t2)
.line(points.t3)
.line(points.t4)
.close();
paths.test.offset(10);
2018-07-24 10:16:31 +00:00
};
2018-07-19 14:43:27 +00:00
2018-07-24 10:16:31 +00:00
if (final) {
decorate(part);
2018-07-19 14:43:27 +00:00
}
// Paperless?
var gauge = function(part) {};
2018-07-19 14:43:27 +00:00
2018-07-24 10:16:31 +00:00
if (paperless) {
gauge(part);
2018-07-19 14:43:27 +00:00
}
}
2018-07-24 10:16:31 +00:00
};
export default back;