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

89 lines
1.7 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 draftBentTopSleeve({
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.us
paths.seam = paths.ts.clone().attr('class', 'fabric', true)
delete paths.ts
2019-02-26 17:46:07 +01:00
2023-04-26 18:53:16 -07:00
store.cutlist.addCut()
2019-02-26 17:46:07 +01:00
// Complete?
if (complete) {
2021-01-31 09:22:15 +01:00
macro('scalebox', { at: points.elbowCenter })
snippets.logo = new Snippet('logo', points.elbowCenter.shift(90, 50))
2019-08-03 15:03:33 +02:00
macro('title', {
2019-02-26 17:46:07 +01:00
at: points.armCenter,
nr: 3,
2021-04-24 10:16:31 +02:00
title: 'topsleeve',
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.tsWristLeft)
.line(points.tsWristRight)
.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, 'ts')
macro('vd', {
2019-02-26 17:46:07 +01:00
from: points.tsLeftEdge,
to: points.top,
2021-04-24 10:16:31 +02:00
x: points.tsLeftEdge.x - sa - 15,
2019-08-03 15:03:33 +02:00
})
macro('hd', {
2019-02-26 17:46:07 +01:00
from: points.tsLeftEdge,
to: points.top,
2021-04-24 10:16:31 +02:00
y: points.top.x - sa - 15,
2019-08-03 15:03:33 +02:00
})
macro('hd', {
2019-02-26 17:46:07 +01:00
from: points.tsLeftEdge,
to: points.backPitchPoint,
2021-04-24 10:16:31 +02:00
y: points.top.x - sa - 30,
2019-08-03 15:03:33 +02:00
})
macro('hd', {
2019-02-26 17:46:07 +01:00
from: points.tsLeftEdge,
to: points.tsRightEdge,
2021-04-24 10:16:31 +02:00
y: points.top.x - sa - 45,
2019-08-03 15:03:33 +02:00
})
macro('vd', {
2019-02-26 17:46:07 +01:00
from: points.tsRightEdge,
to: points.backPitchPoint,
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 topSleeve = {
name: 'bent.topSleeve',
from: sleeve,
draft: draftBentTopSleeve,
}