1
0
Fork 0
freesewing/packages/brian/src/shared.js

74 lines
2.1 KiB
JavaScript
Raw Normal View History

export function saBase(side, points, Path) {
2019-08-03 15:03:33 +02:00
let path = new Path()
if (side === 'back') path.move(points.cbHem)
else path.move(points.cfHem)
2018-08-06 16:19:12 +02:00
path
2018-12-21 12:55:50 +01:00
.line(points.hem)
2018-08-06 16:19:12 +02:00
.line(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
.line(points.neck)
if (side === 'back') {
path.curve(points.neckCp2, points.cbNeck, points.cbNeck)
2018-08-06 16:19:12 +02:00
} else {
2019-08-03 15:03:33 +02:00
path.curve(points.neckCp2, points.cfNeckCp1, points.cfNeck)
2018-08-06 16:19:12 +02:00
}
2019-08-03 15:03:33 +02:00
return path
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 shoulderToArmholePitch(points, Path) {
return new Path()
.move(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 dimensions(macro, points, Path, sa) {
2019-08-03 15:03:33 +02:00
macro('pd', {
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)
2018-08-11 14:13:40 +02:00
.curve(points.armholePitchCp2, points.shoulderCp1, points.shoulder),
2018-08-06 16:19:12 +02:00
d: sa + 15
2019-08-03 15:03:33 +02:00
})
macro('pd', {
2018-08-06 16:19:12 +02:00
path: new Path()
.move(points.armholePitch)
2018-08-11 14:13:40 +02:00
.curve(points.armholePitchCp2, points.shoulderCp1, points.shoulder),
2018-08-06 16:19:12 +02:00
d: -15
2019-08-03 15:03:33 +02:00
})
macro('vd', {
2018-08-06 16:19:12 +02:00
from: points.hips,
to: points.armhole,
x: points.hips.x + sa + 15
2019-08-03 15:03:33 +02:00
})
macro('vd', {
2018-08-06 16:19:12 +02:00
from: points.hips,
to: points.armholePitch,
x: points.hips.x + sa + 30
2019-08-03 15:03:33 +02:00
})
macro('vd', {
2018-08-06 16:19:12 +02:00
from: points.hips,
to: points.shoulder,
x: points.hips.x + sa + 45
2019-08-03 15:03:33 +02:00
})
macro('vd', {
2018-08-06 16:19:12 +02:00
from: points.hips,
to: points.neck,
x: points.hips.x + sa + 60
2019-08-03 15:03:33 +02:00
})
macro('ld', { from: points.neck, to: points.shoulder, d: sa + 15 })
2018-08-06 16:19:12 +02:00
}