chore(titan): Ported to v3
This commit is contained in:
parent
e40b385309
commit
64f69daf84
4 changed files with 79 additions and 97 deletions
|
@ -1,79 +0,0 @@
|
||||||
import configHelpers from '@freesewing/config-helpers'
|
|
||||||
import pkg from '../package.json' assert { type: 'json' }
|
|
||||||
|
|
||||||
const { version } = pkg
|
|
||||||
const { elastics, pctBasedOn } = configHelpers
|
|
||||||
|
|
||||||
export default {
|
|
||||||
version,
|
|
||||||
name: 'titan',
|
|
||||||
design: ['Debra Bean', 'Joost De Cock'],
|
|
||||||
code: 'Joost De Cock',
|
|
||||||
department: 'bottoms',
|
|
||||||
type: 'block',
|
|
||||||
difficulty: 3,
|
|
||||||
optionGroups: {
|
|
||||||
fit: ['seatEase', 'kneeEase', 'waistEase'],
|
|
||||||
style: ['waistHeight', 'fitKnee', 'lengthBonus', 'crotchDrop'],
|
|
||||||
advanced: [
|
|
||||||
'crossSeamCurveStart',
|
|
||||||
'crossSeamCurveBend',
|
|
||||||
'crossSeamCurveAngle',
|
|
||||||
'crotchSeamCurveStart',
|
|
||||||
'crotchSeamCurveBend',
|
|
||||||
'crotchSeamCurveAngle',
|
|
||||||
'grainlinePosition',
|
|
||||||
'legBalance',
|
|
||||||
'waistBalance',
|
|
||||||
'waistbandWidth',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
measurements: [
|
|
||||||
'crossSeam',
|
|
||||||
'crossSeamFront',
|
|
||||||
'knee',
|
|
||||||
'seat',
|
|
||||||
'seatBack',
|
|
||||||
'waist',
|
|
||||||
'waistBack',
|
|
||||||
'waistToFloor',
|
|
||||||
'waistToKnee',
|
|
||||||
'waistToHips',
|
|
||||||
'waistToSeat',
|
|
||||||
'waistToUpperLeg',
|
|
||||||
],
|
|
||||||
dependencies: {
|
|
||||||
front: 'back',
|
|
||||||
},
|
|
||||||
options: {
|
|
||||||
// Constants
|
|
||||||
titanPaperless: true,
|
|
||||||
fitCrossSeam: true,
|
|
||||||
fitCrossSeamFront: true,
|
|
||||||
fitCrossSeamBack: true,
|
|
||||||
fitGuides: true,
|
|
||||||
|
|
||||||
// Fit
|
|
||||||
waistEase: { pct: 2, min: 0, max: 10 },
|
|
||||||
seatEase: { pct: 2, min: 0, max: 10 },
|
|
||||||
kneeEase: { pct: 6, min: 1, max: 25 },
|
|
||||||
|
|
||||||
// Style
|
|
||||||
waistHeight: { pct: 100, min: 0, max: 100 },
|
|
||||||
lengthBonus: { pct: 2, min: -20, max: 10 },
|
|
||||||
crotchDrop: { pct: 2, min: 0, max: 15 },
|
|
||||||
fitKnee: { bool: false },
|
|
||||||
|
|
||||||
// Advanced
|
|
||||||
legBalance: { pct: 57.5, min: 52.5, max: 62.5 },
|
|
||||||
crossSeamCurveStart: { pct: 85, min: 60, max: 100 },
|
|
||||||
crossSeamCurveBend: { pct: 65, min: 45, max: 85 },
|
|
||||||
crossSeamCurveAngle: { deg: 12, min: 0, max: 20 },
|
|
||||||
crotchSeamCurveStart: { pct: 80, min: 60, max: 95 },
|
|
||||||
crotchSeamCurveBend: { pct: 80, min: 45, max: 100 },
|
|
||||||
crotchSeamCurveAngle: { deg: 25, min: 0, max: 35 },
|
|
||||||
waistBalance: { pct: 60, min: 30, max: 90 },
|
|
||||||
grainlinePosition: { pct: 45, min: 30, max: 60 },
|
|
||||||
waistbandWidth: { pct: 3, min: 1, max: 6, snap: elastics, ...pctBasedOn('waistToFloor') },
|
|
||||||
},
|
|
||||||
}
|
|
|
@ -1,4 +1,8 @@
|
||||||
export default (part) => {
|
import { pctBasedOn } from '@freesewing/core'
|
||||||
|
import { elastics } from '@freesewing/snapseries'
|
||||||
|
import { pluginBundle } from '@freesewing/plugin-bundle'
|
||||||
|
|
||||||
|
function titanBack(part) {
|
||||||
/*
|
/*
|
||||||
* Helper method to draw the inseam path
|
* Helper method to draw the inseam path
|
||||||
*/
|
*/
|
||||||
|
@ -492,3 +496,58 @@ export default (part) => {
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const back = {
|
||||||
|
name: 'titan.back',
|
||||||
|
plugins: [pluginBundle],
|
||||||
|
measurements: [
|
||||||
|
'crossSeam',
|
||||||
|
'crossSeamFront',
|
||||||
|
'knee',
|
||||||
|
'seat',
|
||||||
|
'seatBack',
|
||||||
|
'waist',
|
||||||
|
'waistBack',
|
||||||
|
'waistToFloor',
|
||||||
|
'waistToKnee',
|
||||||
|
'waistToHips',
|
||||||
|
'waistToSeat',
|
||||||
|
'waistToUpperLeg',
|
||||||
|
],
|
||||||
|
options: {
|
||||||
|
// Constants
|
||||||
|
titanPaperless: true,
|
||||||
|
fitCrossSeam: true,
|
||||||
|
fitCrossSeamFront: true,
|
||||||
|
fitCrossSeamBack: true,
|
||||||
|
fitGuides: true,
|
||||||
|
// Fit
|
||||||
|
waistEase: { pct: 2, min: 0, max: 10, menu: 'fit' },
|
||||||
|
seatEase: { pct: 2, min: 0, max: 10, menu: 'fit' },
|
||||||
|
kneeEase: { pct: 6, min: 1, max: 25, menu: 'fit' },
|
||||||
|
// Style
|
||||||
|
waistHeight: { pct: 100, min: 0, max: 100, menu: 'style' },
|
||||||
|
lengthBonus: { pct: 2, min: -20, max: 10, menu: 'style' },
|
||||||
|
crotchDrop: { pct: 2, min: 0, max: 15, menu: 'style' },
|
||||||
|
fitKnee: { bool: false, menu: 'style' },
|
||||||
|
// Advanced
|
||||||
|
legBalance: { pct: 57.5, min: 52.5, max: 62.5, menu: 'advanced' },
|
||||||
|
crossSeamCurveStart: { pct: 85, min: 60, max: 100, menu: 'advanced' },
|
||||||
|
crossSeamCurveBend: { pct: 65, min: 45, max: 85, menu: 'advanced' },
|
||||||
|
crossSeamCurveAngle: { deg: 12, min: 0, max: 20, menu: 'advanced' },
|
||||||
|
crotchSeamCurveStart: { pct: 80, min: 60, max: 95, menu: 'advanced' },
|
||||||
|
crotchSeamCurveBend: { pct: 80, min: 45, max: 100, menu: 'advanced' },
|
||||||
|
crotchSeamCurveAngle: { deg: 25, min: 0, max: 35, menu: 'advanced' },
|
||||||
|
waistBalance: { pct: 60, min: 30, max: 90, menu: 'advanced' },
|
||||||
|
grainlinePosition: { pct: 45, min: 30, max: 60, menu: 'advanced' },
|
||||||
|
waistbandWidth: {
|
||||||
|
pct: 3,
|
||||||
|
min: 1,
|
||||||
|
max: 6,
|
||||||
|
snap: elastics,
|
||||||
|
...pctBasedOn('waistToFloor'),
|
||||||
|
menu: 'advanced',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
draft: titanBack,
|
||||||
|
}
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
export default (part) => {
|
import { back } from './back.mjs'
|
||||||
|
|
||||||
|
function titanFront(part) {
|
||||||
/*
|
/*
|
||||||
* Helper method to draw the inseam path
|
* Helper method to draw the inseam path
|
||||||
*/
|
*/
|
||||||
|
@ -563,3 +565,9 @@ export default (part) => {
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const front = {
|
||||||
|
name: 'titan.front',
|
||||||
|
after: back,
|
||||||
|
draft: titanFront,
|
||||||
|
}
|
||||||
|
|
|
@ -1,19 +1,13 @@
|
||||||
import freesewing from '@freesewing/core'
|
import { Design } from '@freesewing/core'
|
||||||
import plugins from '@freesewing/plugin-bundle'
|
import { data } from '../data.mjs'
|
||||||
import config from '../config'
|
import { back } from './back.mjs'
|
||||||
// Parts
|
import { front } from './front.mjs'
|
||||||
import draftBack from './back'
|
|
||||||
import draftFront from './front'
|
|
||||||
|
|
||||||
// Create design
|
// Setup our new design
|
||||||
const Titan = new freesewing.Design(config, plugins)
|
const Titan = new Design({
|
||||||
|
data,
|
||||||
// Attach draft methods to prototype
|
parts: [back, front],
|
||||||
Titan.prototype.draftBack = (part) => draftBack(part)
|
})
|
||||||
Titan.prototype.draftFront = (part) => draftFront(part)
|
|
||||||
|
|
||||||
// Named exports
|
// Named exports
|
||||||
export { config, Titan }
|
export { back, front, Titan }
|
||||||
|
|
||||||
// Default export
|
|
||||||
export default Titan
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue