start with dimensions
This commit is contained in:
parent
ad37fed4fe
commit
2efcf914f5
7 changed files with 124 additions and 95 deletions
|
@ -24,3 +24,5 @@ export { i18n, Lumina, shape, panel, leg, waistband, pocket }
|
|||
// http://localhost:8000/new/lumina#view=%22inspect%22&settings=%7B%22measurements%22%3A%7B%22waist%22%3A960%2C%22waistBack%22%3A440%2C%22hips%22%3A884%2C%22seat%22%3A980%2C%22seatBack%22%3A490%2C%22inseam%22%3A790%2C%22waistToSeat%22%3A230%2C%22waistToUpperLeg%22%3A280%2C%22waistToKnee%22%3A610%2C%22waistToHips%22%3A120%2C%22waistToFloor%22%3A1090%2C%22knee%22%3A415%2C%22ankle%22%3A230%2C%22crossSeam%22%3A800%2C%22crossSeamFront%22%3A380%2C%22heel%22%3A300%2C%22upperLeg%22%3A640%7D%7D
|
||||
|
||||
// http://localhost:8000/new/lumina#view=%22inspect%22&settings=%7B%22measurements%22%3A%7B%22waist%22%3A780%2C%22waistBack%22%3A360%2C%22hips%22%3A860%2C%22seat%22%3A980%2C%22seatBack%22%3A510%2C%22inseam%22%3A680%2C%22waistToSeat%22%3A200%2C%22waistToUpperLeg%22%3A250%2C%22waistToKnee%22%3A500%2C%22waistToHips%22%3A90%2C%22waistToFloor%22%3A890%2C%22knee%22%3A360%2C%22ankle%22%3A220%2C%22crossSeam%22%3A620%2C%22crossSeamFront%22%3A290%2C%22heel%22%3A280%2C%22upperLeg%22%3A580%7D%2C%22options%22%3A%7B%22length%22%3A1%2C%22waistreduction%22%3A0.1%2C%22waistLowering%22%3A0.012%2C%22waistlowering%22%3A0.181%7D%2C%22units%22%3A%22metric%22%7D
|
||||
|
||||
// Climbing pants http://localhost:8000/new/lumina#view=%22draft%22&settings=%7B%22measurements%22%3A%7B%22waist%22%3A780%2C%22waistBack%22%3A360%2C%22hips%22%3A860%2C%22seat%22%3A980%2C%22seatBack%22%3A510%2C%22inseam%22%3A680%2C%22waistToSeat%22%3A200%2C%22waistToUpperLeg%22%3A250%2C%22waistToKnee%22%3A500%2C%22waistToHips%22%3A90%2C%22waistToFloor%22%3A890%2C%22knee%22%3A360%2C%22ankle%22%3A220%2C%22crossSeam%22%3A620%2C%22crossSeamFront%22%3A290%2C%22heel%22%3A280%2C%22upperLeg%22%3A580%7D%2C%22options%22%3A%7B%22waistreduction%22%3A0%2C%22ease%22%3A0.1%2C%22length%22%3A0.945%2C%22waistband%22%3Afalse%2C%22pocket%22%3Afalse%2C%22waistlowering%22%3A0.2%7D%2C%22sabool%22%3A1%2C%22sa%22%3A10%2C%22samm%22%3A10%7D
|
||||
|
|
|
@ -36,6 +36,11 @@ export const leg = {
|
|||
snippets.back2 = new Snippet('notch', paths.backSplit.shiftFractionAlong(0.5))
|
||||
snippets.back3 = new Snippet('notch', paths.backSplit.shiftFractionAlong(0.75))
|
||||
|
||||
console.log({
|
||||
front: paths.front.length(),
|
||||
back: paths.back.length(),
|
||||
total: paths.front.length() + paths.back.length(),
|
||||
})
|
||||
return part
|
||||
},
|
||||
}
|
||||
|
|
|
@ -5,28 +5,25 @@ export const panel = {
|
|||
from: shape,
|
||||
draft: ({ sa, Point, points, Path, paths, Snippet, snippets, options, macro, store, part }) => {
|
||||
paths.panelWaistband = new Path()
|
||||
.move(points.backPanelWaistband)
|
||||
.line(points.frontPanelWaistband)
|
||||
.addText('top', 'note center')
|
||||
.move(points.frontPanelWaistband)
|
||||
.line(points.backPanelWaistband)
|
||||
.setText('top', 'note center')
|
||||
.setClass('hidden')
|
||||
paths.panelHem = new Path()
|
||||
.move(points.frontPanelHem)
|
||||
.line(points.backPanelHem)
|
||||
.addText('bottom', 'note center')
|
||||
.setClass('hidden')
|
||||
paths.frontPanel.unhide().addText('front', 'note center').setClass('hidden')
|
||||
paths.backPanel = paths.backPanel
|
||||
.reverse()
|
||||
.unhide()
|
||||
.addText('back', 'note center')
|
||||
.move(points.backPanelHem)
|
||||
.line(points.frontPanelHem)
|
||||
.setText('bottom', 'note center')
|
||||
.setClass('hidden')
|
||||
paths.frontPanel.reverse().setText('front', 'note center').setClass('hidden')
|
||||
paths.backPanel = paths.backPanel.unhide().setText('back', 'note center').setClass('hidden')
|
||||
|
||||
paths.seam = new Path()
|
||||
.move(points.frontPanelHem)
|
||||
.join(paths.panelHem)
|
||||
.join(paths.backPanel)
|
||||
.join(paths.panelWaistband)
|
||||
.move(points.backPanelHem)
|
||||
.join(paths.backPanel.reverse())
|
||||
.join(paths.panelWaistband.reverse())
|
||||
.join(paths.frontPanel)
|
||||
.join(paths.panelHem.reverse())
|
||||
.reverse()
|
||||
.close()
|
||||
|
||||
if (sa) paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
|
||||
|
|
|
@ -31,10 +31,6 @@ export const pocket = {
|
|||
store,
|
||||
part,
|
||||
}) => {
|
||||
// const p = store.get('pocket')
|
||||
// paths = p.paths
|
||||
// points = p.points
|
||||
|
||||
if (!options.pocket) {
|
||||
return part.hide()
|
||||
}
|
||||
|
@ -42,20 +38,21 @@ export const pocket = {
|
|||
const pocketDepth = measurements.waistToSeat * options.pocketdepth
|
||||
|
||||
paths.pocketWaistband = new Path()
|
||||
.move(points.backPanelWaistband)
|
||||
.line(points.frontPanelWaistband)
|
||||
.move(points.frontPanelWaistband)
|
||||
.line(points.backPanelWaistband)
|
||||
.addText('top', 'note center')
|
||||
.setClass('hidden')
|
||||
points.frontPocketHem = paths.frontPanel.shiftAlong(pocketDepth)
|
||||
points.backPocketHem = paths.backPanel.shiftAlong(pocketDepth)
|
||||
paths.pocketHem = new Path()
|
||||
.move(points.frontPocketHem)
|
||||
.line(points.backPocketHem)
|
||||
.move(points.backPocketHem)
|
||||
.line(points.frontPocketHem)
|
||||
.addText('bottom', 'note center')
|
||||
.setClass('hidden')
|
||||
const frontPocketSplit = paths.frontPanel.split(points.frontPocketHem)
|
||||
if (frontPocketSplit) {
|
||||
paths.frontPocket = frontPocketSplit[0]
|
||||
.reverse()
|
||||
.unhide()
|
||||
.addText('front', 'note center')
|
||||
.setClass('hidden')
|
||||
|
@ -67,7 +64,6 @@ export const pocket = {
|
|||
if (backPocketSplit) {
|
||||
paths.backPocket = backPocketSplit[0]
|
||||
.unhide()
|
||||
.reverse()
|
||||
.addText('back', 'note center')
|
||||
.setClass('hidden')
|
||||
} else {
|
||||
|
@ -77,11 +73,12 @@ export const pocket = {
|
|||
|
||||
paths.seam = new Path()
|
||||
.move(points.frontPocketHem)
|
||||
.join(paths.pocketHem)
|
||||
.join(paths.backPocket)
|
||||
.join(paths.pocketWaistband)
|
||||
.join(paths.frontPocket)
|
||||
.join(paths.pocketHem.reverse())
|
||||
.join(paths.backPocket.reverse())
|
||||
.join(paths.pocketWaistband.reverse())
|
||||
.join(paths.frontPocket.reverse())
|
||||
.close()
|
||||
.reverse()
|
||||
|
||||
if (sa) paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ export const createPath = (paths, Path, points, pathName, names) => {
|
|||
}
|
||||
|
||||
const lowerWaist = (paths, Path, points, waistLowering, pathName, pointName) => {
|
||||
console.log({ pn: pathName, p: paths[pathName] })
|
||||
// console.log({ pn: pathName, p: paths[pathName] })
|
||||
const newPath = extendPath(Path, paths[pathName], 100, 0)
|
||||
const newWaist = newPath.shiftAlong(waistLowering + 100)
|
||||
if (newWaist.sitsRoughlyOn(points[pathName + pointName])) {
|
||||
|
@ -94,16 +94,16 @@ const createSidePoints = ({
|
|||
let measurement
|
||||
// let width
|
||||
let lastGood = 0
|
||||
console.log({
|
||||
prefix: prefix,
|
||||
postfix: postfix,
|
||||
ratio: ratio,
|
||||
ratioFixed: ratioFixed,
|
||||
ease: ease,
|
||||
waistReduction: waistReduction,
|
||||
distanceCompensation: distanceCompensation,
|
||||
fixedSidePanel: fixedSidePanel,
|
||||
})
|
||||
// console.log({
|
||||
// prefix: prefix,
|
||||
// postfix: postfix,
|
||||
// ratio: ratio,
|
||||
// ratioFixed: ratioFixed,
|
||||
// ease: ease,
|
||||
// waistReduction: waistReduction,
|
||||
// distanceCompensation: distanceCompensation,
|
||||
// fixedSidePanel: fixedSidePanel,
|
||||
// })
|
||||
for (let i = 0; i < names.length; i++) {
|
||||
let distance =
|
||||
measurements['waistTo' + names[lastGood]] -
|
||||
|
@ -259,7 +259,8 @@ export const shape = {
|
|||
kneeToWaistLength: 400,
|
||||
crotchPointsCP: 2,
|
||||
},
|
||||
draft: ({ measurements, options, Point, Path, points, paths, utils, store, part }) => {
|
||||
draft: ({ measurements, options, Point, Path, points, paths, utils, store, units, part }) => {
|
||||
console.log('Shape')
|
||||
const inseam =
|
||||
measurements.inseam > measurements.waistToFloor - measurements.waistToUpperLeg
|
||||
? measurements.waistToFloor - measurements.waistToUpperLeg
|
||||
|
@ -448,7 +449,7 @@ export const shape = {
|
|||
;['front', 'back'].forEach((prefix) => {
|
||||
;['Waist', 'Waistband', 'Seat', 'UpperLeg', 'Knee', 'Ankle'].forEach((name) => {
|
||||
points[prefix + 'Panel' + name] = points['middle' + name].shift(
|
||||
prefix == 'front' ? 180 : 0,
|
||||
prefix == 'front' ? 0 : 180,
|
||||
points[prefix + 'Side' + name].dist(points[prefix + 'Split' + name])
|
||||
)
|
||||
})
|
||||
|
@ -582,6 +583,21 @@ export const shape = {
|
|||
store.set('waistbandFrontLength', paths.frontWaistband.length())
|
||||
store.set('waistbandPanelLength', points.frontPanelWaistband.dist(points.backPanelWaistband))
|
||||
|
||||
store.flag.note({
|
||||
msg: `lumina:dimensions`,
|
||||
replace: {
|
||||
waistbandlength: units(
|
||||
(store.get('waistbandBackLength') +
|
||||
store.get('waistbandFrontLength') +
|
||||
store.get('waistbandPanelLength')) *
|
||||
2
|
||||
),
|
||||
length: units(
|
||||
store.get('waistbandSize') + points.frontPanelWaistband.dist(points.frontPanelHem)
|
||||
),
|
||||
},
|
||||
})
|
||||
|
||||
return part.hide()
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,52 +0,0 @@
|
|||
import { ipoints } from './ipoints.mjs'
|
||||
|
||||
export const side = {
|
||||
name: 'lumina.ipoints',
|
||||
after: ipoints,
|
||||
measurements: [
|
||||
'waist',
|
||||
'waistBack',
|
||||
'hips',
|
||||
'seat',
|
||||
'seatBack',
|
||||
'inseam',
|
||||
'waistToSeat',
|
||||
'waistToUpperLeg',
|
||||
'waistToKnee',
|
||||
'waistToHips',
|
||||
'waistToFloor',
|
||||
'knee',
|
||||
'ankle',
|
||||
'crossSeam',
|
||||
'crossSeamFront',
|
||||
'heel',
|
||||
'upperLeg',
|
||||
],
|
||||
options: {
|
||||
size: { pct: 50, min: 10, max: 100, menu: 'fit' },
|
||||
crossSeamAngle: 25,
|
||||
crotchToKnee: 0.5,
|
||||
waistToKneeCP: 0.4,
|
||||
kneeToWaistLength: 400,
|
||||
},
|
||||
draft: ({
|
||||
measurements,
|
||||
options,
|
||||
Point,
|
||||
Path,
|
||||
points,
|
||||
paths,
|
||||
Snippet,
|
||||
snippets,
|
||||
utils,
|
||||
log,
|
||||
complete,
|
||||
sa,
|
||||
paperless,
|
||||
macro,
|
||||
part,
|
||||
}) => {
|
||||
points.sideWaist = new Point(0, 0)
|
||||
points.sideWaistFront = points.sideWaist.shift()
|
||||
},
|
||||
}
|
|
@ -22,7 +22,6 @@ export const waistband = {
|
|||
if (false === options.waistband) {
|
||||
return part.hide()
|
||||
}
|
||||
|
||||
const waistLength = store.get('waistLength')
|
||||
const waistbandBackLength = store.get('waistbandBackLength')
|
||||
const waistbandFrontLength = store.get('waistbandFrontLength')
|
||||
|
@ -104,6 +103,23 @@ export const waistband = {
|
|||
.join(paths.waistband.reverse())
|
||||
}
|
||||
|
||||
paths.front = new Path()
|
||||
.move(points.waistbandFront)
|
||||
.line(points.waistFront)
|
||||
.setText('front', 'note center')
|
||||
.setClass('hidden')
|
||||
paths.back = new Path()
|
||||
.move(points.waistBack)
|
||||
.line(points.waistbandBack)
|
||||
.setText('back', 'note center')
|
||||
.setClass('hidden')
|
||||
|
||||
macro('cutonfold', {
|
||||
from: points.waistbandFront,
|
||||
to: points.waistFront,
|
||||
})
|
||||
store.cutlist.addCut({ cut: 2, from: 'fabric', onFold: true })
|
||||
|
||||
paths.seamSA = new Path()
|
||||
.move(points.waistFront)
|
||||
.join(paths.waist.reverse())
|
||||
|
@ -123,6 +139,54 @@ export const waistband = {
|
|||
.attr('class', 'fabric sa')
|
||||
}
|
||||
|
||||
let top = paths.waist.edge('top')
|
||||
if (top.y == points.waistFront.y) {
|
||||
top = paths.waist.edge('bottom')
|
||||
}
|
||||
let bottom = paths.waistband.edge('bottom')
|
||||
if (bottom.y == points.waistbandFront.y) {
|
||||
bottom = paths.waistband.edge('top')
|
||||
}
|
||||
|
||||
macro('hd', {
|
||||
id: 'top',
|
||||
from: points.waistBack,
|
||||
to: points.waistFront,
|
||||
y: Math.min(points.waistFront.y, top.y) - sa - 15,
|
||||
})
|
||||
macro('hd', {
|
||||
id: 'bottom',
|
||||
from: points.waistbandBack,
|
||||
to: points.waistbandFront,
|
||||
y: Math.max(points.waistbandFront.y, bottom.y) + sa + 15,
|
||||
})
|
||||
macro('vd', {
|
||||
id: 'top',
|
||||
from: points.waistBack,
|
||||
to: top,
|
||||
x: top.x - 15,
|
||||
noStartMarker: true,
|
||||
noEndMarker: true,
|
||||
})
|
||||
macro('vd', {
|
||||
id: 'bottom',
|
||||
from: points.waistFront,
|
||||
to: bottom,
|
||||
x: top.x + 15,
|
||||
})
|
||||
macro('ld', {
|
||||
id: 'front',
|
||||
from: points.waistFront,
|
||||
to: points.waistbandFront,
|
||||
d: 15,
|
||||
})
|
||||
macro('ld', {
|
||||
id: 'back',
|
||||
from: points.waistBack,
|
||||
to: points.waistbandBack,
|
||||
d: -15,
|
||||
})
|
||||
|
||||
return part
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue