2022-09-04 11:37:23 -07:00
|
|
|
import { front } from './front.mjs'
|
|
|
|
|
2022-09-11 12:54:41 +02:00
|
|
|
function draftCarltonInnerPocketTab({
|
|
|
|
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
|
|
|
|
2023-09-15 16:54:22 +02:00
|
|
|
if (sa) paths.sa = paths.seam.offset(sa).attr('class', 'lining sa')
|
|
|
|
if (complete)
|
|
|
|
paths.hint = new Path().move(points.top).line(points.bottom).attr('class', 'lining help')
|
2019-03-25 18:20:15 +01:00
|
|
|
|
2023-09-15 16:54:22 +02:00
|
|
|
/*
|
|
|
|
* Annotations
|
|
|
|
*/
|
2023-03-02 09:36:09 -06:00
|
|
|
|
2023-09-15 16:54:22 +02:00
|
|
|
// Cut list
|
|
|
|
store.cutlist.addCut({ cut: 1, material: 'lining' })
|
2019-03-30 13:51:23 +01:00
|
|
|
|
2023-09-15 16:54:22 +02:00
|
|
|
// Title
|
|
|
|
points.title = points.top.shiftFractionTowards(points.bottom, 0.5)
|
|
|
|
macro('title', {
|
|
|
|
at: points.title,
|
|
|
|
nr: 15,
|
|
|
|
title: 'innerPocketTab',
|
|
|
|
scale: 0.7,
|
|
|
|
})
|
2019-03-30 13:51:23 +01:00
|
|
|
|
2023-09-15 16:54:22 +02:00
|
|
|
// Grainline
|
|
|
|
macro('grainline', {
|
|
|
|
from: points.top,
|
|
|
|
to: points.top.shift(-45, points.top.x * 0.7),
|
|
|
|
})
|
2019-03-30 13:51:23 +01:00
|
|
|
|
2023-09-15 16:54:22 +02:00
|
|
|
// Dimensions
|
|
|
|
macro('hd', {
|
|
|
|
from: points.topLeft,
|
|
|
|
to: points.top,
|
|
|
|
y: points.topLeft.y - sa - 15,
|
|
|
|
})
|
|
|
|
macro('hd', {
|
|
|
|
from: points.topLeft,
|
|
|
|
to: points.topRight,
|
|
|
|
y: points.topLeft.y - sa - 30,
|
|
|
|
})
|
|
|
|
macro('vd', {
|
|
|
|
from: points.bottom,
|
|
|
|
to: points.topRight,
|
|
|
|
x: points.topRight.x + sa + 15,
|
|
|
|
})
|
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,
|
|
|
|
}
|