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

80 lines
1.6 KiB
JavaScript

import { front } from './front.mjs'
function draftCarltonInnerPocketTab({
sa,
store,
complete,
points,
macro,
Point,
paths,
Path,
part,
}) {
points.topLeft = new Point(0, 0)
points.topRight = new Point(store.get('innerPocketWidth') * 1.2, 0)
points.bottom = new Point(
store.get('innerPocketWidth') * 0.6,
store.get('innerPocketWidth') * 0.6
)
points.top = new Point(store.get('innerPocketWidth') * 0.6, 0)
paths.seam = new Path()
.move(points.topLeft)
.line(points.bottom)
.line(points.topRight)
.line(points.topLeft)
.close()
.attr('class', 'lining')
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')
/*
* Annotations
*/
// Cut list
store.cutlist.addCut({ cut: 1, material: 'lining' })
// Title
points.title = points.top.shiftFractionTowards(points.bottom, 0.5)
macro('title', {
at: points.title,
nr: 15,
title: 'innerPocketTab',
scale: 0.7,
})
// Grainline
macro('grainline', {
from: points.top,
to: points.top.shift(-45, points.top.x * 0.7),
})
// 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,
})
return part
}
export const innerPocketTab = {
name: 'carlton.innerPocketTab',
after: front,
draft: draftCarltonInnerPocketTab,
}