1
0
Fork 0

chore(cornelius): Port to v3 stage 2

This commit is contained in:
joostdecock 2022-09-11 14:02:00 +02:00
parent a47eb1a42b
commit 9131c3496d
10 changed files with 139 additions and 72 deletions

View file

@ -175,10 +175,20 @@ function rotateDistanceForP4(part, point, distance, center, origin) {
}
}
function draftCorneliusBack (part) {
let { options, Path, points, paths, Snippet, snippets, complete, sa, store, paperless, macro } =
part.shorthand()
function draftCorneliusBack({
options,
Path,
points,
paths,
Snippet,
snippets,
complete,
sa,
store,
paperless,
macro,
part,
}) {
let tempP = null
let waist = store.get('waist')

View file

@ -1,10 +1,20 @@
import { pluginBundle } from '@freesewing/plugin-bundle'
import { frontpoints } from './frontpoints.mjs'
function draftCorneliusFront (part) {
let { options, Path, points, paths, Snippet, snippets, complete, sa, store, paperless, macro } =
part.shorthand()
function draftCorneliusFront({
options,
Path,
points,
paths,
Snippet,
snippets,
complete,
sa,
store,
paperless,
macro,
part,
}) {
const cc = 0.551915024494 // circle constant
let halfInch = store.get('halfInch')
@ -246,6 +256,6 @@ export const front = {
pctKtoRup: 0.25,
pctKtoH: 0.7,
},
plugins: [ pluginBundle ],
plugins: [pluginBundle],
draft: draftCorneliusFront,
}

View file

@ -1,6 +1,14 @@
function draftCorneliusFrontpoints (part) {
let { options, measurements, Point, Path, points, paths, store, raise } = part.shorthand()
function draftCorneliusFrontpoints({
options,
measurements,
Point,
Path,
points,
paths,
store,
raise,
part,
}) {
let halfInch = measurements.waistToKnee / 48
let inseam = measurements.inseam - (measurements.waistToFloor - measurements.waistToKnee)

View file

@ -15,16 +15,19 @@ import { zipperguard } from './zipperguard.mjs'
// Create new design
const Cornelius = new Design({
data,
parts: [
front, back, legband, legbandKeystone, waistband, pocketFacing,
pocket, zipperguard,
]
parts: [front, back, legband, legbandKeystone, waistband, pocketFacing, pocket, zipperguard],
})
// Named exports
export {
front, back, legband, legbandKeystone, waistband, pocketFacing,
pocket, zipperguard,
front,
back,
legband,
legbandKeystone,
waistband,
pocketFacing,
pocket,
zipperguard,
frontpoints,
Cornelius,
}

View file

@ -25,22 +25,21 @@ function findR(part, height, arcLength) {
return a * (180 / Math.PI)
}
function draftCorneliusLegband (part) {
let {
options,
Point,
Path,
points,
paths,
Snippet,
snippets,
complete,
sa,
store,
paperless,
macro,
} = part.shorthand()
function draftCorneliusLegband({
options,
Point,
Path,
points,
paths,
Snippet,
snippets,
complete,
sa,
store,
paperless,
macro,
part,
}) {
if (options.cuffStyle == 'keystone') {
return part
}
@ -193,12 +192,11 @@ function draftCorneliusLegband (part) {
export const legband = {
name: 'cornelius.legband',
after: [ back, front ],
after: [back, front],
options: {
kneeToBelow: { pct: 94, min: 85, max: 110, menu: 'advanced' },
cuffWidth: { pct: 0, min: -50, max: 150, menu: 'style' },
cuffStyle: { dflt: 'elegant',
list: ['traditional', 'elegant', 'keystone'], menu: 'style' },
cuffStyle: { dflt: 'elegant', list: ['traditional', 'elegant', 'keystone'], menu: 'style' },
},
draft: draftCorneliusLegband,
}

View file

@ -1,23 +1,22 @@
import { front } from './front.mjs'
import { back } from './back.mjs'
function draftCorneliusLegbandKeystone (part) {
let {
options,
measurements,
Point,
Path,
points,
paths,
Snippet,
snippets,
complete,
sa,
store,
paperless,
macro,
} = part.shorthand()
function draftCorneliusLegbandKeystone({
options,
measurements,
Point,
Path,
points,
paths,
Snippet,
snippets,
complete,
sa,
store,
paperless,
macro,
part,
}) {
if (options.cuffStyle != 'keystone') {
return part
}
@ -182,6 +181,6 @@ function draftCorneliusLegbandKeystone (part) {
export const legbandKeystone = {
name: 'cornelius.legbandKeystone',
after: [ back, front ],
after: [back, front],
draft: draftCorneliusLegbandKeystone,
}

View file

@ -1,9 +1,18 @@
import { frontpoints } from './frontpoints.mjs'
function draftCorneliusPocket (part) {
let { Path, points, paths, Snippet, snippets, complete, sa, store, paperless, macro } =
part.shorthand()
function draftCorneliusPocket({
Path,
points,
paths,
Snippet,
snippets,
complete,
sa,
store,
paperless,
macro,
part,
}) {
let halfInch = store.get('halfInch')
paths.waistSeam = paths.waistSeam.split(points.pocketFacingTL)[0].setRender(false)

View file

@ -1,9 +1,19 @@
import { frontpoints } from './frontpoints.mjs'
function draftCorneliusPocketFacing (part) {
let { Path, Point, points, paths, Snippet, snippets, complete, sa, store, paperless, macro } =
part.shorthand()
function draftCorneliusPocketFacing({
Path,
Point,
points,
paths,
Snippet,
snippets,
complete,
sa,
store,
paperless,
macro,
part,
}) {
let halfInch = store.get('halfInch')
let waist = store.get('waist')

View file

@ -1,10 +1,20 @@
import { front } from './front.mjs'
import { back } from './back.mjs'
function draftCorneliusWaistband (part) {
let { Point, Path, points, paths, Snippet, snippets, complete, sa, store, paperless, macro } =
part.shorthand()
function draftCorneliusWaistband({
Point,
Path,
points,
paths,
Snippet,
snippets,
complete,
sa,
store,
paperless,
macro,
part,
}) {
let halfInch = store.get('halfInch')
let waistLength = store.get('frontWaistLength') + store.get('backWaistLength')
let flyWidth = store.get('flyWidth')
@ -77,6 +87,6 @@ function draftCorneliusWaistband (part) {
export const waistband = {
name: 'cornelius.waistband',
after: [ back, front ],
after: [back, front],
draft: draftCorneliusWaistband,
}

View file

@ -1,9 +1,19 @@
import { front } from './front.mjs'
function draftCorneliusZipperguard (part) {
let { Point, Path, points, paths, Snippet, snippets, complete, sa, store, paperless, macro } =
part.shorthand()
function draftCorneliusZipperguard({
Point,
Path,
points,
paths,
Snippet,
snippets,
complete,
sa,
store,
paperless,
macro,
part,
}) {
const cc = 0.551915024494 // circle constant
let halfInch = store.get('halfInch')