1
0
Fork 0
freesewing/designs/hortensia/src/sidepanelreinforcement.js

64 lines
1.7 KiB
JavaScript
Raw Normal View History

import bottomsidepanel from './bottomsidepanel'
export default function (part) {
2021-03-09 17:43:06 +01:00
let { store, Point, Path, points, paths, complete, sa, paperless, macro } = part.shorthand()
2021-01-31 09:22:15 +01:00
const w = store.get('width')
const h = store.get('sidePanelReinforcementHeight')
const sizeRatio = store.get('sizeRatio')
2021-01-31 09:22:15 +01:00
points.topMiddle = new Point(0, 0)
points.topLeft = points.topMiddle.shift(180, w / 2)
points.topRight = points.topMiddle.shift(0, w / 2)
2021-01-31 09:22:15 +01:00
bottomsidepanel(points, points.topMiddle, w, h, sizeRatio)
paths.seam = new Path()
.move(points.topMiddle)
.line(points.topLeft)
.line(points.bottomLeftU)
.curve(points.bottomLeftUcp, points.bottomLeftRcp, points.bottomLeftR)
.line(points.bottomRightL)
.curve(points.bottomRightLcp, points.bottomRightUcp, points.bottomRightU)
.line(points.topRight)
.line(points.topMiddle)
.close()
.attr('class', 'fabric')
// Complete?
if (complete) {
2021-01-31 09:22:15 +01:00
points.title = points.topLeft
.shiftFractionTowards(points.bottomRight, 0.5)
.attr('data-text-class', 'center')
2021-01-31 09:22:15 +01:00
macro('title', {
at: points.title,
nr: 4,
2021-01-31 09:22:15 +01:00
title: 'SidePanelReinforcement',
2021-04-24 10:16:31 +02:00
scale: 0.25,
2021-01-31 09:22:15 +01:00
})
points.__titleNr.attr('data-text-class', 'center')
points.__titleName.attr('data-text-class', 'center')
points.__titlePattern.attr('data-text-class', 'center')
if (sa) {
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
}
}
// Paperless?
if (paperless) {
macro('hd', {
from: points.bottomLeftU,
to: points.bottomRightU,
2021-04-24 10:16:31 +02:00
y: points.bottomLeft.y + sa + 15,
})
macro('vd', {
from: points.bottomRightL,
to: points.topRight,
2021-04-24 10:16:31 +02:00
x: points.topRight.x + sa + 15,
})
}
return part
}