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')

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,8 +25,7 @@ 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,
@ -39,8 +38,8 @@ function draftCorneliusLegband (part) {
store, store,
paperless, paperless,
macro, macro,
} = part.shorthand() part,
}) {
if (options.cuffStyle == 'keystone') { if (options.cuffStyle == 'keystone') {
return part return part
} }
@ -197,8 +196,7 @@ export const legband = {
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,8 +1,7 @@
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,
@ -16,8 +15,8 @@ function draftCorneliusLegbandKeystone (part) {
store, store,
paperless, paperless,
macro, macro,
} = part.shorthand() part,
}) {
if (options.cuffStyle != 'keystone') { if (options.cuffStyle != 'keystone') {
return part return part
} }

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')

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')