1
0
Fork 0

construction: Initegrated plugin-dimension

This commit is contained in:
Joost De Cock 2018-08-01 14:55:16 +02:00
parent 0f28d90147
commit 9bead1d272
3 changed files with 68 additions and 13 deletions

View file

@ -14,7 +14,7 @@
console.log(this);
var pattern = freesewing.patterns.brian
.with(freesewing.plugins.theme)
//.with(freesewing.plugins.designer);
.with(freesewing.plugins.designer);
pattern.settings.measurements = {
bicepsCircumference: 335,
@ -29,8 +29,11 @@ console.log(this);
wristCircumference: 190
};
pattern.settings.mode = 'draft';
pattern.settings.paperless = true;
pattern.settings.sa = 10;
pattern.settings.units = 'metric';
pattern.on('preRenderSvg', function(next) {
this.attributes.add('viewBox', '-20 -20 400 700');
this.attributes.add('viewBox', '-40 -60 400 700');
next();
});
pattern.draft();

View file

@ -4,6 +4,7 @@ import base from "./base";
var back = {
draft: function(part) {
let {
sa,
measurements,
options,
points,
@ -36,8 +37,7 @@ var back = {
.attr("class", "fabric");
// Final?
var decorate = function(part) {
if (final) {
macro("cutonfold", {
from: points.cbNeck,
to: points.cbHips,
@ -53,19 +53,69 @@ var back = {
points.logo = points.title.shift(-90, 100);
snippets.logo = new snippet("logo", points.logo);
//paths.sa = paths.seam.offset(10).attr('class', 'fabric sa');
};
if (final) {
decorate(part);
if (sa) paths.sa = paths.seam.offset(sa).attr("class", "fabric sa");
}
// Paperless?
var gauge = function(part) {};
if (paperless) {
gauge(part);
macro("hd", {
from: points.cbHips,
to: points.hips,
y: points.hips.y + sa + 15
});
macro("vd", {
from: points.hips,
to: points.armhole,
x: points.hips.x + sa + 15
});
macro("vd", {
from: points.hips,
to: points.armholePitch,
x: points.hips.x + sa + 30
});
macro("vd", {
from: points.hips,
to: points.shoulder,
x: points.hips.x + sa + 45
});
macro("vd", {
from: points.hips,
to: points.neck,
x: points.hips.x + sa + 60
});
macro("vd", {
from: points.cbHips,
to: points.cbNeck,
x: points.cbHips.x - sa - 15
});
macro("hd", {
from: points.cbNeck,
to: points.neck,
y: points.neck.y - sa - 15
});
macro("hd", {
from: points.cbNeck,
to: points.shoulder,
y: points.neck.y - sa - 30
});
macro("ld", { from: points.neck, to: points.shoulder, d: sa + 15 });
macro("pd", {
path: new path()
.move(points.armhole)
.curve(points.armholeCp1, points.armholeCp2, points.armholeHollow)
.curve(
points.armholeHollowCp1,
points.armholeHollowCp2,
points.armholePitch
)
.curve(
points.armholePitchCp1,
points.armholePitchCp2,
points.shoulder
),
d: sa + 15
});
}
}
};

View file

@ -2,6 +2,7 @@ import freesewing from "freesewing";
import cutonfold from "@freesewing/plugin-cutonfold";
import title from "@freesewing/plugin-title";
import logo from "@freesewing/plugin-logo";
import dimension from "@freesewing/plugin-dimension";
import config from "../config/config";
import back from "./back";
import { version } from "../package.json";
@ -9,7 +10,8 @@ import { version } from "../package.json";
var pattern = new freesewing.pattern({ version: version, ...config })
.with(cutonfold)
.with(title)
.with(logo);
.with(logo)
.with(dimension);
pattern.draft = function() {
back.draft(pattern.parts.back);