1
0
Fork 0

chore(holmes): Port to v3 stage 2

This commit is contained in:
joostdecock 2022-09-11 14:31:50 +02:00
parent 0776ccbd0e
commit 1cd21a38b8
4 changed files with 95 additions and 89 deletions

View file

@ -1,7 +1,6 @@
import { pluginBundle } from '@freesewing/plugin-bundle'
function draftHolmesEar (part) {
let {
function draftHolmesEar({
Point,
points,
Path,
@ -15,8 +14,8 @@ function draftHolmesEar (part) {
paperless,
macro,
absoluteOptions,
} = part.shorthand()
part,
}) {
// Design pattern here
let headCircumference = measurements.head + absoluteOptions.headEase
let earFlapLength = ((options.lengthRatio * headCircumference) / 2) * options.earLength
@ -33,8 +32,7 @@ function draftHolmesEar (part) {
.curve(points.bottomC, points.topC, points.top)
.curve(points.topCFlipped, points.bottomCFlipped, points.bottomFlipped)
.setRender(false)
paths.hemBase = new Path().move(points.bottomFlipped).line(points.bottom)
.setRender(false)
paths.hemBase = new Path().move(points.bottomFlipped).line(points.bottom).setRender(false)
paths.seam = paths.saBase.join(paths.hemBase).close()
// Complete?
if (complete) {
@ -85,13 +83,17 @@ export const ear = {
name: 'holmes.ear',
measurements: ['head'],
options: {
headEase: { pct: 3, min: 0, max: 9,
headEase: {
pct: 3,
min: 0,
max: 9,
snap: {
metric: [6, 13, 19, 25, 32, 38, 44, 50],
imperial: [6.35, 12.7, 19.05, 25.4, 31.75, 38.1, 44.45, 50.8],
},
toAbs: (pct, { measurements }) => measurements.head * pct,
menu: 'fit' },
menu: 'fit',
},
lengthRatio: { pct: 55, min: 40, max: 60, menu: 'style' },
earLength: { pct: 100, min: 80, max: 150, menu: 'style' },
earWidth: { pct: 100, min: 80, max: 150, menu: 'style' },

View file

@ -1,8 +1,7 @@
import { pluginBundle } from '@freesewing/plugin-bundle'
import { pluginGore } from '@freesewing/plugin-gore'
function draftHolmesGore (part) {
let {
function draftHolmesGore({
Point,
points,
Path,
@ -14,10 +13,8 @@ function draftHolmesGore (part) {
sa,
paperless,
absoluteOptions,
} = part.shorthand()
// Design pattern here
part,
}) {
//Radius of the head
let headCircumference = measurements.head + absoluteOptions.headEase
let headRadius = headCircumference / 2 / Math.PI
@ -89,13 +86,17 @@ export const gore = {
name: 'holmes.gore',
measurements: ['head'],
options: {
headEase: { pct: 3, min: 0, max: 9,
headEase: {
pct: 3,
min: 0,
max: 9,
snap: {
metric: [6, 13, 19, 25, 32, 38, 44, 50],
imperial: [6.35, 12.7, 19.05, 25.4, 31.75, 38.1, 44.45, 50.8],
},
toAbs: (pct, { measurements }) => measurements.head * pct,
menu: 'fit' },
menu: 'fit',
},
lengthRatio: { pct: 55, min: 40, max: 60, menu: 'style' },
gores: { count: 6, min: 4, max: 20, menu: 'style' },
},

View file

@ -1,8 +1,7 @@
import { pluginBundle } from '@freesewing/plugin-bundle'
import { pctBasedOn } from '@freesewing/core'
function draftHolmesVisor (part) {
let {
function draftHolmesVisor({
Point,
points,
Path,
@ -14,8 +13,8 @@ function draftHolmesVisor (part) {
paperless,
macro,
absoluteOptions,
} = part.shorthand()
part,
}) {
let headCircumference = measurements.head + absoluteOptions.headEase
let headRadius = headCircumference / 2 / Math.PI
let visorRadius = headRadius / Math.sin((options.visorAngle * Math.PI) / 180)
@ -71,7 +70,8 @@ paths.seam = paths.saOuter.join(paths.saInner).close()
if (sa) {
points.sa1 = new Point(points.in2.x + sa, paths.saInner.offset(sa * 2).start().y)
points.sa2 = points.sa1.flipX(points.in1)
paths.sa = paths.saOuter.offset(sa)
paths.sa = paths.saOuter
.offset(sa)
.line(points.sa1)
.join(paths.saInner.offset(sa * 2))
.line(points.sa2)
@ -105,16 +105,19 @@ export const visor = {
name: 'holmes.visor',
measurements: ['head'],
options: {
headEase: { pct: 3, min: 0, max: 9,
headEase: {
pct: 3,
min: 0,
max: 9,
snap: {
metric: [6, 13, 19, 25, 32, 38, 44, 50],
imperial: [6.35, 12.7, 19.05, 25.4, 31.75, 38.1, 44.45, 50.8],
},
toAbs: (pct, { measurements }) => measurements.head * pct,
menu: 'fit' },
menu: 'fit',
},
visorAngle: { deg: 45, min: 10, max: 90, menu: 'style' },
visorWidth: { pct: 5, min: 1, max: 17, snap: 5, ...pctBasedOn('head'),
menu: 'style' },
visorWidth: { pct: 5, min: 1, max: 17, snap: 5, ...pctBasedOn('head'), menu: 'style' },
visorLength: { pct: 100, min: 80, max: 150, menu: 'advanced' },
},
plugins: [pluginBundle],