cleanup and introducing a bug
This commit is contained in:
parent
738ca1b89d
commit
4c794e1d86
4 changed files with 217 additions and 422 deletions
|
@ -10,6 +10,8 @@ export const gusset = {
|
||||||
backInsertTopCpAngle: 0,
|
backInsertTopCpAngle: 0,
|
||||||
backInsertGussetCp: 0.2,
|
backInsertGussetCp: 0.2,
|
||||||
frontBulgeLift: 1.75,
|
frontBulgeLift: 1.75,
|
||||||
|
frontBulgeForwardPercentage: 0.125,
|
||||||
|
frontBulgeMiddleShift: 0.65,
|
||||||
buttLift: {
|
buttLift: {
|
||||||
pct: 30,
|
pct: 30,
|
||||||
min: 0,
|
min: 0,
|
||||||
|
@ -39,10 +41,10 @@ export const gusset = {
|
||||||
paths,
|
paths,
|
||||||
Snippet,
|
Snippet,
|
||||||
snippets,
|
snippets,
|
||||||
complete,
|
|
||||||
options,
|
options,
|
||||||
macro,
|
macro,
|
||||||
utils,
|
utils,
|
||||||
|
log,
|
||||||
part,
|
part,
|
||||||
}) => {
|
}) => {
|
||||||
const waistLowering = store.get('waistLowering')
|
const waistLowering = store.get('waistLowering')
|
||||||
|
@ -56,12 +58,6 @@ export const gusset = {
|
||||||
(options.cyclingChamois ? 0.0125 : options.frontBulgeSize) * measurements.crossSeamFront
|
(options.cyclingChamois ? 0.0125 : options.frontBulgeSize) * measurements.crossSeamFront
|
||||||
const backInsertGussetCpAngle = options.cyclingChamois ? 0 : 90 * options.buttLift
|
const backInsertGussetCpAngle = options.cyclingChamois ? 0 : 90 * options.buttLift
|
||||||
|
|
||||||
const RotatePoints = ({ center, angle, pointsArray }) => {
|
|
||||||
pointsArray.forEach((pointName) => {
|
|
||||||
points[pointName] = points[pointName].rotate(angle, center)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
points.backInsertCenterTop = new Point(0, 0)
|
points.backInsertCenterTop = new Point(0, 0)
|
||||||
points.backInsertOutsideGusset = points.backInsertCenterTop
|
points.backInsertOutsideGusset = points.backInsertCenterTop
|
||||||
.shift(
|
.shift(
|
||||||
|
@ -69,7 +65,7 @@ export const gusset = {
|
||||||
measurements.crossSeamBack - measurements.waistToHips - waistLowering - backGussetLength
|
measurements.crossSeamBack - measurements.waistToHips - waistLowering - backGussetLength
|
||||||
)
|
)
|
||||||
.shift(0, gussetWidth)
|
.shift(0, gussetWidth)
|
||||||
points.backInsertCenterGusset = new Point(0, points.backInsertOutsideGusset.y).addCircle(10)
|
points.backInsertCenterGusset = new Point(0, points.backInsertOutsideGusset.y)
|
||||||
|
|
||||||
points.backInsertCenterSeat = points.backInsertCenterTop.shift(
|
points.backInsertCenterSeat = points.backInsertCenterTop.shift(
|
||||||
270,
|
270,
|
||||||
|
@ -113,71 +109,50 @@ export const gusset = {
|
||||||
points.backInsertCenterBottom = points.backInsertOutsideBottom.shift(180, gussetWidth)
|
points.backInsertCenterBottom = points.backInsertOutsideBottom.shift(180, gussetWidth)
|
||||||
|
|
||||||
if (frontBulge) {
|
if (frontBulge) {
|
||||||
const frontLength = store.get('frontLength')
|
const bulgeSplitForward = measurements.crossSeamFront * options.frontBulgeForwardPercentage
|
||||||
|
const frontLength = store.get('frontLength') - bulgeSplitForward
|
||||||
|
const rotateAngle = utils.rad2deg(Math.acos(frontLength / (frontLength + frontBulgeSize))) / 2
|
||||||
|
|
||||||
console.log({ frontBulgeSize: frontBulgeSize })
|
points.frontOutsideSplit = points.backInsertOutsideBottom.shift(270, bulgeSplitForward)
|
||||||
console.log({ frontLength: frontLength })
|
points.frontCenterSplit = points.frontOutsideSplit.shift(180, gussetWidth)
|
||||||
const rotateAngle = utils.rad2deg(Math.acos(frontLength / (frontLength + frontBulgeSize)))
|
points.frontOutside = points.frontOutsideSplit.shift(270 + rotateAngle, frontLength)
|
||||||
const frontCircleCircumference = frontLength * (180 / rotateAngle)
|
|
||||||
const frontCircleRadius = frontCircleCircumference / Math.PI
|
|
||||||
const frontOutsideCircumference = (frontCircleRadius + gussetWidth) * Math.PI
|
|
||||||
const frontOutsideSector = frontOutsideCircumference / (180 / rotateAngle)
|
|
||||||
console.log({
|
|
||||||
rotateAngle: rotateAngle,
|
|
||||||
frontCircleCircumference: frontCircleCircumference,
|
|
||||||
frontCircleRadius: frontCircleRadius,
|
|
||||||
frontOutsideCircumference: frontOutsideCircumference,
|
|
||||||
frontOutsideSector: frontOutsideSector,
|
|
||||||
frontLength: frontLength,
|
|
||||||
frontBulgeSize: frontBulgeSize,
|
|
||||||
frontBulge: frontLength + frontBulgeSize,
|
|
||||||
})
|
|
||||||
|
|
||||||
points.frontOutside = points.backInsertOutsideBottom.shift(270 + rotateAngle, frontLength)
|
const thisCbqc = cbqc * 0.75 //(rotateAngle / 22.5)
|
||||||
|
points.frontOutsideSplitCp1 = points.frontOutsideSplit.shift(270, thisCbqc * frontLength)
|
||||||
const thisCbqc = cbqc * (rotateAngle / 45)
|
|
||||||
points.backInsertOutsideBottomCp1 = points.backInsertOutsideBottom
|
|
||||||
.shift(270, thisCbqc * frontLength)
|
|
||||||
.addCircle(4)
|
|
||||||
.addCircle(6)
|
|
||||||
|
|
||||||
var diff = 0
|
var diff = 0
|
||||||
var iter = 0
|
var iter = 0
|
||||||
do {
|
do {
|
||||||
points.frontOutside = points.frontOutside
|
points.frontOutside = points.frontOutside.shiftTowards(points.frontOutsideSplit, diff)
|
||||||
.shiftTowards(points.backInsertOutsideBottom, diff)
|
points.frontOutsideCp = points.frontOutside.shift(
|
||||||
.addCircle(10)
|
90 + rotateAngle * 2,
|
||||||
points.frontOutsideCp = points.frontOutside
|
thisCbqc * frontLength
|
||||||
.shift(90 + rotateAngle * 2, thisCbqc * frontLength)
|
)
|
||||||
.addCircle(8)
|
|
||||||
paths.frontOutside = new Path()
|
paths.frontOutside = new Path()
|
||||||
.move(points.frontOutside)
|
.move(points.frontOutside)
|
||||||
// .line(points.frontOutside)
|
.curve(points.frontOutsideCp, points.frontOutsideSplitCp1, points.frontOutsideSplit)
|
||||||
.curve(
|
.hide()
|
||||||
points.frontOutsideCp,
|
|
||||||
points.backInsertOutsideBottomCp1,
|
|
||||||
points.backInsertOutsideBottom
|
|
||||||
)
|
|
||||||
|
|
||||||
diff = paths.frontOutside.length() - frontLength
|
diff = paths.frontOutside.length() - frontLength
|
||||||
console.log({ i: iter, d: diff })
|
|
||||||
} while (iter++ < 100 && (diff > 1 || diff < -1))
|
} while (iter++ < 100 && (diff > 1 || diff < -1))
|
||||||
|
if (iter >= 100) {
|
||||||
|
log.info('couldNotFitFrontOutside')
|
||||||
|
}
|
||||||
|
|
||||||
points.frontOutsideHips = paths.frontOutside.shiftAlong(
|
points.frontOutsideHips = paths.frontOutside.shiftAlong(
|
||||||
measurements.waistToHips - waistLowering - waistbandSize
|
measurements.waistToHips - waistLowering - waistbandSize
|
||||||
)
|
)
|
||||||
const frontCenterAngle = points.frontOutside.angle(points.frontOutsideHips) - 90
|
const frontCenterAngle = points.frontOutside.angle(points.frontOutsideHips) - 90
|
||||||
console.log({ frontCenterAngle: frontCenterAngle })
|
console.log({ frontCenterAngle: frontCenterAngle })
|
||||||
points.frontCenter = points.frontOutside
|
points.frontCenterOutside = points.frontOutside.shift(180 + frontCenterAngle, gussetWidth)
|
||||||
.shift(180 + frontCenterAngle, gussetWidth)
|
// .addCircle(5)
|
||||||
.addCircle(5)
|
// .addCircle(10)
|
||||||
.addCircle(10)
|
points.frontCenterHips = points.frontOutsideHips.shift(180 + frontCenterAngle, gussetWidth)
|
||||||
points.frontCenterHips = points.frontOutsideHips
|
// .addCircle(5)
|
||||||
.shift(180 + frontCenterAngle, gussetWidth)
|
// .addCircle(10)
|
||||||
.addCircle(5)
|
|
||||||
.addCircle(10)
|
|
||||||
|
|
||||||
points.backInsertCenterBottom.addCircle(4)
|
points.backInsertCenterBottom
|
||||||
|
//.addCircle(4)
|
||||||
|
|
||||||
const gussetCpLength = points.backInsertCenterGusset.dist(points.backInsertCenterBottom)
|
const gussetCpLength = points.backInsertCenterGusset.dist(points.backInsertCenterBottom)
|
||||||
|
|
||||||
|
@ -186,53 +161,62 @@ export const gusset = {
|
||||||
gussetCpLength * 1
|
gussetCpLength * 1
|
||||||
// gussetCpLength * options.frontBulgeLift
|
// gussetCpLength * options.frontBulgeLift
|
||||||
)
|
)
|
||||||
|
points.frontCenterSplitCp = points.frontCenterSplit.shift(
|
||||||
|
270,
|
||||||
|
gussetCpLength * 1
|
||||||
|
// gussetCpLength * options.frontBulgeLift
|
||||||
|
) //.addCircle(10)
|
||||||
|
|
||||||
points.frontCenterHipsCp9 = paths.frontOutside.shiftAlong(gussetCpLength).addCircle(20)
|
// points.frontCenterHipsCp9 = paths.frontOutside.shiftAlong(gussetCpLength).addCircle(20)
|
||||||
points.frontCenterHipsCp = paths.frontOutside
|
points.frontCenterHipsCp = paths.frontOutside
|
||||||
.shiftAlong(gussetCpLength)
|
.shiftAlong(gussetCpLength)
|
||||||
.shift(180 + frontCenterAngle, gussetWidth)
|
.shift(180 + frontCenterAngle, gussetWidth)
|
||||||
// points.frontCenterHipsCp = points.frontCenterHips.shift(
|
|
||||||
// frontCenterAngle,
|
points.frontCenterMiddle = points.frontCenterHipsCp.shift(
|
||||||
// gussetCpLength * (1 / options.frontBulgeLift)
|
90 + frontCenterAngle,
|
||||||
// )
|
points.frontCenterHipsCp.dist(points.frontCenterSplitCp) * options.frontBulgeMiddleShift
|
||||||
points.frontCenterMiddle = points.frontCenterHipsCp
|
)
|
||||||
.shift(
|
points.frontCenterMiddle = points.frontCenterHipsCp.shiftFractionTowards(
|
||||||
90 + frontCenterAngle,
|
points.frontCenterSplitCp,
|
||||||
points.frontCenterHipsCp.dist(points.backInsertCenterBottomCp) / 2
|
options.frontBulgeMiddleShift
|
||||||
)
|
)
|
||||||
.addCircle(6)
|
|
||||||
|
// .addCircle(3)
|
||||||
|
// .addCircle(6)
|
||||||
|
// .addCircle(9)
|
||||||
|
|
||||||
var diff = 0
|
var diff = 0
|
||||||
var iter = 0
|
var iter = 0
|
||||||
do {
|
do {
|
||||||
points.frontCenterMiddle = points.frontCenterMiddle.shift(
|
points['frontCenterMiddle' + iter] = points.frontCenterMiddle.clone()
|
||||||
180 + frontCenterAngle * 0.5,
|
|
||||||
diff
|
points.frontCenterMiddle = points.frontCenterMiddle.shift(frontCenterAngle * 0.5, diff)
|
||||||
|
// .addCircle(3)
|
||||||
|
// .addCircle(6)
|
||||||
|
// .addCircle(9)
|
||||||
|
points.frontCenterMiddleCp1 = points.frontCenterMiddle.shift(
|
||||||
|
90 + frontCenterAngle * 0.6,
|
||||||
|
gussetCpLength * (1 - options.frontBulgeMiddleShift)
|
||||||
)
|
)
|
||||||
points.frontCenterMiddleCp1 = points.frontCenterMiddle
|
// .addCircle(3)
|
||||||
.shift(90 + frontCenterAngle * 0.6, gussetCpLength * 0.8)
|
|
||||||
.addCircle(3)
|
|
||||||
// points.frontCenterMiddleCp1.x = 0
|
// points.frontCenterMiddleCp1.x = 0
|
||||||
points.frontCenterMiddleCp2 = points.frontCenterMiddle
|
points.frontCenterMiddleCp2 = points.frontCenterMiddle.shift(
|
||||||
.shift(270 + frontCenterAngle * 0.6, gussetCpLength * 0.9)
|
270 + frontCenterAngle * 0.6,
|
||||||
.addCircle(3)
|
gussetCpLength * 0.9
|
||||||
.addCircle(6)
|
)
|
||||||
.addCircle(9)
|
// .addCircle(3)
|
||||||
|
// .addCircle(6)
|
||||||
|
// .addCircle(9)
|
||||||
|
|
||||||
const frontGussetPath = new Path()
|
const frontGussetPath = new Path()
|
||||||
.move(points.frontCenter)
|
.move(points.frontCenterOutside)
|
||||||
.line(points.frontCenterHips)
|
.line(points.frontCenterHips)
|
||||||
.curve(points.frontCenterHipsCp, points.frontCenterMiddleCp2, points.frontCenterMiddle)
|
.curve(points.frontCenterHipsCp, points.frontCenterMiddleCp2, points.frontCenterMiddle)
|
||||||
.curve(
|
.curve(points.frontCenterMiddleCp1, points.frontCenterSplitCp, points.frontCenterSplit)
|
||||||
points.frontCenterMiddleCp1,
|
|
||||||
points.backInsertCenterBottomCp,
|
|
||||||
points.backInsertCenterBottom
|
|
||||||
)
|
|
||||||
|
|
||||||
paths.frontCenterGussetPath = frontGussetPath.clone().addClass('note')
|
|
||||||
|
|
||||||
|
paths['frontCenterGussetPath' + iter] = frontGussetPath.clone().addClass('note')
|
||||||
console.log({ frontGussetPath: frontGussetPath })
|
console.log({ frontGussetPath: frontGussetPath })
|
||||||
diff = frontLength + frontBulgeSize - frontGussetPath.length()
|
diff = frontGussetPath.length() - (frontLength + frontBulgeSize)
|
||||||
|
|
||||||
console.log({
|
console.log({
|
||||||
i: iter,
|
i: iter,
|
||||||
|
@ -240,63 +224,30 @@ export const gusset = {
|
||||||
fl: frontLength + frontBulgeSize,
|
fl: frontLength + frontBulgeSize,
|
||||||
pl: frontGussetPath.length(),
|
pl: frontGussetPath.length(),
|
||||||
})
|
})
|
||||||
} while (iter++ < 1 && (diff > 1 || diff < -1))
|
} while (iter++ < 20 && (diff > 1 || diff < -1))
|
||||||
|
if (iter >= 20) {
|
||||||
|
log.info('couldNotFitFrontGussetPath')
|
||||||
|
}
|
||||||
|
|
||||||
const frontGussetAngle = points.frontCenterMiddle.angle(points.backInsertCenterBottom)
|
const frontGussetAngle = points.frontCenterMiddle.angle(points.backInsertCenterBottom)
|
||||||
console.log({ frontGussetAngle: frontGussetAngle })
|
console.log({ frontGussetAngle: frontGussetAngle })
|
||||||
|
|
||||||
paths.frontBulge = new Path()
|
paths.frontBulge = new Path()
|
||||||
.move(points.backInsertCenterBottom)
|
.move(points.frontCenterSplit)
|
||||||
.curve(
|
.curve(points.frontCenterSplitCp, points.frontCenterMiddleCp1, points.frontCenterMiddle)
|
||||||
points.backInsertCenterBottomCp,
|
|
||||||
points.frontCenterMiddleCp1,
|
|
||||||
points.frontCenterMiddle
|
|
||||||
)
|
|
||||||
.curve(points.frontCenterMiddleCp2, points.frontCenterHipsCp, points.frontCenterHips)
|
.curve(points.frontCenterMiddleCp2, points.frontCenterHipsCp, points.frontCenterHips)
|
||||||
.hide()
|
.hide()
|
||||||
// snippets.front = new Snippet('notch', paths.frontBulge.shiftFractionAlong(0.5))
|
// snippets.front = new Snippet('notch', paths.frontBulge.shiftFractionAlong(0.5))
|
||||||
|
|
||||||
paths.front = new Path()
|
paths.front = new Path()
|
||||||
.move(points.backInsertCenterBottom)
|
.move(points.frontCenterSplit)
|
||||||
.join(paths.frontBulge)
|
.join(paths.frontBulge)
|
||||||
.line(points.frontCenter)
|
.line(points.frontCenterOutside)
|
||||||
.join(paths.frontOutside)
|
.join(paths.frontOutside)
|
||||||
|
.line(points.backInsertOutsideBottom)
|
||||||
.hide()
|
.hide()
|
||||||
|
|
||||||
paths.backGusset = new Path()
|
points.frontCenter = points.frontCenterSplit.clone()
|
||||||
.move(points.backInsertOutsideGusset)
|
|
||||||
.curve(
|
|
||||||
points.backInsertOutsideGussetCp1,
|
|
||||||
points.backInsertCenterTopCp1,
|
|
||||||
points.backInsertCenterTop
|
|
||||||
)
|
|
||||||
|
|
||||||
macro('mirror', {
|
|
||||||
clone: true,
|
|
||||||
mirror: [new Point(0, 1000), new Point(0, -1000)],
|
|
||||||
points: [
|
|
||||||
'backInsertCenterTop',
|
|
||||||
'backInsertCenterBottom',
|
|
||||||
'backInsertCenterTop',
|
|
||||||
'backInsertOutsideGusset',
|
|
||||||
'frontOutside',
|
|
||||||
'backInsertOutsideBottom',
|
|
||||||
],
|
|
||||||
paths: ['front', 'frontBulge', 'backGusset', 'backInsertCircle', 'frontOutside'],
|
|
||||||
prefix: 'mirror',
|
|
||||||
})
|
|
||||||
|
|
||||||
console.log({ Gpoints: JSON.parse(JSON.stringify(points)) })
|
|
||||||
console.log({ Gpaths: JSON.parse(JSON.stringify(paths)) })
|
|
||||||
|
|
||||||
paths.seam = new Path()
|
|
||||||
.move(points.backInsertCenterBottom)
|
|
||||||
.join(paths.front)
|
|
||||||
.line(points.backInsertOutsideGusset)
|
|
||||||
.join(paths.backGusset)
|
|
||||||
.join(paths.mirrorBackGusset.reverse())
|
|
||||||
.line(points.mirrorBackInsertOutsideBottom)
|
|
||||||
.join(paths.mirrorFront.reverse())
|
|
||||||
.close()
|
|
||||||
} else {
|
} else {
|
||||||
const frontGussetAngle = store.get('frontGussetAngle')
|
const frontGussetAngle = store.get('frontGussetAngle')
|
||||||
const frontGussetLength = store.get('frontGussetLength')
|
const frontGussetLength = store.get('frontGussetLength')
|
||||||
|
@ -311,134 +262,76 @@ export const gusset = {
|
||||||
)
|
)
|
||||||
|
|
||||||
paths.front = new Path()
|
paths.front = new Path()
|
||||||
.move(points.backInsertCenterBottom)
|
// .move(points.backInsertCenterBottom)
|
||||||
.line(points.frontCenter)
|
// .line(points.frontCenter)
|
||||||
|
.move(points.frontCenter)
|
||||||
.curve(
|
.curve(
|
||||||
points.frontCenterCp,
|
points.frontCenterCp,
|
||||||
points.backInsertOutsideBottomCp,
|
points.backInsertOutsideBottomCp,
|
||||||
points.backInsertOutsideBottom
|
points.backInsertOutsideBottom
|
||||||
)
|
)
|
||||||
.hide()
|
.hide()
|
||||||
|
|
||||||
paths.backGusset = new Path()
|
|
||||||
.move(points.backInsertOutsideGusset)
|
|
||||||
.curve(
|
|
||||||
points.backInsertOutsideGussetCp1,
|
|
||||||
points.backInsertCenterTopCp1,
|
|
||||||
points.backInsertCenterTop
|
|
||||||
)
|
|
||||||
|
|
||||||
paths.seam = new Path()
|
|
||||||
.move(points.backInsertCenterTop)
|
|
||||||
.line(points.backInsertCenterBottom)
|
|
||||||
.join(paths.front)
|
|
||||||
.line(points.backInsertOutsideGusset)
|
|
||||||
.join(paths.backGusset)
|
|
||||||
.close()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
paths.backGusset = new Path()
|
||||||
|
.move(points.backInsertOutsideGusset)
|
||||||
|
.curve(
|
||||||
|
points.backInsertOutsideGussetCp1,
|
||||||
|
points.backInsertCenterTopCp1,
|
||||||
|
points.backInsertCenterTop
|
||||||
|
)
|
||||||
|
.hide()
|
||||||
|
|
||||||
|
paths.seamSA = new Path()
|
||||||
|
.move(points.frontCenter)
|
||||||
|
.join(paths.front)
|
||||||
|
.line(points.backInsertOutsideGusset)
|
||||||
|
.join(paths.backGusset)
|
||||||
|
.hide()
|
||||||
|
|
||||||
|
paths.seam = new Path()
|
||||||
|
.move(points.backInsertCenterTop)
|
||||||
|
.line(points.frontCenter)
|
||||||
|
.join(paths.seamSA)
|
||||||
|
.close()
|
||||||
|
|
||||||
if (sa) {
|
if (sa) {
|
||||||
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
|
if (frontBulge) {
|
||||||
|
const pathSA = paths.seamSA.offset(sa)
|
||||||
|
paths.saOffset = pathSA.split(pathSA.intersectsX(0)[0])[1].hide()
|
||||||
|
} else {
|
||||||
|
paths.saOffset = paths.seamSA.offset(sa).hide()
|
||||||
|
}
|
||||||
|
paths.sa = new Path()
|
||||||
|
.move(points.frontCenter)
|
||||||
|
.line(points.frontCenter.shift(270, sa))
|
||||||
|
.move(paths.saOffset.start())
|
||||||
|
.join(paths.saOffset)
|
||||||
|
.line(points.backInsertCenterTop.shift(90, sa))
|
||||||
|
.line(points.backInsertCenterTop)
|
||||||
|
.attr('class', 'fabric sa')
|
||||||
}
|
}
|
||||||
|
|
||||||
snippets.circle5 = new Snippet('notch', points.backInsertOutsideBottom)
|
snippets.middle = new Snippet('notch', points.backInsertOutsideBottom)
|
||||||
snippets.circle4 = new Snippet('notch', points.backInsertOutsideGusset)
|
snippets.circle4 = new Snippet('notch', points.backInsertOutsideGusset)
|
||||||
snippets.circle3 = new Snippet('notch', paths.backGusset.shiftFractionAlong(0.25))
|
snippets.circle3 = new Snippet('notch', paths.backGusset.shiftFractionAlong(0.25))
|
||||||
snippets.circle2 = new Snippet('notch', paths.backGusset.shiftFractionAlong(0.5))
|
snippets.circle2 = new Snippet('notch', paths.backGusset.shiftFractionAlong(0.5))
|
||||||
snippets.circle1 = new Snippet('notch', paths.backGusset.shiftFractionAlong(0.75))
|
snippets.circle1 = new Snippet('notch', paths.backGusset.shiftFractionAlong(0.75))
|
||||||
|
snippets.circle0 = new Snippet('notch', points.backInsertCenterTop)
|
||||||
|
|
||||||
|
console.log({ Gpoints: JSON.parse(JSON.stringify(points)) })
|
||||||
|
console.log({ Gpaths: JSON.parse(JSON.stringify(paths)) })
|
||||||
|
|
||||||
console.log({ Gstore: JSON.parse(JSON.stringify(store)) })
|
console.log({ Gstore: JSON.parse(JSON.stringify(store)) })
|
||||||
console.log({ Gmeasurements: JSON.parse(JSON.stringify(measurements)) })
|
console.log({ Gmeasurements: JSON.parse(JSON.stringify(measurements)) })
|
||||||
|
|
||||||
|
macro('cutonfold', {
|
||||||
|
from: points.backInsertCenterTop,
|
||||||
|
to: points.frontCenter,
|
||||||
|
})
|
||||||
|
|
||||||
|
store.cutlist.addCut({ cut: 2, from: 'fabric' })
|
||||||
|
|
||||||
return part
|
return part
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
// if (frontBulge) {
|
|
||||||
// const frontLength = store.get('frontLength')
|
|
||||||
|
|
||||||
// points.frontCenter = points.backInsertCenterBottom.shift(
|
|
||||||
// 270,
|
|
||||||
// measurements.crossSeamFront - waistLowering - waistbandSize
|
|
||||||
// )
|
|
||||||
// points.frontOutside = points.frontCenter.shift(0, gussetWidth)
|
|
||||||
// points.frontOutsideHips = points.frontOutside.shift(
|
|
||||||
// 90,
|
|
||||||
// measurements.waistToHips - waistLowering - waistbandSize
|
|
||||||
// )
|
|
||||||
|
|
||||||
// const gussetCpLength = points.backInsertOutsideGusset.dist(points.backInsertOutsideBottom)
|
|
||||||
|
|
||||||
// points.backInsertOutsideBottomCp = points.backInsertOutsideBottom.shift(
|
|
||||||
// 270,
|
|
||||||
// gussetCpLength * options.frontBulgeLift
|
|
||||||
// )
|
|
||||||
// points.frontOutsideHipsCp = points.frontOutsideHips.shift(
|
|
||||||
// 90,
|
|
||||||
// gussetCpLength * (1 / options.frontBulgeLift)
|
|
||||||
// )
|
|
||||||
// points.frontOutsideMiddle = points.frontOutsideHipsCp.shift(
|
|
||||||
// 90,
|
|
||||||
// points.frontOutsideHipsCp.dist(points.backInsertOutsideBottomCp) / 2
|
|
||||||
// )
|
|
||||||
|
|
||||||
// var diff = 0
|
|
||||||
// var iter = 0
|
|
||||||
// do {
|
|
||||||
// points.frontOutsideMiddle = points.frontOutsideMiddle.shift(0, diff)
|
|
||||||
// points.frontOutsideMiddleCp1 = points.frontOutsideMiddle.shift(90, gussetCpLength)
|
|
||||||
// points.frontOutsideMiddleCp2 = points.frontOutsideMiddle.shift(270, gussetCpLength)
|
|
||||||
|
|
||||||
// const frontGussetPath = new Path()
|
|
||||||
// .move(points.frontOutside)
|
|
||||||
// .line(points.frontOutsideHips)
|
|
||||||
// .curve(points.frontOutsideHipsCp, points.frontOutsideMiddleCp2, points.frontOutsideMiddle)
|
|
||||||
// .curve(
|
|
||||||
// points.frontOutsideMiddleCp1,
|
|
||||||
// points.backInsertOutsideBottomCp,
|
|
||||||
// points.backInsertOutsideBottom
|
|
||||||
// )
|
|
||||||
|
|
||||||
// diff = frontLength + frontBulgeSize - frontGussetPath.length()
|
|
||||||
// } while (iter++ < 3 && (diff > 1 || diff < -1))
|
|
||||||
|
|
||||||
// paths.frontBulge = new Path()
|
|
||||||
// .move(points.frontOutsideHips)
|
|
||||||
// .curve(points.frontOutsideHipsCp, points.frontOutsideMiddleCp2, points.frontOutsideMiddle)
|
|
||||||
// .curve(
|
|
||||||
// points.frontOutsideMiddleCp1,
|
|
||||||
// points.backInsertOutsideBottomCp,
|
|
||||||
// points.backInsertOutsideBottom
|
|
||||||
// )
|
|
||||||
// .hide()
|
|
||||||
// snippets.front = new Snippet('notch', paths.frontBulge.shiftFractionAlong(0.5))
|
|
||||||
|
|
||||||
// paths.front = new Path()
|
|
||||||
// .move(points.backInsertCenterBottom)
|
|
||||||
// .line(points.frontCenter)
|
|
||||||
// .line(points.frontOutside)
|
|
||||||
// .line(points.frontOutsideHips)
|
|
||||||
// .join(paths.frontBulge)
|
|
||||||
// .hide()
|
|
||||||
// } else {
|
|
||||||
// const frontGussetAngle = store.get('frontGussetAngle')
|
|
||||||
// const frontGussetLength = store.get('frontGussetLength')
|
|
||||||
// points.frontCenter = points.backInsertCenterBottom.shift(270, frontGussetLength)
|
|
||||||
// points.frontCenterCp = points.frontCenter.shift(
|
|
||||||
// 90 - frontGussetAngle / 2,
|
|
||||||
// frontGussetLength / 3
|
|
||||||
// )
|
|
||||||
// points.backInsertOutsideBottomCp = points.backInsertOutsideBottom.shift(
|
|
||||||
// 270,
|
|
||||||
// frontGussetLength / 3
|
|
||||||
// )
|
|
||||||
|
|
||||||
// paths.front = new Path()
|
|
||||||
// .move(points.backInsertCenterBottom)
|
|
||||||
// .line(points.frontCenter)
|
|
||||||
// .curve(
|
|
||||||
// points.frontCenterCp,
|
|
||||||
// points.backInsertOutsideBottomCp,
|
|
||||||
// points.backInsertOutsideBottom
|
|
||||||
// )
|
|
||||||
// .hide()
|
|
||||||
// }
|
|
||||||
|
|
|
@ -1,27 +1,9 @@
|
||||||
import { pctBasedOn } from '@freesewing/core'
|
|
||||||
import { shape } from './shape.mjs'
|
import { shape } from './shape.mjs'
|
||||||
|
|
||||||
export const leg = {
|
export const leg = {
|
||||||
name: 'lumira.leg',
|
name: 'lumira.leg',
|
||||||
from: shape,
|
from: shape,
|
||||||
draft: ({
|
draft: ({ store, sa, points, Path, paths, Snippet, snippets, options, macro, part }) => {
|
||||||
measurements,
|
|
||||||
store,
|
|
||||||
sa,
|
|
||||||
Point,
|
|
||||||
points,
|
|
||||||
Path,
|
|
||||||
paths,
|
|
||||||
Snippet,
|
|
||||||
snippets,
|
|
||||||
complete,
|
|
||||||
options,
|
|
||||||
macro,
|
|
||||||
utils,
|
|
||||||
part,
|
|
||||||
}) => {
|
|
||||||
// paths.center = new Path().move(points.centerWaist).line(points.centerAnkle)
|
|
||||||
|
|
||||||
if (options.frontBulge || options.cyclingChamois) {
|
if (options.frontBulge || options.cyclingChamois) {
|
||||||
snippets.front = new Snippet('notch', paths.front.shiftFractionAlong(0.5))
|
snippets.front = new Snippet('notch', paths.front.shiftFractionAlong(0.5))
|
||||||
}
|
}
|
||||||
|
@ -53,13 +35,39 @@ export const leg = {
|
||||||
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
|
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
macro('grainline', {
|
||||||
|
from: points.centerHips,
|
||||||
|
to: points.centerKnee,
|
||||||
|
})
|
||||||
|
|
||||||
|
store.cutlist.addCut({ cut: 2, from: 'fabric' })
|
||||||
|
|
||||||
|
points.gridAnchor = points.centerWaistband.clone()
|
||||||
|
|
||||||
|
points.logo = points.centerUpperLeg.shiftFractionTowards(points.frontWaistband, 0.6)
|
||||||
|
snippets.logo = new Snippet('logo', points.logo)
|
||||||
|
|
||||||
|
points.title = points.centerKnee.shiftFractionTowards(points.frontWaistband, 0.5)
|
||||||
|
macro('title', {
|
||||||
|
at: points.title,
|
||||||
|
nr: 1,
|
||||||
|
title: 'leg',
|
||||||
|
align: 'center',
|
||||||
|
})
|
||||||
|
|
||||||
|
points.scalebox = points.centerSeat
|
||||||
|
.shiftFractionTowards(points.frontWaistband, 0.5)
|
||||||
|
.shiftFractionTowards(points.title, 0.5)
|
||||||
|
macro('scalebox', {
|
||||||
|
at: points.scalebox,
|
||||||
|
})
|
||||||
|
|
||||||
snippets.circle1 = new Snippet('notch', paths.backCircle.shiftFractionAlong(0.25))
|
snippets.circle1 = new Snippet('notch', paths.backCircle.shiftFractionAlong(0.25))
|
||||||
snippets.circle2 = new Snippet('notch', paths.backCircle.shiftFractionAlong(0.5))
|
snippets.circle2 = new Snippet('notch', paths.backCircle.shiftFractionAlong(0.5))
|
||||||
snippets.circle3 = new Snippet('notch', paths.backCircle.shiftFractionAlong(0.75))
|
snippets.circle3 = new Snippet('notch', paths.backCircle.shiftFractionAlong(0.75))
|
||||||
snippets.circle4 = new Snippet('notch', points.backCircleGusset)
|
snippets.circle4 = new Snippet('notch', points.backHips)
|
||||||
snippets.circle5 = new Snippet('notch', points.frontGusset)
|
snippets.circle5 = new Snippet('notch', points.backCircleGusset)
|
||||||
|
snippets.circle6 = new Snippet('notch', points.frontGusset)
|
||||||
console.log({ w: measurements.waist / 2, len: points.backWaist.dist(points.frontWaist) })
|
|
||||||
|
|
||||||
return part
|
return part
|
||||||
},
|
},
|
||||||
|
|
|
@ -24,6 +24,7 @@ export const shape = {
|
||||||
options: {
|
options: {
|
||||||
// Constants
|
// Constants
|
||||||
gussetCompensation: 1.03,
|
gussetCompensation: 1.03,
|
||||||
|
|
||||||
// Booleans
|
// Booleans
|
||||||
frontBulge: {
|
frontBulge: {
|
||||||
bool: false,
|
bool: false,
|
||||||
|
@ -37,7 +38,7 @@ export const shape = {
|
||||||
ease: { pct: -10, min: -30, max: 0, menu: 'fit' },
|
ease: { pct: -10, min: -30, max: 0, menu: 'fit' },
|
||||||
waistLowering: { pct: 35, min: 0, max: 60, menu: 'style' },
|
waistLowering: { pct: 35, min: 0, max: 60, menu: 'style' },
|
||||||
gussetWidth: {
|
gussetWidth: {
|
||||||
pct: 10,
|
pct: 16,
|
||||||
min: 1,
|
min: 1,
|
||||||
max: 30,
|
max: 30,
|
||||||
...pctBasedOn('crossSeamFront'),
|
...pctBasedOn('crossSeamFront'),
|
||||||
|
@ -70,23 +71,7 @@ export const shape = {
|
||||||
menu: (settings, mergedOptions) => (mergedOptions?.waistband ? 'style' : false),
|
menu: (settings, mergedOptions) => (mergedOptions?.waistband ? 'style' : false),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
draft: ({
|
draft: ({ measurements, store, Point, points, Path, paths, options, utils, part }) => {
|
||||||
measurements,
|
|
||||||
store,
|
|
||||||
sa,
|
|
||||||
Point,
|
|
||||||
points,
|
|
||||||
Path,
|
|
||||||
paths,
|
|
||||||
Snippet,
|
|
||||||
snippets,
|
|
||||||
complete,
|
|
||||||
options,
|
|
||||||
macro,
|
|
||||||
utils,
|
|
||||||
part,
|
|
||||||
}) => {
|
|
||||||
let a
|
|
||||||
const cpDistanceDivider = 3.5
|
const cpDistanceDivider = 3.5
|
||||||
const waistLowering = measurements.waistToHips * options.waistLowering
|
const waistLowering = measurements.waistToHips * options.waistLowering
|
||||||
const waistReduction = options.waistband ? measurements.waist * options.waistReduction : 0
|
const waistReduction = options.waistband ? measurements.waist * options.waistReduction : 0
|
||||||
|
@ -109,11 +94,6 @@ export const shape = {
|
||||||
store.set('frontGussetLength', frontGussetLength)
|
store.set('frontGussetLength', frontGussetLength)
|
||||||
|
|
||||||
const ReduceWaist = (pathName, pointName, distance) => {
|
const ReduceWaist = (pathName, pointName, distance) => {
|
||||||
console.log({ pathName: pathName, distance: distance, l: paths[pathName] })
|
|
||||||
console.log({ paths: JSON.parse(JSON.stringify(paths)) })
|
|
||||||
console.log({ points: JSON.parse(JSON.stringify(points)) })
|
|
||||||
console.log({ pn: pathName + 'Waist', p: points[pathName + 'Waist'] })
|
|
||||||
|
|
||||||
const newPoint = paths[pathName].shiftAlong(distance)
|
const newPoint = paths[pathName].shiftAlong(distance)
|
||||||
if (newPoint.sitsRoughlyOn(points[pathName + 'Waist'])) {
|
if (newPoint.sitsRoughlyOn(points[pathName + 'Waist'])) {
|
||||||
return
|
return
|
||||||
|
@ -127,37 +107,41 @@ export const shape = {
|
||||||
}
|
}
|
||||||
paths[pathName] = pTemp[1].hide()
|
paths[pathName] = pTemp[1].hide()
|
||||||
}
|
}
|
||||||
|
|
||||||
const ControlPoints = (p1, p2, p3) => {
|
const ControlPoints = (p1, p2, p3) => {
|
||||||
|
var angle
|
||||||
if (p1 === undefined) {
|
if (p1 === undefined) {
|
||||||
a = p2.angle(p3) + 180
|
angle = p2.angle(p3) + 180
|
||||||
} else if (p3 === undefined) {
|
} else if (p3 === undefined) {
|
||||||
a = p2.angle(p1)
|
angle = p2.angle(p1)
|
||||||
} else {
|
} else {
|
||||||
a = Math.abs(p2.angle(p1) - p2.angle(p3)) / 2
|
angle = Math.abs(p2.angle(p1) - p2.angle(p3)) / 2
|
||||||
}
|
}
|
||||||
// const t1 = p2.shift(p2.angle(p1) + a - 90, p2.dist(p1) / 3)
|
|
||||||
// const t3 = p2.shift(p2.angle(p3) - a + 90, p2.dist(p3) / 3)
|
|
||||||
return {
|
return {
|
||||||
cp1:
|
cp1:
|
||||||
p1 !== undefined
|
|
||||||
? p2.shift(p2.angle(p1) + a - 90, p2.dist(p1) / cpDistanceDivider)
|
|
||||||
: null,
|
|
||||||
cp3:
|
|
||||||
p3 !== undefined
|
p3 !== undefined
|
||||||
? p2.shift(p2.angle(p3) - a + 90, p2.dist(p3) / cpDistanceDivider)
|
? p2.shift(p2.angle(p3) - angle + 90, p2.dist(p3) / cpDistanceDivider)
|
||||||
|
: null,
|
||||||
|
cp2:
|
||||||
|
p1 !== undefined
|
||||||
|
? p2.shift(p2.angle(p1) + angle - 90, p2.dist(p1) / cpDistanceDivider)
|
||||||
: null,
|
: null,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const CreateControlPoints = (names) => {
|
const CreateControlPoints = (names) => {
|
||||||
for (var i = 0; i < names.length; i++) {
|
for (var i = 0; i < names.length; i++) {
|
||||||
var cp = ControlPoints(points[names[i - 1]], points[names[i]], points[names[i + 1]])
|
var cp = ControlPoints(points[names[i - 1]], points[names[i]], points[names[i + 1]])
|
||||||
if (cp.cp1) points[names[i] + 'Cp2'] = cp.cp1
|
if (cp.cp1) points[names[i] + 'Cp1'] = cp.cp1
|
||||||
if (cp.cp3) points[names[i] + 'Cp1'] = cp.cp3
|
if (cp.cp2) points[names[i] + 'Cp2'] = cp.cp2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const ExtendPath = (path, length = 100) => {
|
||||||
|
return new Path()
|
||||||
|
.move(path.shiftAlong(1).shiftOutwards(path.start(), length))
|
||||||
|
.line(path.start())
|
||||||
|
.join(path)
|
||||||
|
.line(path.reverse().shiftAlong(1).shiftOutwards(path.end(), length))
|
||||||
|
}
|
||||||
|
|
||||||
const waistBackFrontRatio = measurements.waistBack / measurements.waistFront
|
|
||||||
const seatBackFrontRatio = measurements.seatBack / measurements.seatFront
|
const seatBackFrontRatio = measurements.seatBack / measurements.seatFront
|
||||||
const crossSeamBackFrontRatio = measurements.crossSeamBack / measurements.crossSeamFront
|
const crossSeamBackFrontRatio = measurements.crossSeamBack / measurements.crossSeamFront
|
||||||
const waistToInseam = measurements.waistToFloor - measurements.inseam
|
const waistToInseam = measurements.waistToFloor - measurements.inseam
|
||||||
|
@ -221,28 +205,9 @@ export const shape = {
|
||||||
measurements.seatFront * 0.5 * ease
|
measurements.seatFront * 0.5 * ease
|
||||||
)
|
)
|
||||||
|
|
||||||
// AdjustUpperLegPoints('front')
|
|
||||||
// AdjustUpperLegPoints('back')
|
|
||||||
CreateControlPoints(['frontWaist', 'frontSeat', 'frontUpperLeg'])
|
CreateControlPoints(['frontWaist', 'frontSeat', 'frontUpperLeg'])
|
||||||
CreateControlPoints(['backWaist', 'backSeat', 'backUpperLeg'])
|
CreateControlPoints(['backWaist', 'backSeat', 'backUpperLeg'])
|
||||||
|
|
||||||
// paths.front = new Path()
|
|
||||||
// .move(points.frontAnkle)
|
|
||||||
// .line(points.frontKnee)
|
|
||||||
// .line(points.frontUpperLeg)
|
|
||||||
// paths.back = new Path().move(points.backAnkle).line(points.backKnee).line(points.backUpperLeg)
|
|
||||||
|
|
||||||
// paths.frontCrotch1 = new Path()
|
|
||||||
// .move(points.frontWaist)
|
|
||||||
// .curve(points.frontWaist, points.frontSeatCp2, points.frontSeat)
|
|
||||||
// .curve(points.frontSeatCp1, points.frontUpperLegCp2, points.frontUpperLeg)
|
|
||||||
// paths.backCrotch1 = new Path()
|
|
||||||
// .move(points.backWaist)
|
|
||||||
// .curve(points.backWaist, points.backSeatCp2, points.backSeat)
|
|
||||||
// .curve(points.backSeatCp1, points.backUpperLegCp2, points.backUpperLeg)
|
|
||||||
|
|
||||||
points.frontUpperLeg1 = points.centerUpperLeg.shift(0, (measurements.upperLeg / 2) * ease)
|
|
||||||
points.backUpperLeg1 = points.centerUpperLeg.shift(180, (measurements.upperLeg / 2) * ease)
|
|
||||||
points.frontUpperLegCp2 = points.frontUpperLeg.shiftFractionTowards(points.centerUpperLeg, 0.5)
|
points.frontUpperLegCp2 = points.frontUpperLeg.shiftFractionTowards(points.centerUpperLeg, 0.5)
|
||||||
points.frontUpperLegCp2Temp = points.frontUpperLeg.shiftFractionTowards(
|
points.frontUpperLegCp2Temp = points.frontUpperLeg.shiftFractionTowards(
|
||||||
points.centerUpperLeg,
|
points.centerUpperLeg,
|
||||||
|
@ -252,40 +217,26 @@ export const shape = {
|
||||||
|
|
||||||
paths.center = new Path().move(points.centerWaist).line(points.centerAnkle).hide()
|
paths.center = new Path().move(points.centerWaist).line(points.centerAnkle).hide()
|
||||||
|
|
||||||
// paths.frontT = new Path()
|
|
||||||
// .move(points.frontWaist)
|
|
||||||
// ._curve(points.frontUpperLegCp2, points.frontUpperLeg1)
|
|
||||||
// paths.backT = new Path()
|
|
||||||
// .move(points.backWaist)
|
|
||||||
// ._curve(points.backUpperLegCp2, points.backUpperLeg1)
|
|
||||||
paths.frontTemp = new Path()
|
|
||||||
.move(points.frontWaist)
|
|
||||||
._curve(points.frontUpperLegCp2Temp, points.frontUpperLeg1)
|
|
||||||
.hide()
|
|
||||||
// .addClass('note')
|
|
||||||
paths.front = new Path()
|
paths.front = new Path()
|
||||||
.move(points.frontWaist)
|
.move(points.frontWaist)
|
||||||
._curve(points.frontUpperLegCp2, points.frontUpperLeg1)
|
._curve(points.frontUpperLegCp2, points.frontUpperLeg)
|
||||||
.hide()
|
.hide()
|
||||||
paths.back = new Path()
|
paths.back = new Path()
|
||||||
.move(points.backWaist)
|
.move(points.backWaist)
|
||||||
._curve(points.backUpperLegCp2, points.backUpperLeg1)
|
._curve(points.backUpperLegCp2, points.backUpperLeg)
|
||||||
.hide()
|
.hide()
|
||||||
|
|
||||||
// paths.front2 = paths.front.clone().unhide()
|
|
||||||
;['center', 'front', 'back'].forEach((prefix) => {
|
;['center', 'front', 'back'].forEach((prefix) => {
|
||||||
ReduceWaist(prefix, 'Waist', waistLowering)
|
ReduceWaist(prefix, 'Waist', waistLowering)
|
||||||
})
|
})
|
||||||
|
|
||||||
points.frontHips = paths.front.shiftAlong(measurements.waistToHips - waistLowering)
|
points.frontHips = paths.front.shiftAlong(measurements.waistToHips - waistLowering)
|
||||||
points.backHips = paths.back.shiftAlong(measurements.waistToHips - waistLowering)
|
points.backHips = paths.back.shiftAlong(measurements.waistToHips - waistLowering)
|
||||||
|
|
||||||
paths.frontTop = paths.front.split(points.frontHips)[0].hide()
|
paths.frontTop = paths.front.split(points.frontHips)[0].hide()
|
||||||
paths.backTop = paths.back.split(points.backHips)[0].hide()
|
paths.backTop = paths.back.split(points.backHips)[0].hide()
|
||||||
;['center', 'front', 'back'].forEach((prefix) => {
|
;['center', 'front', 'back'].forEach((prefix) => {
|
||||||
// points[prefix +'Waist'].addCircle(3)
|
|
||||||
points[prefix + 'Waistband'] = points[prefix + 'Waist'].clone()
|
points[prefix + 'Waistband'] = points[prefix + 'Waist'].clone()
|
||||||
ReduceWaist(prefix, 'Waistband', waistbandSize)
|
ReduceWaist(prefix, 'Waistband', waistbandSize)
|
||||||
// points[prefix +'Waistband'].addCircle(6)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
points.frontWaistbandCp = paths.frontTop.shiftAlong(waistbandSize / 2)
|
points.frontWaistbandCp = paths.frontTop.shiftAlong(waistbandSize / 2)
|
||||||
|
@ -302,23 +253,19 @@ export const shape = {
|
||||||
._curve(points.backWaistbandCp, points.backWaistband)
|
._curve(points.backWaistbandCp, points.backWaistband)
|
||||||
.hide()
|
.hide()
|
||||||
|
|
||||||
// paths.back.unhide()
|
points.frontGusset = points.frontUpperLeg.shiftTowards(points.frontKnee, gussetWidth)
|
||||||
|
points.backGusset = points.backUpperLeg.shiftTowards(points.backKnee, gussetWidth)
|
||||||
|
|
||||||
points.frontGusset = points.frontUpperLeg1.shiftTowards(points.frontKnee, gussetWidth)
|
points.frontGussetJoin = paths.front.reverse().shiftAlong(frontGussetLength)
|
||||||
points.backGusset = points.backUpperLeg1.shiftTowards(points.backKnee, gussetWidth)
|
|
||||||
|
|
||||||
points.frontGussetJoin = paths.front.reverse().shiftAlong(frontGussetLength) //.addCircle(3).addCircle(5)
|
|
||||||
|
|
||||||
if (frontBulge) {
|
if (frontBulge) {
|
||||||
// paths.frontBulge = paths.front.offset(gussetWidth)
|
paths.front = ExtendPath(paths.front.offset(gussetWidth)).hide()
|
||||||
// .addClass('note')
|
|
||||||
// const frontBulgeSize = options.frontBulgeSize *measurements.crossSeamFront
|
|
||||||
|
|
||||||
paths.front = paths.front.offset(gussetWidth).hide()
|
|
||||||
points.frontWaistband = paths.front.intersects(
|
points.frontWaistband = paths.front.intersects(
|
||||||
new Path().move(points.frontWaistband).line(points.centerWaistband)
|
new Path().move(points.frontWaistband).line(points.centerWaistband)
|
||||||
)[0]
|
)[0]
|
||||||
if (false == points.frontWaistband.sitsRoughlyOn(paths.front.ops[0].to)) {
|
|
||||||
|
if (false == points.frontWaistband.sitsRoughlyOn(paths.front.start())) {
|
||||||
console.log({
|
console.log({
|
||||||
pf: paths.front,
|
pf: paths.front,
|
||||||
p: points.frontWaistband,
|
p: points.frontWaistband,
|
||||||
|
@ -326,10 +273,15 @@ export const shape = {
|
||||||
})
|
})
|
||||||
paths.front = paths.front.split(points.frontWaistband)[1].hide()
|
paths.front = paths.front.split(points.frontWaistband)[1].hide()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//////
|
||||||
|
// something goes wrong here
|
||||||
|
//////
|
||||||
|
|
||||||
points.frontGusset = paths.front.intersects(
|
points.frontGusset = paths.front.intersects(
|
||||||
new Path().move(points.frontUpperLeg1).line(points.frontKnee)
|
new Path().move(points.frontUpperLeg).line(points.frontKnee)
|
||||||
)[0]
|
)[0]
|
||||||
if (false == points.frontGusset.sitsRoughlyOn(paths.front.reverse().ops[0].to)) {
|
if (false == points.frontGusset.sitsRoughlyOn(paths.front.end())) {
|
||||||
console.log({
|
console.log({
|
||||||
pf: paths.front,
|
pf: paths.front,
|
||||||
p: points.frontWaistband,
|
p: points.frontWaistband,
|
||||||
|
@ -337,37 +289,8 @@ export const shape = {
|
||||||
})
|
})
|
||||||
paths.front = paths.front.split(points.frontGusset)[0].hide()
|
paths.front = paths.front.split(points.frontGusset)[0].hide()
|
||||||
}
|
}
|
||||||
|
|
||||||
// points.frontGussetCp = points.frontUpperLegCp2.clone()
|
|
||||||
// points.frontWaist = points.frontWaist.shiftTowards(points.backWaist, gussetWidth)
|
|
||||||
// points.frontWaistband = points.frontWaistband.shiftTowards(points.backWaistband, gussetWidth)
|
|
||||||
|
|
||||||
// console.log({
|
|
||||||
// frontGussetCp: points.frontGussetCp,
|
|
||||||
// frontWaistband: points.frontWaistband,
|
|
||||||
// frontGusset: points.frontGusset,
|
|
||||||
// })
|
|
||||||
// var iter = 0
|
|
||||||
// var diff = 0
|
|
||||||
// do {
|
|
||||||
// points.frontGussetCp = points.frontGussetCp.shift(0, diff)
|
|
||||||
// paths.front = new Path()
|
|
||||||
// .move(points.frontWaistband)
|
|
||||||
// ._curve(points.frontGussetCp, points.frontGusset)
|
|
||||||
// .hide()
|
|
||||||
|
|
||||||
// diff = paths.front.length() - ((measurements.crossSeamFront *options.gussetCompensation) - waistLowering - waistbandSize)
|
|
||||||
|
|
||||||
// console.log({
|
|
||||||
// i: iter,
|
|
||||||
// d: diff,
|
|
||||||
// fl: paths.front.length(),
|
|
||||||
// csf: measurements.crossSeamFront - waistLowering,
|
|
||||||
// p: paths.front,
|
|
||||||
// })
|
|
||||||
// } while (iter++ < 50 && (diff > 1 || diff < -1))
|
|
||||||
} else {
|
} else {
|
||||||
points.frontGussetCp = points.frontGusset.shiftFractionTowards(points.centerUpperLeg, 0.1) //.addCircle(3)
|
points.frontGussetCp = points.frontGusset.shiftFractionTowards(points.centerUpperLeg, 0.1)
|
||||||
if (points.frontGussetCp.x < points.frontGussetJoin.x) {
|
if (points.frontGussetCp.x < points.frontGussetJoin.x) {
|
||||||
points.frontGussetCp.x = points.frontGussetJoin.x
|
points.frontGussetCp.x = points.frontGussetJoin.x
|
||||||
}
|
}
|
||||||
|
@ -382,7 +305,7 @@ export const shape = {
|
||||||
const pFrontGussetPoint = pFrontGusset.shiftAlong(1)
|
const pFrontGussetPoint = pFrontGusset.shiftAlong(1)
|
||||||
const pFront = new Path()
|
const pFront = new Path()
|
||||||
.move(points.frontWaist)
|
.move(points.frontWaist)
|
||||||
._curve(points.frontUpperLegCp2, points.frontUpperLeg1)
|
._curve(points.frontUpperLegCp2, points.frontUpperLeg)
|
||||||
.hide()
|
.hide()
|
||||||
const pFrontPoint = pFront.shiftAlong(1)
|
const pFrontPoint = pFront.shiftAlong(1)
|
||||||
if (
|
if (
|
||||||
|
@ -391,9 +314,9 @@ export const shape = {
|
||||||
points.frontGussetJoinCp = points.frontGussetJoin.shift(
|
points.frontGussetJoinCp = points.frontGussetJoin.shift(
|
||||||
pFrontPoint.angle(points.frontGussetJoin),
|
pFrontPoint.angle(points.frontGussetJoin),
|
||||||
frontGussetLength - gussetWidth
|
frontGussetLength - gussetWidth
|
||||||
) //.addCircle(10)
|
)
|
||||||
} else {
|
} else {
|
||||||
points.frontGussetJoinCp = points.frontGussetJoin.clone() //.addCircle(18).addCircle(12)
|
points.frontGussetJoinCp = points.frontGussetJoin.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
paths.frontGusset = new Path()
|
paths.frontGusset = new Path()
|
||||||
|
@ -407,21 +330,12 @@ export const shape = {
|
||||||
)
|
)
|
||||||
store.set('frontGussetAngle', frontGussetAngle * 2)
|
store.set('frontGussetAngle', frontGussetAngle * 2)
|
||||||
|
|
||||||
paths.frontTempGusset = paths.front.offset(gussetWidth).hide()
|
|
||||||
|
|
||||||
paths.front = paths.front.split(points.frontGussetJoin)[0].join(paths.frontGusset).hide()
|
paths.front = paths.front.split(points.frontGussetJoin)[0].join(paths.frontGusset).hide()
|
||||||
}
|
}
|
||||||
store.set('frontLength', paths.front.length())
|
store.set('frontLength', paths.front.length())
|
||||||
;['front', 'back'].forEach((prefix) => {
|
;['front', 'back'].forEach((prefix) => {
|
||||||
CreateControlPoints([prefix + 'UpperLeg', prefix + 'Knee', prefix + 'Ankle'])
|
CreateControlPoints([prefix + 'UpperLeg', prefix + 'Knee', prefix + 'Ankle'])
|
||||||
})
|
})
|
||||||
// paths.frontTemp2 = paths.front.clone().addClass('lining').unhide()
|
|
||||||
|
|
||||||
console.log({
|
|
||||||
fc: measurements.crossSeamFront,
|
|
||||||
pl: paths.front.length() + waistLowering + waistbandSize,
|
|
||||||
plt: paths.frontTemp.length(),
|
|
||||||
})
|
|
||||||
|
|
||||||
paths.backTempGusset = paths.back.offset(-1 * gussetWidth).hide()
|
paths.backTempGusset = paths.back.offset(-1 * gussetWidth).hide()
|
||||||
|
|
||||||
|
@ -436,6 +350,8 @@ export const shape = {
|
||||||
.line(points.frontAnkle)
|
.line(points.frontAnkle)
|
||||||
.hide()
|
.hide()
|
||||||
|
|
||||||
|
store.set('waistLength', paths.waist.length())
|
||||||
|
|
||||||
const backHips = paths.back.shiftFractionAlong(0.99)
|
const backHips = paths.back.shiftFractionAlong(0.99)
|
||||||
const backHipsAngle = points.backHips.angle(backHips) + 90
|
const backHipsAngle = points.backHips.angle(backHips) + 90
|
||||||
|
|
||||||
|
@ -446,13 +362,11 @@ export const shape = {
|
||||||
backHipsAngle,
|
backHipsAngle,
|
||||||
measurements.hips * 0.25 * 0.5 * ease * backGussetWidth
|
measurements.hips * 0.25 * 0.5 * ease * backGussetWidth
|
||||||
)
|
)
|
||||||
// .addCircle(9)
|
|
||||||
|
|
||||||
points.backCircleUpperLegCp1 = points.backUpperLegToHips.shift(
|
points.backCircleUpperLegCp1 = points.backUpperLegToHips.shift(
|
||||||
0,
|
0,
|
||||||
measurements.upperLeg * 0.25 * ease * backGussetWidth
|
measurements.upperLeg * 0.25 * ease * backGussetWidth
|
||||||
)
|
)
|
||||||
// .addCircle(5)
|
|
||||||
|
|
||||||
paths.back = paths.back.split(points.backHips)[0].hide()
|
paths.back = paths.back.split(points.backHips)[0].hide()
|
||||||
|
|
||||||
|
@ -464,11 +378,6 @@ export const shape = {
|
||||||
|
|
||||||
points.backCircleGusset = paths.backTempCircle.intersects(paths.backTempGusset)[1]
|
points.backCircleGusset = paths.backTempCircle.intersects(paths.backTempGusset)[1]
|
||||||
const pathBackGusset = paths.backTempGusset.split(points.backCircleGusset)
|
const pathBackGusset = paths.backTempGusset.split(points.backCircleGusset)
|
||||||
console.log({
|
|
||||||
pathBackGusset: pathBackGusset,
|
|
||||||
t0: undefined === pathBackGusset[0].ops,
|
|
||||||
t1: undefined === pathBackGusset[1].ops,
|
|
||||||
})
|
|
||||||
if (undefined !== pathBackGusset[1].ops) {
|
if (undefined !== pathBackGusset[1].ops) {
|
||||||
paths.backGusset = paths.backTempGusset.split(points.backCircleGusset)[1].hide()
|
paths.backGusset = paths.backTempGusset.split(points.backCircleGusset)[1].hide()
|
||||||
} else {
|
} else {
|
||||||
|
@ -479,20 +388,10 @@ export const shape = {
|
||||||
store.set('backGussetLength', paths.backGusset.length())
|
store.set('backGussetLength', paths.backGusset.length())
|
||||||
store.set('backCircleLength', paths.backCircle.length())
|
store.set('backCircleLength', paths.backCircle.length())
|
||||||
|
|
||||||
points.backCircleIntersect = paths.backCircle.intersects(
|
// console.log({ points: JSON.parse(JSON.stringify(points)) })
|
||||||
new Path().move(points.backSeat).line(points.centerSeat)
|
// console.log({ paths: JSON.parse(JSON.stringify(paths)) })
|
||||||
)[0]
|
// console.log({ store: JSON.parse(JSON.stringify(store)) })
|
||||||
// .addCircle(10)
|
// console.log({ measurements: JSON.parse(JSON.stringify(measurements)) })
|
||||||
console.log({
|
|
||||||
dist: points.backCircleIntersect.dist(points.centerSeat),
|
|
||||||
pct:
|
|
||||||
points.backCircleIntersect.dist(points.centerSeat) /
|
|
||||||
points.backSeat.dist(points.centerSeat),
|
|
||||||
})
|
|
||||||
console.log({ points: JSON.parse(JSON.stringify(points)) })
|
|
||||||
console.log({ paths: JSON.parse(JSON.stringify(paths)) })
|
|
||||||
console.log({ store: JSON.parse(JSON.stringify(store)) })
|
|
||||||
console.log({ measurements: JSON.parse(JSON.stringify(measurements)) })
|
|
||||||
|
|
||||||
return part
|
return part
|
||||||
},
|
},
|
||||||
|
|
|
@ -24,11 +24,12 @@ export const waistband = {
|
||||||
return part.hide()
|
return part.hide()
|
||||||
}
|
}
|
||||||
|
|
||||||
const gussetWidth = store.get('gussetWidth')
|
const waistLength = store.get('waistLength')
|
||||||
const waistbandSize = store.get('waistbandSize')
|
const waistbandSize = store.get('waistbandSize')
|
||||||
|
const gussetWidth = options.frontBulge ? store.get('gussetWidth') : 0
|
||||||
|
|
||||||
const topLength = points.backWaist.dist(points.frontWaist) + gussetWidth
|
const topLength = points.backWaist.dist(points.frontWaist) + gussetWidth
|
||||||
const bottomLength = points.backWaistband.dist(points.frontWaistband) + gussetWidth
|
const bottomLength = waistLength + gussetWidth
|
||||||
const magic1 = 0.35
|
const magic1 = 0.35
|
||||||
|
|
||||||
points.topFront = new Point(Math.min(topLength, bottomLength) / 2, 0)
|
points.topFront = new Point(Math.min(topLength, bottomLength) / 2, 0)
|
||||||
|
@ -103,20 +104,14 @@ export const waistband = {
|
||||||
.line(points.topFront)
|
.line(points.topFront)
|
||||||
.close()
|
.close()
|
||||||
|
|
||||||
// paths.seam = new Path()
|
|
||||||
// .move(points.frontWaist)
|
|
||||||
// .line(points.centerWaist)
|
|
||||||
// .line(points.backWaist)
|
|
||||||
// .join(paths.backTop)
|
|
||||||
// .line(points.centerWaistband)
|
|
||||||
// .line(points.frontWaistband)
|
|
||||||
// .join(paths.frontTop.reverse())
|
|
||||||
// .close()
|
|
||||||
|
|
||||||
if (sa) {
|
if (sa) {
|
||||||
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
|
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
macro('cutonfold', {
|
||||||
|
from: points.bottomFront,
|
||||||
|
to: points.topFront,
|
||||||
|
})
|
||||||
if (gussetWidth > 0) {
|
if (gussetWidth > 0) {
|
||||||
snippets.gusset = new Snippet('notch', paths.bottom.shiftAlong(gussetWidth))
|
snippets.gusset = new Snippet('notch', paths.bottom.shiftAlong(gussetWidth))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue