1
0
Fork 0
freesewing/designs/yuri/src/sleeve.mjs

78 lines
1.8 KiB
JavaScript
Raw Normal View History

import { sleeve as brianSleeve } from '@freesewing/brian'
function draft (part) {
release: v2.18.0 ## 2.18.0 (2021-09-09) ### core #### Fixed - Handle path.offset() of very short curves with control points on the start or end point Closes [#1257](https://github.com/freesewing/freesewing/issues/1257) ### holmes #### Fixed - The `brimWidth` option is not a percent option, allowing the pattern to scale properly ### huey #### Fixed - Replace cut-on-fold indicator on pocket with a regular grainline indicator Closes [#1265](https://github.com/freesewing/freesewing/issues/1265) ### i18n #### Added - Added translations for Yuri #### Fixed - Added optional chaining so missing options always lead to clear error message ### simon #### Fixed - Avoid paperless depending on a complete pattern ### theo #### Fixed - Avoid paperless depending on a complete pattern ### wahid #### Fixed - Close Seam Allowance path of front lining Closes [#1267](https://github.com/freesewing/freesewing/issues/1267) - Support a zero value for the `backScyeDart` option ### yuri - Handle path.offset() of very short curves with control points on the start or end point Closes [#1257](https://github.com/freesewing/freesewing/issues/1257) - The `brimWidth` option is not a percent option, allowing the pattern to scale properly - Replace cut-on-fold indicator on pocket with a regular grainline indicator Closes [#1265](https://github.com/freesewing/freesewing/issues/1265) - Added translations for Yuri - Added optional chaining so missing options always lead to clear error message - Avoid paperless depending on a complete pattern - Avoid paperless depending on a complete pattern - Close Seam Allowance path of front lining Closes [#1267](https://github.com/freesewing/freesewing/issues/1267) - Support a zero value for the `backScyeDart` option
2021-09-09 20:25:59 +02:00
let { Point, Path, points, paths, complete, sa, paperless, macro } = part.shorthand()
2021-07-25 19:56:42 +02:00
// Clear paths from Brian, but keep sleevecap
for (let p of Object.keys(paths)) {
if (p !== 'sleevecap') delete paths[p]
}
// Paths
paths.saBase = new Path()
.move(points.wristRight)
.line(points.bicepsRight)
.join(paths.sleevecap)
.line(points.wristLeft)
.attr('class', 'various stroke-xxl')
paths.hemBase = new Path()
.move(points.wristLeft)
.line(points.wristRight)
.attr('class', 'various stroke-xxl')
paths.saBase.render = false
paths.hemBase.render = false
paths.seam = paths.saBase.join(paths.hemBase).close().attr('class', 'fabric')
// Complete?
if (complete) {
macro('grainline', {
from: new Point(0, points.wristLeft.y),
to: new Point(0, points.backPitch.y),
})
if (sa) {
paths.sa = paths.saBase
.clone()
.offset(sa)
.join(paths.hemBase.offset(3 * sa))
.close()
2021-07-25 19:56:42 +02:00
paths.sa.attr('class', 'fabric sa')
}
}
// Paperless?
if (paperless) {
const hemSa = 3 * sa
2021-07-25 19:56:42 +02:00
macro('hd', {
from: points.wristLeft,
to: points.wristRight,
y: points.wristLeft.y + hemSa + 15,
})
macro('hd', {
from: points.bicepsLeft,
to: points.bicepsRight,
y: points.sleeveTip.y - sa - 15,
})
macro('vd', {
from: points.wristLeft,
to: points.bicepsLeft,
x: points.bicepsLeft.x - sa - 15,
})
macro('vd', {
from: points.wristLeft,
to: points.sleeveTip,
x: points.bicepsLeft.x - sa - 30,
})
}
return part
}
export const sleeve = {
name: 'yuri.sleeve',
from: brianSleeve,
hideDependencies: true,
draft
}