🎨 Updated prettier config
This commit is contained in:
parent
b8e632998b
commit
6710d76b08
401 changed files with 13193 additions and 15620 deletions
|
@ -1,57 +1,68 @@
|
|||
import { calculateRatios } from "./shared";
|
||||
import { calculateRatios } from './shared'
|
||||
|
||||
export default function(part) {
|
||||
let { paperless, sa, snippets, Snippet, store, complete, points, measurements, options, macro, Point, paths, Path } = part.shorthand();
|
||||
let {
|
||||
paperless,
|
||||
sa,
|
||||
snippets,
|
||||
Snippet,
|
||||
store,
|
||||
complete,
|
||||
points,
|
||||
measurements,
|
||||
options,
|
||||
macro,
|
||||
Point,
|
||||
paths,
|
||||
Path
|
||||
} = part.shorthand()
|
||||
|
||||
calculateRatios(part);
|
||||
calculateRatios(part)
|
||||
// Belt width
|
||||
let bw = measurements.centerBackNeckToWaist * options.beltWidth;
|
||||
store.set("beltWidth", bw);
|
||||
let bw = measurements.centerBackNeckToWaist * options.beltWidth
|
||||
store.set('beltWidth', bw)
|
||||
|
||||
// Box pleat (bp)
|
||||
points.bpStart = new Point(0, points.armholePitch.y);
|
||||
points.bpStart = new Point(0, points.armholePitch.y)
|
||||
points.bpTop = new Point(
|
||||
measurements.chestCircumference * options.backPleat * -1,
|
||||
points.armholePitch.y
|
||||
);
|
||||
points.bpBottom = new Point(
|
||||
points.bpTop.x,
|
||||
points.cbWaist.y - bw/2
|
||||
);
|
||||
points.bpTriangleEdge = points.bpStart.shift(0, points.bpTop.dx(points.bpStart)*0.6);
|
||||
points.bpTriangleTip = points.bpStart.shift(90, points.bpStart.dx(points.bpTriangleEdge));
|
||||
)
|
||||
points.bpBottom = new Point(points.bpTop.x, points.cbWaist.y - bw / 2)
|
||||
points.bpTriangleEdge = points.bpStart.shift(0, points.bpTop.dx(points.bpStart) * 0.6)
|
||||
points.bpTriangleTip = points.bpStart.shift(90, points.bpStart.dx(points.bpTriangleEdge))
|
||||
|
||||
// Waist shaping
|
||||
points.waist = new Point(
|
||||
store.get("chest")/4 - store.get("waistReduction") / 8,
|
||||
store.get('chest') / 4 - store.get('waistReduction') / 8,
|
||||
points.bpBottom.y
|
||||
);
|
||||
points.waistCp2 = points.waist.shift(90, points.armhole.dy(points.waist)/3);
|
||||
points.cbWaist = new Point(0, points.bpBottom.y);
|
||||
)
|
||||
points.waistCp2 = points.waist.shift(90, points.armhole.dy(points.waist) / 3)
|
||||
points.cbWaist = new Point(0, points.bpBottom.y)
|
||||
|
||||
// Dart
|
||||
points.dartCenter = points.cbWaist.shiftFractionTowards(points.waist, 0.4);
|
||||
points.dartTip = points.dartCenter.shift(90, points.armhole.dy(points.dartCenter)*0.85);
|
||||
points.dartRight = points.dartCenter.shift(0, store.get("waistReduction")/8);
|
||||
points.dartLeft = points.dartRight.flipX(points.dartCenter);
|
||||
points.dartLeftCp = points.dartLeft.shift(90, points.dartTip.dy(points.dartCenter)*0.6);
|
||||
points.dartRightCp = points.dartLeftCp.flipX(points.dartCenter);
|
||||
points.dartCenter = points.cbWaist.shiftFractionTowards(points.waist, 0.4)
|
||||
points.dartTip = points.dartCenter.shift(90, points.armhole.dy(points.dartCenter) * 0.85)
|
||||
points.dartRight = points.dartCenter.shift(0, store.get('waistReduction') / 8)
|
||||
points.dartLeft = points.dartRight.flipX(points.dartCenter)
|
||||
points.dartLeftCp = points.dartLeft.shift(90, points.dartTip.dy(points.dartCenter) * 0.6)
|
||||
points.dartRightCp = points.dartLeftCp.flipX(points.dartCenter)
|
||||
|
||||
store.set("cbToDart", points.dartLeft.x);
|
||||
store.set("dartToSide", points.dartRight.dx(points.waist));
|
||||
store.set('cbToDart', points.dartLeft.x)
|
||||
store.set('dartToSide', points.dartRight.dx(points.waist))
|
||||
|
||||
// Back stay (bs)
|
||||
points.bsCp1 = points.bpStart.shiftFractionTowards(points.armholePitch, 0.5);
|
||||
points.bsCp2 = points.armhole.shiftFractionTowards(points.cbArmhole, 0.3);
|
||||
points.bsCp1 = points.bpStart.shiftFractionTowards(points.armholePitch, 0.5)
|
||||
points.bsCp2 = points.armhole.shiftFractionTowards(points.cbArmhole, 0.3)
|
||||
|
||||
// Store collar length
|
||||
store.set(
|
||||
"backCollarLength",
|
||||
'backCollarLength',
|
||||
new Path()
|
||||
.move(points.cbNeck)
|
||||
._curve(points.neckCp2, points.neck)
|
||||
.length()
|
||||
);
|
||||
)
|
||||
|
||||
// Clean up
|
||||
for (let i in paths) delete paths[i]
|
||||
|
@ -79,154 +90,147 @@ export default function(part) {
|
|||
.join(paths.dart)
|
||||
.join(paths.seam2)
|
||||
.close()
|
||||
.attr("class", "fabric");
|
||||
.attr('class', 'fabric')
|
||||
|
||||
paths.backStay = new Path()
|
||||
.move(points.bpStart)
|
||||
.curve(points.bsCp1, points.bsCp2, points.armhole)
|
||||
.attr("class", "canvas lashed");
|
||||
.attr('class', 'canvas lashed')
|
||||
|
||||
paths.triangle = new Path()
|
||||
.move(points.bpTriangleTip)
|
||||
.line(points.bpTriangleEdge)
|
||||
.line(points.bpStart)
|
||||
.attr("class", "dashed");
|
||||
.attr('class', 'dashed')
|
||||
|
||||
if (complete) {
|
||||
macro("sprinkle", {
|
||||
snippet: "notch",
|
||||
on: [
|
||||
"armholePitch",
|
||||
"bpTriangleTip"
|
||||
]
|
||||
});
|
||||
macro('sprinkle', {
|
||||
snippet: 'notch',
|
||||
on: ['armholePitch', 'bpTriangleTip']
|
||||
})
|
||||
|
||||
macro("grainline", {
|
||||
macro('grainline', {
|
||||
from: points.cbWaist,
|
||||
to: points.bpStart
|
||||
});
|
||||
})
|
||||
|
||||
points.logo = new Point(
|
||||
points.armhole.x * 0.7,
|
||||
points.dartTip.y
|
||||
);
|
||||
snippets.logo = new Snippet("logo", points.logo);
|
||||
points.logo = new Point(points.armhole.x * 0.7, points.dartTip.y)
|
||||
snippets.logo = new Snippet('logo', points.logo)
|
||||
|
||||
if (sa) {
|
||||
paths.sa =
|
||||
paths.seam1
|
||||
paths.sa = paths.seam1
|
||||
.line(points.waist)
|
||||
.offset(sa)
|
||||
.join(paths.seam2.offset(sa))
|
||||
.close()
|
||||
.trim()
|
||||
.close()
|
||||
.attr("class", "fabric sa");
|
||||
.attr('class', 'fabric sa')
|
||||
}
|
||||
|
||||
if (paperless) {
|
||||
macro("hd", {
|
||||
macro('hd', {
|
||||
from: points.bpBottom,
|
||||
to: points.cbWaist,
|
||||
y: points.cbWaist.y + 15 + sa
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.cbWaist,
|
||||
to: points.dartLeft,
|
||||
y: points.cbWaist.y + 15 + sa
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.dartLeft,
|
||||
to: points.dartRight,
|
||||
y: points.cbWaist.y + 15 + sa
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.dartRight,
|
||||
to: points.waist,
|
||||
y: points.cbWaist.y + 15 + sa
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.cbWaist,
|
||||
to: points.waist,
|
||||
y: points.cbWaist.y + 30 + sa
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.bpBottom,
|
||||
to: points.waist,
|
||||
y: points.cbWaist.y + 45 + sa
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.waist,
|
||||
to: points.armhole,
|
||||
x: points.armhole.x + 15 + sa
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.armhole,
|
||||
to: points.armholePitch,
|
||||
x: points.armhole.x + 15 + sa
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.armhole,
|
||||
to: points.shoulder,
|
||||
x: points.armhole.x + 30 + sa
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.waist,
|
||||
to: points.shoulder,
|
||||
x: points.armhole.x + 45 + sa
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.dartRight,
|
||||
to: points.dartTip,
|
||||
x: points.dartRight.x + 15
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.bpBottom,
|
||||
to: points.bpTop,
|
||||
x: points.bpTop.x - 15 - sa
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.bpTop,
|
||||
to: points.cbNeck,
|
||||
x: points.bpTop.x - 15 - sa
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.bpBottom,
|
||||
to: points.neck,
|
||||
x: points.bpTop.x - 30 - sa
|
||||
});
|
||||
macro("vd", {
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.bpStart,
|
||||
to: points.bpTriangleTip,
|
||||
x: points.bpTriangleEdge.x + 15
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.bpStart,
|
||||
to: points.bpTriangleEdge,
|
||||
y: points.bpTriangleEdge.y + 15
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.cbNeck,
|
||||
to: points.neck,
|
||||
y: points.neck.y - 15 - sa
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.cbNeck,
|
||||
to: points.armholePitch,
|
||||
y: points.neck.y - 30 - sa
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.cbNeck,
|
||||
to: points.shoulder,
|
||||
y: points.neck.y - 45 - sa
|
||||
});
|
||||
macro("hd", {
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.cbNeck,
|
||||
to: points.armhole,
|
||||
y: points.neck.y - 60 - sa
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
return part;
|
||||
return part
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue