2020-06-28 12:27:34 +02:00
|
|
|
export default function (part) {
|
2019-08-03 15:03:33 +02:00
|
|
|
let { Point, points, Path, paths, measurements, options } = part.shorthand()
|
2019-05-30 21:19:06 +02:00
|
|
|
|
2020-06-28 12:27:34 +02:00
|
|
|
let width = measurements.head * options.widthRatio
|
|
|
|
let length = measurements.head * options.lengthRatio
|
2019-05-30 21:19:06 +02:00
|
|
|
|
2019-08-03 15:03:33 +02:00
|
|
|
points.topLeft = new Point(width / -2, points.top.y - (width / 2 - points.right.x))
|
|
|
|
points.topRight = points.topLeft.shift(0, width)
|
|
|
|
points.bottomLeft = points.topLeft.shift(-90, length)
|
|
|
|
points.bottomRight = points.topRight.shift(-90, length)
|
2019-05-30 21:19:06 +02:00
|
|
|
|
|
|
|
paths.rect = new Path()
|
|
|
|
.move(points.topLeft)
|
|
|
|
.line(points.bottomLeft)
|
|
|
|
.line(points.bottomRight)
|
|
|
|
.line(points.topRight)
|
|
|
|
.line(points.topLeft)
|
2019-08-03 15:03:33 +02:00
|
|
|
.close()
|
2019-05-30 21:19:06 +02:00
|
|
|
|
2019-08-03 15:03:33 +02:00
|
|
|
return part
|
2019-05-30 21:19:06 +02:00
|
|
|
}
|