1
0
Fork 0

start with dimensions

This commit is contained in:
woutervdub 2024-01-06 18:07:53 +00:00
parent ad37fed4fe
commit 2efcf914f5
7 changed files with 124 additions and 95 deletions

View file

@ -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%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 // 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

View file

@ -36,6 +36,11 @@ export const leg = {
snippets.back2 = new Snippet('notch', paths.backSplit.shiftFractionAlong(0.5)) snippets.back2 = new Snippet('notch', paths.backSplit.shiftFractionAlong(0.5))
snippets.back3 = new Snippet('notch', paths.backSplit.shiftFractionAlong(0.75)) 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 return part
}, },
} }

View file

@ -5,28 +5,25 @@ export const panel = {
from: shape, from: shape,
draft: ({ sa, Point, points, Path, paths, Snippet, snippets, options, macro, store, part }) => { draft: ({ sa, Point, points, Path, paths, Snippet, snippets, options, macro, store, part }) => {
paths.panelWaistband = new Path() paths.panelWaistband = new Path()
.move(points.backPanelWaistband) .move(points.frontPanelWaistband)
.line(points.frontPanelWaistband) .line(points.backPanelWaistband)
.addText('top', 'note center') .setText('top', 'note center')
.setClass('hidden') .setClass('hidden')
paths.panelHem = new Path() paths.panelHem = new Path()
.move(points.frontPanelHem) .move(points.backPanelHem)
.line(points.backPanelHem) .line(points.frontPanelHem)
.addText('bottom', 'note center') .setText('bottom', 'note center')
.setClass('hidden')
paths.frontPanel.unhide().addText('front', 'note center').setClass('hidden')
paths.backPanel = paths.backPanel
.reverse()
.unhide()
.addText('back', 'note center')
.setClass('hidden') .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() paths.seam = new Path()
.move(points.frontPanelHem) .move(points.backPanelHem)
.join(paths.panelHem) .join(paths.backPanel.reverse())
.join(paths.backPanel) .join(paths.panelWaistband.reverse())
.join(paths.panelWaistband)
.join(paths.frontPanel) .join(paths.frontPanel)
.join(paths.panelHem.reverse())
.reverse()
.close() .close()
if (sa) paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') if (sa) paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')

View file

@ -31,10 +31,6 @@ export const pocket = {
store, store,
part, part,
}) => { }) => {
// const p = store.get('pocket')
// paths = p.paths
// points = p.points
if (!options.pocket) { if (!options.pocket) {
return part.hide() return part.hide()
} }
@ -42,20 +38,21 @@ export const pocket = {
const pocketDepth = measurements.waistToSeat * options.pocketdepth const pocketDepth = measurements.waistToSeat * options.pocketdepth
paths.pocketWaistband = new Path() paths.pocketWaistband = new Path()
.move(points.backPanelWaistband) .move(points.frontPanelWaistband)
.line(points.frontPanelWaistband) .line(points.backPanelWaistband)
.addText('top', 'note center') .addText('top', 'note center')
.setClass('hidden') .setClass('hidden')
points.frontPocketHem = paths.frontPanel.shiftAlong(pocketDepth) points.frontPocketHem = paths.frontPanel.shiftAlong(pocketDepth)
points.backPocketHem = paths.backPanel.shiftAlong(pocketDepth) points.backPocketHem = paths.backPanel.shiftAlong(pocketDepth)
paths.pocketHem = new Path() paths.pocketHem = new Path()
.move(points.frontPocketHem) .move(points.backPocketHem)
.line(points.backPocketHem) .line(points.frontPocketHem)
.addText('bottom', 'note center') .addText('bottom', 'note center')
.setClass('hidden') .setClass('hidden')
const frontPocketSplit = paths.frontPanel.split(points.frontPocketHem) const frontPocketSplit = paths.frontPanel.split(points.frontPocketHem)
if (frontPocketSplit) { if (frontPocketSplit) {
paths.frontPocket = frontPocketSplit[0] paths.frontPocket = frontPocketSplit[0]
.reverse()
.unhide() .unhide()
.addText('front', 'note center') .addText('front', 'note center')
.setClass('hidden') .setClass('hidden')
@ -67,7 +64,6 @@ export const pocket = {
if (backPocketSplit) { if (backPocketSplit) {
paths.backPocket = backPocketSplit[0] paths.backPocket = backPocketSplit[0]
.unhide() .unhide()
.reverse()
.addText('back', 'note center') .addText('back', 'note center')
.setClass('hidden') .setClass('hidden')
} else { } else {
@ -77,11 +73,12 @@ export const pocket = {
paths.seam = new Path() paths.seam = new Path()
.move(points.frontPocketHem) .move(points.frontPocketHem)
.join(paths.pocketHem) .join(paths.pocketHem.reverse())
.join(paths.backPocket) .join(paths.backPocket.reverse())
.join(paths.pocketWaistband) .join(paths.pocketWaistband.reverse())
.join(paths.frontPocket) .join(paths.frontPocket.reverse())
.close() .close()
.reverse()
if (sa) paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') if (sa) paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')

View file

@ -15,7 +15,7 @@ export const createPath = (paths, Path, points, pathName, names) => {
} }
const lowerWaist = (paths, Path, points, waistLowering, pathName, pointName) => { 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 newPath = extendPath(Path, paths[pathName], 100, 0)
const newWaist = newPath.shiftAlong(waistLowering + 100) const newWaist = newPath.shiftAlong(waistLowering + 100)
if (newWaist.sitsRoughlyOn(points[pathName + pointName])) { if (newWaist.sitsRoughlyOn(points[pathName + pointName])) {
@ -94,16 +94,16 @@ const createSidePoints = ({
let measurement let measurement
// let width // let width
let lastGood = 0 let lastGood = 0
console.log({ // console.log({
prefix: prefix, // prefix: prefix,
postfix: postfix, // postfix: postfix,
ratio: ratio, // ratio: ratio,
ratioFixed: ratioFixed, // ratioFixed: ratioFixed,
ease: ease, // ease: ease,
waistReduction: waistReduction, // waistReduction: waistReduction,
distanceCompensation: distanceCompensation, // distanceCompensation: distanceCompensation,
fixedSidePanel: fixedSidePanel, // fixedSidePanel: fixedSidePanel,
}) // })
for (let i = 0; i < names.length; i++) { for (let i = 0; i < names.length; i++) {
let distance = let distance =
measurements['waistTo' + names[lastGood]] - measurements['waistTo' + names[lastGood]] -
@ -259,7 +259,8 @@ export const shape = {
kneeToWaistLength: 400, kneeToWaistLength: 400,
crotchPointsCP: 2, 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 = const inseam =
measurements.inseam > measurements.waistToFloor - measurements.waistToUpperLeg measurements.inseam > measurements.waistToFloor - measurements.waistToUpperLeg
? measurements.waistToFloor - measurements.waistToUpperLeg ? measurements.waistToFloor - measurements.waistToUpperLeg
@ -448,7 +449,7 @@ export const shape = {
;['front', 'back'].forEach((prefix) => { ;['front', 'back'].forEach((prefix) => {
;['Waist', 'Waistband', 'Seat', 'UpperLeg', 'Knee', 'Ankle'].forEach((name) => { ;['Waist', 'Waistband', 'Seat', 'UpperLeg', 'Knee', 'Ankle'].forEach((name) => {
points[prefix + 'Panel' + name] = points['middle' + name].shift( 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]) points[prefix + 'Side' + name].dist(points[prefix + 'Split' + name])
) )
}) })
@ -582,6 +583,21 @@ export const shape = {
store.set('waistbandFrontLength', paths.frontWaistband.length()) store.set('waistbandFrontLength', paths.frontWaistband.length())
store.set('waistbandPanelLength', points.frontPanelWaistband.dist(points.backPanelWaistband)) 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() return part.hide()
}, },
} }

View file

@ -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()
},
}

View file

@ -22,7 +22,6 @@ export const waistband = {
if (false === options.waistband) { if (false === options.waistband) {
return part.hide() return part.hide()
} }
const waistLength = store.get('waistLength') const waistLength = store.get('waistLength')
const waistbandBackLength = store.get('waistbandBackLength') const waistbandBackLength = store.get('waistbandBackLength')
const waistbandFrontLength = store.get('waistbandFrontLength') const waistbandFrontLength = store.get('waistbandFrontLength')
@ -104,6 +103,23 @@ export const waistband = {
.join(paths.waistband.reverse()) .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() paths.seamSA = new Path()
.move(points.waistFront) .move(points.waistFront)
.join(paths.waist.reverse()) .join(paths.waist.reverse())
@ -123,6 +139,54 @@ export const waistband = {
.attr('class', 'fabric sa') .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 return part
}, },
} }