2023-10-17 14:34:11 +00:00
|
|
|
import { cbqc } from '@freesewing/core'
|
|
|
|
|
2023-10-16 04:56:56 +00:00
|
|
|
export const ghost = {
|
|
|
|
name: 'gozer.ghost',
|
|
|
|
measurements: ['hpsToWaistBack', 'waistToFloor', 'head'],
|
|
|
|
draft: ({ measurements, Point, Path, points, paths, Snippet, snippets, sa, macro, part }) => {
|
|
|
|
const eyeSize = measurements.head * 0.0416
|
|
|
|
const size =
|
|
|
|
measurements.hpsToWaistBack + measurements.waistToFloor + measurements.head / Math.PI
|
|
|
|
|
|
|
|
points.middle = new Point(0, 0)
|
|
|
|
points.eyeLine = points.middle.shift(270, measurements.head / Math.PI / 2)
|
|
|
|
points.eyeLeft = points.eyeLine.shift(180, measurements.head * 0.13)
|
|
|
|
points.eyeRight = points.eyeLine.shift(0, measurements.head * 0.13)
|
|
|
|
points.top = new Point(0, -1 * size)
|
|
|
|
points.left = new Point(-1 * size, 0)
|
|
|
|
points.right = new Point(size, 0)
|
|
|
|
points.bottom = new Point(0, size)
|
2023-10-17 14:37:59 +00:00
|
|
|
points.topCp1 = points.top.shift(180, size * cbqc)
|
|
|
|
points.topCp2 = points.top.shift(0, size * cbqc)
|
|
|
|
points.leftCp1 = points.left.shift(270, size * cbqc)
|
|
|
|
points.leftCp2 = points.left.shift(90, size * cbqc)
|
|
|
|
points.bottomCp1 = points.bottom.shift(0, size * cbqc)
|
|
|
|
points.bottomCp2 = points.bottom.shift(180, size * cbqc)
|
|
|
|
points.rightCp1 = points.right.shift(90, size * cbqc)
|
|
|
|
points.rightCp2 = points.right.shift(270, size * cbqc)
|
2023-10-16 04:56:56 +00:00
|
|
|
|
2023-10-17 14:34:11 +00:00
|
|
|
points.eyeLeft.addCircle(eyeSize)
|
|
|
|
points.eyeRight.addCircle(eyeSize)
|
2023-10-16 04:56:56 +00:00
|
|
|
|
|
|
|
paths.seam = new Path()
|
|
|
|
.move(points.top)
|
|
|
|
.curve(points.topCp1, points.leftCp2, points.left)
|
|
|
|
.curve(points.leftCp1, points.bottomCp2, points.bottom)
|
|
|
|
.curve(points.bottomCp1, points.rightCp2, points.right)
|
|
|
|
.curve(points.rightCp1, points.topCp2, points.top)
|
|
|
|
.close()
|
2023-10-17 14:37:59 +00:00
|
|
|
.addClass('fabric')
|
2023-10-16 04:56:56 +00:00
|
|
|
|
|
|
|
points.title = points.middle.shiftFractionTowards(points.bottom, 0.65)
|
|
|
|
macro('title', {
|
|
|
|
nr: 1,
|
|
|
|
at: points.title,
|
|
|
|
title: 'Gozer',
|
|
|
|
align: 'center',
|
|
|
|
})
|
|
|
|
points.logo = points.middle.shiftFractionTowards(points.bottom, 0.5)
|
|
|
|
snippets.logo = new Snippet('logo', points.logo)
|
|
|
|
|
|
|
|
if (sa) {
|
2023-10-17 14:37:59 +00:00
|
|
|
paths.sa = paths.seam.offset(sa).addClass('fabric sa')
|
2023-10-16 04:56:56 +00:00
|
|
|
}
|
|
|
|
|
2023-10-17 14:34:11 +00:00
|
|
|
macro('hd', {
|
|
|
|
from: points.left,
|
|
|
|
to: points.right,
|
|
|
|
id: 'width',
|
|
|
|
y: points.right.y,
|
|
|
|
})
|
|
|
|
macro('hd', {
|
|
|
|
from: points.eyeLeft,
|
|
|
|
to: points.middle,
|
|
|
|
id: 'eye',
|
|
|
|
y: points.eyeLeft.y,
|
|
|
|
})
|
|
|
|
macro('vd', {
|
|
|
|
from: points.eyeLeft,
|
|
|
|
to: points.middle,
|
|
|
|
id: 'eye',
|
|
|
|
x: points.eyeLeft.x,
|
|
|
|
})
|
|
|
|
|
2023-10-16 04:56:56 +00:00
|
|
|
return part
|
|
|
|
},
|
|
|
|
}
|