1
0
Fork 0
freesewing/designs/carlton/src/innerpockettab.mjs

77 lines
1.7 KiB
JavaScript
Raw Normal View History

2022-09-04 11:37:23 -07:00
import { front } from './front.mjs'
2022-09-11 12:54:41 +02:00
function draftCarltonInnerPocketTab({
paperless,
sa,
store,
complete,
points,
macro,
Point,
paths,
Path,
part,
}) {
2019-08-03 15:03:33 +02:00
points.topLeft = new Point(0, 0)
points.topRight = new Point(store.get('innerPocketWidth') * 1.2, 0)
2019-03-25 18:20:15 +01:00
points.bottom = new Point(
2019-08-03 15:03:33 +02:00
store.get('innerPocketWidth') * 0.6,
store.get('innerPocketWidth') * 0.6
)
points.top = new Point(store.get('innerPocketWidth') * 0.6, 0)
2019-03-25 18:20:15 +01:00
paths.seam = new Path()
.move(points.topLeft)
.line(points.bottom)
.line(points.topRight)
.line(points.topLeft)
.close()
2019-08-03 15:03:33 +02:00
.attr('class', 'lining')
2019-03-25 18:20:15 +01:00
2021-01-31 09:22:15 +01:00
paths.hint = new Path().move(points.top).line(points.bottom).attr('class', 'lining dashed')
2019-03-25 18:20:15 +01:00
if (typeof store.addCut === 'function') store.addCut({ cut: 1, material: 'lining' })
2019-03-30 13:51:23 +01:00
if (complete) {
2019-08-03 15:03:33 +02:00
points.title = points.top.shiftFractionTowards(points.bottom, 0.5)
macro('title', {
2019-03-30 13:51:23 +01:00
at: points.title,
nr: 15,
2021-04-24 10:16:31 +02:00
title: 'innerPocketTab',
2019-08-03 15:03:33 +02:00
})
2019-03-30 13:51:23 +01:00
2019-08-03 15:03:33 +02:00
macro('grainline', {
2019-03-30 13:51:23 +01:00
from: points.top,
2021-04-24 10:16:31 +02:00
to: points.top.shift(-45, points.top.x * 0.7),
2019-08-03 15:03:33 +02:00
})
2019-03-30 13:51:23 +01:00
2019-08-03 15:03:33 +02:00
if (sa) paths.sa = paths.seam.offset(sa).attr('class', 'lining sa')
2019-03-30 13:51:23 +01:00
if (paperless) {
2019-08-03 15:03:33 +02:00
macro('hd', {
2019-03-30 13:51:23 +01:00
from: points.topLeft,
to: points.top,
2021-04-24 10:16:31 +02:00
y: points.topLeft.y - sa - 15,
2019-08-03 15:03:33 +02:00
})
macro('hd', {
2019-03-30 13:51:23 +01:00
from: points.topLeft,
to: points.topRight,
2021-04-24 10:16:31 +02:00
y: points.topLeft.y - sa - 30,
2019-08-03 15:03:33 +02:00
})
macro('vd', {
2019-03-30 13:51:23 +01:00
from: points.bottom,
to: points.topRight,
2021-04-24 10:16:31 +02:00
x: points.topRight.x + sa + 15,
2019-08-03 15:03:33 +02:00
})
2019-03-30 13:51:23 +01:00
}
}
2019-08-03 15:03:33 +02:00
return part
2019-03-25 18:20:15 +01:00
}
2022-09-04 11:37:23 -07:00
export const innerPocketTab = {
name: 'carlton.innerPocketTab',
after: front,
draft: draftCarltonInnerPocketTab,
}