1
0
Fork 0
freesewing/designs/brian/src/shared.mjs

70 lines
2 KiB
JavaScript
Raw Normal View History

2022-09-10 19:37:33 +02:00
export function s3Notches(snippets, Snippet, points, options, type) {
if (options.s3Armhole !== 0) snippets.shoulderNotch = new Snippet(type, points.shoulder)
if (options.s3Collar !== 0) snippets.collarNotch = new Snippet(type, points.hps)
2018-08-06 16:19:12 +02:00
}
export function armholeLength(points, Path) {
return 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)
2019-08-03 15:03:33 +02:00
.length()
2018-08-06 16:19:12 +02:00
}
export function armholeToArmholePitch(points, Path) {
2018-08-06 16:19:12 +02:00
return new Path()
.move(points.armhole)
.curve(points.armholeCp2, points.armholeHollowCp1, points.armholeHollow)
.curve(points.armholeHollowCp2, points.armholePitchCp1, points.armholePitch)
2019-08-03 15:03:33 +02:00
.length()
2018-08-06 16:19:12 +02:00
}
export function dimensions(part, side) {
const { macro, points, Path, sa, paths } = part.shorthand()
2019-08-03 15:03:33 +02:00
macro('pd', {
2023-09-07 17:51:35 +02:00
id: 'lArmhole',
2018-08-06 16:19:12 +02:00
path: new Path()
.move(points.armhole)
2018-08-11 14:13:40 +02:00
.curve(points.armholeCp2, points.armholeHollowCp1, points.armholeHollow)
2019-08-03 15:03:33 +02:00
.curve(points.armholeHollowCp2, points.armholePitchCp1, points.armholePitch)
.join(paths[`${side}Armhole`]),
2021-04-24 10:16:31 +02:00
d: sa + 15,
2019-08-03 15:03:33 +02:00
})
macro('pd', {
2023-09-07 19:19:48 +02:00
id: 'lShoulderToArmholePitch',
path: paths[`${side}Armhole`],
2021-04-24 10:16:31 +02:00
d: -15,
2019-08-03 15:03:33 +02:00
})
macro('vd', {
2023-09-07 17:51:35 +02:00
id: 'hHemToArmhole',
from: points.hem,
2018-08-06 16:19:12 +02:00
to: points.armhole,
2021-04-24 10:16:31 +02:00
x: points.hips.x + sa + 15,
2019-08-03 15:03:33 +02:00
})
macro('vd', {
2023-09-07 17:51:35 +02:00
id: 'hHemToArmholePitch',
from: points.hem,
2018-08-06 16:19:12 +02:00
to: points.armholePitch,
2021-04-24 10:16:31 +02:00
x: points.hips.x + sa + 30,
2019-08-03 15:03:33 +02:00
})
macro('vd', {
2023-09-07 17:51:35 +02:00
id: 'hHemToShoulder',
from: points.hem,
to: points.s3ArmholeSplit,
2021-04-24 10:16:31 +02:00
x: points.hips.x + sa + 45,
2019-08-03 15:03:33 +02:00
})
macro('vd', {
2023-09-07 17:51:35 +02:00
id: 'hTotal',
from: points.hem,
to: points.s3CollarSplit,
2021-04-24 10:16:31 +02:00
x: points.hips.x + sa + 60,
2019-08-03 15:03:33 +02:00
})
2023-09-07 17:51:35 +02:00
macro('ld', {
id: 'lShoulder',
from: points.s3CollarSplit,
to: points.s3ArmholeSplit,
d: sa + 15,
})
2018-08-06 16:19:12 +02:00
}