1
0
Fork 0
freesewing/designs/bent/src/undersleeve.mjs

75 lines
1.4 KiB
JavaScript
Raw Normal View History

2022-09-04 06:05:13 -07:00
import { sleeve } from './sleeve.mjs'
import { dimensions } from './shared.mjs'
2019-02-26 17:46:07 +01:00
2022-09-10 20:25:28 +02:00
function draftBentUnderSleeve({
macro,
Path,
points,
paths,
complete,
paperless,
snippets,
Snippet,
sa,
2023-04-26 18:53:16 -07:00
store,
2022-09-10 20:25:28 +02:00
part,
}) {
2019-02-26 17:46:07 +01:00
// Extract seamline from sleeve
2019-08-03 15:03:33 +02:00
delete paths.ts
paths.seam = paths.us.clone().attr('class', 'fabric', true)
delete paths.us
2019-02-26 17:46:07 +01:00
points.anchor = points.usTip.clone()
2023-04-26 18:53:16 -07:00
store.cutlist.addCut()
2019-02-26 17:46:07 +01:00
// Complete?
if (complete) {
2019-08-03 15:03:33 +02:00
snippets.logo = new Snippet('logo', points.elbowCenter)
macro('title', {
2019-02-26 17:46:07 +01:00
at: points.armCenter,
nr: 4,
2021-04-24 10:16:31 +02:00
title: 'undersleeve',
2019-08-03 15:03:33 +02:00
})
2019-02-26 17:46:07 +01:00
if (sa) {
2019-08-03 15:03:33 +02:00
paths.sa = paths.seam.clone()
2019-02-26 17:46:07 +01:00
// Remove hem
2019-08-03 15:03:33 +02:00
paths.sa.ops.splice(-2)
2019-02-26 17:46:07 +01:00
paths.sa = paths.sa
.offset(sa)
.join(
new Path()
.move(points.usWristLeft)
.line(points.usWristRight)
.offset(sa * 3)
2019-02-26 17:46:07 +01:00
)
.close()
2019-08-03 15:03:33 +02:00
.attr('class', 'fabric sa')
2019-02-26 17:46:07 +01:00
}
}
// Paperless?
if (paperless) {
2019-08-03 15:03:33 +02:00
dimensions(part, 'us')
macro('hd', {
2019-02-26 17:46:07 +01:00
from: points.usLeftEdge,
to: points.usTip,
2021-04-24 10:16:31 +02:00
y: points.usTip.y - sa - 15,
2019-08-03 15:03:33 +02:00
})
macro('vd', {
2019-02-26 17:46:07 +01:00
from: points.tsRightEdge,
to: points.usTip,
2021-04-24 10:16:31 +02:00
x: points.tsRightEdge.x + sa + 15,
2019-08-03 15:03:33 +02:00
})
2019-02-26 17:46:07 +01:00
}
2019-08-03 15:03:33 +02:00
return part
2019-02-26 17:46:07 +01:00
}
2022-09-04 06:05:13 -07:00
export const underSleeve = {
name: 'bent.underSleeve',
from: sleeve,
draft: draftBentUnderSleeve,
}