🎨 Updated prettier config
This commit is contained in:
parent
b8e632998b
commit
6710d76b08
401 changed files with 13193 additions and 15620 deletions
|
@ -1,7 +1,7 @@
|
|||
import { calculateReduction } from "./shared";
|
||||
import { calculateReduction } from './shared'
|
||||
|
||||
export default part => {
|
||||
part.paths = {}; // Removes paperless dimensions from brian
|
||||
part.paths = {} // Removes paperless dimensions from brian
|
||||
let {
|
||||
store,
|
||||
measurements,
|
||||
|
@ -17,60 +17,50 @@ export default part => {
|
|||
paperless,
|
||||
macro,
|
||||
options
|
||||
} = part.shorthand();
|
||||
} = part.shorthand()
|
||||
|
||||
// Populare store with data we need
|
||||
calculateReduction(part);
|
||||
calculateReduction(part)
|
||||
store.set(
|
||||
"backArmholeLength",
|
||||
'backArmholeLength',
|
||||
new Path()
|
||||
.move(points.armhole)
|
||||
.curve(points.armholeCp2, points.armholeHollowCp1, points.armholeHollow)
|
||||
.curve(
|
||||
points.armholeHollowCp2,
|
||||
points.armholePitchCp1,
|
||||
points.armholePitch
|
||||
)
|
||||
.curve(points.armholeHollowCp2, points.armholePitchCp1, points.armholePitch)
|
||||
.curve(points.armholePitchCp2, points.shoulderCp1, points.shoulder)
|
||||
.length()
|
||||
);
|
||||
)
|
||||
|
||||
// Hip shaping
|
||||
points.hips = points.hips.shift(180, store.get("hipsReduction") / 4);
|
||||
points.hem = points.hem.shift(180, store.get("hipsReduction") / 4);
|
||||
points.hips = points.hips.shift(180, store.get('hipsReduction') / 4)
|
||||
points.hem = points.hem.shift(180, store.get('hipsReduction') / 4)
|
||||
|
||||
// Waist shaping
|
||||
let reduce = store.get("waistReduction");
|
||||
let reduce = store.get('waistReduction')
|
||||
if (reduce / 4 > options.minimalDartShaping) {
|
||||
// Add darts in the back
|
||||
points.waist = points.waist.shift(180, reduce / 8);
|
||||
points.dartCenter = points.cbWaist.shiftFractionTowards(points.waist, 0.6);
|
||||
points.dartTop = points.dartCenter.shift(
|
||||
90,
|
||||
points.armhole.dy(points.waist) * 0.75
|
||||
);
|
||||
points.dartBottom = points.dartCenter.shift(
|
||||
-90,
|
||||
measurements.naturalWaistToHip * 0.75
|
||||
);
|
||||
points.dartCenterIn = points.dartCenter.shift(180, reduce / 8);
|
||||
points.dartCenterOut = points.dartCenter.shift(0, reduce / 8);
|
||||
points.waist = points.waist.shift(180, reduce / 8)
|
||||
points.dartCenter = points.cbWaist.shiftFractionTowards(points.waist, 0.6)
|
||||
points.dartTop = points.dartCenter.shift(90, points.armhole.dy(points.waist) * 0.75)
|
||||
points.dartBottom = points.dartCenter.shift(-90, measurements.naturalWaistToHip * 0.75)
|
||||
points.dartCenterIn = points.dartCenter.shift(180, reduce / 8)
|
||||
points.dartCenterOut = points.dartCenter.shift(0, reduce / 8)
|
||||
points.dartCenterInCp1 = points.dartCenterIn.shift(
|
||||
90,
|
||||
points.dartTop.dy(points.dartCenter) * 0.2
|
||||
);
|
||||
)
|
||||
points.dartCenterInCp2 = points.dartCenterIn.shift(
|
||||
90,
|
||||
points.dartBottom.dy(points.dartCenter) * 0.2
|
||||
);
|
||||
)
|
||||
points.dartCenterOutCp1 = points.dartCenterOut.shift(
|
||||
90,
|
||||
points.dartBottom.dy(points.dartCenter) * 0.2
|
||||
);
|
||||
)
|
||||
points.dartCenterOutCp2 = points.dartCenterOut.shift(
|
||||
90,
|
||||
points.dartTop.dy(points.dartCenter) * 0.2
|
||||
);
|
||||
)
|
||||
paths.dart = new Path()
|
||||
.move(points.dartTop)
|
||||
._curve(points.dartCenterInCp1, points.dartCenterIn)
|
||||
|
@ -78,35 +68,28 @@ export default part => {
|
|||
._curve(points.dartCenterOutCp1, points.dartCenterOut)
|
||||
.curve_(points.dartCenterOutCp2, points.dartTop)
|
||||
.close()
|
||||
.attr("class", "fabric");
|
||||
.attr('class', 'fabric')
|
||||
} else {
|
||||
// No darts in the back
|
||||
points.waist = points.waist.shift(180, reduce / 4);
|
||||
points.waist = points.waist.shift(180, reduce / 4)
|
||||
}
|
||||
points.waistCp1 = points.waist.shift(
|
||||
-90,
|
||||
measurements.naturalWaistToHip * 0.5
|
||||
);
|
||||
points.waistCp2 = points.waist.shift(90, points.armhole.dy(points.waist) / 2);
|
||||
points.hipsCp2 = points.hips.shift(90, points.waist.dy(points.hips) / 4);
|
||||
points.waistCp1 = points.waist.shift(-90, measurements.naturalWaistToHip * 0.5)
|
||||
points.waistCp2 = points.waist.shift(90, points.armhole.dy(points.waist) / 2)
|
||||
points.hipsCp2 = points.hips.shift(90, points.waist.dy(points.hips) / 4)
|
||||
|
||||
// Yoke dart
|
||||
paths.armhole = new Path()
|
||||
.move(points.armhole)
|
||||
.curve(points.armholeCp2, points.armholeHollowCp1, points.armholeHollow)
|
||||
.curve(
|
||||
points.armholeHollowCp2,
|
||||
points.armholePitchCp1,
|
||||
points.armholePitch
|
||||
);
|
||||
paths.armhole.render = false;
|
||||
.curve(points.armholeHollowCp2, points.armholePitchCp1, points.armholePitch)
|
||||
paths.armhole.render = false
|
||||
if (options.yokeDart > 0) {
|
||||
points.tmp1 = points.armholePitch.shift(
|
||||
-90,
|
||||
points.armholePitch.dy(points.armhole) * options.yokeDart
|
||||
);
|
||||
points.tmp2 = points.tmp1.shift(180, 50);
|
||||
points.tmp3 = points.tmp1.shift(0, 50);
|
||||
)
|
||||
points.tmp2 = points.tmp1.shift(180, 50)
|
||||
points.tmp3 = points.tmp1.shift(0, 50)
|
||||
points.yokeDartEdge = utils.lineIntersectsCurve(
|
||||
points.tmp2,
|
||||
points.tmp3,
|
||||
|
@ -114,69 +97,59 @@ export default part => {
|
|||
points.armholePitchCp1,
|
||||
points.armholeHollowCp2,
|
||||
points.armholeHollow
|
||||
);
|
||||
points.yokeDartTip = points.armholePitch.shift(
|
||||
180,
|
||||
points.armholePitch.x * 0.4
|
||||
);
|
||||
points.yokeDartTipCp1 = points.armholePitch.shiftFractionTowards(
|
||||
points.yokeDartTip,
|
||||
0.4
|
||||
);
|
||||
paths.armhole = paths.armhole.split(points.yokeDartEdge)[0];
|
||||
paths.armhole._curve(points.yokeDartTipCp1, points.yokeDartTip);
|
||||
)
|
||||
points.yokeDartTip = points.armholePitch.shift(180, points.armholePitch.x * 0.4)
|
||||
points.yokeDartTipCp1 = points.armholePitch.shiftFractionTowards(points.yokeDartTip, 0.4)
|
||||
paths.armhole = paths.armhole.split(points.yokeDartEdge)[0]
|
||||
paths.armhole._curve(points.yokeDartTipCp1, points.yokeDartTip)
|
||||
// Adapt armhole length to accomodate dart
|
||||
store.set(
|
||||
"backArmholeLength",
|
||||
store.get("backArmholeLength") -
|
||||
points.yokeDartEdge.dist(points.armholePitch)
|
||||
);
|
||||
'backArmholeLength',
|
||||
store.get('backArmholeLength') - points.yokeDartEdge.dist(points.armholePitch)
|
||||
)
|
||||
}
|
||||
|
||||
// Cut off at yoke
|
||||
points.cbYoke = new Point(0, points.armholePitch.y);
|
||||
points.cbYoke = new Point(0, points.armholePitch.y)
|
||||
|
||||
// Draft hem
|
||||
switch (options.hemStyle) {
|
||||
case "baseball":
|
||||
points.bballStart = points.cbHem.shiftFractionTowards(points.hem, 0.5);
|
||||
points.bballEnd = points.hem.shiftFractionTowards(
|
||||
points.hips,
|
||||
options.hemCurve
|
||||
);
|
||||
points.bballCp1 = points.bballStart.shiftFractionTowards(points.hem, 0.5);
|
||||
points.bballCp2 = new Point(points.bballCp1.x, points.bballEnd.y);
|
||||
case 'baseball':
|
||||
points.bballStart = points.cbHem.shiftFractionTowards(points.hem, 0.5)
|
||||
points.bballEnd = points.hem.shiftFractionTowards(points.hips, options.hemCurve)
|
||||
points.bballCp1 = points.bballStart.shiftFractionTowards(points.hem, 0.5)
|
||||
points.bballCp2 = new Point(points.bballCp1.x, points.bballEnd.y)
|
||||
paths.saBase = new Path()
|
||||
.move(points.bballEnd)
|
||||
.line(points.hips)
|
||||
.curve(points.hipsCp2, points.waistCp1, points.waist)
|
||||
.curve_(points.waistCp2, points.armhole)
|
||||
.join(paths.armhole)
|
||||
.line(points.cbYoke);
|
||||
.line(points.cbYoke)
|
||||
paths.hemBase = new Path()
|
||||
.move(points.cbHem)
|
||||
.line(points.bballStart)
|
||||
.curve(points.bballCp1, points.bballCp2, points.bballEnd);
|
||||
break;
|
||||
case "slashed":
|
||||
macro("round", {
|
||||
.curve(points.bballCp1, points.bballCp2, points.bballEnd)
|
||||
break
|
||||
case 'slashed':
|
||||
macro('round', {
|
||||
from: points.hips,
|
||||
to: points.cbHem,
|
||||
via: points.hem,
|
||||
radius: points.hips.dist(points.hem) * options.hemCurve,
|
||||
prefix: "slash"
|
||||
});
|
||||
prefix: 'slash'
|
||||
})
|
||||
paths.saBase = new Path()
|
||||
.move(points.hips)
|
||||
.curve(points.hipsCp2, points.waistCp1, points.waist)
|
||||
.curve_(points.waistCp2, points.armhole)
|
||||
.join(paths.armhole)
|
||||
.line(points.cbYoke);
|
||||
.line(points.cbYoke)
|
||||
paths.hemBase = new Path()
|
||||
.move(points.cbHem)
|
||||
.line(points.slashEnd)
|
||||
.curve(points.slashCp2, points.slashCp1, points.slashStart);
|
||||
break;
|
||||
.curve(points.slashCp2, points.slashCp1, points.slashStart)
|
||||
break
|
||||
default:
|
||||
paths.saBase = new Path()
|
||||
.move(points.hem)
|
||||
|
@ -184,34 +157,34 @@ export default part => {
|
|||
.curve(points.hipsCp2, points.waistCp1, points.waist)
|
||||
.curve_(points.waistCp2, points.armhole)
|
||||
.join(paths.armhole)
|
||||
.line(points.cbYoke);
|
||||
paths.hemBase = new Path().move(points.cbHem).line(points.hem);
|
||||
.line(points.cbYoke)
|
||||
paths.hemBase = new Path().move(points.cbHem).line(points.hem)
|
||||
}
|
||||
|
||||
// Paths
|
||||
paths.saBase.render = false;
|
||||
paths.hemBase.render = false;
|
||||
paths.saBase.render = false
|
||||
paths.hemBase.render = false
|
||||
paths.seam = paths.hemBase
|
||||
.join(paths.saBase)
|
||||
.close()
|
||||
.attr("class", "fabric");
|
||||
.attr('class', 'fabric')
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
delete snippets.armholePitchNotch;
|
||||
macro("cutonfold", {
|
||||
delete snippets.armholePitchNotch
|
||||
macro('cutonfold', {
|
||||
from: points.cbYoke,
|
||||
to: points.cbHem,
|
||||
grainline: true
|
||||
});
|
||||
points.title = new Point(points.armhole.x / 4, points.armhole.y);
|
||||
macro("title", { at: points.title, nr: 3, title: "back" });
|
||||
points.logo = points.title.shift(-90, 70);
|
||||
snippets.logo = new Snippet("logo", points.logo);
|
||||
})
|
||||
points.title = new Point(points.armhole.x / 4, points.armhole.y)
|
||||
macro('title', { at: points.title, nr: 3, title: 'back' })
|
||||
points.logo = points.title.shift(-90, 70)
|
||||
snippets.logo = new Snippet('logo', points.logo)
|
||||
|
||||
if (sa) {
|
||||
paths.sa = paths.saBase.offset(sa).attr("class", "fabric sa");
|
||||
paths.hemSa = paths.hemBase.offset(sa * 3).attr("class", "fabric sa");
|
||||
paths.sa = paths.saBase.offset(sa).attr('class', 'fabric sa')
|
||||
paths.hemSa = paths.hemBase.offset(sa * 3).attr('class', 'fabric sa')
|
||||
paths.saConnect = new Path()
|
||||
.move(points.cbHem)
|
||||
.line(paths.hemSa.start())
|
||||
|
@ -219,131 +192,131 @@ export default part => {
|
|||
.line(paths.sa.start())
|
||||
.move(paths.sa.end())
|
||||
.line(points.cbYoke)
|
||||
.attr("class", "fabric sa");
|
||||
macro("banner", {
|
||||
path: "hemSa",
|
||||
text: ["hem", ": 3x", "seamAllowance"]
|
||||
});
|
||||
.attr('class', 'fabric sa')
|
||||
macro('banner', {
|
||||
path: 'hemSa',
|
||||
text: ['hem', ': 3x', 'seamAllowance']
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
if (reduce / 4 > options.minimalDartShaping) {
|
||||
macro("vd", {
|
||||
macro('vd', {
|
||||
from: points.dartBottom,
|
||||
to: points.dartCenterIn,
|
||||
x: points.dartCenterIn.x - 15
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.dartCenterIn,
|
||||
to: points.dartTop,
|
||||
x: points.dartCenterIn.x - 15
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.dartCenterIn,
|
||||
to: points.dartCenterOut,
|
||||
y: points.dartBottom.y + 15
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.dartCenterOut,
|
||||
to: points.waist
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.cbWaist,
|
||||
to: points.dartCenterIn
|
||||
});
|
||||
})
|
||||
} else {
|
||||
macro("hd", {
|
||||
macro('hd', {
|
||||
from: points.cbWaist,
|
||||
to: points.waist
|
||||
});
|
||||
})
|
||||
}
|
||||
let bottomRight;
|
||||
if (typeof points.slashEnd !== "undefined") {
|
||||
macro("hd", {
|
||||
let bottomRight
|
||||
if (typeof points.slashEnd !== 'undefined') {
|
||||
macro('hd', {
|
||||
from: points.cbHem,
|
||||
to: points.slashEnd,
|
||||
y: points.cbHem.y + 15 + 3 * sa
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.slashEnd,
|
||||
to: points.slashStart,
|
||||
x: points.slashStart.x + 15 + 3 * sa
|
||||
});
|
||||
bottomRight = points.slashEnd;
|
||||
} else if (typeof points.bballStart !== "undefined") {
|
||||
macro("hd", {
|
||||
})
|
||||
bottomRight = points.slashEnd
|
||||
} else if (typeof points.bballStart !== 'undefined') {
|
||||
macro('hd', {
|
||||
from: points.cbHem,
|
||||
to: points.bballStart,
|
||||
y: points.cbHem.y + 15 + 3 * sa
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.bballStart,
|
||||
to: points.bballEnd,
|
||||
x: points.hips.x + 15 + sa
|
||||
});
|
||||
bottomRight = points.bballStart;
|
||||
} else bottomRight = points.hem;
|
||||
macro("hd", {
|
||||
})
|
||||
bottomRight = points.bballStart
|
||||
} else bottomRight = points.hem
|
||||
macro('hd', {
|
||||
from: points.cbHem,
|
||||
to: points.hips,
|
||||
y: points.cbHem.y + 30 + 3 * sa
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: bottomRight,
|
||||
to: points.hips,
|
||||
x: points.hips.x + 30 + sa
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: bottomRight,
|
||||
to: points.waist,
|
||||
x: points.hips.x + 45 + sa
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: bottomRight,
|
||||
to: points.armhole,
|
||||
x: points.hips.x + 60 + sa
|
||||
});
|
||||
})
|
||||
if (options.yokeDart > 0) {
|
||||
macro("vd", {
|
||||
macro('vd', {
|
||||
from: points.armhole,
|
||||
to: points.yokeDartEdge,
|
||||
x: points.armhole.x + 15 + sa
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.armhole,
|
||||
to: points.yokeDartTip,
|
||||
x: points.armhole.x + 30 + sa
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.cbYoke,
|
||||
to: points.yokeDartTip,
|
||||
y: points.cbYoke.y - 15 - sa
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.cbYoke,
|
||||
to: points.yokeDartEdge,
|
||||
y: points.cbYoke.y - 30 - sa
|
||||
});
|
||||
})
|
||||
} else {
|
||||
macro("vd", {
|
||||
macro('vd', {
|
||||
from: points.armhole,
|
||||
to: points.armholePitch,
|
||||
x: points.armhole.x + 15 + sa
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.cbYoke,
|
||||
to: points.armholePitch,
|
||||
y: points.cbYoke.y - 15 - sa
|
||||
});
|
||||
})
|
||||
}
|
||||
macro("vd", {
|
||||
macro('vd', {
|
||||
from: points.cbHem,
|
||||
to: points.cbYoke,
|
||||
x: points.cbHem.x - 15
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
return part;
|
||||
};
|
||||
return part
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { addButtonHoles } from "./shared";
|
||||
import { addButtonHoles } from './shared'
|
||||
|
||||
export default part => {
|
||||
let {
|
||||
|
@ -14,21 +14,18 @@ export default part => {
|
|||
paperless,
|
||||
macro,
|
||||
options
|
||||
} = part.shorthand();
|
||||
} = part.shorthand()
|
||||
|
||||
if (
|
||||
!options.seperateButtonholePlacket ||
|
||||
options.buttonholePlacketStyle !== "classic"
|
||||
) {
|
||||
part.paths = {};
|
||||
part.snippets = {};
|
||||
part.points = {};
|
||||
return part;
|
||||
if (!options.seperateButtonholePlacket || options.buttonholePlacketStyle !== 'classic') {
|
||||
part.paths = {}
|
||||
part.snippets = {}
|
||||
part.points = {}
|
||||
return part
|
||||
}
|
||||
|
||||
for (let id of Object.keys(part.paths)) delete part.paths[id];
|
||||
let width = options.buttonholePlacketWidth;
|
||||
let fold = options.buttonholePlacketFoldWidth;
|
||||
for (let id of Object.keys(part.paths)) delete part.paths[id]
|
||||
let width = options.buttonholePlacketWidth
|
||||
let fold = options.buttonholePlacketFoldWidth
|
||||
|
||||
points.topInnerEdge = utils.lineIntersectsCurve(
|
||||
new Point(points.cfNeck.x + fold * 2, points.cfNeck.y + 20),
|
||||
|
@ -37,65 +34,38 @@ export default part => {
|
|||
points.cfNeckCp1,
|
||||
points.neckCp2Front,
|
||||
points.neck
|
||||
);
|
||||
points.bottomInnerEdge = new Point(points.topInnerEdge.x, points.cfHem.y);
|
||||
)
|
||||
points.bottomInnerEdge = new Point(points.topInnerEdge.x, points.cfHem.y)
|
||||
|
||||
points.placketCfNeck = points.cfNeck.shift(180, fold * 2);
|
||||
points.placketTopInnerEdgeFold = points.placketCfNeck.shift(0, width / 2);
|
||||
points.placketTopInnerEdgeOver = points.placketCfNeck.shift(
|
||||
0,
|
||||
width / 2 - fold
|
||||
);
|
||||
points.placketTopInnerEdgeUnder = points.placketCfNeck.shift(
|
||||
0,
|
||||
width / 2 + fold
|
||||
);
|
||||
points.placketTopOuterEdgeFold = points.placketCfNeck.shift(180, width / 2);
|
||||
points.placketTopOuterEdgeOver = points.placketCfNeck.shift(
|
||||
180,
|
||||
width / 2 - fold
|
||||
);
|
||||
points.placketTopOuterEdgeUnder = points.placketCfNeck.shift(
|
||||
180,
|
||||
width / 2 + fold
|
||||
);
|
||||
points.placketCfHem = points.cfHem.shift(180, fold * 2);
|
||||
points.placketBottomInnerEdgeFold = points.placketCfHem.shift(0, width / 2);
|
||||
points.placketBottomInnerEdgeOver = points.placketCfHem.shift(
|
||||
0,
|
||||
width / 2 - fold
|
||||
);
|
||||
points.placketBottomInnerEdgeUnder = points.placketCfHem.shift(
|
||||
0,
|
||||
width / 2 + fold
|
||||
);
|
||||
points.placketBottomOuterEdgeFold = points.placketCfHem.shift(180, width / 2);
|
||||
points.placketBottomOuterEdgeOver = points.placketCfHem.shift(
|
||||
180,
|
||||
width / 2 - fold
|
||||
);
|
||||
points.placketBottomOuterEdgeUnder = points.placketCfHem.shift(
|
||||
180,
|
||||
width / 2 + fold
|
||||
);
|
||||
points.placketTopEdge = points.placketTopOuterEdgeFold.shift(180, width);
|
||||
points.placketBottomEdge = points.placketBottomOuterEdgeFold.shift(
|
||||
180,
|
||||
width
|
||||
);
|
||||
points.placketCfNeck = points.cfNeck.shift(180, fold * 2)
|
||||
points.placketTopInnerEdgeFold = points.placketCfNeck.shift(0, width / 2)
|
||||
points.placketTopInnerEdgeOver = points.placketCfNeck.shift(0, width / 2 - fold)
|
||||
points.placketTopInnerEdgeUnder = points.placketCfNeck.shift(0, width / 2 + fold)
|
||||
points.placketTopOuterEdgeFold = points.placketCfNeck.shift(180, width / 2)
|
||||
points.placketTopOuterEdgeOver = points.placketCfNeck.shift(180, width / 2 - fold)
|
||||
points.placketTopOuterEdgeUnder = points.placketCfNeck.shift(180, width / 2 + fold)
|
||||
points.placketCfHem = points.cfHem.shift(180, fold * 2)
|
||||
points.placketBottomInnerEdgeFold = points.placketCfHem.shift(0, width / 2)
|
||||
points.placketBottomInnerEdgeOver = points.placketCfHem.shift(0, width / 2 - fold)
|
||||
points.placketBottomInnerEdgeUnder = points.placketCfHem.shift(0, width / 2 + fold)
|
||||
points.placketBottomOuterEdgeFold = points.placketCfHem.shift(180, width / 2)
|
||||
points.placketBottomOuterEdgeOver = points.placketCfHem.shift(180, width / 2 - fold)
|
||||
points.placketBottomOuterEdgeUnder = points.placketCfHem.shift(180, width / 2 + fold)
|
||||
points.placketTopEdge = points.placketTopOuterEdgeFold.shift(180, width)
|
||||
points.placketBottomEdge = points.placketBottomOuterEdgeFold.shift(180, width)
|
||||
|
||||
paths.saBase = new Path()
|
||||
.move(points.placketTopEdge)
|
||||
.line(points.cfNeck)
|
||||
.curve(points.cfNeckCp1, points.neckCp2Front, points.neck)
|
||||
.split(points.topInnerEdge)[0]
|
||||
.line(points.bottomInnerEdge);
|
||||
.line(points.bottomInnerEdge)
|
||||
|
||||
paths.seam = paths.saBase
|
||||
.clone()
|
||||
.line(points.placketBottomEdge)
|
||||
.close()
|
||||
.attr("class", "fabric");
|
||||
.attr('class', 'fabric')
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
|
@ -103,117 +73,107 @@ export default part => {
|
|||
paths.frontCenter = new Path()
|
||||
.move(points.placketCfNeck)
|
||||
.line(points.placketCfHem)
|
||||
.attr("class", "help");
|
||||
.attr('class', 'help')
|
||||
paths.placketInnerEdgeFold = new Path()
|
||||
.move(points.placketTopInnerEdgeFold)
|
||||
.line(points.placketBottomInnerEdgeFold)
|
||||
.attr("class", "dotted");
|
||||
.attr('class', 'dotted')
|
||||
paths.placketInnerEdgeOver = new Path()
|
||||
.move(points.placketTopInnerEdgeOver)
|
||||
.line(points.placketBottomInnerEdgeOver)
|
||||
.attr("class", "dotted");
|
||||
.attr('class', 'dotted')
|
||||
paths.placketOuterEdgeFold = new Path()
|
||||
.move(points.placketTopOuterEdgeFold)
|
||||
.line(points.placketBottomOuterEdgeFold)
|
||||
.attr("class", "dotted");
|
||||
.attr('class', 'dotted')
|
||||
paths.placketOuterEdgeOver = new Path()
|
||||
.move(points.placketTopOuterEdgeOver)
|
||||
.line(points.placketBottomOuterEdgeOver)
|
||||
.attr("class", "dotted");
|
||||
.attr('class', 'dotted')
|
||||
paths.placketOuterEdgeUnder = new Path()
|
||||
.move(points.placketTopOuterEdgeUnder)
|
||||
.line(points.placketBottomOuterEdgeUnder)
|
||||
.attr("class", "dotted");
|
||||
.attr('class', 'dotted')
|
||||
|
||||
// Notches
|
||||
snippets["cfArmhole-notch"].anchor.x = points.cfArmhole.x - fold * 2;
|
||||
snippets["cfWaist-notch"].anchor.x = points.cfArmhole.x - fold * 2;
|
||||
snippets["cfHips-notch"].anchor.x = points.cfArmhole.x - fold * 2;
|
||||
snippets['cfArmhole-notch'].anchor.x = points.cfArmhole.x - fold * 2
|
||||
snippets['cfWaist-notch'].anchor.x = points.cfArmhole.x - fold * 2
|
||||
snippets['cfHips-notch'].anchor.x = points.cfArmhole.x - fold * 2
|
||||
|
||||
// Buttons
|
||||
addButtonHoles(part, "placketCfNeck");
|
||||
addButtonHoles(part, 'placketCfNeck')
|
||||
|
||||
// Grainline
|
||||
points.grainlineFrom = points.placketBottomEdge.shift(0, width / 2);
|
||||
points.grainlineTo = points.placketTopEdge.shift(0, width / 2);
|
||||
macro("grainline", {
|
||||
points.grainlineFrom = points.placketBottomEdge.shift(0, width / 2)
|
||||
points.grainlineTo = points.placketTopEdge.shift(0, width / 2)
|
||||
macro('grainline', {
|
||||
from: points.grainlineFrom,
|
||||
to: points.grainlineTo
|
||||
});
|
||||
})
|
||||
|
||||
// Title
|
||||
points.title = new Point(points.placketCfNeck.x, points.cfArmhole.y);
|
||||
macro("title", {
|
||||
points.title = new Point(points.placketCfNeck.x, points.cfArmhole.y)
|
||||
macro('title', {
|
||||
at: points.title,
|
||||
nr: "2b",
|
||||
title: "buttonholePlacket",
|
||||
nr: '2b',
|
||||
title: 'buttonholePlacket',
|
||||
scale: 0.75,
|
||||
rotation: -90
|
||||
});
|
||||
})
|
||||
|
||||
// Logo
|
||||
points.logo = points.title.shift(-90, 120);
|
||||
snippets.logo = new Snippet("logo", points.logo)
|
||||
.attr("data-scale", 0.5)
|
||||
.attr("data-rotate", -90);
|
||||
points.logo = points.title.shift(-90, 120)
|
||||
snippets.logo = new Snippet('logo', points.logo)
|
||||
.attr('data-scale', 0.5)
|
||||
.attr('data-rotate', -90)
|
||||
|
||||
if (sa) {
|
||||
paths.sa = paths.saBase.offset(sa * -1);
|
||||
paths.sa = paths.saBase.offset(sa * -1)
|
||||
paths.sa
|
||||
.line(
|
||||
new Point(
|
||||
points.bottomInnerEdge.x + sa,
|
||||
points.bottomInnerEdge.y + 3 * sa
|
||||
)
|
||||
)
|
||||
.line(
|
||||
new Point(
|
||||
points.placketBottomEdge.x,
|
||||
points.placketBottomEdge.y + 3 * sa
|
||||
)
|
||||
)
|
||||
.line(new Point(points.bottomInnerEdge.x + sa, points.bottomInnerEdge.y + 3 * sa))
|
||||
.line(new Point(points.placketBottomEdge.x, points.placketBottomEdge.y + 3 * sa))
|
||||
.line(points.placketBottomEdge)
|
||||
.move(points.placketTopEdge)
|
||||
.line(paths.sa.start())
|
||||
.attr("class", "fabric sa");
|
||||
.attr('class', 'fabric sa')
|
||||
}
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
let offset = 0;
|
||||
let offset = 0
|
||||
for (let pid of [
|
||||
"placketBottomOuterEdgeUnder",
|
||||
"placketBottomOuterEdgeFold",
|
||||
"placketBottomOuterEdgeOver",
|
||||
"placketCfHem",
|
||||
"placketBottomInnerEdgeOver",
|
||||
"placketBottomInnerEdgeFold",
|
||||
"placketBottomInnerEdgeUnder"
|
||||
'placketBottomOuterEdgeUnder',
|
||||
'placketBottomOuterEdgeFold',
|
||||
'placketBottomOuterEdgeOver',
|
||||
'placketCfHem',
|
||||
'placketBottomInnerEdgeOver',
|
||||
'placketBottomInnerEdgeFold',
|
||||
'placketBottomInnerEdgeUnder'
|
||||
]) {
|
||||
offset += 15;
|
||||
macro("hd", {
|
||||
offset += 15
|
||||
macro('hd', {
|
||||
from: points.placketBottomEdge,
|
||||
to: points[pid],
|
||||
y: points.placketBottomEdge.y + offset + 3 * sa
|
||||
});
|
||||
})
|
||||
}
|
||||
points.button0 = points.placketTopEdge;
|
||||
let j;
|
||||
points.button0 = points.placketTopEdge
|
||||
let j
|
||||
for (let i = 0; i < options.buttons; i++) {
|
||||
j = i + 1;
|
||||
macro("vd", {
|
||||
from: points["button" + j],
|
||||
to: points["button" + i],
|
||||
j = i + 1
|
||||
macro('vd', {
|
||||
from: points['button' + j],
|
||||
to: points['button' + i],
|
||||
x: points.placketTopEdge.x - 15
|
||||
});
|
||||
})
|
||||
}
|
||||
macro("vd", {
|
||||
macro('vd', {
|
||||
from: points.placketBottomEdge,
|
||||
to: points.placketTopEdge,
|
||||
x: points.placketTopEdge.x - 30
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
return part;
|
||||
};
|
||||
return part
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { addButtons } from "./shared";
|
||||
import { addButtons } from './shared'
|
||||
|
||||
export default part => {
|
||||
let {
|
||||
|
@ -14,23 +14,20 @@ export default part => {
|
|||
paperless,
|
||||
macro,
|
||||
options
|
||||
} = part.shorthand();
|
||||
} = part.shorthand()
|
||||
|
||||
if (
|
||||
!options.seperateButtonPlacket ||
|
||||
options.buttonPlacketStyle !== "classic"
|
||||
) {
|
||||
part.paths = {};
|
||||
part.snippets = {};
|
||||
part.points = {};
|
||||
return part;
|
||||
if (!options.seperateButtonPlacket || options.buttonPlacketStyle !== 'classic') {
|
||||
part.paths = {}
|
||||
part.snippets = {}
|
||||
part.points = {}
|
||||
return part
|
||||
}
|
||||
|
||||
for (let id of Object.keys(part.paths)) {
|
||||
if (id !== "seam") delete part.paths[id];
|
||||
if (id !== 'seam') delete part.paths[id]
|
||||
}
|
||||
macro("flip");
|
||||
let width = options.buttonPlacketWidth;
|
||||
macro('flip')
|
||||
let width = options.buttonPlacketWidth
|
||||
points.placketTopIn = utils.lineIntersectsCurve(
|
||||
new Point(width / -2, points.cfNeck.y + 20),
|
||||
new Point(width / -2, points.cfNeck.y - 20),
|
||||
|
@ -38,24 +35,24 @@ export default part => {
|
|||
points.cfNeckCp1,
|
||||
points.neckCp2Front,
|
||||
points.neck
|
||||
);
|
||||
points.placketTopOut = points.cfNeck.shift(0, width / 2);
|
||||
points.placketTopEdge = points.cfNeck.shift(0, width * 1.5);
|
||||
points.placketBottomIn = points.cfHem.shift(180, width / 2);
|
||||
points.placketBottomOut = points.cfHem.shift(0, width / 2);
|
||||
points.placketBottomEdge = points.cfHem.shift(0, width * 1.5);
|
||||
)
|
||||
points.placketTopOut = points.cfNeck.shift(0, width / 2)
|
||||
points.placketTopEdge = points.cfNeck.shift(0, width * 1.5)
|
||||
points.placketBottomIn = points.cfHem.shift(180, width / 2)
|
||||
points.placketBottomOut = points.cfHem.shift(0, width / 2)
|
||||
points.placketBottomEdge = points.cfHem.shift(0, width * 1.5)
|
||||
|
||||
paths.saBase = new Path()
|
||||
.move(points.placketBottomIn)
|
||||
.line(points.placketTopIn)
|
||||
.join(paths.seam.split(points.placketTopIn)[1])
|
||||
.line(points.placketTopEdge)
|
||||
.line(points.placketBottomEdge);
|
||||
.line(points.placketBottomEdge)
|
||||
|
||||
paths.seam = paths.saBase
|
||||
.clone()
|
||||
.close()
|
||||
.attr("class", "fabric");
|
||||
.attr('class', 'fabric')
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
|
@ -63,87 +60,77 @@ export default part => {
|
|||
paths.placketOuterFold = new Path()
|
||||
.move(points.placketTopOut)
|
||||
.line(points.placketBottomOut)
|
||||
.attr("class", "dotted");
|
||||
macro("sprinkle", {
|
||||
snippet: "notch",
|
||||
on: ["placketTopOut", "placketBottomOut"]
|
||||
});
|
||||
.attr('class', 'dotted')
|
||||
macro('sprinkle', {
|
||||
snippet: 'notch',
|
||||
on: ['placketTopOut', 'placketBottomOut']
|
||||
})
|
||||
|
||||
// Buttons
|
||||
addButtons(part);
|
||||
addButtons(part)
|
||||
|
||||
// Grainline
|
||||
points.grainlineFrom = points.placketBottomEdge.shift(180, width / 2);
|
||||
points.grainlineTo = points.placketTopEdge.shift(180, width / 2);
|
||||
macro("grainline", {
|
||||
points.grainlineFrom = points.placketBottomEdge.shift(180, width / 2)
|
||||
points.grainlineTo = points.placketTopEdge.shift(180, width / 2)
|
||||
macro('grainline', {
|
||||
from: points.grainlineFrom,
|
||||
to: points.grainlineTo
|
||||
});
|
||||
})
|
||||
|
||||
// Title
|
||||
points.title = new Point(points.placketTopOut.x, points.cfArmhole.y);
|
||||
macro("title", {
|
||||
points.title = new Point(points.placketTopOut.x, points.cfArmhole.y)
|
||||
macro('title', {
|
||||
at: points.title,
|
||||
nr: "1b",
|
||||
title: "buttonPlacket",
|
||||
nr: '1b',
|
||||
title: 'buttonPlacket',
|
||||
scale: 0.75,
|
||||
rotation: -90
|
||||
});
|
||||
})
|
||||
|
||||
// Logo
|
||||
points.logo = points.title.shift(-90, 120);
|
||||
snippets.logo = new Snippet("logo", points.logo)
|
||||
.attr("data-scale", 0.5)
|
||||
.attr("data-rotate", -90);
|
||||
points.logo = points.title.shift(-90, 120)
|
||||
snippets.logo = new Snippet('logo', points.logo)
|
||||
.attr('data-scale', 0.5)
|
||||
.attr('data-rotate', -90)
|
||||
|
||||
if (sa) {
|
||||
paths.sa = paths.saBase
|
||||
.offset(sa * -1)
|
||||
.line(
|
||||
new Point(
|
||||
points.placketBottomEdge.x + sa,
|
||||
points.placketBottomEdge.y + 3 * sa
|
||||
)
|
||||
)
|
||||
.line(
|
||||
new Point(
|
||||
points.placketBottomIn.x - sa,
|
||||
points.placketBottomIn.y + 3 * sa
|
||||
)
|
||||
)
|
||||
.line(new Point(points.placketBottomEdge.x + sa, points.placketBottomEdge.y + 3 * sa))
|
||||
.line(new Point(points.placketBottomIn.x - sa, points.placketBottomIn.y + 3 * sa))
|
||||
.close()
|
||||
.attr("class", "fabric sa");
|
||||
.attr('class', 'fabric sa')
|
||||
}
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
macro("hd", {
|
||||
macro('hd', {
|
||||
from: points.placketTopIn,
|
||||
to: points.placketTopOut,
|
||||
y: points.placketTopIn.y - 15 - sa
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.placketTopIn,
|
||||
to: points.placketTopEdge,
|
||||
y: points.placketTopIn.y - 30 - sa
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.placketBottomEdge,
|
||||
to: points.placketTopEdge,
|
||||
x: points.placketTopEdge.x + 15 + sa
|
||||
});
|
||||
points.button0 = points.placketTopEdge;
|
||||
let j;
|
||||
})
|
||||
points.button0 = points.placketTopEdge
|
||||
let j
|
||||
for (let i = 0; i < options.buttons; i++) {
|
||||
j = i + 1;
|
||||
macro("vd", {
|
||||
from: points["button" + j],
|
||||
to: points["button" + i],
|
||||
j = i + 1
|
||||
macro('vd', {
|
||||
from: points['button' + j],
|
||||
to: points['button' + i],
|
||||
x: points.placketTopIn.x - 15 - sa
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
return part;
|
||||
};
|
||||
return part
|
||||
}
|
||||
|
|
|
@ -11,67 +11,52 @@ export default part => {
|
|||
paperless,
|
||||
macro,
|
||||
options
|
||||
} = part.shorthand();
|
||||
} = part.shorthand()
|
||||
|
||||
const draft = function(tweak = 1) {
|
||||
let length =
|
||||
measurements.neckCircumference *
|
||||
(1 + options.collarEase - options.collarGap) *
|
||||
tweak;
|
||||
let width = options.collarStandWidth * (1 + options.collarRoll);
|
||||
measurements.neckCircumference * (1 + options.collarEase - options.collarGap) * tweak
|
||||
let width = options.collarStandWidth * (1 + options.collarRoll)
|
||||
|
||||
// Draft right side
|
||||
points.topMid = new Point(0, 0);
|
||||
points.bottomMid = new Point(0, width);
|
||||
points.bottomMidCp1 = points.bottomMid.shift(0, length * 0.35);
|
||||
points.rightBottomEdge = new Point(
|
||||
length / 2,
|
||||
width + length * options.collarBend
|
||||
);
|
||||
points.rightTopHinge = points.topMid.shift(0, length * 0.25);
|
||||
points.rightTopEdgeDirection = points.rightTopHinge.shift(
|
||||
options.collarFlare,
|
||||
10
|
||||
);
|
||||
points.rightBottomEdgeDirection = points.rightBottomEdge.shift(
|
||||
options.collarAngle,
|
||||
10
|
||||
);
|
||||
points.topMid = new Point(0, 0)
|
||||
points.bottomMid = new Point(0, width)
|
||||
points.bottomMidCp1 = points.bottomMid.shift(0, length * 0.35)
|
||||
points.rightBottomEdge = new Point(length / 2, width + length * options.collarBend)
|
||||
points.rightTopHinge = points.topMid.shift(0, length * 0.25)
|
||||
points.rightTopEdgeDirection = points.rightTopHinge.shift(options.collarFlare, 10)
|
||||
points.rightBottomEdgeDirection = points.rightBottomEdge.shift(options.collarAngle, 10)
|
||||
points.rightTopEdge = utils.beamsIntersect(
|
||||
points.rightTopHinge,
|
||||
points.rightTopEdgeDirection,
|
||||
points.rightBottomEdge,
|
||||
points.rightBottomEdgeDirection
|
||||
);
|
||||
points.rightTopHingeCp1 = points.rightTopHinge.shift(0, length * 0.1);
|
||||
)
|
||||
points.rightTopHingeCp1 = points.rightTopHinge.shift(0, length * 0.1)
|
||||
|
||||
// Draft left side
|
||||
points.leftTopHinge = points.rightTopHinge.flipX();
|
||||
points.bottomMidCp2 = points.bottomMidCp1.flipX();
|
||||
points.leftTopHingeCp2 = points.rightTopHingeCp1.flipX();
|
||||
points.leftTopEdge = points.rightTopEdge.flipX();
|
||||
points.leftBottomEdge = points.rightBottomEdge.flipX();
|
||||
points.leftTopHinge = points.rightTopHinge.flipX()
|
||||
points.bottomMidCp2 = points.bottomMidCp1.flipX()
|
||||
points.leftTopHingeCp2 = points.rightTopHingeCp1.flipX()
|
||||
points.leftTopEdge = points.rightTopEdge.flipX()
|
||||
points.leftBottomEdge = points.rightBottomEdge.flipX()
|
||||
|
||||
let len = new Path()
|
||||
.move(points.leftBottomEdge)
|
||||
._curve(points.bottomMidCp2, points.bottomMid)
|
||||
.length();
|
||||
.length()
|
||||
|
||||
return (
|
||||
len * 2 -
|
||||
measurements.neckCircumference *
|
||||
(1 + options.collarEase - options.collarGap)
|
||||
);
|
||||
};
|
||||
return len * 2 - measurements.neckCircumference * (1 + options.collarEase - options.collarGap)
|
||||
}
|
||||
|
||||
let delta, tweak, run;
|
||||
tweak = 1;
|
||||
run = 1;
|
||||
let delta, tweak, run
|
||||
tweak = 1
|
||||
run = 1
|
||||
do {
|
||||
delta = draft(tweak);
|
||||
tweak = tweak * (1 - delta / 1000);
|
||||
run++;
|
||||
} while (Math.abs(delta) > 1 && run < 20);
|
||||
delta = draft(tweak)
|
||||
tweak = tweak * (1 - delta / 1000)
|
||||
run++
|
||||
} while (Math.abs(delta) > 1 && run < 20)
|
||||
|
||||
paths.seam = new Path()
|
||||
.move(points.bottomMid)
|
||||
|
@ -84,117 +69,109 @@ export default part => {
|
|||
.line(points.leftBottomEdge)
|
||||
._curve(points.bottomMidCp2, points.bottomMid)
|
||||
.close()
|
||||
.attr("class", "fabric");
|
||||
.attr('class', 'fabric')
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
// Draw undercollar line
|
||||
let uc = points.topMid.dist(points.bottomMid) * 0.05;
|
||||
points.ucTopMid = points.topMid.shift(-90, uc);
|
||||
points.ucRightTopHinge = points.rightTopHinge.shift(-90, uc);
|
||||
points.ucRightTopHingeCp1 = points.rightTopHingeCp1.shift(-90, uc);
|
||||
points.ucLeftTopHinge = points.ucRightTopHinge.flipX();
|
||||
points.ucLeftTopHingeCp2 = points.ucRightTopHingeCp1.flipX();
|
||||
let uc = points.topMid.dist(points.bottomMid) * 0.05
|
||||
points.ucTopMid = points.topMid.shift(-90, uc)
|
||||
points.ucRightTopHinge = points.rightTopHinge.shift(-90, uc)
|
||||
points.ucRightTopHingeCp1 = points.rightTopHingeCp1.shift(-90, uc)
|
||||
points.ucLeftTopHinge = points.ucRightTopHinge.flipX()
|
||||
points.ucLeftTopHingeCp2 = points.ucRightTopHingeCp1.flipX()
|
||||
paths.underCollar = new Path()
|
||||
.move(points.rightTopEdge)
|
||||
._curve(points.ucRightTopHingeCp1, points.ucRightTopHinge)
|
||||
.line(points.ucLeftTopHinge)
|
||||
.curve_(points.ucLeftTopHingeCp2, points.leftTopEdge)
|
||||
.attr("class", "dotted")
|
||||
.attr("data-text", "cutUndercollarSlightlySmaller")
|
||||
.attr("data-text-class", "center");
|
||||
.attr('class', 'dotted')
|
||||
.attr('data-text', 'cutUndercollarSlightlySmaller')
|
||||
.attr('data-text-class', 'center')
|
||||
|
||||
// Helplines
|
||||
paths.help = new Path()
|
||||
.move(points.topMid)
|
||||
.line(points.bottomMid)
|
||||
.attr("class", "dotted");
|
||||
.attr('class', 'dotted')
|
||||
|
||||
// Grainline
|
||||
macro("grainline", {
|
||||
macro('grainline', {
|
||||
from: points.bottomMidCp2.shift(90, 10),
|
||||
to: points.bottomMidCp1.shift(90, 10)
|
||||
});
|
||||
})
|
||||
|
||||
// Title
|
||||
points.title = new Point(20, points.bottomMid.y / 2);
|
||||
macro("title", {
|
||||
points.title = new Point(20, points.bottomMid.y / 2)
|
||||
macro('title', {
|
||||
at: points.title,
|
||||
nr: "7 & 8",
|
||||
title: "collarAndUndercollar",
|
||||
nr: '7 & 8',
|
||||
title: 'collarAndUndercollar',
|
||||
scale: 0.6,
|
||||
append: true
|
||||
});
|
||||
})
|
||||
|
||||
// Indicate collar stand side
|
||||
paths.collarStandLeft = new Path()
|
||||
.move(points.leftBottomEdge)
|
||||
._curve(points.bottomMidCp2, points.bottomMid)
|
||||
.attr("data-text", "sideOfTheCollarStand")
|
||||
.attr("data-text-class", "center");
|
||||
.attr('data-text', 'sideOfTheCollarStand')
|
||||
.attr('data-text-class', 'center')
|
||||
paths.collarStandRight = new Path()
|
||||
.move(points.bottomMid)
|
||||
.curve_(points.bottomMidCp1, points.rightBottomEdge)
|
||||
.attr("data-text", "sideOfTheCollarStand")
|
||||
.attr("data-text-class", "center");
|
||||
.attr('data-text', 'sideOfTheCollarStand')
|
||||
.attr('data-text-class', 'center')
|
||||
// Notches
|
||||
macro("sprinkle", {
|
||||
snippet: "notch",
|
||||
on: [
|
||||
"bottomMid",
|
||||
"rightBottomEdge",
|
||||
"leftBottomEdge",
|
||||
"rightTopEdge",
|
||||
"leftTopEdge"
|
||||
]
|
||||
});
|
||||
macro('sprinkle', {
|
||||
snippet: 'notch',
|
||||
on: ['bottomMid', 'rightBottomEdge', 'leftBottomEdge', 'rightTopEdge', 'leftTopEdge']
|
||||
})
|
||||
|
||||
if (sa) {
|
||||
paths.sa = paths.seam.offset(sa).attr("class", "fabric sa");
|
||||
paths.saUndercollar = paths.underCollar
|
||||
.offset(sa)
|
||||
.attr("class", "dotted");
|
||||
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
|
||||
paths.saUndercollar = paths.underCollar.offset(sa).attr('class', 'dotted')
|
||||
}
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
macro("vd", {
|
||||
macro('vd', {
|
||||
from: points.bottomMid,
|
||||
to: points.topMid,
|
||||
x: points.rightTopEdge.x + 15 + sa
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.bottomMid,
|
||||
to: points.rightTopEdge,
|
||||
x: points.rightTopEdge.x + 30 + sa
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.rightBottomEdge,
|
||||
to: points.topMid,
|
||||
x: points.rightTopEdge.x + 45 + sa
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.rightBottomEdge,
|
||||
to: points.rightTopEdge,
|
||||
x: points.rightTopEdge.x + 60 + sa
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.leftTopHinge,
|
||||
to: points.rightTopHinge,
|
||||
y: points.leftTopEdge.y - 15 - sa
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.leftTopEdge,
|
||||
to: points.rightTopEdge,
|
||||
y: points.leftTopEdge.y - 30 - sa
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.leftBottomEdge,
|
||||
to: points.rightBottomEdge,
|
||||
y: points.leftBottomEdge.y + 15 + sa
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
return part;
|
||||
};
|
||||
return part
|
||||
}
|
||||
|
|
|
@ -12,132 +12,83 @@ export default part => {
|
|||
paperless,
|
||||
macro,
|
||||
options
|
||||
} = part.shorthand();
|
||||
} = part.shorthand()
|
||||
|
||||
const draft = function(tweak = 1) {
|
||||
let length =
|
||||
measurements.neckCircumference * (1 + options.collarEase) * tweak;
|
||||
let width = options.collarStandWidth;
|
||||
let half = length / 2;
|
||||
let bend = options.collarStandBend * -1;
|
||||
let curve = options.collarStandCurve - options.collarStandBend;
|
||||
let hinge = 90 + (bend + curve) / 2;
|
||||
let length = measurements.neckCircumference * (1 + options.collarEase) * tweak
|
||||
let width = options.collarStandWidth
|
||||
let half = length / 2
|
||||
let bend = options.collarStandBend * -1
|
||||
let curve = options.collarStandCurve - options.collarStandBend
|
||||
let hinge = 90 + (bend + curve) / 2
|
||||
|
||||
// Center line
|
||||
points.center = new Point(0, 0);
|
||||
points.hinge = points.center.shift(bend, half * 0.7);
|
||||
points.rightCf = points.hinge.shift(curve, half * 0.3);
|
||||
points.center = new Point(0, 0)
|
||||
points.hinge = points.center.shift(bend, half * 0.7)
|
||||
points.rightCf = points.hinge.shift(curve, half * 0.3)
|
||||
|
||||
// Give it our collar width (right side only)
|
||||
points.topMid = points.center.shift(90, width / 2);
|
||||
points.bottomMid = points.topMid.flipY();
|
||||
points.rightTopHinge = points.hinge.shift(hinge, width / 2);
|
||||
points.rightBottomHinge = points.hinge.shift(180 + hinge, width / 2);
|
||||
points.rightTopCf = points.rightCf.shift(curve + 90, width / 2);
|
||||
points.rightBottomCf = points.rightCf.shift(curve - 90, width / 2);
|
||||
points.rightBottomEdge = points.rightBottomCf.shift(
|
||||
curve,
|
||||
options.buttonholePlacketWidth / 2
|
||||
);
|
||||
points.topMid = points.center.shift(90, width / 2)
|
||||
points.bottomMid = points.topMid.flipY()
|
||||
points.rightTopHinge = points.hinge.shift(hinge, width / 2)
|
||||
points.rightBottomHinge = points.hinge.shift(180 + hinge, width / 2)
|
||||
points.rightTopCf = points.rightCf.shift(curve + 90, width / 2)
|
||||
points.rightBottomCf = points.rightCf.shift(curve - 90, width / 2)
|
||||
points.rightBottomEdge = points.rightBottomCf.shift(curve, options.buttonholePlacketWidth / 2)
|
||||
|
||||
// Add control points (right side only)
|
||||
points.bottomMidCp2 = points.bottomMid.shift(0, half * 0.2);
|
||||
points.rightBottomHingeCp1 = points.rightBottomHinge.shift(
|
||||
90 + hinge,
|
||||
half * 0.2
|
||||
);
|
||||
points.rightBottomHingeCp2 = points.rightBottomHinge.shift(
|
||||
hinge - 90,
|
||||
half * 0.1
|
||||
);
|
||||
points.rightBottomCfCp1 = points.rightBottomCf.shift(
|
||||
180 + curve,
|
||||
half * 0.1
|
||||
);
|
||||
points.rightBottomEdgeCp2 = points.rightBottomCf.rotate(
|
||||
-90,
|
||||
points.rightBottomEdge
|
||||
);
|
||||
points.rightTopCfCp1 = points.rightTopCf.shift(
|
||||
curve,
|
||||
options.buttonholePlacketWidth / 2
|
||||
);
|
||||
points.topMidCp1 = points.topMid.shift(0, half * 0.2);
|
||||
points.rightTopHingeCp2 = points.rightTopHinge.shift(
|
||||
90 + hinge,
|
||||
half * 0.2
|
||||
);
|
||||
points.rightTopHingeCp1 = points.rightTopHinge.shift(
|
||||
hinge - 90,
|
||||
half * 0.1
|
||||
);
|
||||
points.topEdgeCp1 = points.rightTopCf.rotate(-90, points.rightBottomEdge);
|
||||
points.rightTopCfCp2 = points.rightTopCf.shift(
|
||||
180 + curve,
|
||||
options.buttonholePlacketWidth / 2
|
||||
);
|
||||
points.bottomMidCp2 = points.bottomMid.shift(0, half * 0.2)
|
||||
points.rightBottomHingeCp1 = points.rightBottomHinge.shift(90 + hinge, half * 0.2)
|
||||
points.rightBottomHingeCp2 = points.rightBottomHinge.shift(hinge - 90, half * 0.1)
|
||||
points.rightBottomCfCp1 = points.rightBottomCf.shift(180 + curve, half * 0.1)
|
||||
points.rightBottomEdgeCp2 = points.rightBottomCf.rotate(-90, points.rightBottomEdge)
|
||||
points.rightTopCfCp1 = points.rightTopCf.shift(curve, options.buttonholePlacketWidth / 2)
|
||||
points.topMidCp1 = points.topMid.shift(0, half * 0.2)
|
||||
points.rightTopHingeCp2 = points.rightTopHinge.shift(90 + hinge, half * 0.2)
|
||||
points.rightTopHingeCp1 = points.rightTopHinge.shift(hinge - 90, half * 0.1)
|
||||
points.topEdgeCp1 = points.rightTopCf.rotate(-90, points.rightBottomEdge)
|
||||
points.rightTopCfCp2 = points.rightTopCf.shift(180 + curve, options.buttonholePlacketWidth / 2)
|
||||
|
||||
// Now do the left side
|
||||
points.leftCf = points.rightCf.flipX();
|
||||
points.topMidCp2 = points.topMidCp1.flipX();
|
||||
points.leftTopHingeCp1 = points.rightTopHingeCp2.flipX();
|
||||
points.leftTopHinge = points.rightTopHinge.flipX();
|
||||
points.leftTopHingeCp2 = points.rightTopHingeCp1.flipX();
|
||||
points.leftTopCfCp1 = points.rightTopCfCp2.flipX();
|
||||
points.leftTopCf = points.rightTopCf.flipX();
|
||||
points.leftBottomCf = points.rightBottomCf.flipX();
|
||||
points.leftBottomEdge = points.leftBottomCf.shift(
|
||||
bend + 180,
|
||||
options.buttonPlacketWidth / 2
|
||||
);
|
||||
points.leftTopCfCp2 = points.leftTopCf.shift(
|
||||
bend + 180,
|
||||
options.buttonPlacketWidth / 2
|
||||
);
|
||||
points.leftBottomEdgeCp1 = points.leftBottomCf.rotate(
|
||||
90,
|
||||
points.leftBottomEdge
|
||||
);
|
||||
points.leftBottomCfCp2 = points.rightBottomCfCp1.flipX();
|
||||
points.leftBottomHingeCp1 = points.rightBottomHingeCp2.flipX();
|
||||
points.leftBottomHinge = points.rightBottomHinge.flipX();
|
||||
points.leftBottomHingeCp2 = points.rightBottomHingeCp1.flipX();
|
||||
points.bottomMidCp1 = points.bottomMidCp2.flipX();
|
||||
points.leftCf = points.rightCf.flipX()
|
||||
points.topMidCp2 = points.topMidCp1.flipX()
|
||||
points.leftTopHingeCp1 = points.rightTopHingeCp2.flipX()
|
||||
points.leftTopHinge = points.rightTopHinge.flipX()
|
||||
points.leftTopHingeCp2 = points.rightTopHingeCp1.flipX()
|
||||
points.leftTopCfCp1 = points.rightTopCfCp2.flipX()
|
||||
points.leftTopCf = points.rightTopCf.flipX()
|
||||
points.leftBottomCf = points.rightBottomCf.flipX()
|
||||
points.leftBottomEdge = points.leftBottomCf.shift(bend + 180, options.buttonPlacketWidth / 2)
|
||||
points.leftTopCfCp2 = points.leftTopCf.shift(bend + 180, options.buttonPlacketWidth / 2)
|
||||
points.leftBottomEdgeCp1 = points.leftBottomCf.rotate(90, points.leftBottomEdge)
|
||||
points.leftBottomCfCp2 = points.rightBottomCfCp1.flipX()
|
||||
points.leftBottomHingeCp1 = points.rightBottomHingeCp2.flipX()
|
||||
points.leftBottomHinge = points.rightBottomHinge.flipX()
|
||||
points.leftBottomHingeCp2 = points.rightBottomHingeCp1.flipX()
|
||||
points.bottomMidCp1 = points.bottomMidCp2.flipX()
|
||||
|
||||
let len = new Path()
|
||||
.move(points.leftBottomCf)
|
||||
.curve(
|
||||
points.leftBottomCfCp2,
|
||||
points.leftBottomHingeCp1,
|
||||
points.leftBottomHinge
|
||||
)
|
||||
.curve(points.leftBottomCfCp2, points.leftBottomHingeCp1, points.leftBottomHinge)
|
||||
.curve(points.leftBottomHingeCp2, points.bottomMidCp1, points.bottomMid)
|
||||
.length();
|
||||
.length()
|
||||
|
||||
return len * 2 - measurements.neckCircumference * (1 + options.collarEase);
|
||||
};
|
||||
return len * 2 - measurements.neckCircumference * (1 + options.collarEase)
|
||||
}
|
||||
|
||||
let delta, tweak, run;
|
||||
tweak = 1;
|
||||
run = 1;
|
||||
let delta, tweak, run
|
||||
tweak = 1
|
||||
run = 1
|
||||
do {
|
||||
delta = draft(tweak);
|
||||
tweak = tweak * (1 - delta / 1000);
|
||||
run++;
|
||||
} while (Math.abs(delta) > 1 && run < 20);
|
||||
delta = draft(tweak)
|
||||
tweak = tweak * (1 - delta / 1000)
|
||||
run++
|
||||
} while (Math.abs(delta) > 1 && run < 20)
|
||||
|
||||
paths.seam = new Path()
|
||||
.move(points.bottomMid)
|
||||
.curve(
|
||||
points.bottomMidCp2,
|
||||
points.rightBottomHingeCp1,
|
||||
points.rightBottomHinge
|
||||
)
|
||||
.curve(
|
||||
points.rightBottomHingeCp2,
|
||||
points.rightBottomCfCp1,
|
||||
points.rightBottomCf
|
||||
)
|
||||
.curve(points.bottomMidCp2, points.rightBottomHingeCp1, points.rightBottomHinge)
|
||||
.curve(points.rightBottomHingeCp2, points.rightBottomCfCp1, points.rightBottomCf)
|
||||
.line(points.rightBottomEdge)
|
||||
.curve(points.rightBottomEdgeCp2, points.rightTopCfCp1, points.rightTopCf)
|
||||
.curve(points.rightTopCfCp2, points.rightTopHingeCp1, points.rightTopHinge)
|
||||
|
@ -146,14 +97,10 @@ export default part => {
|
|||
.curve(points.leftTopHingeCp2, points.leftTopCfCp1, points.leftTopCf)
|
||||
.curve(points.leftTopCfCp2, points.leftBottomEdgeCp1, points.leftBottomEdge)
|
||||
.line(points.leftBottomCf)
|
||||
.curve(
|
||||
points.leftBottomCfCp2,
|
||||
points.leftBottomHingeCp1,
|
||||
points.leftBottomHinge
|
||||
)
|
||||
.curve(points.leftBottomCfCp2, points.leftBottomHingeCp1, points.leftBottomHinge)
|
||||
.curve(points.leftBottomHingeCp2, points.bottomMidCp1, points.bottomMid)
|
||||
.close()
|
||||
.attr("class", "fabric");
|
||||
.attr('class', 'fabric')
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
|
@ -165,114 +112,102 @@ export default part => {
|
|||
.line(points.bottomMid)
|
||||
.move(points.leftTopCf)
|
||||
.line(points.leftBottomCf)
|
||||
.attr("class", "dotted");
|
||||
.attr('class', 'dotted')
|
||||
|
||||
// Grainline
|
||||
macro("grainline", {
|
||||
macro('grainline', {
|
||||
from: points.leftCf,
|
||||
to: points.rightCf
|
||||
});
|
||||
})
|
||||
|
||||
// Title
|
||||
points.title = points.center.shift(0, 20);
|
||||
macro("title", {
|
||||
points.title = points.center.shift(0, 20)
|
||||
macro('title', {
|
||||
at: points.title,
|
||||
nr: 6,
|
||||
title: "collarStand",
|
||||
title: 'collarStand',
|
||||
scale: 0.6
|
||||
});
|
||||
})
|
||||
|
||||
// Notches
|
||||
macro("sprinkle", {
|
||||
snippet: "notch",
|
||||
macro('sprinkle', {
|
||||
snippet: 'notch',
|
||||
on: [
|
||||
"rightTopCf",
|
||||
"rightBottomCf",
|
||||
"leftBottomCf",
|
||||
"leftTopCf",
|
||||
"rightBottomEdge",
|
||||
"leftBottomEdge"
|
||||
'rightTopCf',
|
||||
'rightBottomCf',
|
||||
'leftBottomCf',
|
||||
'leftTopCf',
|
||||
'rightBottomEdge',
|
||||
'leftBottomEdge'
|
||||
]
|
||||
});
|
||||
})
|
||||
|
||||
// Button and buttonhole
|
||||
snippets.button = new Snippet("button", points.leftCf);
|
||||
let angle = options.collarStandCurve - options.collarStandBend - 180;
|
||||
points.buttonhole = points.rightCf.shift(angle, 3);
|
||||
snippets.buttonhole = new Snippet("buttonhole", points.buttonhole).attr(
|
||||
"data-rotate",
|
||||
snippets.button = new Snippet('button', points.leftCf)
|
||||
let angle = options.collarStandCurve - options.collarStandBend - 180
|
||||
points.buttonhole = points.rightCf.shift(angle, 3)
|
||||
snippets.buttonhole = new Snippet('buttonhole', points.buttonhole).attr(
|
||||
'data-rotate',
|
||||
90 - angle
|
||||
);
|
||||
)
|
||||
|
||||
if (sa) {
|
||||
paths.sa = paths.seam.offset(sa);
|
||||
paths.sa = paths.seam.offset(sa)
|
||||
}
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
macro("hd", {
|
||||
macro('hd', {
|
||||
from: points.topMid,
|
||||
to: points.rightTopCf,
|
||||
y: points.topMid.y - 15 - sa
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.leftTopCf,
|
||||
to: points.topMid,
|
||||
y: points.topMid.y - 15 - sa
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.topMid,
|
||||
to: points.rightBottomEdge,
|
||||
y: points.topMid.y - 30 - sa
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.leftBottomEdge,
|
||||
to: points.topMid,
|
||||
y: points.topMid.y - 30 - sa
|
||||
});
|
||||
macro("pd", {
|
||||
})
|
||||
macro('pd', {
|
||||
path: new Path()
|
||||
.move(points.leftBottomCf)
|
||||
.curve(
|
||||
points.leftBottomCfCp2,
|
||||
points.leftBottomHingeCp1,
|
||||
points.leftBottomHinge
|
||||
)
|
||||
.curve(points.leftBottomCfCp2, points.leftBottomHingeCp1, points.leftBottomHinge)
|
||||
.curve(points.leftBottomHingeCp2, points.bottomMidCp1, points.bottomMid)
|
||||
.curve(
|
||||
points.bottomMidCp2,
|
||||
points.rightBottomHingeCp1,
|
||||
points.rightBottomHinge
|
||||
)
|
||||
.curve(
|
||||
points.rightBottomHingeCp2,
|
||||
points.rightBottomCfCp1,
|
||||
points.rightBottomCf
|
||||
),
|
||||
.curve(points.bottomMidCp2, points.rightBottomHingeCp1, points.rightBottomHinge)
|
||||
.curve(points.rightBottomHingeCp2, points.rightBottomCfCp1, points.rightBottomCf),
|
||||
d: 15 + sa
|
||||
});
|
||||
macro("ld", {
|
||||
})
|
||||
macro('ld', {
|
||||
from: points.leftBottomEdge,
|
||||
to: points.leftBottomCf,
|
||||
d: -30 - sa
|
||||
});
|
||||
macro("ld", {
|
||||
})
|
||||
macro('ld', {
|
||||
from: points.rightBottomCf,
|
||||
to: points.rightBottomEdge,
|
||||
d: -30 - sa
|
||||
});
|
||||
macro("ld", {
|
||||
})
|
||||
macro('ld', {
|
||||
from: points.rightBottomCf,
|
||||
to: points.rightTopCf,
|
||||
d: -15 - sa - options.buttonholePlacketWidth / 2
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.rightBottomCf,
|
||||
to: points.topMid,
|
||||
x: points.rightBottomEdge.x + 30 + sa
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
return part;
|
||||
};
|
||||
return part
|
||||
}
|
||||
|
|
|
@ -1,28 +1,15 @@
|
|||
import {
|
||||
draftBarrelCuff,
|
||||
decorateBarrelCuff,
|
||||
paperlessBarrelCuff
|
||||
} from "./shared";
|
||||
import { draftBarrelCuff, decorateBarrelCuff, paperlessBarrelCuff } from './shared'
|
||||
|
||||
export default part => {
|
||||
let {
|
||||
store,
|
||||
sa,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
complete,
|
||||
paperless,
|
||||
macro
|
||||
} = part.shorthand();
|
||||
let { store, sa, points, Path, paths, complete, paperless, macro } = part.shorthand()
|
||||
|
||||
draftBarrelCuff(part);
|
||||
let height = store.get("cuffHeight");
|
||||
draftBarrelCuff(part)
|
||||
let height = store.get('cuffHeight')
|
||||
|
||||
points.leftAngleTop = points.topLeft.shift(0, height / 3);
|
||||
points.leftAngleBottom = points.topLeft.shift(-90, height / 3);
|
||||
points.rightAngleTop = points.topRight.shift(180, height / 3);
|
||||
points.rightAngleBottom = points.topRight.shift(-90, height / 3);
|
||||
points.leftAngleTop = points.topLeft.shift(0, height / 3)
|
||||
points.leftAngleBottom = points.topLeft.shift(-90, height / 3)
|
||||
points.rightAngleTop = points.topRight.shift(180, height / 3)
|
||||
points.rightAngleBottom = points.topRight.shift(-90, height / 3)
|
||||
paths.seam = new Path()
|
||||
.move(points.leftAngleBottom)
|
||||
.line(points.bottomLeft)
|
||||
|
@ -32,23 +19,23 @@ export default part => {
|
|||
.line(points.leftAngleTop)
|
||||
.line(points.leftAngleBottom)
|
||||
.close()
|
||||
.attr("class", "fabric");
|
||||
.attr('class', 'fabric')
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
decorateBarrelCuff(part);
|
||||
if (sa) paths.sa = paths.seam.offset(sa);
|
||||
decorateBarrelCuff(part)
|
||||
if (sa) paths.sa = paths.seam.offset(sa)
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
paperlessBarrelCuff(part);
|
||||
macro("vd", {
|
||||
paperlessBarrelCuff(part)
|
||||
macro('vd', {
|
||||
from: points.rightAngleBottom,
|
||||
to: points.rightAngleTop,
|
||||
x: points.rightAngleBottom.x + 15 + sa
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
return part;
|
||||
};
|
||||
return part
|
||||
}
|
||||
|
|
|
@ -1,74 +1,53 @@
|
|||
import {
|
||||
draftBarrelCuff,
|
||||
decorateBarrelCuff,
|
||||
paperlessBarrelCuff
|
||||
} from "./shared";
|
||||
import { draftBarrelCuff, decorateBarrelCuff, paperlessBarrelCuff } from './shared'
|
||||
|
||||
export default part => {
|
||||
let {
|
||||
store,
|
||||
sa,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
complete,
|
||||
paperless,
|
||||
macro
|
||||
} = part.shorthand();
|
||||
let { store, sa, points, Path, paths, complete, paperless, macro } = part.shorthand()
|
||||
|
||||
draftBarrelCuff(part);
|
||||
let height = store.get("cuffHeight");
|
||||
macro("round", {
|
||||
draftBarrelCuff(part)
|
||||
let height = store.get('cuffHeight')
|
||||
macro('round', {
|
||||
from: points.topRight,
|
||||
to: points.bottomLeft,
|
||||
via: points.topLeft,
|
||||
radius: height / 3,
|
||||
prefix: "topLeftRound"
|
||||
});
|
||||
macro("round", {
|
||||
prefix: 'topLeftRound'
|
||||
})
|
||||
macro('round', {
|
||||
from: points.bottomRight,
|
||||
to: points.topLeft,
|
||||
via: points.topRight,
|
||||
radius: height / 3,
|
||||
prefix: "topRightRound"
|
||||
});
|
||||
points.leftAngleBottom = points.topLeft.shift(-90, height / 3);
|
||||
points.rightAngleTop = points.topRight.shift(180, height / 3);
|
||||
points.rightAngleBottom = points.topRight.shift(-90, height / 3);
|
||||
prefix: 'topRightRound'
|
||||
})
|
||||
points.leftAngleBottom = points.topLeft.shift(-90, height / 3)
|
||||
points.rightAngleTop = points.topRight.shift(180, height / 3)
|
||||
points.rightAngleBottom = points.topRight.shift(-90, height / 3)
|
||||
paths.seam = new Path()
|
||||
.move(points.topLeftRoundEnd)
|
||||
.line(points.bottomLeft)
|
||||
.line(points.bottomRight)
|
||||
.line(points.topRightRoundStart)
|
||||
.curve(
|
||||
points.topRightRoundCp1,
|
||||
points.topRightRoundCp2,
|
||||
points.topRightRoundEnd
|
||||
)
|
||||
.curve(points.topRightRoundCp1, points.topRightRoundCp2, points.topRightRoundEnd)
|
||||
.line(points.topLeftRoundStart)
|
||||
.curve(
|
||||
points.topLeftRoundCp1,
|
||||
points.topLeftRoundCp2,
|
||||
points.topLeftRoundEnd
|
||||
)
|
||||
.curve(points.topLeftRoundCp1, points.topLeftRoundCp2, points.topLeftRoundEnd)
|
||||
.close()
|
||||
.attr("class", "fabric");
|
||||
.attr('class', 'fabric')
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
decorateBarrelCuff(part);
|
||||
if (sa) paths.sa = paths.seam.offset(sa);
|
||||
decorateBarrelCuff(part)
|
||||
if (sa) paths.sa = paths.seam.offset(sa)
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
paperlessBarrelCuff(part);
|
||||
macro("vd", {
|
||||
paperlessBarrelCuff(part)
|
||||
macro('vd', {
|
||||
from: points.topRightRoundStart,
|
||||
to: points.topRightRoundEnd,
|
||||
x: points.topRightRoundStart.x + 15 + sa
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
return part;
|
||||
};
|
||||
return part
|
||||
}
|
||||
|
|
|
@ -1,13 +1,9 @@
|
|||
import {
|
||||
draftBarrelCuff,
|
||||
decorateBarrelCuff,
|
||||
paperlessBarrelCuff
|
||||
} from "./shared";
|
||||
import { draftBarrelCuff, decorateBarrelCuff, paperlessBarrelCuff } from './shared'
|
||||
|
||||
export default part => {
|
||||
let { sa, points, Path, paths, complete, paperless } = part.shorthand();
|
||||
let { sa, points, Path, paths, complete, paperless } = part.shorthand()
|
||||
|
||||
draftBarrelCuff(part);
|
||||
draftBarrelCuff(part)
|
||||
paths.seam = new Path()
|
||||
.move(points.topLeft)
|
||||
.line(points.bottomLeft)
|
||||
|
@ -15,18 +11,18 @@ export default part => {
|
|||
.line(points.topRight)
|
||||
.line(points.topLeft)
|
||||
.close()
|
||||
.attr("class", "fabric");
|
||||
.attr('class', 'fabric')
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
decorateBarrelCuff(part);
|
||||
if (sa) paths.sa = paths.seam.offset(sa);
|
||||
decorateBarrelCuff(part)
|
||||
if (sa) paths.sa = paths.seam.offset(sa)
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
paperlessBarrelCuff(part);
|
||||
paperlessBarrelCuff(part)
|
||||
}
|
||||
|
||||
return part;
|
||||
};
|
||||
return part
|
||||
}
|
||||
|
|
|
@ -1,31 +1,19 @@
|
|||
import {
|
||||
draftFrenchCuff,
|
||||
decorateFrenchCuff,
|
||||
paperlessFrenchCuff
|
||||
} from "./shared";
|
||||
import { draftFrenchCuff, decorateFrenchCuff, paperlessFrenchCuff } from './shared'
|
||||
|
||||
export default part => {
|
||||
let {
|
||||
store,
|
||||
sa,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
complete,
|
||||
paperless
|
||||
} = part.shorthand();
|
||||
let { store, sa, points, Path, paths, complete, paperless } = part.shorthand()
|
||||
|
||||
draftFrenchCuff(part);
|
||||
let height = store.get("cuffHeight");
|
||||
points.leftAngleTopTop = points.topLeft.shift(0, height / 3);
|
||||
points.leftAngleTopBottom = points.topLeft.shift(-90, height / 3);
|
||||
points.rightAngleTopTop = points.topRight.shift(180, height / 3);
|
||||
points.rightAngleTopBottom = points.topRight.shift(-90, height / 3);
|
||||
draftFrenchCuff(part)
|
||||
let height = store.get('cuffHeight')
|
||||
points.leftAngleTopTop = points.topLeft.shift(0, height / 3)
|
||||
points.leftAngleTopBottom = points.topLeft.shift(-90, height / 3)
|
||||
points.rightAngleTopTop = points.topRight.shift(180, height / 3)
|
||||
points.rightAngleTopBottom = points.topRight.shift(-90, height / 3)
|
||||
|
||||
points.leftAngleBottomTop = points.bottomLeft.shift(90, height / 3);
|
||||
points.leftAngleBottomBottom = points.bottomLeft.shift(0, height / 3);
|
||||
points.rightAngleBottomTop = points.bottomRight.shift(90, height / 3);
|
||||
points.rightAngleBottomBottom = points.bottomRight.shift(180, height / 3);
|
||||
points.leftAngleBottomTop = points.bottomLeft.shift(90, height / 3)
|
||||
points.leftAngleBottomBottom = points.bottomLeft.shift(0, height / 3)
|
||||
points.rightAngleBottomTop = points.bottomRight.shift(90, height / 3)
|
||||
points.rightAngleBottomBottom = points.bottomRight.shift(180, height / 3)
|
||||
|
||||
paths.seam = new Path()
|
||||
.move(points.leftAngleTopBottom)
|
||||
|
@ -38,21 +26,21 @@ export default part => {
|
|||
.line(points.leftAngleTopTop)
|
||||
.line(points.leftAngleTopBottom)
|
||||
.close()
|
||||
.attr("class", "fabric");
|
||||
.attr('class', 'fabric')
|
||||
|
||||
paths.fold = new Path()
|
||||
.move(points.midLeft)
|
||||
.line(points.midRight)
|
||||
.attr("class", "dotted");
|
||||
.attr('class', 'dotted')
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
decorateFrenchCuff(part);
|
||||
if (sa) paths.sa = paths.seam.offset(sa).attr("class", "fabric sa");
|
||||
decorateFrenchCuff(part)
|
||||
if (sa) paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) paperlessFrenchCuff(part);
|
||||
if (paperless) paperlessFrenchCuff(part)
|
||||
|
||||
return part;
|
||||
};
|
||||
return part
|
||||
}
|
||||
|
|
|
@ -1,50 +1,37 @@
|
|||
import {
|
||||
draftFrenchCuff,
|
||||
decorateFrenchCuff,
|
||||
paperlessFrenchCuff
|
||||
} from "./shared";
|
||||
import { draftFrenchCuff, decorateFrenchCuff, paperlessFrenchCuff } from './shared'
|
||||
|
||||
export default part => {
|
||||
let {
|
||||
store,
|
||||
sa,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
complete,
|
||||
paperless,
|
||||
macro
|
||||
} = part.shorthand();
|
||||
draftFrenchCuff(part);
|
||||
let height = store.get("cuffHeight");
|
||||
macro("round", {
|
||||
let { store, sa, points, Path, paths, complete, paperless, macro } = part.shorthand()
|
||||
draftFrenchCuff(part)
|
||||
let height = store.get('cuffHeight')
|
||||
macro('round', {
|
||||
from: points.topRight,
|
||||
to: points.bottomLeft,
|
||||
via: points.topLeft,
|
||||
radius: height / 3,
|
||||
prefix: "topLeft"
|
||||
});
|
||||
macro("round", {
|
||||
prefix: 'topLeft'
|
||||
})
|
||||
macro('round', {
|
||||
from: points.topLeft,
|
||||
to: points.bottomRight,
|
||||
via: points.bottomLeft,
|
||||
radius: height / 3,
|
||||
prefix: "bottomLeft"
|
||||
});
|
||||
macro("round", {
|
||||
prefix: 'bottomLeft'
|
||||
})
|
||||
macro('round', {
|
||||
from: points.bottomLeft,
|
||||
to: points.topRight,
|
||||
via: points.bottomRight,
|
||||
radius: height / 3,
|
||||
prefix: "bottomRight"
|
||||
});
|
||||
macro("round", {
|
||||
prefix: 'bottomRight'
|
||||
})
|
||||
macro('round', {
|
||||
from: points.bottomRight,
|
||||
to: points.topLeft,
|
||||
via: points.topRight,
|
||||
radius: height / 3,
|
||||
prefix: "topRight"
|
||||
});
|
||||
prefix: 'topRight'
|
||||
})
|
||||
|
||||
paths.seam = new Path()
|
||||
.move(points.topLeftEnd)
|
||||
|
@ -57,21 +44,21 @@ export default part => {
|
|||
.line(points.topLeftStart)
|
||||
.curve(points.topLeftCp1, points.topLeftCp2, points.topLeftEnd)
|
||||
.close()
|
||||
.attr("class", "fabric");
|
||||
.attr('class', 'fabric')
|
||||
|
||||
paths.fold = new Path()
|
||||
.move(points.midLeft)
|
||||
.line(points.midRight)
|
||||
.attr("class", "dotted");
|
||||
.attr('class', 'dotted')
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
decorateFrenchCuff(part);
|
||||
if (sa) paths.sa = paths.seam.offset(sa).attr("class", "fabric sa");
|
||||
decorateFrenchCuff(part)
|
||||
if (sa) paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) paperlessFrenchCuff(part);
|
||||
if (paperless) paperlessFrenchCuff(part)
|
||||
|
||||
return part;
|
||||
};
|
||||
return part
|
||||
}
|
||||
|
|
|
@ -1,13 +1,9 @@
|
|||
import {
|
||||
draftFrenchCuff,
|
||||
decorateFrenchCuff,
|
||||
paperlessFrenchCuff
|
||||
} from "./shared";
|
||||
import { draftFrenchCuff, decorateFrenchCuff, paperlessFrenchCuff } from './shared'
|
||||
|
||||
export default part => {
|
||||
let { sa, points, Path, paths, complete, paperless } = part.shorthand();
|
||||
let { sa, points, Path, paths, complete, paperless } = part.shorthand()
|
||||
|
||||
draftFrenchCuff(part);
|
||||
draftFrenchCuff(part)
|
||||
|
||||
paths.seam = new Path()
|
||||
.move(points.topLeft)
|
||||
|
@ -16,21 +12,21 @@ export default part => {
|
|||
.line(points.topRight)
|
||||
.line(points.topLeft)
|
||||
.close()
|
||||
.attr("class", "fabric");
|
||||
.attr('class', 'fabric')
|
||||
|
||||
paths.fold = new Path()
|
||||
.move(points.midLeft)
|
||||
.line(points.midRight)
|
||||
.attr("class", "dotted");
|
||||
.attr('class', 'dotted')
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
decorateFrenchCuff(part);
|
||||
if (sa) paths.sa = paths.seam.offset(sa);
|
||||
decorateFrenchCuff(part)
|
||||
if (sa) paths.sa = paths.seam.offset(sa)
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) paperlessFrenchCuff(part);
|
||||
if (paperless) paperlessFrenchCuff(part)
|
||||
|
||||
return part;
|
||||
};
|
||||
return part
|
||||
}
|
||||
|
|
|
@ -1,24 +1,24 @@
|
|||
import straightBarrelCuff from "./cuff-barrel-straight";
|
||||
import roundedBarrelCuff from "./cuff-barrel-rounded";
|
||||
import angledBarrelCuff from "./cuff-barrel-angled";
|
||||
import straightFrenchCuff from "./cuff-french-straight";
|
||||
import angledFrenchCuff from "./cuff-french-angled";
|
||||
import roundedFrenchCuff from "./cuff-french-rounded";
|
||||
import straightBarrelCuff from './cuff-barrel-straight'
|
||||
import roundedBarrelCuff from './cuff-barrel-rounded'
|
||||
import angledBarrelCuff from './cuff-barrel-angled'
|
||||
import straightFrenchCuff from './cuff-french-straight'
|
||||
import angledFrenchCuff from './cuff-french-angled'
|
||||
import roundedFrenchCuff from './cuff-french-rounded'
|
||||
|
||||
export default part => {
|
||||
let { options } = part.shorthand();
|
||||
let { options } = part.shorthand()
|
||||
switch (options.cuffStyle) {
|
||||
case "roundedBarrelCuff":
|
||||
return roundedBarrelCuff(part);
|
||||
case "straightBarrelCuff":
|
||||
return straightBarrelCuff(part);
|
||||
case "roundedFrenchCuff":
|
||||
return roundedFrenchCuff(part);
|
||||
case "angledFrenchCuff":
|
||||
return angledFrenchCuff(part);
|
||||
case "straightFrenchCuff":
|
||||
return straightFrenchCuff(part);
|
||||
case 'roundedBarrelCuff':
|
||||
return roundedBarrelCuff(part)
|
||||
case 'straightBarrelCuff':
|
||||
return straightBarrelCuff(part)
|
||||
case 'roundedFrenchCuff':
|
||||
return roundedFrenchCuff(part)
|
||||
case 'angledFrenchCuff':
|
||||
return angledFrenchCuff(part)
|
||||
case 'straightFrenchCuff':
|
||||
return straightFrenchCuff(part)
|
||||
default:
|
||||
return angledBarrelCuff(part);
|
||||
return angledBarrelCuff(part)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { calculateReduction } from "./shared";
|
||||
import { calculateReduction } from './shared'
|
||||
|
||||
export default part => {
|
||||
part.paths = {};
|
||||
part.paths = {}
|
||||
let {
|
||||
store,
|
||||
measurements,
|
||||
|
@ -14,138 +14,126 @@ export default part => {
|
|||
paperless,
|
||||
macro,
|
||||
options
|
||||
} = part.shorthand();
|
||||
} = part.shorthand()
|
||||
|
||||
// Populare store with data we need
|
||||
calculateReduction(part);
|
||||
calculateReduction(part)
|
||||
store.set(
|
||||
"frontArmholeLength",
|
||||
'frontArmholeLength',
|
||||
new Path()
|
||||
.move(points.armhole)
|
||||
.curve(points.armholeCp2, points.armholeHollowCp1, points.armholeHollow)
|
||||
.curve(
|
||||
points.armholeHollowCp2,
|
||||
points.armholePitchCp1,
|
||||
points.armholePitch
|
||||
)
|
||||
.curve(points.armholeHollowCp2, points.armholePitchCp1, points.armholePitch)
|
||||
.curve(points.armholePitchCp2, points.shoulderCp1, points.shoulder)
|
||||
.length()
|
||||
);
|
||||
)
|
||||
|
||||
// Hip shaping
|
||||
points.hips = points.hips.shift(180, store.get("hipsReduction") / 4);
|
||||
points.hem = points.hem.shift(180, store.get("hipsReduction") / 4);
|
||||
points.hips = points.hips.shift(180, store.get('hipsReduction') / 4)
|
||||
points.hem = points.hem.shift(180, store.get('hipsReduction') / 4)
|
||||
|
||||
// Waist shaping
|
||||
let reduce = store.get("waistReduction");
|
||||
if (reduce / 4 > options.minimalDartShaping) reduce = reduce / 8;
|
||||
else reduce = reduce / 4;
|
||||
points.waist = points.waist.shift(180, reduce);
|
||||
points.waistCp1 = points.waist.shift(
|
||||
-90,
|
||||
measurements.naturalWaistToHip * 0.5
|
||||
);
|
||||
points.waistCp2 = points.waist.shift(90, points.armhole.dy(points.waist) / 2);
|
||||
points.hipsCp2 = points.hips.shift(90, points.waist.dy(points.hips) / 4);
|
||||
let reduce = store.get('waistReduction')
|
||||
if (reduce / 4 > options.minimalDartShaping) reduce = reduce / 8
|
||||
else reduce = reduce / 4
|
||||
points.waist = points.waist.shift(180, reduce)
|
||||
points.waistCp1 = points.waist.shift(-90, measurements.naturalWaistToHip * 0.5)
|
||||
points.waistCp2 = points.waist.shift(90, points.armhole.dy(points.waist) / 2)
|
||||
points.hipsCp2 = points.hips.shift(90, points.waist.dy(points.hips) / 4)
|
||||
|
||||
// Draft hem
|
||||
paths.saBaseFromHips = new Path()
|
||||
.move(points.hips)
|
||||
.curve(points.hipsCp2, points.waistCp1, points.waist)
|
||||
.curve_(points.waistCp2, points.armhole);
|
||||
.curve_(points.waistCp2, points.armhole)
|
||||
paths.saBaseFromArmhole = new Path()
|
||||
.move(points.armhole)
|
||||
.curve(points.armholeCp2, points.armholeHollowCp1, points.armholeHollow)
|
||||
.curve(points.armholeHollowCp2, points.armholePitchCp1, points.armholePitch)
|
||||
.curve(points.armholePitchCp2, points.shoulderCp1, points.shoulder)
|
||||
.line(points.neck)
|
||||
.curve(points.neckCp2Front, points.cfNeckCp1, points.cfNeck);
|
||||
.curve(points.neckCp2Front, points.cfNeckCp1, points.cfNeck)
|
||||
switch (options.hemStyle) {
|
||||
case "baseball":
|
||||
points.bballStart = points.cfHem.shiftFractionTowards(points.hem, 0.5);
|
||||
points.bballEnd = points.hem.shiftFractionTowards(
|
||||
points.hips,
|
||||
options.hemCurve
|
||||
);
|
||||
points.bballCp1 = points.bballStart.shiftFractionTowards(points.hem, 0.5);
|
||||
points.bballCp2 = new Point(points.bballCp1.x, points.bballEnd.y);
|
||||
case 'baseball':
|
||||
points.bballStart = points.cfHem.shiftFractionTowards(points.hem, 0.5)
|
||||
points.bballEnd = points.hem.shiftFractionTowards(points.hips, options.hemCurve)
|
||||
points.bballCp1 = points.bballStart.shiftFractionTowards(points.hem, 0.5)
|
||||
points.bballCp2 = new Point(points.bballCp1.x, points.bballEnd.y)
|
||||
paths.saBase = new Path()
|
||||
.move(points.bballEnd)
|
||||
.line(points.hips)
|
||||
.join(paths.saBaseFromHips);
|
||||
.join(paths.saBaseFromHips)
|
||||
paths.hemBase = new Path()
|
||||
.move(points.cfHem)
|
||||
.line(points.bballStart)
|
||||
.curve(points.bballCp1, points.bballCp2, points.bballEnd);
|
||||
break;
|
||||
case "slashed":
|
||||
macro("round", {
|
||||
.curve(points.bballCp1, points.bballCp2, points.bballEnd)
|
||||
break
|
||||
case 'slashed':
|
||||
macro('round', {
|
||||
from: points.hips,
|
||||
to: points.cfHem,
|
||||
via: points.hem,
|
||||
radius: points.hips.dist(points.hem) * options.hemCurve,
|
||||
prefix: "slash"
|
||||
});
|
||||
paths.saBase = new Path().move(points.hips).join(paths.saBaseFromHips);
|
||||
prefix: 'slash'
|
||||
})
|
||||
paths.saBase = new Path().move(points.hips).join(paths.saBaseFromHips)
|
||||
paths.hemBase = new Path()
|
||||
.move(points.cfHem)
|
||||
.line(points.slashEnd)
|
||||
.curve(points.slashCp2, points.slashCp1, points.slashStart);
|
||||
break;
|
||||
.curve(points.slashCp2, points.slashCp1, points.slashStart)
|
||||
break
|
||||
default:
|
||||
paths.saBase = new Path()
|
||||
.move(points.hem)
|
||||
.line(points.hips)
|
||||
.join(paths.saBaseFromHips);
|
||||
paths.hemBase = new Path().move(points.cfHem).line(points.hem);
|
||||
.join(paths.saBaseFromHips)
|
||||
paths.hemBase = new Path().move(points.cfHem).line(points.hem)
|
||||
}
|
||||
|
||||
// Paths
|
||||
paths.saBase.render = false;
|
||||
paths.saBaseFromHips.render = false;
|
||||
paths.saBaseFromArmhole.render = false;
|
||||
paths.hemBase.render = false;
|
||||
paths.saBase.render = false
|
||||
paths.saBaseFromHips.render = false
|
||||
paths.saBaseFromArmhole.render = false
|
||||
paths.hemBase.render = false
|
||||
paths.seam = paths.hemBase
|
||||
.join(paths.saBase)
|
||||
.join(paths.saBaseFromArmhole)
|
||||
.attr("class", "fabric");
|
||||
.attr('class', 'fabric')
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
delete paths.cutonfold;
|
||||
macro("grainline", {
|
||||
delete paths.cutonfold
|
||||
macro('grainline', {
|
||||
from: points.cfHem.shift(0, 45),
|
||||
to: points.cfNeck.shift(0, 45)
|
||||
});
|
||||
macro("title", { at: points.title, nr: "X", title: "front" });
|
||||
macro("sprinkle", {
|
||||
snippet: "notch",
|
||||
})
|
||||
macro('title', { at: points.title, nr: 'X', title: 'front' })
|
||||
macro('sprinkle', {
|
||||
snippet: 'notch',
|
||||
on: [
|
||||
"waist",
|
||||
"armholePitch",
|
||||
"shoulder",
|
||||
"neck",
|
||||
"hips",
|
||||
"cfHips",
|
||||
"cfWaist",
|
||||
"armhole",
|
||||
"cfArmhole"
|
||||
'waist',
|
||||
'armholePitch',
|
||||
'shoulder',
|
||||
'neck',
|
||||
'hips',
|
||||
'cfHips',
|
||||
'cfWaist',
|
||||
'armhole',
|
||||
'cfArmhole'
|
||||
]
|
||||
});
|
||||
})
|
||||
|
||||
if (sa) {
|
||||
paths.saFrench = paths.saBase.offset(sa * 2).attr("class", "fabric sa");
|
||||
paths.saFromArmhole = paths.saBaseFromArmhole
|
||||
.offset(sa)
|
||||
.attr("class", "fabric sa");
|
||||
paths.hemSa = paths.hemBase.offset(sa * 3).attr("class", "fabric sa");
|
||||
paths.saFrench = paths.saBase.offset(sa * 2).attr('class', 'fabric sa')
|
||||
paths.saFromArmhole = paths.saBaseFromArmhole.offset(sa).attr('class', 'fabric sa')
|
||||
paths.hemSa = paths.hemBase.offset(sa * 3).attr('class', 'fabric sa')
|
||||
paths.saConnect = new Path()
|
||||
.move(paths.hemSa.end())
|
||||
.line(paths.saFrench.start())
|
||||
.move(paths.saFrench.end())
|
||||
.line(paths.saFromArmhole.start())
|
||||
.attr("class", "fabric sa");
|
||||
delete paths.sa;
|
||||
.attr('class', 'fabric sa')
|
||||
delete paths.sa
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -153,5 +141,5 @@ export default part => {
|
|||
if (paperless) {
|
||||
}
|
||||
|
||||
return part;
|
||||
};
|
||||
return part
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { addButtonHoles } from "./shared";
|
||||
import { addButtonHoles } from './shared'
|
||||
|
||||
export default part => {
|
||||
let {
|
||||
|
@ -12,58 +12,31 @@ export default part => {
|
|||
paperless,
|
||||
macro,
|
||||
options
|
||||
} = part.shorthand();
|
||||
} = part.shorthand()
|
||||
|
||||
let fold = options.buttonholePlacketFoldWidth;
|
||||
let width = options.buttonholePlacketWidth;
|
||||
points.placketCfNeck = points.cfNeck.shift(180, fold * 2);
|
||||
points.placketTopInnerEdgeFold = points.placketCfNeck.shift(0, width / 2);
|
||||
points.placketTopInnerEdgeOver = points.placketCfNeck.shift(
|
||||
0,
|
||||
width / 2 - fold
|
||||
);
|
||||
points.placketTopInnerEdgeUnder = points.placketCfNeck.shift(
|
||||
0,
|
||||
width / 2 + fold
|
||||
);
|
||||
points.placketTopOuterEdgeFold = points.placketCfNeck.shift(180, width / 2);
|
||||
points.placketTopOuterEdgeOver = points.placketCfNeck.shift(
|
||||
180,
|
||||
width / 2 - fold
|
||||
);
|
||||
points.placketTopOuterEdgeUnder = points.placketCfNeck.shift(
|
||||
180,
|
||||
width / 2 + fold
|
||||
);
|
||||
points.placketCfHem = points.cfHem.shift(180, fold * 2);
|
||||
points.placketBottomInnerEdgeFold = points.placketCfHem.shift(0, width / 2);
|
||||
points.placketBottomInnerEdgeOver = points.placketCfHem.shift(
|
||||
0,
|
||||
width / 2 - fold
|
||||
);
|
||||
points.placketBottomInnerEdgeUnder = points.placketCfHem.shift(
|
||||
0,
|
||||
width / 2 + fold
|
||||
);
|
||||
points.placketBottomOuterEdgeFold = points.placketCfHem.shift(180, width / 2);
|
||||
points.placketBottomOuterEdgeOver = points.placketCfHem.shift(
|
||||
180,
|
||||
width / 2 - fold
|
||||
);
|
||||
points.placketBottomOuterEdgeUnder = points.placketCfHem.shift(
|
||||
180,
|
||||
width / 2 + fold
|
||||
);
|
||||
points.placketTopEdge = points.placketTopOuterEdgeFold.shift(180, width);
|
||||
points.placketBottomEdge = points.placketBottomOuterEdgeFold.shift(
|
||||
180,
|
||||
width
|
||||
);
|
||||
let fold = options.buttonholePlacketFoldWidth
|
||||
let width = options.buttonholePlacketWidth
|
||||
points.placketCfNeck = points.cfNeck.shift(180, fold * 2)
|
||||
points.placketTopInnerEdgeFold = points.placketCfNeck.shift(0, width / 2)
|
||||
points.placketTopInnerEdgeOver = points.placketCfNeck.shift(0, width / 2 - fold)
|
||||
points.placketTopInnerEdgeUnder = points.placketCfNeck.shift(0, width / 2 + fold)
|
||||
points.placketTopOuterEdgeFold = points.placketCfNeck.shift(180, width / 2)
|
||||
points.placketTopOuterEdgeOver = points.placketCfNeck.shift(180, width / 2 - fold)
|
||||
points.placketTopOuterEdgeUnder = points.placketCfNeck.shift(180, width / 2 + fold)
|
||||
points.placketCfHem = points.cfHem.shift(180, fold * 2)
|
||||
points.placketBottomInnerEdgeFold = points.placketCfHem.shift(0, width / 2)
|
||||
points.placketBottomInnerEdgeOver = points.placketCfHem.shift(0, width / 2 - fold)
|
||||
points.placketBottomInnerEdgeUnder = points.placketCfHem.shift(0, width / 2 + fold)
|
||||
points.placketBottomOuterEdgeFold = points.placketCfHem.shift(180, width / 2)
|
||||
points.placketBottomOuterEdgeOver = points.placketCfHem.shift(180, width / 2 - fold)
|
||||
points.placketBottomOuterEdgeUnder = points.placketCfHem.shift(180, width / 2 + fold)
|
||||
points.placketTopEdge = points.placketTopOuterEdgeFold.shift(180, width)
|
||||
points.placketBottomEdge = points.placketBottomOuterEdgeFold.shift(180, width)
|
||||
|
||||
paths.seam
|
||||
.line(points.placketTopEdge)
|
||||
.line(points.placketBottomEdge)
|
||||
.close();
|
||||
.close()
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
|
@ -71,73 +44,64 @@ export default part => {
|
|||
paths.frontCenter = new Path()
|
||||
.move(points.placketCfNeck)
|
||||
.line(points.placketCfHem)
|
||||
.attr("class", "help");
|
||||
.attr('class', 'help')
|
||||
paths.placketInnerEdgeFold = new Path()
|
||||
.move(points.placketTopInnerEdgeFold)
|
||||
.line(points.placketBottomInnerEdgeFold)
|
||||
.attr("class", "dotted");
|
||||
.attr('class', 'dotted')
|
||||
paths.placketInnerEdgeOver = new Path()
|
||||
.move(points.placketTopInnerEdgeOver)
|
||||
.line(points.placketBottomInnerEdgeOver)
|
||||
.attr("class", "dotted");
|
||||
.attr('class', 'dotted')
|
||||
paths.placketInnerEdgeUnder = new Path()
|
||||
.move(points.placketTopInnerEdgeUnder)
|
||||
.line(points.placketBottomInnerEdgeUnder)
|
||||
.attr("class", "dotted");
|
||||
.attr('class', 'dotted')
|
||||
paths.placketOuterEdgeFold = new Path()
|
||||
.move(points.placketTopOuterEdgeFold)
|
||||
.line(points.placketBottomOuterEdgeFold)
|
||||
.attr("class", "dotted");
|
||||
.attr('class', 'dotted')
|
||||
paths.placketOuterEdgeOver = new Path()
|
||||
.move(points.placketTopOuterEdgeOver)
|
||||
.line(points.placketBottomOuterEdgeOver)
|
||||
.attr("class", "dotted");
|
||||
.attr('class', 'dotted')
|
||||
paths.placketOuterEdgeUnder = new Path()
|
||||
.move(points.placketTopOuterEdgeUnder)
|
||||
.line(points.placketBottomOuterEdgeUnder)
|
||||
.attr("class", "dotted");
|
||||
points.placketEdgeWaist = new Point(
|
||||
points.placketBottomEdge.x,
|
||||
points.waist.y
|
||||
);
|
||||
points.placketEdgeArmhole = new Point(
|
||||
points.placketBottomEdge.x,
|
||||
points.armhole.y
|
||||
);
|
||||
points.placketEdgeHips = new Point(
|
||||
points.placketBottomEdge.x,
|
||||
points.hips.y
|
||||
);
|
||||
macro("sprinkle", {
|
||||
snippet: "notch",
|
||||
.attr('class', 'dotted')
|
||||
points.placketEdgeWaist = new Point(points.placketBottomEdge.x, points.waist.y)
|
||||
points.placketEdgeArmhole = new Point(points.placketBottomEdge.x, points.armhole.y)
|
||||
points.placketEdgeHips = new Point(points.placketBottomEdge.x, points.hips.y)
|
||||
macro('sprinkle', {
|
||||
snippet: 'notch',
|
||||
on: [
|
||||
"placketCfNeck",
|
||||
"placketCfHem",
|
||||
"placketEdgeArmhole",
|
||||
"placketEdgeWaist",
|
||||
"placketEdgeHips",
|
||||
"placketTopInnerEdgeFold",
|
||||
"placketTopInnerEdgeOver",
|
||||
"placketTopInnerEdgeUnder",
|
||||
"placketTopOuterEdgeFold",
|
||||
"placketTopOuterEdgeOver",
|
||||
"placketTopOuterEdgeUnder",
|
||||
"placketBottomInnerEdgeFold",
|
||||
"placketBottomInnerEdgeOver",
|
||||
"placketBottomInnerEdgeUnder",
|
||||
"placketBottomOuterEdgeFold",
|
||||
"placketBottomOuterEdgeOver",
|
||||
"placketBottomOuterEdgeUnder"
|
||||
'placketCfNeck',
|
||||
'placketCfHem',
|
||||
'placketEdgeArmhole',
|
||||
'placketEdgeWaist',
|
||||
'placketEdgeHips',
|
||||
'placketTopInnerEdgeFold',
|
||||
'placketTopInnerEdgeOver',
|
||||
'placketTopInnerEdgeUnder',
|
||||
'placketTopOuterEdgeFold',
|
||||
'placketTopOuterEdgeOver',
|
||||
'placketTopOuterEdgeUnder',
|
||||
'placketBottomInnerEdgeFold',
|
||||
'placketBottomInnerEdgeOver',
|
||||
'placketBottomInnerEdgeUnder',
|
||||
'placketBottomOuterEdgeFold',
|
||||
'placketBottomOuterEdgeOver',
|
||||
'placketBottomOuterEdgeUnder'
|
||||
]
|
||||
});
|
||||
delete snippets["cfWaist-notch"];
|
||||
delete snippets["cfHips-notch"];
|
||||
delete snippets["cfArmhole-notch"];
|
||||
})
|
||||
delete snippets['cfWaist-notch']
|
||||
delete snippets['cfHips-notch']
|
||||
delete snippets['cfArmhole-notch']
|
||||
// Buttons
|
||||
addButtonHoles(part, "placketCfNeck");
|
||||
addButtonHoles(part, 'placketCfNeck')
|
||||
|
||||
// Title
|
||||
macro("title", { at: points.title, nr: 2, title: "frontLeft" });
|
||||
macro('title', { at: points.title, nr: 2, title: 'frontLeft' })
|
||||
|
||||
if (sa) {
|
||||
paths.saFromArmhole
|
||||
|
@ -145,66 +109,66 @@ export default part => {
|
|||
.line(points.placketTopEdge)
|
||||
.move(points.placketBottomEdge)
|
||||
.line(points.placketBottomEdge.shift(-90, 3 * sa))
|
||||
.line(paths.hemSa.start());
|
||||
.line(paths.hemSa.start())
|
||||
}
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
macro("hd", {
|
||||
macro('hd', {
|
||||
from: points.placketEdgeArmhole,
|
||||
to: points.armhole
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.placketEdgeWaist,
|
||||
to: points.waist
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.placketEdgeHips,
|
||||
to: points.hips
|
||||
});
|
||||
let offset = 0;
|
||||
})
|
||||
let offset = 0
|
||||
for (let pid of [
|
||||
"placketTopOuterEdgeUnder",
|
||||
"placketTopOuterEdgeFold",
|
||||
"placketTopOuterEdgeOver",
|
||||
"placketCfNeck",
|
||||
"placketTopInnerEdgeOver",
|
||||
"placketTopInnerEdgeFold",
|
||||
"placketTopInnerEdgeUnder"
|
||||
'placketTopOuterEdgeUnder',
|
||||
'placketTopOuterEdgeFold',
|
||||
'placketTopOuterEdgeOver',
|
||||
'placketCfNeck',
|
||||
'placketTopInnerEdgeOver',
|
||||
'placketTopInnerEdgeFold',
|
||||
'placketTopInnerEdgeUnder'
|
||||
]) {
|
||||
offset += 15;
|
||||
macro("hd", {
|
||||
offset += 15
|
||||
macro('hd', {
|
||||
from: points.placketTopEdge,
|
||||
to: points[pid],
|
||||
y: points.placketTopEdge.y - offset - sa
|
||||
});
|
||||
})
|
||||
}
|
||||
macro("hd", {
|
||||
macro('hd', {
|
||||
from: points.placketTopEdge,
|
||||
to: points.neck,
|
||||
y: points.placketTopEdge.y - offset - sa - 15
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.placketTopEdge,
|
||||
to: points.shoulder,
|
||||
y: points.placketTopEdge.y - offset - sa - 30
|
||||
});
|
||||
points.button0 = points.placketTopEdge;
|
||||
let j;
|
||||
})
|
||||
points.button0 = points.placketTopEdge
|
||||
let j
|
||||
for (let i = 0; i < options.buttons; i++) {
|
||||
j = i + 1;
|
||||
macro("vd", {
|
||||
from: points["button" + j],
|
||||
to: points["button" + i],
|
||||
j = i + 1
|
||||
macro('vd', {
|
||||
from: points['button' + j],
|
||||
to: points['button' + i],
|
||||
x: points.placketTopEdge.x - 15
|
||||
});
|
||||
})
|
||||
}
|
||||
macro("vd", {
|
||||
macro('vd', {
|
||||
from: points.placketBottomEdge,
|
||||
to: points.placketTopEdge,
|
||||
x: points.placketTopEdge.x - 30
|
||||
});
|
||||
})
|
||||
}
|
||||
return part;
|
||||
};
|
||||
return part
|
||||
}
|
||||
|
|
|
@ -11,9 +11,9 @@ export default part => {
|
|||
paperless,
|
||||
macro,
|
||||
options
|
||||
} = part.shorthand();
|
||||
} = part.shorthand()
|
||||
|
||||
let fold = options.buttonholePlacketFoldWidth;
|
||||
let fold = options.buttonholePlacketFoldWidth
|
||||
points.neckEdge = utils.lineIntersectsCurve(
|
||||
new Point(points.cfNeck.x + fold * 2, points.cfNeck.y + 20),
|
||||
new Point(points.cfNeck.x + fold * 2, points.cfNeck.y - 20),
|
||||
|
@ -21,66 +21,66 @@ export default part => {
|
|||
points.cfNeckCp1,
|
||||
points.neckCp2Front,
|
||||
points.neck
|
||||
);
|
||||
points.hemEdge = new Point(points.neckEdge.x, points.cfHem.y);
|
||||
)
|
||||
points.hemEdge = new Point(points.neckEdge.x, points.cfHem.y)
|
||||
|
||||
paths.seam = paths.seam.split(points.neckEdge)[0];
|
||||
paths.seam.ops[0].to = points.hemEdge;
|
||||
paths.seam.close().attr("class", "fabric");
|
||||
paths.seam = paths.seam.split(points.neckEdge)[0]
|
||||
paths.seam.ops[0].to = points.hemEdge
|
||||
paths.seam.close().attr('class', 'fabric')
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
// Title
|
||||
macro("title", { at: points.title, nr: "2a", title: "frontLeft" });
|
||||
macro('title', { at: points.title, nr: '2a', title: 'frontLeft' })
|
||||
|
||||
delete snippets["cfWaist-notch"];
|
||||
delete snippets["cfHips-notch"];
|
||||
delete snippets["cfArmhole-notch"];
|
||||
points.edgeArmhole = new Point(points.neckEdge.x, points.armhole.y);
|
||||
points.edgeWaist = new Point(points.neckEdge.x, points.waist.y);
|
||||
points.edgeHips = new Point(points.neckEdge.x, points.hips.y);
|
||||
macro("sprinkle", {
|
||||
snippet: "notch",
|
||||
on: ["edgeArmhole", "edgeWaist", "edgeHips"]
|
||||
});
|
||||
delete snippets['cfWaist-notch']
|
||||
delete snippets['cfHips-notch']
|
||||
delete snippets['cfArmhole-notch']
|
||||
points.edgeArmhole = new Point(points.neckEdge.x, points.armhole.y)
|
||||
points.edgeWaist = new Point(points.neckEdge.x, points.waist.y)
|
||||
points.edgeHips = new Point(points.neckEdge.x, points.hips.y)
|
||||
macro('sprinkle', {
|
||||
snippet: 'notch',
|
||||
on: ['edgeArmhole', 'edgeWaist', 'edgeHips']
|
||||
})
|
||||
if (sa) {
|
||||
paths.saFromArmhole.end().x = points.neckEdge.x - sa;
|
||||
paths.hemSa.start().x = points.neckEdge.x - sa;
|
||||
paths.saFromArmhole.end().x = points.neckEdge.x - sa
|
||||
paths.hemSa.start().x = points.neckEdge.x - sa
|
||||
paths.saClosure = new Path()
|
||||
.move(paths.saFromArmhole.end())
|
||||
.line(paths.hemSa.start())
|
||||
.attr("class", "fabric sa");
|
||||
.attr('class', 'fabric sa')
|
||||
}
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
macro("hd", {
|
||||
macro('hd', {
|
||||
from: points.neckEdge,
|
||||
to: points.neck,
|
||||
y: points.neck.y - sa - 15
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.neckEdge,
|
||||
to: points.shoulder,
|
||||
y: points.neck.y - sa - 30
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.neckEdge,
|
||||
to: points.neck,
|
||||
x: points.neckEdge.x - sa - 15
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.hemEdge,
|
||||
to: points.neck,
|
||||
x: points.neckEdge.x - sa - 30
|
||||
});
|
||||
for (let pid of ["Armhole", "Waist", "Hips"]) {
|
||||
macro("hd", {
|
||||
from: points["edge" + pid],
|
||||
})
|
||||
for (let pid of ['Armhole', 'Waist', 'Hips']) {
|
||||
macro('hd', {
|
||||
from: points['edge' + pid],
|
||||
to: points[pid.toLowerCase()]
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
return part;
|
||||
};
|
||||
return part
|
||||
}
|
||||
|
|
|
@ -1,29 +1,20 @@
|
|||
import { addButtonHoles } from "./shared";
|
||||
import { addButtonHoles } from './shared'
|
||||
|
||||
export default part => {
|
||||
let {
|
||||
sa,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
complete,
|
||||
paperless,
|
||||
macro,
|
||||
options
|
||||
} = part.shorthand();
|
||||
let width = options.buttonholePlacketWidth;
|
||||
points.placketCfNeck = points.cfNeck;
|
||||
points.placketTopFold1 = points.cfNeck.shift(180, width / 2);
|
||||
points.placketTopFold2 = points.cfNeck.shift(180, width * 1.5);
|
||||
points.placketTopEdge = points.cfNeck.shift(180, width * 2.5);
|
||||
points.placketBottomFold1 = points.cfHem.shift(180, width / 2);
|
||||
points.placketBottomFold2 = points.cfHem.shift(180, width * 1.5);
|
||||
points.placketBottomEdge = points.cfHem.shift(180, width * 2.5);
|
||||
let { sa, points, Path, paths, complete, paperless, macro, options } = part.shorthand()
|
||||
let width = options.buttonholePlacketWidth
|
||||
points.placketCfNeck = points.cfNeck
|
||||
points.placketTopFold1 = points.cfNeck.shift(180, width / 2)
|
||||
points.placketTopFold2 = points.cfNeck.shift(180, width * 1.5)
|
||||
points.placketTopEdge = points.cfNeck.shift(180, width * 2.5)
|
||||
points.placketBottomFold1 = points.cfHem.shift(180, width / 2)
|
||||
points.placketBottomFold2 = points.cfHem.shift(180, width * 1.5)
|
||||
points.placketBottomEdge = points.cfHem.shift(180, width * 2.5)
|
||||
|
||||
paths.seam
|
||||
.line(points.placketTopEdge)
|
||||
.line(points.placketBottomEdge)
|
||||
.close();
|
||||
.close()
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
|
@ -31,32 +22,32 @@ export default part => {
|
|||
paths.frontCenter = new Path()
|
||||
.move(points.cfNeck)
|
||||
.line(points.cfHem)
|
||||
.attr("class", "help");
|
||||
.attr('class', 'help')
|
||||
paths.placketFold1 = new Path()
|
||||
.move(points.placketTopFold1)
|
||||
.line(points.placketBottomFold1)
|
||||
.attr("class", "dotted");
|
||||
.attr('class', 'dotted')
|
||||
paths.placketFold2 = new Path()
|
||||
.move(points.placketTopFold2)
|
||||
.line(points.placketBottomFold2)
|
||||
.attr("class", "dotted");
|
||||
macro("sprinkle", {
|
||||
snippet: "notch",
|
||||
.attr('class', 'dotted')
|
||||
macro('sprinkle', {
|
||||
snippet: 'notch',
|
||||
on: [
|
||||
"cfNeck",
|
||||
"cfHem",
|
||||
"placketTopFold1",
|
||||
"placketTopFold2",
|
||||
"placketBottomFold1",
|
||||
"placketBottomFold2"
|
||||
'cfNeck',
|
||||
'cfHem',
|
||||
'placketTopFold1',
|
||||
'placketTopFold2',
|
||||
'placketBottomFold1',
|
||||
'placketBottomFold2'
|
||||
]
|
||||
});
|
||||
})
|
||||
|
||||
// Buttons
|
||||
addButtonHoles(part, "cfNeck");
|
||||
addButtonHoles(part, 'cfNeck')
|
||||
|
||||
// Title
|
||||
macro("title", { at: points.title, nr: 2, title: "frontLeft" });
|
||||
macro('title', { at: points.title, nr: 2, title: 'frontLeft' })
|
||||
|
||||
if (sa) {
|
||||
paths.saFromArmhole
|
||||
|
@ -64,46 +55,41 @@ export default part => {
|
|||
.line(points.placketTopEdge)
|
||||
.move(points.placketBottomEdge)
|
||||
.line(points.placketBottomEdge.shift(-90, 3 * sa))
|
||||
.line(paths.hemSa.start());
|
||||
.line(paths.hemSa.start())
|
||||
}
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
let offset = 0;
|
||||
for (let pid of [
|
||||
"placketBottomFold2",
|
||||
"placketBottomFold1",
|
||||
"cfHem",
|
||||
"hips"
|
||||
]) {
|
||||
offset += 15;
|
||||
macro("hd", {
|
||||
let offset = 0
|
||||
for (let pid of ['placketBottomFold2', 'placketBottomFold1', 'cfHem', 'hips']) {
|
||||
offset += 15
|
||||
macro('hd', {
|
||||
from: points.placketBottomEdge,
|
||||
to: points[pid],
|
||||
y: points.placketBottomEdge.y + offset + 3 * sa
|
||||
});
|
||||
})
|
||||
}
|
||||
macro("hd", {
|
||||
macro('hd', {
|
||||
from: points.placketTopEdge,
|
||||
to: points.neck,
|
||||
y: points.neck.y - 15 - sa
|
||||
});
|
||||
points.button0 = points.placketTopEdge;
|
||||
let j;
|
||||
})
|
||||
points.button0 = points.placketTopEdge
|
||||
let j
|
||||
for (let i = 0; i < options.buttons; i++) {
|
||||
j = i + 1;
|
||||
macro("vd", {
|
||||
from: points["button" + j],
|
||||
to: points["button" + i],
|
||||
j = i + 1
|
||||
macro('vd', {
|
||||
from: points['button' + j],
|
||||
to: points['button' + i],
|
||||
x: points.placketTopEdge.x - 15
|
||||
});
|
||||
})
|
||||
}
|
||||
macro("vd", {
|
||||
macro('vd', {
|
||||
from: points.placketBottomEdge,
|
||||
to: points.placketTopEdge,
|
||||
x: points.placketTopEdge.x - 30
|
||||
});
|
||||
})
|
||||
}
|
||||
return part;
|
||||
};
|
||||
return part
|
||||
}
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
import { frontDimensions } from "./shared";
|
||||
import frontLeftClassicSeperate from "./frontleft-classic-seperate";
|
||||
import frontLeftClassicCuton from "./frontleft-classic-cuton";
|
||||
import frontLeftSeamless from "./frontleft-seamless";
|
||||
import { frontDimensions } from './shared'
|
||||
import frontLeftClassicSeperate from './frontleft-classic-seperate'
|
||||
import frontLeftClassicCuton from './frontleft-classic-cuton'
|
||||
import frontLeftSeamless from './frontleft-seamless'
|
||||
|
||||
export default part => {
|
||||
let { sa, options, complete, paperless, points, macro } = part.shorthand();
|
||||
let { sa, options, complete, paperless, points, macro } = part.shorthand()
|
||||
|
||||
if (complete && paperless) {
|
||||
frontDimensions(part, "left");
|
||||
macro("ld", {
|
||||
frontDimensions(part, 'left')
|
||||
macro('ld', {
|
||||
from: points.neck,
|
||||
to: points.shoulder,
|
||||
d: 15 + sa
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
return options.buttonholePlacketStyle === "seamless"
|
||||
return options.buttonholePlacketStyle === 'seamless'
|
||||
? frontLeftSeamless(part)
|
||||
: options.seperateButtonholePlacket
|
||||
? frontLeftClassicSeperate(part)
|
||||
: frontLeftClassicCuton(part);
|
||||
};
|
||||
: frontLeftClassicCuton(part)
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { addButtons } from "./shared";
|
||||
import { addButtons } from './shared'
|
||||
|
||||
export default part => {
|
||||
let {
|
||||
|
@ -12,9 +12,9 @@ export default part => {
|
|||
paperless,
|
||||
macro,
|
||||
options
|
||||
} = part.shorthand();
|
||||
} = part.shorthand()
|
||||
|
||||
let width = options.buttonPlacketWidth;
|
||||
let width = options.buttonPlacketWidth
|
||||
points.placketTopIn = utils.lineIntersectsCurve(
|
||||
new Point(width / -2, points.cfNeck.y + 20),
|
||||
new Point(width / -2, points.cfNeck.y - 20),
|
||||
|
@ -22,18 +22,18 @@ export default part => {
|
|||
points.cfNeckCp1,
|
||||
points.neckCp2Front,
|
||||
points.neck
|
||||
);
|
||||
points.placketTopOut = points.cfNeck.shift(0, width / 2);
|
||||
points.placketTopEdge = points.cfNeck.shift(0, width * 1.5);
|
||||
points.placketBottomIn = points.cfHem.shift(180, width / 2);
|
||||
points.placketBottomOut = points.cfHem.shift(0, width / 2);
|
||||
points.placketBottomEdge = points.cfHem.shift(0, width * 1.5);
|
||||
)
|
||||
points.placketTopOut = points.cfNeck.shift(0, width / 2)
|
||||
points.placketTopEdge = points.cfNeck.shift(0, width * 1.5)
|
||||
points.placketBottomIn = points.cfHem.shift(180, width / 2)
|
||||
points.placketBottomOut = points.cfHem.shift(0, width / 2)
|
||||
points.placketBottomEdge = points.cfHem.shift(0, width * 1.5)
|
||||
|
||||
paths.seam
|
||||
.line(points.placketTopEdge)
|
||||
.line(points.placketBottomEdge)
|
||||
.line(points.cfHem)
|
||||
.close();
|
||||
.close()
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
|
@ -41,91 +41,84 @@ export default part => {
|
|||
paths.frontCenter = new Path()
|
||||
.move(points.cfNeck)
|
||||
.line(points.cfHem)
|
||||
.attr("class", "help");
|
||||
.attr('class', 'help')
|
||||
paths.placketInnerFold = new Path()
|
||||
.move(points.placketTopIn)
|
||||
.line(points.placketBottomIn)
|
||||
.attr("class", "dotted");
|
||||
.attr('class', 'dotted')
|
||||
paths.placketOuterFold = new Path()
|
||||
.move(points.placketTopOut)
|
||||
.line(points.placketBottomOut)
|
||||
.attr("class", "dotted");
|
||||
macro("sprinkle", {
|
||||
snippet: "notch",
|
||||
.attr('class', 'dotted')
|
||||
macro('sprinkle', {
|
||||
snippet: 'notch',
|
||||
on: [
|
||||
"placketTopIn",
|
||||
"placketTopOut",
|
||||
"cfNeck",
|
||||
"placketBottomIn",
|
||||
"placketBottomOut",
|
||||
"cfHem"
|
||||
'placketTopIn',
|
||||
'placketTopOut',
|
||||
'cfNeck',
|
||||
'placketBottomIn',
|
||||
'placketBottomOut',
|
||||
'cfHem'
|
||||
]
|
||||
});
|
||||
})
|
||||
|
||||
// Buttons
|
||||
addButtons(part);
|
||||
addButtons(part)
|
||||
|
||||
// Title
|
||||
macro("title", { at: points.title, nr: 1, title: "frontRight" });
|
||||
macro('title', { at: points.title, nr: 1, title: 'frontRight' })
|
||||
|
||||
if (sa) {
|
||||
paths.saFromArmhole
|
||||
.line(
|
||||
new Point(points.placketTopEdge.x + sa, points.placketTopEdge.y - sa)
|
||||
)
|
||||
.line(
|
||||
new Point(
|
||||
points.placketBottomEdge.x + sa,
|
||||
points.placketBottomEdge.y + sa * 3
|
||||
)
|
||||
)
|
||||
.line(paths.hemSa.start());
|
||||
.line(new Point(points.placketTopEdge.x + sa, points.placketTopEdge.y - sa))
|
||||
.line(new Point(points.placketBottomEdge.x + sa, points.placketBottomEdge.y + sa * 3))
|
||||
.line(paths.hemSa.start())
|
||||
}
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
macro("hd", {
|
||||
macro('hd', {
|
||||
from: points.placketTopOut,
|
||||
to: points.placketTopEdge,
|
||||
y: points.placketTopEdge.y - 15 - sa
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.cfNeck,
|
||||
to: points.placketTopEdge,
|
||||
y: points.placketTopEdge.y - 30 - sa
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.placketTopIn,
|
||||
to: points.placketTopEdge,
|
||||
y: points.placketTopEdge.y - 45 - sa
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.neck,
|
||||
to: points.placketTopEdge,
|
||||
y: points.neck.y - 15 - sa
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.shoulder,
|
||||
to: points.placketTopEdge,
|
||||
y: points.neck.y - 30 - sa
|
||||
});
|
||||
points.button0 = points.placketTopEdge;
|
||||
let j;
|
||||
})
|
||||
points.button0 = points.placketTopEdge
|
||||
let j
|
||||
for (let i = 0; i < options.buttons; i++) {
|
||||
j = i + 1;
|
||||
macro("vd", {
|
||||
from: points["button" + j],
|
||||
to: points["button" + i],
|
||||
j = i + 1
|
||||
macro('vd', {
|
||||
from: points['button' + j],
|
||||
to: points['button' + i],
|
||||
x: points.placketTopEdge.x + 15 + sa
|
||||
});
|
||||
})
|
||||
}
|
||||
macro("vd", {
|
||||
macro('vd', {
|
||||
from: points.placketBottomEdge,
|
||||
to: points.placketTopEdge,
|
||||
x: points.placketTopEdge.x + 30 + sa
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
return part;
|
||||
};
|
||||
return part
|
||||
}
|
||||
|
|
|
@ -1,17 +1,7 @@
|
|||
export default part => {
|
||||
let {
|
||||
utils,
|
||||
sa,
|
||||
Point,
|
||||
points,
|
||||
paths,
|
||||
complete,
|
||||
paperless,
|
||||
macro,
|
||||
options
|
||||
} = part.shorthand();
|
||||
let { utils, sa, Point, points, paths, complete, paperless, macro, options } = part.shorthand()
|
||||
|
||||
let width = options.buttonPlacketWidth;
|
||||
let width = options.buttonPlacketWidth
|
||||
points.placketTopIn = utils.lineIntersectsCurve(
|
||||
new Point(width / -2, points.cfNeck.y + 20),
|
||||
new Point(width / -2, points.cfNeck.y - 20),
|
||||
|
@ -19,55 +9,55 @@ export default part => {
|
|||
points.cfNeckCp1,
|
||||
points.neckCp2Front,
|
||||
points.neck
|
||||
);
|
||||
points.placketBottomIn = points.cfHem.shift(180, width / 2);
|
||||
paths.seam = paths.seam.split(points.placketTopIn)[0];
|
||||
paths.seam.ops[0].to = points.placketBottomIn;
|
||||
paths.seam.close().attr("class", "fabric");
|
||||
)
|
||||
points.placketBottomIn = points.cfHem.shift(180, width / 2)
|
||||
paths.seam = paths.seam.split(points.placketTopIn)[0]
|
||||
paths.seam.ops[0].to = points.placketBottomIn
|
||||
paths.seam.close().attr('class', 'fabric')
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
// Title
|
||||
macro("title", { at: points.title, nr: "1a", title: "rightFront" });
|
||||
delete snippets["cfWaist-notch"];
|
||||
delete snippets["cfHips-notch"];
|
||||
delete snippets["cfArmhole-notch"];
|
||||
points.edgeArmhole = new Point(points.placketTopIn.x, points.armhole.y);
|
||||
points.edgeWaist = new Point(points.placketTopIn.x, points.waist.y);
|
||||
points.edgeHips = new Point(points.placketTopIn.x, points.hips.y);
|
||||
macro('title', { at: points.title, nr: '1a', title: 'rightFront' })
|
||||
delete snippets['cfWaist-notch']
|
||||
delete snippets['cfHips-notch']
|
||||
delete snippets['cfArmhole-notch']
|
||||
points.edgeArmhole = new Point(points.placketTopIn.x, points.armhole.y)
|
||||
points.edgeWaist = new Point(points.placketTopIn.x, points.waist.y)
|
||||
points.edgeHips = new Point(points.placketTopIn.x, points.hips.y)
|
||||
|
||||
if (sa) paths.saFromArmhole.line(paths.hemSa.start());
|
||||
if (sa) paths.saFromArmhole.line(paths.hemSa.start())
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
macro("hd", {
|
||||
macro('hd', {
|
||||
from: points.neck,
|
||||
to: points.placketTopIn,
|
||||
y: points.neck.y - sa - 15
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.shoulder,
|
||||
to: points.placketTopIn,
|
||||
y: points.neck.y - sa - 30
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.placketTopIn,
|
||||
to: points.neck,
|
||||
x: points.placketTopIn.x + sa + 15
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.placketBottomIn,
|
||||
to: points.placketTopIn,
|
||||
x: points.placketTopIn.x + sa + 15
|
||||
});
|
||||
for (let pid of ["Armhole", "Waist", "Hips"]) {
|
||||
macro("hd", {
|
||||
from: points["edge" + pid],
|
||||
})
|
||||
for (let pid of ['Armhole', 'Waist', 'Hips']) {
|
||||
macro('hd', {
|
||||
from: points['edge' + pid],
|
||||
to: points[pid.toLowerCase()]
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
return part;
|
||||
};
|
||||
return part
|
||||
}
|
||||
|
|
|
@ -1,30 +1,20 @@
|
|||
import { addButtons } from "./shared";
|
||||
import { addButtons } from './shared'
|
||||
|
||||
export default part => {
|
||||
let {
|
||||
sa,
|
||||
Point,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
complete,
|
||||
paperless,
|
||||
macro,
|
||||
options
|
||||
} = part.shorthand();
|
||||
let { sa, Point, points, Path, paths, complete, paperless, macro, options } = part.shorthand()
|
||||
|
||||
let width = options.buttonPlacketWidth;
|
||||
points.placketTopFold1 = points.cfNeck.shift(0, width / 2);
|
||||
points.placketTopFold2 = points.cfNeck.shift(0, width * 1.5);
|
||||
points.placketTopEdge = points.cfNeck.shift(0, width * 2.5);
|
||||
points.placketBottomFold1 = points.cfHem.shift(0, width / 2);
|
||||
points.placketBottomFold2 = points.cfHem.shift(0, width * 1.5);
|
||||
points.placketBottomEdge = points.cfHem.shift(0, width * 2.5);
|
||||
let width = options.buttonPlacketWidth
|
||||
points.placketTopFold1 = points.cfNeck.shift(0, width / 2)
|
||||
points.placketTopFold2 = points.cfNeck.shift(0, width * 1.5)
|
||||
points.placketTopEdge = points.cfNeck.shift(0, width * 2.5)
|
||||
points.placketBottomFold1 = points.cfHem.shift(0, width / 2)
|
||||
points.placketBottomFold2 = points.cfHem.shift(0, width * 1.5)
|
||||
points.placketBottomEdge = points.cfHem.shift(0, width * 2.5)
|
||||
paths.seam
|
||||
.line(points.placketTopEdge)
|
||||
.line(points.placketBottomEdge)
|
||||
.line(points.cfHem)
|
||||
.close();
|
||||
.close()
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
|
@ -32,32 +22,32 @@ export default part => {
|
|||
paths.frontCenter = new Path()
|
||||
.move(points.cfNeck)
|
||||
.line(points.cfHem)
|
||||
.attr("class", "help");
|
||||
.attr('class', 'help')
|
||||
paths.placketFold1 = new Path()
|
||||
.move(points.placketTopFold1)
|
||||
.line(points.placketBottomFold1)
|
||||
.attr("class", "dotted");
|
||||
.attr('class', 'dotted')
|
||||
paths.placketFold2 = new Path()
|
||||
.move(points.placketTopFold2)
|
||||
.line(points.placketBottomFold2)
|
||||
.attr("class", "dotted");
|
||||
macro("sprinkle", {
|
||||
snippet: "notch",
|
||||
.attr('class', 'dotted')
|
||||
macro('sprinkle', {
|
||||
snippet: 'notch',
|
||||
on: [
|
||||
"placketTopFold1",
|
||||
"placketTopFold2",
|
||||
"placketBottomFold1",
|
||||
"placketBottomFold2",
|
||||
"cfNeck",
|
||||
"cfHem"
|
||||
'placketTopFold1',
|
||||
'placketTopFold2',
|
||||
'placketBottomFold1',
|
||||
'placketBottomFold2',
|
||||
'cfNeck',
|
||||
'cfHem'
|
||||
]
|
||||
});
|
||||
})
|
||||
|
||||
// Buttons
|
||||
addButtons(part);
|
||||
addButtons(part)
|
||||
|
||||
// Title
|
||||
macro("title", { at: points.title, nr: 1, title: "frontRight" });
|
||||
macro('title', { at: points.title, nr: 1, title: 'frontRight' })
|
||||
|
||||
if (sa) {
|
||||
paths.saFromArmhole
|
||||
|
@ -65,7 +55,7 @@ export default part => {
|
|||
.line(points.placketTopEdge)
|
||||
.move(points.placketBottomEdge)
|
||||
.line(points.placketBottomEdge.shift(-90, sa * 3))
|
||||
.line(paths.hemSa.start());
|
||||
.line(paths.hemSa.start())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -73,5 +63,5 @@ export default part => {
|
|||
if (paperless) {
|
||||
}
|
||||
|
||||
return part;
|
||||
};
|
||||
return part
|
||||
}
|
||||
|
|
|
@ -1,37 +1,29 @@
|
|||
import { frontDimensions } from "./shared";
|
||||
import frontRightClassicSeperate from "./frontright-classic-seperate";
|
||||
import frontRightClassicCuton from "./frontright-classic-cuton";
|
||||
import frontRightSeamless from "./frontright-seamless";
|
||||
import { frontDimensions } from './shared'
|
||||
import frontRightClassicSeperate from './frontright-classic-seperate'
|
||||
import frontRightClassicCuton from './frontright-classic-cuton'
|
||||
import frontRightSeamless from './frontright-seamless'
|
||||
|
||||
export default part => {
|
||||
let {
|
||||
sa,
|
||||
options,
|
||||
complete,
|
||||
paperless,
|
||||
points,
|
||||
macro,
|
||||
paths
|
||||
} = part.shorthand();
|
||||
macro("flip");
|
||||
let { sa, options, complete, paperless, points, macro, paths } = part.shorthand()
|
||||
macro('flip')
|
||||
if (complete) {
|
||||
points.scalebox = points.waist.shiftFractionTowards(points.cfWaist, 0.5);
|
||||
macro("scalebox", { at: points.scalebox });
|
||||
points.scalebox = points.waist.shiftFractionTowards(points.cfWaist, 0.5)
|
||||
macro('scalebox', { at: points.scalebox })
|
||||
if (paperless) {
|
||||
frontDimensions(part, "right");
|
||||
macro("ld", {
|
||||
frontDimensions(part, 'right')
|
||||
macro('ld', {
|
||||
from: points.shoulder,
|
||||
to: points.neck,
|
||||
d: 15 + sa
|
||||
});
|
||||
paths.hemSa.attr("data-text-dy", 7, true);
|
||||
paths.saFrench.attr("data-text-dy", 7, true);
|
||||
})
|
||||
paths.hemSa.attr('data-text-dy', 7, true)
|
||||
paths.saFrench.attr('data-text-dy', 7, true)
|
||||
}
|
||||
}
|
||||
|
||||
return options.buttonPlacketStyle === "seamless"
|
||||
return options.buttonPlacketStyle === 'seamless'
|
||||
? frontRightSeamless(part)
|
||||
: options.seperateButtonPlacket
|
||||
? frontRightClassicSeperate(part)
|
||||
: frontRightClassicCuton(part);
|
||||
};
|
||||
: frontRightClassicCuton(part)
|
||||
}
|
||||
|
|
|
@ -1,57 +1,53 @@
|
|||
import freesewing from "@freesewing/core";
|
||||
import Brian from "@freesewing/brian";
|
||||
import plugins from "@freesewing/plugin-bundle";
|
||||
import flipPlugin from "@freesewing/plugin-flip";
|
||||
import buttonPlugin from "@freesewing/plugin-buttons";
|
||||
import config from "../config";
|
||||
import freesewing from '@freesewing/core'
|
||||
import Brian from '@freesewing/brian'
|
||||
import plugins from '@freesewing/plugin-bundle'
|
||||
import flipPlugin from '@freesewing/plugin-flip'
|
||||
import buttonPlugin from '@freesewing/plugin-buttons'
|
||||
import config from '../config'
|
||||
// Parts
|
||||
import draftBack from "./back";
|
||||
import draftFront from "./front";
|
||||
import draftFrontRight from "./frontright";
|
||||
import draftButtonPlacket from "./buttonplacket";
|
||||
import draftFrontLeft from "./frontleft";
|
||||
import draftButtonholePlacket from "./buttonholeplacket";
|
||||
import draftYoke from "./yoke";
|
||||
import draftSleeve from "./sleeve";
|
||||
import draftCollarStand from "./collarstand";
|
||||
import draftCollar from "./collar";
|
||||
import draftSleevePlacketUnderlap from "./sleeveplacket-underlap";
|
||||
import draftSleevePlacketOverlap from "./sleeveplacket-overlap";
|
||||
import draftCuff from "./cuff";
|
||||
import draftBack from './back'
|
||||
import draftFront from './front'
|
||||
import draftFrontRight from './frontright'
|
||||
import draftButtonPlacket from './buttonplacket'
|
||||
import draftFrontLeft from './frontleft'
|
||||
import draftButtonholePlacket from './buttonholeplacket'
|
||||
import draftYoke from './yoke'
|
||||
import draftSleeve from './sleeve'
|
||||
import draftCollarStand from './collarstand'
|
||||
import draftCollar from './collar'
|
||||
import draftSleevePlacketUnderlap from './sleeveplacket-underlap'
|
||||
import draftSleevePlacketOverlap from './sleeveplacket-overlap'
|
||||
import draftCuff from './cuff'
|
||||
|
||||
// Create design
|
||||
const Pattern = new freesewing.Design(config, [
|
||||
plugins,
|
||||
flipPlugin,
|
||||
buttonPlugin
|
||||
]);
|
||||
const Pattern = new freesewing.Design(config, [plugins, flipPlugin, buttonPlugin])
|
||||
|
||||
// Attach draft methods to prototype
|
||||
Pattern.prototype.draftBase = function(part) {
|
||||
return new Brian(this.settings).draftBase(part);
|
||||
};
|
||||
return new Brian(this.settings).draftBase(part)
|
||||
}
|
||||
Pattern.prototype.draftFrontBase = function(part) {
|
||||
return new Brian(this.settings).draftFront(part);
|
||||
};
|
||||
return new Brian(this.settings).draftFront(part)
|
||||
}
|
||||
Pattern.prototype.draftBackBase = function(part) {
|
||||
return new Brian(this.settings).draftBack(part);
|
||||
};
|
||||
return new Brian(this.settings).draftBack(part)
|
||||
}
|
||||
Pattern.prototype.draftSleeveBase = function(part) {
|
||||
let brian = new Brian(this.settings);
|
||||
return brian.draftSleeve(brian.draftSleevecap(part));
|
||||
};
|
||||
Pattern.prototype.draftBack = draftBack;
|
||||
Pattern.prototype.draftFront = draftFront;
|
||||
Pattern.prototype.draftFrontRight = draftFrontRight;
|
||||
Pattern.prototype.draftButtonPlacket = draftButtonPlacket;
|
||||
Pattern.prototype.draftFrontLeft = draftFrontLeft;
|
||||
Pattern.prototype.draftButtonholePlacket = draftButtonholePlacket;
|
||||
Pattern.prototype.draftYoke = draftYoke;
|
||||
Pattern.prototype.draftSleeve = draftSleeve;
|
||||
Pattern.prototype.draftCollarStand = draftCollarStand;
|
||||
Pattern.prototype.draftCollar = draftCollar;
|
||||
Pattern.prototype.draftSleevePlacketUnderlap = draftSleevePlacketUnderlap;
|
||||
Pattern.prototype.draftSleevePlacketOverlap = draftSleevePlacketOverlap;
|
||||
Pattern.prototype.draftCuff = draftCuff;
|
||||
let brian = new Brian(this.settings)
|
||||
return brian.draftSleeve(brian.draftSleevecap(part))
|
||||
}
|
||||
Pattern.prototype.draftBack = draftBack
|
||||
Pattern.prototype.draftFront = draftFront
|
||||
Pattern.prototype.draftFrontRight = draftFrontRight
|
||||
Pattern.prototype.draftButtonPlacket = draftButtonPlacket
|
||||
Pattern.prototype.draftFrontLeft = draftFrontLeft
|
||||
Pattern.prototype.draftButtonholePlacket = draftButtonholePlacket
|
||||
Pattern.prototype.draftYoke = draftYoke
|
||||
Pattern.prototype.draftSleeve = draftSleeve
|
||||
Pattern.prototype.draftCollarStand = draftCollarStand
|
||||
Pattern.prototype.draftCollar = draftCollar
|
||||
Pattern.prototype.draftSleevePlacketUnderlap = draftSleevePlacketUnderlap
|
||||
Pattern.prototype.draftSleevePlacketOverlap = draftSleevePlacketOverlap
|
||||
Pattern.prototype.draftCuff = draftCuff
|
||||
|
||||
export default Pattern;
|
||||
export default Pattern
|
||||
|
|
|
@ -1,357 +1,301 @@
|
|||
export const calculateReduction = function(part) {
|
||||
let { store, measurements, options } = part.shorthand();
|
||||
if (store.get("reduction") === true) return;
|
||||
let { store, measurements, options } = part.shorthand()
|
||||
if (store.get('reduction') === true) return
|
||||
|
||||
let chest = measurements.chestCircumference * (1 + options.chestEase);
|
||||
let waist = measurements.naturalWaist * (1 + options.waistEase);
|
||||
let hips = measurements.hipsCircumference * (1 + options.hipsEase);
|
||||
let waistReduction = chest - waist;
|
||||
let hipsReduction = chest - hips;
|
||||
let chest = measurements.chestCircumference * (1 + options.chestEase)
|
||||
let waist = measurements.naturalWaist * (1 + options.waistEase)
|
||||
let hips = measurements.hipsCircumference * (1 + options.hipsEase)
|
||||
let waistReduction = chest - waist
|
||||
let hipsReduction = chest - hips
|
||||
|
||||
// If your waist > chest, this pattern is not going to work for you as-is.
|
||||
if (waistReduction < 0) waistReduction = 0;
|
||||
if (hipsReduction < 0) hipsReduction = 0;
|
||||
store.set("waistReduction", waistReduction);
|
||||
store.set("hipsReduction", hipsReduction);
|
||||
store.set("reduction", true);
|
||||
};
|
||||
if (waistReduction < 0) waistReduction = 0
|
||||
if (hipsReduction < 0) hipsReduction = 0
|
||||
store.set('waistReduction', waistReduction)
|
||||
store.set('hipsReduction', hipsReduction)
|
||||
store.set('reduction', true)
|
||||
}
|
||||
|
||||
export const addButtons = function(
|
||||
part,
|
||||
origin = "cfNeck",
|
||||
snippet = "button"
|
||||
) {
|
||||
let { points, options, snippets, Snippet } = part.shorthand();
|
||||
let len = points.cfNeck.dist(points.cfHips) * (1 - options.buttonFreeLength);
|
||||
export const addButtons = function(part, origin = 'cfNeck', snippet = 'button') {
|
||||
let { points, options, snippets, Snippet } = part.shorthand()
|
||||
let len = points.cfNeck.dist(points.cfHips) * (1 - options.buttonFreeLength)
|
||||
for (let i = 1; i <= options.buttons; i++) {
|
||||
points["button" + i] = points[origin].shift(
|
||||
-90,
|
||||
(len / options.buttons) * i
|
||||
);
|
||||
snippets[snippet + i] = new Snippet(snippet, points["button" + i]);
|
||||
points['button' + i] = points[origin].shift(-90, (len / options.buttons) * i)
|
||||
snippets[snippet + i] = new Snippet(snippet, points['button' + i])
|
||||
}
|
||||
if (options.extraTopButton)
|
||||
snippets["top" + snippet] = new Snippet(
|
||||
snippets['top' + snippet] = new Snippet(
|
||||
snippet,
|
||||
points[origin].shift(-90, len / options.buttons / 2)
|
||||
);
|
||||
};
|
||||
)
|
||||
}
|
||||
|
||||
export const addButtonHoles = (part, origin) =>
|
||||
addButtons(part, origin, "buttonhole");
|
||||
export const addButtonHoles = (part, origin) => addButtons(part, origin, 'buttonhole')
|
||||
|
||||
export const draftBarrelCuff = part => {
|
||||
let { store, points, measurements, options, Point } = part.shorthand();
|
||||
let height = measurements.shoulderToWrist * options.cuffLength;
|
||||
let width =
|
||||
measurements.wristCircumference *
|
||||
(1 + options.cuffEase + options.cuffOverlap);
|
||||
store.set("cuffHeight", height);
|
||||
points.topLeft = new Point(0, 0);
|
||||
points.topRight = new Point(width, 0);
|
||||
points.bottomLeft = new Point(0, height);
|
||||
points.bottomRight = new Point(width, height);
|
||||
let { store, points, measurements, options, Point } = part.shorthand()
|
||||
let height = measurements.shoulderToWrist * options.cuffLength
|
||||
let width = measurements.wristCircumference * (1 + options.cuffEase + options.cuffOverlap)
|
||||
store.set('cuffHeight', height)
|
||||
points.topLeft = new Point(0, 0)
|
||||
points.topRight = new Point(width, 0)
|
||||
points.bottomLeft = new Point(0, height)
|
||||
points.bottomRight = new Point(width, height)
|
||||
|
||||
return part;
|
||||
};
|
||||
return part
|
||||
}
|
||||
|
||||
export const decorateBarrelCuff = part => {
|
||||
let {
|
||||
macro,
|
||||
snippets,
|
||||
Snippet,
|
||||
points,
|
||||
measurements,
|
||||
options,
|
||||
Point
|
||||
} = part.shorthand();
|
||||
let { macro, snippets, Snippet, points, measurements, options, Point } = part.shorthand()
|
||||
// Title
|
||||
points.title = new Point(points.bottomRight.x / 2, points.bottomRight.y / 2);
|
||||
macro("title", {
|
||||
points.title = new Point(points.bottomRight.x / 2, points.bottomRight.y / 2)
|
||||
macro('title', {
|
||||
nr: 11,
|
||||
title: "cuff",
|
||||
title: 'cuff',
|
||||
at: points.title,
|
||||
scale: 0.8
|
||||
});
|
||||
})
|
||||
|
||||
// Button and buttonhole
|
||||
let margin = measurements.wristCircumference * options.cuffOverlap;
|
||||
points.buttonLineTop = points.topRight.shift(180, margin / 2);
|
||||
points.buttonLineBottom = points.bottomRight.shift(180, margin / 2);
|
||||
points.buttonholeLineTop = points.topLeft.shift(0, margin / 2);
|
||||
points.buttonholeLineBottom = points.bottomLeft.shift(0, margin / 2);
|
||||
let margin = measurements.wristCircumference * options.cuffOverlap
|
||||
points.buttonLineTop = points.topRight.shift(180, margin / 2)
|
||||
points.buttonLineBottom = points.bottomRight.shift(180, margin / 2)
|
||||
points.buttonholeLineTop = points.topLeft.shift(0, margin / 2)
|
||||
points.buttonholeLineBottom = points.bottomLeft.shift(0, margin / 2)
|
||||
|
||||
for (let i = 1; i <= options.cuffButtonRows; i++) {
|
||||
points["button" + i] = points.buttonLineTop.shiftFractionTowards(
|
||||
points['button' + i] = points.buttonLineTop.shiftFractionTowards(
|
||||
points.buttonLineBottom,
|
||||
(1 / (options.cuffButtonRows + 1)) * i
|
||||
);
|
||||
snippets["button" + i] = new Snippet("button", points["button" + i]);
|
||||
points["buttonhole" + i] = new Point(
|
||||
points.buttonholeLineTop.x,
|
||||
points["button" + i].y
|
||||
);
|
||||
snippets["buttonhole" + i] = new Snippet(
|
||||
"buttonhole",
|
||||
points["buttonhole" + i]
|
||||
).attr("data-rotate", 90);
|
||||
)
|
||||
snippets['button' + i] = new Snippet('button', points['button' + i])
|
||||
points['buttonhole' + i] = new Point(points.buttonholeLineTop.x, points['button' + i].y)
|
||||
snippets['buttonhole' + i] = new Snippet('buttonhole', points['buttonhole' + i]).attr(
|
||||
'data-rotate',
|
||||
90
|
||||
)
|
||||
if (options.barrelCuffNarrowButton) {
|
||||
points["narrowButton" + i] = points["button" + i].shift(180, margin);
|
||||
snippets["narrowButton" + i] = new Snippet(
|
||||
"button",
|
||||
points["narrowButton" + i]
|
||||
);
|
||||
points['narrowButton' + i] = points['button' + i].shift(180, margin)
|
||||
snippets['narrowButton' + i] = new Snippet('button', points['narrowButton' + i])
|
||||
}
|
||||
}
|
||||
|
||||
return part;
|
||||
};
|
||||
return part
|
||||
}
|
||||
|
||||
export const draftFrenchCuff = part => {
|
||||
let { store, points, measurements, options, Point } = part.shorthand();
|
||||
let margin = measurements.wristCircumference * options.cuffOverlap;
|
||||
let height = measurements.shoulderToWrist * options.cuffLength;
|
||||
let { store, points, measurements, options, Point } = part.shorthand()
|
||||
let margin = measurements.wristCircumference * options.cuffOverlap
|
||||
let height = measurements.shoulderToWrist * options.cuffLength
|
||||
let width =
|
||||
measurements.wristCircumference *
|
||||
(1 + options.cuffEase + options.cuffOverlap + options.cuffDrape) +
|
||||
margin / 2;
|
||||
store.set("cuffHeight", height);
|
||||
points.topLeft = new Point(0, 0);
|
||||
points.topRight = new Point(width, 0);
|
||||
points.midLeft = new Point(0, height);
|
||||
points.midRight = new Point(width, height);
|
||||
points.bottomLeft = new Point(0, height * 2);
|
||||
points.bottomRight = new Point(width, height * 2);
|
||||
margin / 2
|
||||
store.set('cuffHeight', height)
|
||||
points.topLeft = new Point(0, 0)
|
||||
points.topRight = new Point(width, 0)
|
||||
points.midLeft = new Point(0, height)
|
||||
points.midRight = new Point(width, height)
|
||||
points.bottomLeft = new Point(0, height * 2)
|
||||
points.bottomRight = new Point(width, height * 2)
|
||||
|
||||
return part;
|
||||
};
|
||||
return part
|
||||
}
|
||||
|
||||
export const decorateFrenchCuff = part => {
|
||||
let {
|
||||
macro,
|
||||
snippets,
|
||||
Snippet,
|
||||
points,
|
||||
measurements,
|
||||
options,
|
||||
Point
|
||||
} = part.shorthand();
|
||||
let { macro, snippets, Snippet, points, measurements, options, Point } = part.shorthand()
|
||||
// Title
|
||||
points.title = new Point(points.bottomRight.x / 2, points.bottomRight.y / 2);
|
||||
macro("title", {
|
||||
points.title = new Point(points.bottomRight.x / 2, points.bottomRight.y / 2)
|
||||
macro('title', {
|
||||
nr: 11,
|
||||
title: "cuff",
|
||||
title: 'cuff',
|
||||
at: points.title,
|
||||
scale: 0.8
|
||||
});
|
||||
})
|
||||
|
||||
// Buttonholes
|
||||
let margin = measurements.wristCircumference * options.cuffOverlap;
|
||||
points.buttonLineTop = points.topRight.shift(180, margin * 0.75);
|
||||
points.buttonLineBottom = points.bottomRight.shift(180, margin * 0.75);
|
||||
points.buttonholeLineTop = points.topLeft.shift(0, margin * 0.75);
|
||||
points.buttonholeLineBottom = points.bottomLeft.shift(0, margin * 0.75);
|
||||
let margin = measurements.wristCircumference * options.cuffOverlap
|
||||
points.buttonLineTop = points.topRight.shift(180, margin * 0.75)
|
||||
points.buttonLineBottom = points.bottomRight.shift(180, margin * 0.75)
|
||||
points.buttonholeLineTop = points.topLeft.shift(0, margin * 0.75)
|
||||
points.buttonholeLineBottom = points.bottomLeft.shift(0, margin * 0.75)
|
||||
|
||||
points.button1 = points.buttonLineTop.shiftFractionTowards(
|
||||
points.buttonLineBottom,
|
||||
0.2
|
||||
);
|
||||
points.button2 = points.buttonLineTop.shiftFractionTowards(
|
||||
points.buttonLineBottom,
|
||||
0.8
|
||||
);
|
||||
points.button3 = points.buttonholeLineTop.shiftFractionTowards(
|
||||
points.buttonholeLineBottom,
|
||||
0.2
|
||||
);
|
||||
points.button4 = points.buttonholeLineTop.shiftFractionTowards(
|
||||
points.buttonholeLineBottom,
|
||||
0.8
|
||||
);
|
||||
snippets.buttonhole1 = new Snippet("buttonhole", points.button1).attr(
|
||||
"data-rotate",
|
||||
90
|
||||
);
|
||||
snippets.buttonhole2 = new Snippet("buttonhole", points.button2).attr(
|
||||
"data-rotate",
|
||||
90
|
||||
);
|
||||
snippets.buttonhole3 = new Snippet("buttonhole", points.button3).attr(
|
||||
"data-rotate",
|
||||
90
|
||||
);
|
||||
snippets.buttonhole4 = new Snippet("buttonhole", points.button4).attr(
|
||||
"data-rotate",
|
||||
90
|
||||
);
|
||||
points.button1 = points.buttonLineTop.shiftFractionTowards(points.buttonLineBottom, 0.2)
|
||||
points.button2 = points.buttonLineTop.shiftFractionTowards(points.buttonLineBottom, 0.8)
|
||||
points.button3 = points.buttonholeLineTop.shiftFractionTowards(points.buttonholeLineBottom, 0.2)
|
||||
points.button4 = points.buttonholeLineTop.shiftFractionTowards(points.buttonholeLineBottom, 0.8)
|
||||
snippets.buttonhole1 = new Snippet('buttonhole', points.button1).attr('data-rotate', 90)
|
||||
snippets.buttonhole2 = new Snippet('buttonhole', points.button2).attr('data-rotate', 90)
|
||||
snippets.buttonhole3 = new Snippet('buttonhole', points.button3).attr('data-rotate', 90)
|
||||
snippets.buttonhole4 = new Snippet('buttonhole', points.button4).attr('data-rotate', 90)
|
||||
|
||||
return part;
|
||||
};
|
||||
return part
|
||||
}
|
||||
|
||||
export const paperlessBarrelCuff = part => {
|
||||
let { sa, macro, points, options } = part.shorthand();
|
||||
macro("hd", {
|
||||
let { sa, macro, points, options } = part.shorthand()
|
||||
macro('hd', {
|
||||
from: points.buttonhole1,
|
||||
to: points.button1,
|
||||
y: points.bottomLeft.y + 15 + sa
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.bottomLeft,
|
||||
to: points.bottomRight,
|
||||
y: points.bottomLeft.y + 30 + sa
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.bottomLeft,
|
||||
to: points.topLeft.shift(0, 40),
|
||||
x: points.bottomLeft.x - 15 - sa
|
||||
});
|
||||
})
|
||||
if (options.barrelCuffNarrowButton) {
|
||||
macro("hd", {
|
||||
macro('hd', {
|
||||
from: points.narrowButton1,
|
||||
to: points.button1,
|
||||
y: points.topRight.y - 15 - sa
|
||||
});
|
||||
})
|
||||
}
|
||||
if (options.cuffButtonRows === 2) {
|
||||
macro("vd", {
|
||||
macro('vd', {
|
||||
from: points.button2,
|
||||
to: points.button1,
|
||||
x: points.topRight.x + 15 + sa
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
return part;
|
||||
};
|
||||
return part
|
||||
}
|
||||
|
||||
export const paperlessFrenchCuff = part => {
|
||||
let { sa, macro, points } = part.shorthand();
|
||||
macro("hd", {
|
||||
let { sa, macro, points } = part.shorthand()
|
||||
macro('hd', {
|
||||
from: points.button4,
|
||||
to: points.button2,
|
||||
y: points.bottomLeft.y + 15 + sa
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.midLeft,
|
||||
to: points.midRight,
|
||||
y: points.bottomLeft.y + 30 + sa
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.button2,
|
||||
to: points.button1,
|
||||
x: points.topRight.x + 15 + sa
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.bottomRight.shift(180, 40),
|
||||
to: points.topRight.shift(180, 40),
|
||||
x: points.topRight.x + 30 + sa
|
||||
});
|
||||
})
|
||||
|
||||
return part;
|
||||
};
|
||||
return part
|
||||
}
|
||||
|
||||
export const frontDimensions = (part, side = "left") => {
|
||||
let { sa, options, paperless, points, macro, Path } = part.shorthand();
|
||||
let factor = side === "right" ? -1 : 1;
|
||||
macro("banner", {
|
||||
path: "hemSa",
|
||||
text: ["hem", ": 3x", "seamAllowance"]
|
||||
});
|
||||
macro("banner", {
|
||||
path: "saFrench",
|
||||
text: ["frenchSeam", ": 2x", "seamAllowance"]
|
||||
});
|
||||
export const frontDimensions = (part, side = 'left') => {
|
||||
let { sa, options, paperless, points, macro, Path } = part.shorthand()
|
||||
let factor = side === 'right' ? -1 : 1
|
||||
macro('banner', {
|
||||
path: 'hemSa',
|
||||
text: ['hem', ': 3x', 'seamAllowance']
|
||||
})
|
||||
macro('banner', {
|
||||
path: 'saFrench',
|
||||
text: ['frenchSeam', ': 2x', 'seamAllowance']
|
||||
})
|
||||
if (paperless) {
|
||||
macro("pd", {
|
||||
macro('pd', {
|
||||
path: new Path()
|
||||
.move(points.armholePitch)
|
||||
.curve(points.armholePitchCp2, points.shoulderCp1, points.shoulder),
|
||||
d: -15 * factor
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.armhole,
|
||||
to: points.armholePitch,
|
||||
x: points.armhole.x + (15 + sa * 2) * factor
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.armhole,
|
||||
to: points.shoulder,
|
||||
x: points.armhole.x + (30 + sa * 2) * factor
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.armhole,
|
||||
to: points.neck,
|
||||
x: points.armhole.x + (45 + sa * 2) * factor
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.waist,
|
||||
to: points.armhole,
|
||||
x: points.armhole.x + (15 + sa * 2) * factor
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.hips,
|
||||
to: points.armhole,
|
||||
x: points.armhole.x + (30 + sa * 2) * factor
|
||||
});
|
||||
if (options.hemStyle === "baseball") {
|
||||
macro("vd", {
|
||||
})
|
||||
if (options.hemStyle === 'baseball') {
|
||||
macro('vd', {
|
||||
from: points.bballStart,
|
||||
to: points.bballEnd,
|
||||
x: points.hips.x + (15 + 2 * sa) * factor
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.bballStart,
|
||||
to: points.hips,
|
||||
x: points.hips.x + (30 + 2 * sa) * factor
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.bballStart,
|
||||
to: points.armhole,
|
||||
x: points.hips.x + (45 + 2 * sa) * factor
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.bballStart,
|
||||
to: points.neck,
|
||||
x: points.hips.x + (60 + 2 * sa) * factor
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.bballStart,
|
||||
to: points.bballEnd,
|
||||
y: points.bballStart.y + 15 + 3 * sa
|
||||
});
|
||||
} else if (options.hemStyle === "slashed") {
|
||||
macro("vd", {
|
||||
})
|
||||
} else if (options.hemStyle === 'slashed') {
|
||||
macro('vd', {
|
||||
from: points.slashEnd,
|
||||
to: points.slashStart,
|
||||
x: points.hips.x + (15 + 3 * sa) * factor
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.slashEnd,
|
||||
to: points.hips,
|
||||
x: points.hips.x + (30 + 3 * sa) * factor
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.slashEnd,
|
||||
to: points.armhole,
|
||||
x: points.hips.x + (45 + 3 * sa) * factor
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.slashEnd,
|
||||
to: points.neck,
|
||||
x: points.hips.x + (60 + 3 * sa) * factor
|
||||
});
|
||||
})
|
||||
} else {
|
||||
macro("vd", {
|
||||
macro('vd', {
|
||||
from: points.hem,
|
||||
to: points.armhole,
|
||||
x: points.armhole.x + (45 + 2 * sa) * factor
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.hem,
|
||||
to: points.neck,
|
||||
x: points.armhole.x + (60 + 2 * sa) * factor
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
return part;
|
||||
};
|
||||
return part
|
||||
}
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
export default part => {
|
||||
part.paths = {}; // This removed paperless dimensions from brian block
|
||||
part.paths = {} // This removed paperless dimensions from brian block
|
||||
for (let pid of [
|
||||
"__scaleboxLead",
|
||||
"__scaleboxMetric",
|
||||
"__scaleboxImperial",
|
||||
"__scaleboxText",
|
||||
"__scaleboxTitle",
|
||||
"__scaleboxLink"
|
||||
'__scaleboxLead',
|
||||
'__scaleboxMetric',
|
||||
'__scaleboxImperial',
|
||||
'__scaleboxText',
|
||||
'__scaleboxTitle',
|
||||
'__scaleboxLink'
|
||||
])
|
||||
delete part.points[pid];
|
||||
delete part.points[pid]
|
||||
let {
|
||||
measurements,
|
||||
sa,
|
||||
|
@ -20,85 +20,67 @@ export default part => {
|
|||
paperless,
|
||||
macro,
|
||||
options
|
||||
} = part.shorthand();
|
||||
} = part.shorthand()
|
||||
|
||||
// Sleeve width depends on cuff style
|
||||
let width =
|
||||
measurements.wristCircumference *
|
||||
(1 + options.cuffEase + options.cuffOverlap);
|
||||
let width = measurements.wristCircumference * (1 + options.cuffEase + options.cuffOverlap)
|
||||
if (
|
||||
options.cuffStyle === "straightFrenchcuff" ||
|
||||
options.cuffStyle === "roundedFrenchcuff" ||
|
||||
options.cuffStyle === "angledFrenchCuff"
|
||||
options.cuffStyle === 'straightFrenchcuff' ||
|
||||
options.cuffStyle === 'roundedFrenchcuff' ||
|
||||
options.cuffStyle === 'angledFrenchCuff'
|
||||
)
|
||||
width =
|
||||
measurements.wristCircumference *
|
||||
(1 + options.cuffEase + options.cuffOverlap * 1.5);
|
||||
points.wristRight.x = width / 2;
|
||||
points.wristLeft.x = width / -2;
|
||||
let cuffLength = measurements.shoulderToWrist * options.cuffLength;
|
||||
points.wristRight = points.wristRight.shift(90, cuffLength);
|
||||
points.wristLeft = points.wristLeft.shift(90, cuffLength);
|
||||
width = measurements.wristCircumference * (1 + options.cuffEase + options.cuffOverlap * 1.5)
|
||||
points.wristRight.x = width / 2
|
||||
points.wristLeft.x = width / -2
|
||||
let cuffLength = measurements.shoulderToWrist * options.cuffLength
|
||||
points.wristRight = points.wristRight.shift(90, cuffLength)
|
||||
points.wristLeft = points.wristLeft.shift(90, cuffLength)
|
||||
|
||||
points.cuffMid = new Point(0, points.wristLeft.y);
|
||||
points.cuffLeftMid = points.cuffMid.shiftFractionTowards(
|
||||
points.wristLeft,
|
||||
0.5
|
||||
);
|
||||
points.cuffRightMid = points.cuffMid.shiftFractionTowards(
|
||||
points.wristRight,
|
||||
0.5
|
||||
);
|
||||
points.cuffLeftCusp = points.cuffLeftMid.shift(90, width / 50);
|
||||
points.cuffRightCusp = points.cuffRightMid.shift(-90, width / 50);
|
||||
points.cuffLeftCuspCp1 = points.cuffLeftCusp.shift(180, width / 10);
|
||||
points.cuffLeftCuspCp2 = points.cuffLeftCusp.shift(0, width / 10);
|
||||
points.cuffRightCuspCp1 = points.cuffRightCusp.shift(180, width / 10);
|
||||
points.cuffRightCuspCp2 = points.cuffRightCusp.shift(0, width / 10);
|
||||
points.cuffMid = new Point(0, points.wristLeft.y)
|
||||
points.cuffLeftMid = points.cuffMid.shiftFractionTowards(points.wristLeft, 0.5)
|
||||
points.cuffRightMid = points.cuffMid.shiftFractionTowards(points.wristRight, 0.5)
|
||||
points.cuffLeftCusp = points.cuffLeftMid.shift(90, width / 50)
|
||||
points.cuffRightCusp = points.cuffRightMid.shift(-90, width / 50)
|
||||
points.cuffLeftCuspCp1 = points.cuffLeftCusp.shift(180, width / 10)
|
||||
points.cuffLeftCuspCp2 = points.cuffLeftCusp.shift(0, width / 10)
|
||||
points.cuffRightCuspCp1 = points.cuffRightCusp.shift(180, width / 10)
|
||||
points.cuffRightCuspCp2 = points.cuffRightCusp.shift(0, width / 10)
|
||||
|
||||
// Cuff pleats
|
||||
let drape = options.cuffDrape * measurements.shoulderToWrist;
|
||||
let pleats = 0;
|
||||
let pleatLength = measurements.shoulderToWrist * 0.15;
|
||||
let drape = options.cuffDrape * measurements.shoulderToWrist
|
||||
let pleats = 0
|
||||
let pleatLength = measurements.shoulderToWrist * 0.15
|
||||
if (drape > 0) {
|
||||
pl;
|
||||
pl
|
||||
let shiftRight = [
|
||||
"cuffRightCuspCp1",
|
||||
"cuffRightCusp",
|
||||
"cuffRightCuspCp2",
|
||||
"wristRight",
|
||||
"cuffRightMid"
|
||||
];
|
||||
let shiftLeft = [
|
||||
"cuffLeftCuspCp1",
|
||||
"cuffLeftCusp",
|
||||
"cuffLeftCuspCp2",
|
||||
"wristLeft"
|
||||
];
|
||||
if (drape > 20) pleats = 2;
|
||||
else pleats = 1;
|
||||
for (let id of shiftRight)
|
||||
points[id] = points[id].shift(0, drape / (2 * pleats));
|
||||
for (let id of shiftLeft)
|
||||
points[id] = points[id].shift(180, drape / (2 * pleats));
|
||||
points.cuffPleat1Fold = points.cuffMid.shift(0, drape / (2 * pleats));
|
||||
points.cuffPleat1Edge = points.cuffMid.shift(0, drape / pleats);
|
||||
points.cuffMidTop = points.cuffMid.shift(90, pleatLength);
|
||||
points.cuffPleat1FoldTop = points.cuffPleat1Fold.shift(90, pleatLength);
|
||||
points.cuffPleat1EdgeTop = points.cuffPleat1Edge.shift(90, pleatLength);
|
||||
'cuffRightCuspCp1',
|
||||
'cuffRightCusp',
|
||||
'cuffRightCuspCp2',
|
||||
'wristRight',
|
||||
'cuffRightMid'
|
||||
]
|
||||
let shiftLeft = ['cuffLeftCuspCp1', 'cuffLeftCusp', 'cuffLeftCuspCp2', 'wristLeft']
|
||||
if (drape > 20) pleats = 2
|
||||
else pleats = 1
|
||||
for (let id of shiftRight) points[id] = points[id].shift(0, drape / (2 * pleats))
|
||||
for (let id of shiftLeft) points[id] = points[id].shift(180, drape / (2 * pleats))
|
||||
points.cuffPleat1Fold = points.cuffMid.shift(0, drape / (2 * pleats))
|
||||
points.cuffPleat1Edge = points.cuffMid.shift(0, drape / pleats)
|
||||
points.cuffMidTop = points.cuffMid.shift(90, pleatLength)
|
||||
points.cuffPleat1FoldTop = points.cuffPleat1Fold.shift(90, pleatLength)
|
||||
points.cuffPleat1EdgeTop = points.cuffPleat1Edge.shift(90, pleatLength)
|
||||
if (pleats === 2) {
|
||||
let moreRight = ["cuffRightCuspCp2", "wristRight"];
|
||||
let shift = shiftRight.concat(shiftLeft);
|
||||
let moreRight = ['cuffRightCuspCp2', 'wristRight']
|
||||
let shift = shiftRight.concat(shiftLeft)
|
||||
for (let id of shift) {
|
||||
if (moreRight.indexOf(id) === -1)
|
||||
points[id] = points[id].shift(180, drape / 4);
|
||||
else points[id] = points[id].shift(0, drape / 4);
|
||||
if (moreRight.indexOf(id) === -1) points[id] = points[id].shift(180, drape / 4)
|
||||
else points[id] = points[id].shift(0, drape / 4)
|
||||
}
|
||||
points.cuffPleat2Fold = points.cuffRightCusp.shift(0, drape / 4);
|
||||
points.cuffPleat2Edge = points.cuffRightCusp.shift(0, drape / 2);
|
||||
points.cuffPleat2FoldTop = points.cuffPleat2Fold.shift(90, pleatLength);
|
||||
points.cuffPleat2EdgeTop = points.cuffPleat2Edge.shift(90, pleatLength);
|
||||
points.cuffPleat2Top = points.cuffRightCusp.shift(90, pleatLength);
|
||||
points.cuffPleat2Fold = points.cuffRightCusp.shift(0, drape / 4)
|
||||
points.cuffPleat2Edge = points.cuffRightCusp.shift(0, drape / 2)
|
||||
points.cuffPleat2FoldTop = points.cuffPleat2Fold.shift(90, pleatLength)
|
||||
points.cuffPleat2EdgeTop = points.cuffPleat2Edge.shift(90, pleatLength)
|
||||
points.cuffPleat2Top = points.cuffRightCusp.shift(90, pleatLength)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -109,41 +91,39 @@ export default part => {
|
|||
.curve(points.capQ1Cp2, points.capQ2Cp1, points.capQ2)
|
||||
.curve(points.capQ2Cp2, points.capQ3Cp1, points.capQ3)
|
||||
.curve(points.capQ3Cp2, points.capQ4Cp1, points.capQ4)
|
||||
.curve_(points.capQ4Cp2, points.bicepsLeft);
|
||||
paths.frenchBase.render = false;
|
||||
.curve_(points.capQ4Cp2, points.bicepsLeft)
|
||||
paths.frenchBase.render = false
|
||||
|
||||
paths.saBase = new Path().move(points.bicepsLeft).line(points.wristLeft);
|
||||
paths.saBase.render = false;
|
||||
paths.saBase = new Path().move(points.bicepsLeft).line(points.wristLeft)
|
||||
paths.saBase.render = false
|
||||
|
||||
paths.cuffBase = new Path()
|
||||
.move(points.wristLeft)
|
||||
._curve(points.cuffLeftCuspCp1, points.cuffLeftCusp);
|
||||
._curve(points.cuffLeftCuspCp1, points.cuffLeftCusp)
|
||||
if (pleats > 0) {
|
||||
paths.cuffBase
|
||||
.curve_(points.cuffLeftCuspCp2, points.cuffMid)
|
||||
.line(points.cuffPleat1Edge);
|
||||
paths.cuffBase.curve_(points.cuffLeftCuspCp2, points.cuffMid).line(points.cuffPleat1Edge)
|
||||
}
|
||||
paths.cuffBase._curve(points.cuffRightCuspCp1, points.cuffRightCusp);
|
||||
if (pleats === 2) paths.cuffBase.line(points.cuffPleat2Edge);
|
||||
paths.cuffBase.curve_(points.cuffRightCuspCp2, points.wristRight);
|
||||
paths.cuffBase.render = false;
|
||||
paths.cuffBase._curve(points.cuffRightCuspCp1, points.cuffRightCusp)
|
||||
if (pleats === 2) paths.cuffBase.line(points.cuffPleat2Edge)
|
||||
paths.cuffBase.curve_(points.cuffRightCuspCp2, points.wristRight)
|
||||
paths.cuffBase.render = false
|
||||
|
||||
paths.seam = paths.frenchBase
|
||||
.clone()
|
||||
.line(points.wristLeft)
|
||||
.join(paths.cuffBase)
|
||||
.attr("class", "fabric");
|
||||
.attr('class', 'fabric')
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
points.placketEnd = points.cuffLeftCusp.shift(
|
||||
90,
|
||||
options.sleevePlacketLength * measurements.shoulderToWrist
|
||||
);
|
||||
)
|
||||
paths.placketCut = new Path()
|
||||
.move(points.cuffLeftCusp)
|
||||
.line(points.placketEnd)
|
||||
.attr("class", "fabric");
|
||||
.attr('class', 'fabric')
|
||||
if (pleats > 0) {
|
||||
paths.pleats = new Path()
|
||||
.move(points.cuffMid)
|
||||
|
@ -151,7 +131,7 @@ export default part => {
|
|||
.move(points.cuffPleat1Fold)
|
||||
.line(points.cuffPleat1FoldTop)
|
||||
.move(points.cuffPleat1Edge)
|
||||
.line(points.cuffPleat1EdgeTop);
|
||||
.line(points.cuffPleat1EdgeTop)
|
||||
if (pleats === 2) {
|
||||
paths.pleats
|
||||
.move(points.cuffRightCusp)
|
||||
|
@ -159,56 +139,56 @@ export default part => {
|
|||
.move(points.cuffPleat2Fold)
|
||||
.line(points.cuffPleat2FoldTop)
|
||||
.move(points.cuffPleat2Edge)
|
||||
.line(points.cuffPleat2EdgeTop);
|
||||
.line(points.cuffPleat2EdgeTop)
|
||||
}
|
||||
paths.pleats.attr("class", "dotted");
|
||||
paths.pleats.attr('class', 'dotted')
|
||||
}
|
||||
macro("title", { at: points.centerBiceps, nr: 5, title: "sleeve" });
|
||||
macro("grainline", { from: points.cuffMid, to: points.sleeveTip });
|
||||
macro('title', { at: points.centerBiceps, nr: 5, title: 'sleeve' })
|
||||
macro('grainline', { from: points.cuffMid, to: points.sleeveTip })
|
||||
|
||||
if (sa) {
|
||||
paths.sa = paths.frenchBase.offset(sa * 2);
|
||||
paths.frenchSa = paths.sa.clone();
|
||||
paths.sa = paths.frenchBase.offset(sa * 2)
|
||||
paths.frenchSa = paths.sa.clone()
|
||||
paths.sa = paths.sa
|
||||
.join(paths.saBase.offset(sa))
|
||||
.join(paths.cuffBase.offset(sa))
|
||||
.close()
|
||||
.attr("class", "fabric sa");
|
||||
macro("banner", {
|
||||
path: "frenchSa",
|
||||
text: ["frenchSean", ": 2x", "seamAllowance"]
|
||||
});
|
||||
.attr('class', 'fabric sa')
|
||||
macro('banner', {
|
||||
path: 'frenchSa',
|
||||
text: ['frenchSean', ': 2x', 'seamAllowance']
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
macro("hd", {
|
||||
macro('hd', {
|
||||
from: points.backNotch,
|
||||
to: points.sleeveTip,
|
||||
y: points.sleeveTip.y - 15 - sa * 2
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.sleeveTip,
|
||||
to: points.frontNotch,
|
||||
y: points.sleeveTip.y - 15 - sa * 2
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.bicepsLeft,
|
||||
to: points.sleeveTip,
|
||||
y: points.sleeveTip.y - 30 - sa * 2
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.sleeveTip,
|
||||
to: points.bicepsRight,
|
||||
y: points.sleeveTip.y - 30 - sa * 2
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.bicepsLeft,
|
||||
to: points.bicepsRight,
|
||||
y: points.sleeveTip.y - 45 - sa * 2
|
||||
});
|
||||
macro("pd", {
|
||||
})
|
||||
macro('pd', {
|
||||
path: new Path()
|
||||
.move(points.bicepsRight)
|
||||
._curve(points.capQ1Cp1, points.capQ1)
|
||||
|
@ -218,52 +198,52 @@ export default part => {
|
|||
.curve_(points.capQ4Cp2, points.bicepsLeft)
|
||||
.reverse(),
|
||||
d: 15
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.wristRight,
|
||||
to: points.bicepsRight,
|
||||
x: points.bicepsRight.x + 15 + sa * 2
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.bicepsRight,
|
||||
to: points.frontNotch,
|
||||
x: points.bicepsRight.x + 15 + sa * 2
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.bicepsRight,
|
||||
to: points.sleeveTip,
|
||||
x: points.bicepsRight.x + 30 + sa * 2
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.bicepsLeft,
|
||||
to: points.backNotch,
|
||||
x: points.bicepsLeft.x - 15 - sa
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.cuffLeftCusp,
|
||||
to: points.placketEnd,
|
||||
x: points.placketEnd.x - 15
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.wristLeft,
|
||||
to: points.wristRight,
|
||||
y: points.wristLeft.y + 15 + sa
|
||||
});
|
||||
})
|
||||
if (pleats > 0) {
|
||||
macro("hd", {
|
||||
macro('hd', {
|
||||
from: points.cuffMidTop,
|
||||
to: points.cuffPleat1EdgeTop,
|
||||
y: points.cuffMidTop.y - 15
|
||||
});
|
||||
})
|
||||
if (pleats === 2) {
|
||||
macro("hd", {
|
||||
macro('hd', {
|
||||
from: points.cuffPleat2Top,
|
||||
to: points.cuffPleat2EdgeTop,
|
||||
y: points.cuffPleat2Top.y - 15
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return part;
|
||||
};
|
||||
return part
|
||||
}
|
||||
|
|
|
@ -12,37 +12,34 @@ export default part => {
|
|||
paperless,
|
||||
macro,
|
||||
options
|
||||
} = part.shorthand();
|
||||
} = part.shorthand()
|
||||
|
||||
let width = options.sleevePlacketWidth;
|
||||
let length = measurements.shoulderToWrist * options.sleevePlacketLength;
|
||||
let width = options.sleevePlacketWidth
|
||||
let length = measurements.shoulderToWrist * options.sleevePlacketLength
|
||||
|
||||
points.midLeft = new Point(0, 0);
|
||||
points.midLen = points.midLeft.shift(0, length);
|
||||
points.midRight = points.midLeft.shift(0, length + width * 1.25);
|
||||
points.fold1Left = points.midLeft.shift(90, width / 2);
|
||||
points.fold2Left = points.midLeft.shift(-90, width / 2);
|
||||
points.boxTopRight = points.midRight.shift(90, width / 2);
|
||||
points.boxBottomRight = points.midRight.shift(-90, width / 2);
|
||||
points.boxTopLeft = points.midLen.shift(90, width / 2);
|
||||
points.boxBottomLeft = points.midLen.shift(-90, width / 2);
|
||||
points.boxTip = points.midLen.shift(0, width * 1.5);
|
||||
points.fold1Right = points.boxTopRight.shift(0, width * 0.5);
|
||||
points.fold2Right = points.boxBottomRight.shift(0, width * 0.5);
|
||||
points.topLeft = points.fold1Left.shift(90, width / 2 - 1.5);
|
||||
points.topRight = points.fold1Right.shift(90, width / 2 - 1.5);
|
||||
points.bottomRight = points.fold2Right.shift(-90, width * 1.5 - 1.5);
|
||||
points.bottomLeft = points.fold2Left.shift(-90, width * 1.5 - 1.5);
|
||||
points.cutRight = points.fold2Right.shift(-90, width / 2 - 1.5);
|
||||
points.zig = points.cutRight.shift(180, width * 0.6);
|
||||
points.zag = new Point(
|
||||
points.bottomRight.x - width,
|
||||
points.bottomRight.y - width * 0.6
|
||||
);
|
||||
points.cutLeft = points.zag.shift(180, width / 2);
|
||||
points.cutBottom = new Point(points.cutLeft.x, points.bottomLeft.y);
|
||||
points.fold3Left = new Point(0, width * 1.5);
|
||||
points.fold3Right = new Point(points.cutBottom.x, width * 1.5);
|
||||
points.midLeft = new Point(0, 0)
|
||||
points.midLen = points.midLeft.shift(0, length)
|
||||
points.midRight = points.midLeft.shift(0, length + width * 1.25)
|
||||
points.fold1Left = points.midLeft.shift(90, width / 2)
|
||||
points.fold2Left = points.midLeft.shift(-90, width / 2)
|
||||
points.boxTopRight = points.midRight.shift(90, width / 2)
|
||||
points.boxBottomRight = points.midRight.shift(-90, width / 2)
|
||||
points.boxTopLeft = points.midLen.shift(90, width / 2)
|
||||
points.boxBottomLeft = points.midLen.shift(-90, width / 2)
|
||||
points.boxTip = points.midLen.shift(0, width * 1.5)
|
||||
points.fold1Right = points.boxTopRight.shift(0, width * 0.5)
|
||||
points.fold2Right = points.boxBottomRight.shift(0, width * 0.5)
|
||||
points.topLeft = points.fold1Left.shift(90, width / 2 - 1.5)
|
||||
points.topRight = points.fold1Right.shift(90, width / 2 - 1.5)
|
||||
points.bottomRight = points.fold2Right.shift(-90, width * 1.5 - 1.5)
|
||||
points.bottomLeft = points.fold2Left.shift(-90, width * 1.5 - 1.5)
|
||||
points.cutRight = points.fold2Right.shift(-90, width / 2 - 1.5)
|
||||
points.zig = points.cutRight.shift(180, width * 0.6)
|
||||
points.zag = new Point(points.bottomRight.x - width, points.bottomRight.y - width * 0.6)
|
||||
points.cutLeft = points.zag.shift(180, width / 2)
|
||||
points.cutBottom = new Point(points.cutLeft.x, points.bottomLeft.y)
|
||||
points.fold3Left = new Point(0, width * 1.5)
|
||||
points.fold3Right = new Point(points.cutBottom.x, width * 1.5)
|
||||
|
||||
paths.seam = new Path()
|
||||
.move(points.topLeft)
|
||||
|
@ -54,7 +51,7 @@ export default part => {
|
|||
.line(points.cutBottom)
|
||||
.line(points.bottomLeft)
|
||||
.close()
|
||||
.attr("class", "fabric");
|
||||
.attr('class', 'fabric')
|
||||
|
||||
paths.outline = new Path()
|
||||
.move(points.fold1Left)
|
||||
|
@ -64,7 +61,7 @@ export default part => {
|
|||
.line(points.fold2Left)
|
||||
.move(points.boxTopLeft)
|
||||
.line(points.boxBottomLeft)
|
||||
.attr("class", "dashed");
|
||||
.attr('class', 'dashed')
|
||||
|
||||
paths.folds = new Path()
|
||||
.move(points.fold3Left)
|
||||
|
@ -74,25 +71,22 @@ export default part => {
|
|||
.line(points.boxTip)
|
||||
.line(points.fold1Right)
|
||||
.line(points.boxTopRight)
|
||||
.attr("class", "dotted");
|
||||
.attr('class', 'dotted')
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
// Title
|
||||
points.title = new Point(length / 4, 0);
|
||||
macro("title", {
|
||||
points.title = new Point(length / 4, 0)
|
||||
macro('title', {
|
||||
at: points.title,
|
||||
nr: 10,
|
||||
title: "sleevePlacketOverlap",
|
||||
title: 'sleevePlacketOverlap',
|
||||
scale: 0.6
|
||||
});
|
||||
})
|
||||
|
||||
// Button
|
||||
points.buttonhole = new Point(length / 2, 0);
|
||||
snippets.buttonhole = new Snippet("buttonhole", points.buttonhole).attr(
|
||||
"data-rotate",
|
||||
90
|
||||
);
|
||||
points.buttonhole = new Point(length / 2, 0)
|
||||
snippets.buttonhole = new Snippet('buttonhole', points.buttonhole).attr('data-rotate', 90)
|
||||
|
||||
if (sa) {
|
||||
paths.sa = new Path()
|
||||
|
@ -100,73 +94,73 @@ export default part => {
|
|||
.line(points.bottomLeft.shift(180, sa))
|
||||
.line(points.topLeft.shift(180, sa))
|
||||
.line(points.topLeft)
|
||||
.attr("class", "fabric sa");
|
||||
.attr('class', 'fabric sa')
|
||||
}
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
macro("hd", {
|
||||
macro('hd', {
|
||||
from: points.bottomLeft,
|
||||
to: points.cutBottom,
|
||||
y: points.bottomLeft.y + 15
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.bottomLeft,
|
||||
to: points.zag,
|
||||
y: points.bottomLeft.y + 30
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.bottomLeft,
|
||||
to: points.zig,
|
||||
y: points.bottomLeft.y + 45
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.bottomLeft,
|
||||
to: points.cutRight,
|
||||
y: points.bottomLeft.y + 60
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.fold1Right,
|
||||
to: points.topRight,
|
||||
x: points.topRight.x + 15
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.boxTip,
|
||||
to: points.topRight,
|
||||
x: points.topRight.x + 30
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.fold2Right,
|
||||
to: points.topRight,
|
||||
x: points.topRight.x + 45
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.cutRight,
|
||||
to: points.topRight,
|
||||
x: points.topRight.x + 60
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.zag,
|
||||
to: points.topRight,
|
||||
x: points.topRight.x + 75
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.cutBottom,
|
||||
to: points.topRight,
|
||||
x: points.topRight.x + 90
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.topLeft,
|
||||
to: points.boxTopLeft,
|
||||
y: points.topLeft.y - 15
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.topLeft,
|
||||
to: points.boxTopRight,
|
||||
y: points.topLeft.y - 30
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
return part;
|
||||
};
|
||||
return part
|
||||
}
|
||||
|
|
|
@ -12,22 +12,21 @@ export default part => {
|
|||
paperless,
|
||||
macro,
|
||||
options
|
||||
} = part.shorthand();
|
||||
} = part.shorthand()
|
||||
|
||||
let width =
|
||||
options.sleevePlacketWidth > 20 ? 10 : options.sleevePlacketWidth / 4;
|
||||
let length = measurements.shoulderToWrist * options.sleevePlacketLength;
|
||||
let width = options.sleevePlacketWidth > 20 ? 10 : options.sleevePlacketWidth / 4
|
||||
let length = measurements.shoulderToWrist * options.sleevePlacketLength
|
||||
|
||||
points.midLeft = new Point(0, 0);
|
||||
points.midRight = points.midLeft.shift(0, length);
|
||||
points.fold1Left = points.midLeft.shift(90, width);
|
||||
points.fold2Left = points.midLeft.shift(-90, width);
|
||||
points.fold1Right = points.fold1Left.shift(0, length);
|
||||
points.fold2Right = points.fold2Left.shift(0, length);
|
||||
points.topLeft = points.midLeft.shift(90, width * 2 - 1.5);
|
||||
points.topRight = points.midRight.shift(90, width * 2 - 1.5);
|
||||
points.bottomLeft = points.midLeft.shift(-90, width * 2 - 1.5);
|
||||
points.bottomRight = points.midRight.shift(-90, width * 2 - 1.5);
|
||||
points.midLeft = new Point(0, 0)
|
||||
points.midRight = points.midLeft.shift(0, length)
|
||||
points.fold1Left = points.midLeft.shift(90, width)
|
||||
points.fold2Left = points.midLeft.shift(-90, width)
|
||||
points.fold1Right = points.fold1Left.shift(0, length)
|
||||
points.fold2Right = points.fold2Left.shift(0, length)
|
||||
points.topLeft = points.midLeft.shift(90, width * 2 - 1.5)
|
||||
points.topRight = points.midRight.shift(90, width * 2 - 1.5)
|
||||
points.bottomLeft = points.midLeft.shift(-90, width * 2 - 1.5)
|
||||
points.bottomRight = points.midRight.shift(-90, width * 2 - 1.5)
|
||||
|
||||
paths.seam = new Path()
|
||||
.move(points.topLeft)
|
||||
|
@ -35,7 +34,7 @@ export default part => {
|
|||
.line(points.bottomRight)
|
||||
.line(points.bottomLeft)
|
||||
.close()
|
||||
.attr("class", "fabric");
|
||||
.attr('class', 'fabric')
|
||||
|
||||
paths.folds = new Path()
|
||||
.move(points.fold1Left)
|
||||
|
@ -44,23 +43,23 @@ export default part => {
|
|||
.line(points.fold2Right)
|
||||
.move(points.midLeft)
|
||||
.line(points.midRight)
|
||||
.attr("class", "help");
|
||||
.attr('class', 'help')
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
// Title
|
||||
points.title = new Point(length / 4, 0);
|
||||
macro("title", {
|
||||
points.title = new Point(length / 4, 0)
|
||||
macro('title', {
|
||||
at: points.title,
|
||||
nr: 9,
|
||||
title: "sleevePlacketUnderlap",
|
||||
title: 'sleevePlacketUnderlap',
|
||||
scale: 0.6,
|
||||
append: true
|
||||
});
|
||||
})
|
||||
|
||||
// Button
|
||||
points.button = new Point(length / 2, width / 2);
|
||||
snippets.button = new Snippet("button", points.button);
|
||||
points.button = new Point(length / 2, width / 2)
|
||||
snippets.button = new Snippet('button', points.button)
|
||||
|
||||
if (sa) {
|
||||
paths.sa = new Path()
|
||||
|
@ -68,33 +67,33 @@ export default part => {
|
|||
.line(points.bottomLeft.shift(180, sa))
|
||||
.line(points.topLeft.shift(180, sa))
|
||||
.line(points.topLeft)
|
||||
.attr("class", "fabric sa");
|
||||
.attr('class', 'fabric sa')
|
||||
}
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
macro("vd", {
|
||||
macro('vd', {
|
||||
from: points.fold2Right,
|
||||
to: points.fold1Right,
|
||||
x: points.topRight.x + 15
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.bottomRight,
|
||||
to: points.topRight,
|
||||
x: points.topRight.x + 30
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.bottomLeft,
|
||||
to: points.button,
|
||||
y: points.bottomRight.y + 15
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.bottomLeft,
|
||||
to: points.bottomRight,
|
||||
y: points.bottomRight.y + 30
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
return part;
|
||||
};
|
||||
return part
|
||||
}
|
||||
|
|
|
@ -11,12 +11,12 @@ export default part => {
|
|||
paperless,
|
||||
macro,
|
||||
options
|
||||
} = part.shorthand();
|
||||
} = part.shorthand()
|
||||
|
||||
for (let id of Object.keys(part.paths)) delete part.paths[id];
|
||||
for (let id of Object.keys(part.paths)) delete part.paths[id]
|
||||
|
||||
// Cut off at yoke
|
||||
points.cbYoke = new Point(0, points.armholePitch.y);
|
||||
points.cbYoke = new Point(0, points.armholePitch.y)
|
||||
|
||||
// Paths
|
||||
paths.saBase = new Path()
|
||||
|
@ -24,95 +24,94 @@ export default part => {
|
|||
.line(points.armholePitch)
|
||||
.curve(points.armholePitchCp2, points.shoulderCp1, points.shoulder)
|
||||
.line(points.neck)
|
||||
.curve_(points.neckCp2, points.cbNeck);
|
||||
if (options.splitYoke)
|
||||
paths.saBase = paths.saBase.line(points.cbYoke).close();
|
||||
paths.seam = paths.saBase.clone();
|
||||
paths.saBase.render = false;
|
||||
paths.seam = paths.seam.close().attr("class", "fabric");
|
||||
.curve_(points.neckCp2, points.cbNeck)
|
||||
if (options.splitYoke) paths.saBase = paths.saBase.line(points.cbYoke).close()
|
||||
paths.seam = paths.saBase.clone()
|
||||
paths.saBase.render = false
|
||||
paths.seam = paths.seam.close().attr('class', 'fabric')
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
delete snippets.armholePitchNotch;
|
||||
points.title = new Point(points.neck.x, points.cbYoke.y / 3);
|
||||
macro("title", { at: points.title, nr: 4, title: "yoke", scale: 0.8 });
|
||||
points.logo = points.title.shift(-90, 50);
|
||||
snippets.logo = new Snippet("logo", points.logo);
|
||||
snippets.logo.attr("data-scale", 0.8);
|
||||
delete snippets.armholePitchNotch
|
||||
points.title = new Point(points.neck.x, points.cbYoke.y / 3)
|
||||
macro('title', { at: points.title, nr: 4, title: 'yoke', scale: 0.8 })
|
||||
points.logo = points.title.shift(-90, 50)
|
||||
snippets.logo = new Snippet('logo', points.logo)
|
||||
snippets.logo.attr('data-scale', 0.8)
|
||||
if (options.splitYoke) {
|
||||
points.grainlineFrom = points.cbYoke.shift(0, 20);
|
||||
points.grainlineTo = points.cbNeck.shift(0, 20);
|
||||
macro("grainline", {
|
||||
points.grainlineFrom = points.cbYoke.shift(0, 20)
|
||||
points.grainlineTo = points.cbNeck.shift(0, 20)
|
||||
macro('grainline', {
|
||||
from: points.grainlineFrom,
|
||||
to: points.grainlineTo
|
||||
});
|
||||
})
|
||||
} else {
|
||||
macro("cutonfold", {
|
||||
macro('cutonfold', {
|
||||
from: points.cbNeck,
|
||||
to: points.cbYoke,
|
||||
grainline: true
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
macro("sprinkle", {
|
||||
snippet: "notch",
|
||||
on: ["neck", "shoulder"]
|
||||
});
|
||||
macro('sprinkle', {
|
||||
snippet: 'notch',
|
||||
on: ['neck', 'shoulder']
|
||||
})
|
||||
|
||||
if (sa) {
|
||||
paths.sa = paths.saBase.offset(sa).attr("class", "fabric sa");
|
||||
paths.sa = paths.saBase.offset(sa).attr('class', 'fabric sa')
|
||||
if (options.splitYoke) {
|
||||
paths.sa = paths.sa
|
||||
.line(points.cbNeck)
|
||||
.move(points.cbYoke)
|
||||
.line(paths.sa.start());
|
||||
.line(paths.sa.start())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
macro("pd", {
|
||||
macro('pd', {
|
||||
path: new Path().move(points.cbNeck)._curve(points.neckCp2, points.neck),
|
||||
d: 15
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.cbNeck,
|
||||
to: points.neck,
|
||||
y: points.neck.y - 15 - sa
|
||||
});
|
||||
macro("ld", {
|
||||
})
|
||||
macro('ld', {
|
||||
from: points.neck,
|
||||
to: points.shoulder,
|
||||
d: 15 + sa
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.cbYoke,
|
||||
to: points.armholePitch,
|
||||
y: points.cbYoke.y + 15 + sa
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.cbYoke,
|
||||
to: points.shoulder,
|
||||
y: points.cbYoke.y + 30 + sa
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.cbYoke,
|
||||
to: points.cbNeck,
|
||||
x: points.cbYoke.x - 15 - sa
|
||||
});
|
||||
macro("pd", {
|
||||
})
|
||||
macro('pd', {
|
||||
path: new Path()
|
||||
.move(points.armholePitch)
|
||||
.curve(points.armholePitchCp2, points.shoulderCp1, points.shoulder),
|
||||
d: 15 + sa
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.armholePitch,
|
||||
to: points.shoulder,
|
||||
x: points.shoulder.x + 30 + sa
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
return part;
|
||||
};
|
||||
return part
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue