1
0
Fork 0
freesewing/packages/bent/src/undersleeve.js

56 lines
1.2 KiB
JavaScript
Raw Normal View History

2019-08-03 15:03:33 +02:00
import dimensions from './shared'
2019-02-26 17:46:07 +01:00
export default function (part) {
2019-08-03 15:03:33 +02:00
let { macro, Path, points, paths, complete, paperless, snippets, Snippet, sa } = part.shorthand()
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()
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,
2019-08-03 15:03:33 +02:00
title: 'undersleeve'
})
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,
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,
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
}