1
0
Fork 0

construction: Added second part

This commit is contained in:
Joost De Cock 2018-08-03 17:44:55 +02:00
parent 9bead1d272
commit 3a7460da1d
7 changed files with 90 additions and 47 deletions

View file

@ -3,20 +3,9 @@ import base from "./base";
var back = {
draft: function(part) {
let {
sa,
measurements,
options,
points,
paths,
snippets,
path,
point,
snippet,
final,
paperless,
macro
} = freesewing.utils.shorthand(part);
// prettier-ignore
let {sa, point, points, path, paths, snippet, snippets, final, paperless, macro} = freesewing.utils.shorthand(part);
base.draft(part);
paths.seam = new path()
@ -36,6 +25,9 @@ var back = {
.close()
.attr("class", "fabric");
// Anchor point for sampling
points.gridAnchor = points.cbHips;
// Final?
if (final) {
macro("cutonfold", {
@ -52,6 +44,7 @@ var back = {
points.logo = points.title.shift(-90, 100);
snippets.logo = new snippet("logo", points.logo);
snippets.armholePitchNotch = new snippet("notch", points.armholePitch);
if (sa) paths.sa = paths.seam.offset(sa).attr("class", "fabric sa");
}
@ -116,7 +109,19 @@ var back = {
),
d: sa + 15
});
macro("pd", {
path: new path()
.move(points.armholePitch)
.curve(
points.armholePitchCp1,
points.armholePitchCp2,
points.shoulder
),
d: -15
});
}
return part;
}
};

View file

@ -0,0 +1,14 @@
import freesewing from "freesewing";
import base from "./base";
var front = {
draft: function(part) {
// prettier-ignore
let {sa, point, points, path, paths, snippet, snippets, final, paperless, macro} = freesewing.utils.shorthand(part);
macro("title", { at: points.title, nr: 1 });
return part;
}
};
export default front;

View file

@ -5,6 +5,7 @@ import logo from "@freesewing/plugin-logo";
import dimension from "@freesewing/plugin-dimension";
import config from "../config/config";
import back from "./back";
import front from "./front";
import { version } from "../package.json";
var pattern = new freesewing.pattern({ version: version, ...config })
@ -14,7 +15,12 @@ var pattern = new freesewing.pattern({ version: version, ...config })
.with(dimension);
pattern.draft = function() {
// Draft back
back.draft(pattern.parts.back);
// Clone back
pattern.parts.front = pattern.parts.back.clone(pattern.parts.front.id);
// Draft front
front.draft(pattern.parts.front);
return pattern;
};