From 9bead1d2729da2038deb649cacc00ee1c243478d Mon Sep 17 00:00:00 2001 From: Joost De Cock Date: Wed, 1 Aug 2018 14:55:16 +0200 Subject: [PATCH] construction: Initegrated plugin-dimension --- packages/brian/index.html | 7 ++-- packages/brian/src/back.js | 70 +++++++++++++++++++++++++++++++------ packages/brian/src/index.js | 4 ++- 3 files changed, 68 insertions(+), 13 deletions(-) diff --git a/packages/brian/index.html b/packages/brian/index.html index 77da9ccf27a..fef537da37a 100644 --- a/packages/brian/index.html +++ b/packages/brian/index.html @@ -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(); diff --git a/packages/brian/src/back.js b/packages/brian/src/back.js index 7fe4dd4aa14..91375d618f9 100644 --- a/packages/brian/src/back.js +++ b/packages/brian/src/back.js @@ -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 + }); } } }; diff --git a/packages/brian/src/index.js b/packages/brian/src/index.js index 5ad82a2dad2..b702e315f2a 100644 --- a/packages/brian/src/index.js +++ b/packages/brian/src/index.js @@ -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);