construction: Initegrated plugin-dimension
This commit is contained in:
parent
0f28d90147
commit
9bead1d272
3 changed files with 68 additions and 13 deletions
|
@ -14,7 +14,7 @@
|
||||||
console.log(this);
|
console.log(this);
|
||||||
var pattern = freesewing.patterns.brian
|
var pattern = freesewing.patterns.brian
|
||||||
.with(freesewing.plugins.theme)
|
.with(freesewing.plugins.theme)
|
||||||
//.with(freesewing.plugins.designer);
|
.with(freesewing.plugins.designer);
|
||||||
|
|
||||||
pattern.settings.measurements = {
|
pattern.settings.measurements = {
|
||||||
bicepsCircumference: 335,
|
bicepsCircumference: 335,
|
||||||
|
@ -29,8 +29,11 @@ console.log(this);
|
||||||
wristCircumference: 190
|
wristCircumference: 190
|
||||||
};
|
};
|
||||||
pattern.settings.mode = 'draft';
|
pattern.settings.mode = 'draft';
|
||||||
|
pattern.settings.paperless = true;
|
||||||
|
pattern.settings.sa = 10;
|
||||||
|
pattern.settings.units = 'metric';
|
||||||
pattern.on('preRenderSvg', function(next) {
|
pattern.on('preRenderSvg', function(next) {
|
||||||
this.attributes.add('viewBox', '-20 -20 400 700');
|
this.attributes.add('viewBox', '-40 -60 400 700');
|
||||||
next();
|
next();
|
||||||
});
|
});
|
||||||
pattern.draft();
|
pattern.draft();
|
||||||
|
|
|
@ -4,6 +4,7 @@ import base from "./base";
|
||||||
var back = {
|
var back = {
|
||||||
draft: function(part) {
|
draft: function(part) {
|
||||||
let {
|
let {
|
||||||
|
sa,
|
||||||
measurements,
|
measurements,
|
||||||
options,
|
options,
|
||||||
points,
|
points,
|
||||||
|
@ -36,8 +37,7 @@ var back = {
|
||||||
.attr("class", "fabric");
|
.attr("class", "fabric");
|
||||||
|
|
||||||
// Final?
|
// Final?
|
||||||
|
if (final) {
|
||||||
var decorate = function(part) {
|
|
||||||
macro("cutonfold", {
|
macro("cutonfold", {
|
||||||
from: points.cbNeck,
|
from: points.cbNeck,
|
||||||
to: points.cbHips,
|
to: points.cbHips,
|
||||||
|
@ -53,19 +53,69 @@ var back = {
|
||||||
points.logo = points.title.shift(-90, 100);
|
points.logo = points.title.shift(-90, 100);
|
||||||
snippets.logo = new snippet("logo", points.logo);
|
snippets.logo = new snippet("logo", points.logo);
|
||||||
|
|
||||||
//paths.sa = paths.seam.offset(10).attr('class', 'fabric sa');
|
if (sa) paths.sa = paths.seam.offset(sa).attr("class", "fabric sa");
|
||||||
};
|
|
||||||
|
|
||||||
if (final) {
|
|
||||||
decorate(part);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Paperless?
|
// Paperless?
|
||||||
|
|
||||||
var gauge = function(part) {};
|
|
||||||
|
|
||||||
if (paperless) {
|
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
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,6 +2,7 @@ import freesewing from "freesewing";
|
||||||
import cutonfold from "@freesewing/plugin-cutonfold";
|
import cutonfold from "@freesewing/plugin-cutonfold";
|
||||||
import title from "@freesewing/plugin-title";
|
import title from "@freesewing/plugin-title";
|
||||||
import logo from "@freesewing/plugin-logo";
|
import logo from "@freesewing/plugin-logo";
|
||||||
|
import dimension from "@freesewing/plugin-dimension";
|
||||||
import config from "../config/config";
|
import config from "../config/config";
|
||||||
import back from "./back";
|
import back from "./back";
|
||||||
import { version } from "../package.json";
|
import { version } from "../package.json";
|
||||||
|
@ -9,7 +10,8 @@ import { version } from "../package.json";
|
||||||
var pattern = new freesewing.pattern({ version: version, ...config })
|
var pattern = new freesewing.pattern({ version: version, ...config })
|
||||||
.with(cutonfold)
|
.with(cutonfold)
|
||||||
.with(title)
|
.with(title)
|
||||||
.with(logo);
|
.with(logo)
|
||||||
|
.with(dimension);
|
||||||
|
|
||||||
pattern.draft = function() {
|
pattern.draft = function() {
|
||||||
back.draft(pattern.parts.back);
|
back.draft(pattern.parts.back);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue