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) { function draftCorneliusBack({
let { options, Path, points, paths, Snippet, snippets, complete, sa, store, paperless, macro } = options,
part.shorthand() Path,
points,
paths,
Snippet,
snippets,
complete,
sa,
store,
paperless,
macro,
part,
}) {
let tempP = null let tempP = null
let waist = store.get('waist') let waist = store.get('waist')

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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