chore(teagan): Ported to v3
This commit is contained in:
parent
cdac5589c0
commit
3e8c23a2ce
5 changed files with 64 additions and 106 deletions
|
@ -1,60 +0,0 @@
|
||||||
import { config as brianConfig } from '@freesewing/brian'
|
|
||||||
import pkg from '../package.json' assert { type: 'json' }
|
|
||||||
|
|
||||||
const { version } = pkg
|
|
||||||
|
|
||||||
const config = {
|
|
||||||
version,
|
|
||||||
name: 'teagan',
|
|
||||||
design: 'Joost De Cock',
|
|
||||||
code: 'Joost De Cock',
|
|
||||||
department: 'tops',
|
|
||||||
type: 'pattern',
|
|
||||||
difficulty: 2,
|
|
||||||
optionGroups: {
|
|
||||||
fit: ['chestEase', 'hipsEase', 'sleeveEase', 'draftForHighBust'],
|
|
||||||
style: ['necklineWidth', 'necklineDepth', 'necklineBend', 'lengthBonus', 'sleeveLength'],
|
|
||||||
advanced: brianConfig.optionGroups.advanced,
|
|
||||||
},
|
|
||||||
measurements: [...brianConfig.measurements, 'hips', 'waist'],
|
|
||||||
optionalMeasurements: ['highBust'],
|
|
||||||
dependencies: {
|
|
||||||
front: 'base',
|
|
||||||
back: 'front',
|
|
||||||
sleevecap: 'back',
|
|
||||||
sleeve: 'sleevecap',
|
|
||||||
},
|
|
||||||
inject: {
|
|
||||||
front: 'base',
|
|
||||||
back: 'front',
|
|
||||||
sleeve: 'sleevecap',
|
|
||||||
},
|
|
||||||
hide: ['base', 'sleevecap'],
|
|
||||||
options: {
|
|
||||||
...brianConfig.options,
|
|
||||||
|
|
||||||
// Constants
|
|
||||||
bicepsEase: 0.05,
|
|
||||||
shoulderEase: 0,
|
|
||||||
collarEase: 0,
|
|
||||||
shoulderSlopeReduction: 0,
|
|
||||||
sleeveWidthGuarantee: 0.85,
|
|
||||||
frontArmholeDeeper: 0.005,
|
|
||||||
|
|
||||||
// Brian overrides
|
|
||||||
chestEase: { pct: 12, min: 5, max: 25 },
|
|
||||||
sleeveLength: { pct: 30, min: 20, max: 100 },
|
|
||||||
lengthBonus: { pct: 5, min: -20, max: 60 },
|
|
||||||
backNeckCutout: { pct: 8, min: 4, max: 12 },
|
|
||||||
|
|
||||||
// Teagan specific
|
|
||||||
draftForHighBust: { bool: false },
|
|
||||||
hipsEase: { pct: 18, min: 8, max: 30 },
|
|
||||||
sleeveEase: { pct: 15, min: 5, max: 35 },
|
|
||||||
necklineDepth: { pct: 25, min: 20, max: 40 },
|
|
||||||
necklineWidth: { pct: 30, min: 10, max: 50 },
|
|
||||||
necklineBend: { pct: 30, min: 0, max: 70 },
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
export default config
|
|
|
@ -1,5 +1,7 @@
|
||||||
export default function (part) {
|
import { front } from './front.mjs'
|
||||||
let {
|
|
||||||
|
function teaganBack(part) {
|
||||||
|
const {
|
||||||
store,
|
store,
|
||||||
sa,
|
sa,
|
||||||
Point,
|
Point,
|
||||||
|
@ -88,3 +90,9 @@ export default function (part) {
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const back = {
|
||||||
|
name: 'teagan.back',
|
||||||
|
from: front,
|
||||||
|
draft: teaganBack,
|
||||||
|
}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
export default function (part) {
|
import { base } from '@freesewing/brian'
|
||||||
let {
|
|
||||||
|
function teaganFront(part) {
|
||||||
|
const {
|
||||||
utils,
|
utils,
|
||||||
store,
|
store,
|
||||||
sa,
|
sa,
|
||||||
|
@ -160,3 +162,29 @@ export default function (part) {
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const front = {
|
||||||
|
name: 'teagan.front',
|
||||||
|
from: base,
|
||||||
|
measurements: ['hips', 'waist'],
|
||||||
|
options: {
|
||||||
|
bicepsEase: 0.05,
|
||||||
|
shoulderEase: 0,
|
||||||
|
collarEase: 0,
|
||||||
|
shoulderSlopeReduction: 0,
|
||||||
|
sleeveWidthGuarantee: 0.85,
|
||||||
|
frontArmholeDeeper: 0.005,
|
||||||
|
// Brian overrides
|
||||||
|
chestEase: { pct: 12, min: 5, max: 25, menu: 'fit' },
|
||||||
|
sleeveLength: { pct: 30, min: 20, max: 100, menu: 'fit' },
|
||||||
|
lengthBonus: { pct: 5, min: -20, max: 60, menu: 'style' },
|
||||||
|
backNeckCutout: { pct: 8, min: 4, max: 12, menu: 'fit' },
|
||||||
|
// Teagan specific
|
||||||
|
draftForHighBust: { bool: false, menu: 'fit' },
|
||||||
|
hipsEase: { pct: 18, min: 8, max: 30, menu: 'fit' },
|
||||||
|
necklineDepth: { pct: 25, min: 20, max: 40, menu: 'style' },
|
||||||
|
necklineWidth: { pct: 30, min: 10, max: 50, menu: 'style' },
|
||||||
|
necklineBend: { pct: 30, min: 0, max: 70, menu: 'style' },
|
||||||
|
},
|
||||||
|
draft: teaganFront,
|
||||||
|
}
|
||||||
|
|
|
@ -1,43 +1,14 @@
|
||||||
import freesewing from '@freesewing/core'
|
import { Design } from '@freesewing/core'
|
||||||
import Brian from '@freesewing/brian'
|
import { data } from '../data.mjs'
|
||||||
import plugins from '@freesewing/plugin-bundle'
|
import { back } from './back.mjs'
|
||||||
import plugin from '@freesewing/plugin-bust' // Note: conditional plugin
|
import { front } from './front.mjs'
|
||||||
import config from '../config'
|
import { sleeve } from './sleeve.mjs'
|
||||||
// Parts
|
|
||||||
import draftBack from './back'
|
|
||||||
import draftFront from './front'
|
|
||||||
import draftSleeve from './sleeve'
|
|
||||||
|
|
||||||
/* Check to see whether we should load the bust plugin
|
// Setup our new design
|
||||||
* Only of the `draftForHighBust` options is set
|
const Teagan = new Design({
|
||||||
* AND the highBust measurement is available
|
data,
|
||||||
*/
|
parts: [back, front, sleeve],
|
||||||
const condition = (settings = false) =>
|
})
|
||||||
settings &&
|
|
||||||
settings.options &&
|
|
||||||
settings.options.draftForHighBust &&
|
|
||||||
settings.measurements.highBust
|
|
||||||
? true
|
|
||||||
: false
|
|
||||||
|
|
||||||
// Create design
|
|
||||||
const Teagan = new freesewing.Design(config, plugins, { plugin, condition })
|
|
||||||
|
|
||||||
// Attach draft methods to prototype
|
|
||||||
Teagan.prototype.draftBase = function (part) {
|
|
||||||
// Getting the base part from Brian
|
|
||||||
return new Brian(this.settings).draftBase(part)
|
|
||||||
}
|
|
||||||
Teagan.prototype.draftSleevecap = function (part) {
|
|
||||||
// Getting the sleevecap part from Brian
|
|
||||||
return new Brian(this.settings).draftSleevecap(part)
|
|
||||||
}
|
|
||||||
Teagan.prototype.draftFront = (part) => draftFront(part)
|
|
||||||
Teagan.prototype.draftBack = (part) => draftBack(part)
|
|
||||||
Teagan.prototype.draftSleeve = (part) => draftSleeve(part)
|
|
||||||
|
|
||||||
// Named exports
|
// Named exports
|
||||||
export { config, Teagan }
|
export { back, front, sleeve, Teagan }
|
||||||
|
|
||||||
// Default export
|
|
||||||
export default Teagan
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
export default function (part) {
|
import { sleevecap } from '@freesewing/brian'
|
||||||
let { sa, Point, points, Path, paths, options, complete, paperless, macro, measurements } =
|
|
||||||
|
function teaganSleeve(part) {
|
||||||
|
const { sa, Point, points, Path, paths, options, complete, paperless, macro, measurements } =
|
||||||
part.shorthand()
|
part.shorthand()
|
||||||
|
|
||||||
let height = points.bicepsRight.x * options.sleeveLength
|
let height = points.bicepsRight.x * options.sleeveLength
|
||||||
|
@ -81,3 +83,12 @@ export default function (part) {
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const sleeve = {
|
||||||
|
name: 'teagan.sleeve',
|
||||||
|
from: sleevecap,
|
||||||
|
options: {
|
||||||
|
sleeveEase: { pct: 15, min: 5, max: 35, menu: 'style' },
|
||||||
|
},
|
||||||
|
draft: teaganSleeve,
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue