Skip to content

Commit

Permalink
Merge branch 'develop' into bella-front-side-dart-seam-length
Browse files Browse the repository at this point in the history
  • Loading branch information
joostdecock authored Sep 28, 2024
2 parents ea13f88 + ebf02b0 commit 2e5e25e
Show file tree
Hide file tree
Showing 26 changed files with 337 additions and 136 deletions.
1 change: 1 addition & 0 deletions designs/bee/src/cup.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const cup = {
bustDartCurve: 1,
bustDartLength: 1,
waistDartLength: 1,
waistDartCurve: 1,
backHemSlope: 2.5,
backNeckCutout: 0.06,
bustDartAngle: 0,
Expand Down
4 changes: 4 additions & 0 deletions designs/bella/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@
"t": "Bust dart minimum fabric",
"d": "The minimum amount of side seam above and below the bust dart"
},
"waistDartCurve": {
"t": "Waist dart curve",
"d": "Controls the curvature of the waist dart"
},
"armholeDepth": {
"t": "Armhole depth",
"d": "Controls the depth of the armhole"
Expand Down
2 changes: 2 additions & 0 deletions designs/bella/src/back.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ export const back = {
bustDartAngle: { count: 0, min: -45, max: 45, menu: 'darts' },
bustDartMinimumFabric: { pct: 5, min: 1, max: 50, menu: 'darts' },
waistDartLength: { pct: 90, min: 75, max: 95, menu: 'darts' },
waistDartCurve: { pct: 100, min: -100, max: 100, menu: 'darts' },
waistDartLength: { pct: 90, min: 75, max: 100, menu: 'darts' },

Check failure on line 40 in designs/bella/src/back.mjs

View workflow job for this annotation

GitHub Actions / lint (18.x)

Duplicate key 'waistDartLength'
// Armhole
armholeDepth: { pct: 44, min: 38, max: 46, menu: 'armhole' },
backArmholeCurvature: { pct: 63, min: 50, max: 85, menu: 'armhole' },
Expand Down
99 changes: 66 additions & 33 deletions designs/bella/src/front-side-dart.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,16 @@ export const frontSideDart = {
let reduce = points.cfHem.dist(points.sideHemInitial) - hemLen

// Waist dart
let includeWaistDart = true
if (reduce <= 0) {
includeWaistDart = false
log.info(
'`' +
part.name +
'`: Front waist dart omitted (because the calculated dart' +
' width was 0.0 mm/inches or less).'
)
}
points.waistDartHem = new Point(points.bust.x, points.cfHem.y)
points.waistDartLeft = points.waistDartHem.shift(180, reduce / 2)
points.waistDartRight = points.waistDartHem.shift(0, reduce / 2)
Expand All @@ -188,12 +198,28 @@ export const frontSideDart = {
90,
points.waistDartHem.dist(points.bust) / 2
)

paths.seam = new Path()
.move(points.cfHem)
// Apply option-controlled curvature to waist dart
points.waistDartLeftMid = new Path()
.move(points.bust)
.line(points.waistDartLeft)
.curve_(points.waistDartLeftCp, points.waistDartTip)
._curve(points.waistDartRightCp, points.waistDartRight)
.shiftFractionAlong(0.5)
points.waistDartRightMid = new Path()
.move(points.bust)
.line(points.waistDartRight)
.shiftFractionAlong(0.5)
const waistDartCpWidth =
points.waistDartLeftMid.dist(points.waistDartLeftCp) * options.waistDartCurve
points.waistDartLeftCp.x = points.waistDartLeftMid.x - waistDartCpWidth
points.waistDartRightCp.x = points.waistDartRightMid.x + waistDartCpWidth

paths.seam = new Path().move(points.cfHem)
if (includeWaistDart)
paths.seam
.line(points.waistDartLeft)
.curve_(points.waistDartLeftCp, points.waistDartTip)
._curve(points.waistDartRightCp, points.waistDartRight)
.line(points.waistDartRight)
paths.seam
.line(points.sideHem)
.line(points.bustDartBottom)
._curve(points.bustDartCpBottom, points.bustDartTip)
Expand All @@ -207,10 +233,9 @@ export const frontSideDart = {
.close()
.attr('class', 'fabric')

paths.saBase = new Path()
.move(points.cfHem)
.line(points.waistDartLeft)
.line(points.waistDartRight)
paths.saBase = new Path().move(points.cfHem)
if (includeWaistDart) paths.saBase.line(points.waistDartLeft).line(points.waistDartRight)
paths.saBase
.line(points.sideHem)
.line(points.bustDartBottom)
.line(points.bustDartEdge)
Expand Down Expand Up @@ -269,29 +294,33 @@ export const frontSideDart = {
})

// Dimensions
macro('vd', {
id: 'hCfHemToWaistDartTop',
from: points.cfHem,
to: points.waistDartTip,
x: 0 - 15,
})
let dimensionOffset = 0
if (includeWaistDart) {
dimensionOffset = 15
macro('vd', {
id: 'hCfHemToWaistDartTop',
from: points.cfHem,
to: points.waistDartTip,
x: 0 - 15,
})
}
macro('vd', {
id: 'hCfHemToBustPoint',
from: points.cfHem,
to: points.bust,
x: 0 - 30,
x: 0 - 15 - dimensionOffset,
})
macro('vd', {
id: 'hCfHemToNeckCutout',
from: points.cfHem,
to: points.cfNeck,
x: 0 - 45,
x: 0 - 30 - dimensionOffset,
})
macro('vd', {
id: 'hTotal',
from: points.cfHem,
to: points.hps,
x: 0 - 60,
x: 0 - 45 - dimensionOffset,
})
macro('hd', {
id: 'wCfToWaistDartTip',
Expand All @@ -305,35 +334,39 @@ export const frontSideDart = {
to: points.bustDartTip,
y: points.bust.y - 30,
})
macro('hd', {
id: 'wCfToWaistDartLeft',
from: points.cfHem,
to: points.waistDartLeft,
y: points.cfHem.y + sa + 15,
})
macro('hd', {
id: 'wCfToWaistDartRight',
from: points.cfHem,
to: points.waistDartRight,
y: points.cfHem.y + sa + 30,
})
dimensionOffset = 0
if (includeWaistDart) {
dimensionOffset = 30
macro('hd', {
id: 'wCfToWaistDartLeft',
from: points.cfHem,
to: points.waistDartLeft,
y: points.cfHem.y + sa + 15,
})
macro('hd', {
id: 'wCfToWaistDartRight',
from: points.cfHem,
to: points.waistDartRight,
y: points.cfHem.y + sa + 30,
})
}
macro('hd', {
id: 'wHemTotal',
from: points.cfHem,
to: points.sideHem,
y: points.cfHem.y + sa + 45,
y: points.cfHem.y + sa + 15 + dimensionOffset,
})
macro('hd', {
id: 'wCfHemToBustDartBottom',
from: points.cfHem,
to: points.bustDartBottom,
y: points.cfHem.y + sa + 60,
y: points.cfHem.y + sa + 30 + dimensionOffset,
})
macro('hd', {
id: 'wCfHemToBustDartTop',
from: points.cfHem,
to: points.bustDartTop,
y: points.cfHem.y + sa + 75,
y: points.cfHem.y + sa + 45 + dimensionOffset,
})
macro('vd', {
id: 'hHemRightToBustDartBottom',
Expand Down
3 changes: 2 additions & 1 deletion designs/bent/src/sleeve.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ function draftBentSleeve({ Path, paths, points, store, options, part }) {
let { Point, Path, points, store, options, measurements, utils } = part.shorthand()
// Sleeve frame
points.top = new Point(0, 0)
points.boxTopRight = points.top.shift(0, (store.get('sleevecapTarget') / 5.8) * tweak)
const easedQuarterBiceps = (measurements.biceps / 4) * (1 + options.bicepsEase)
points.boxTopRight = points.top.shift(0, easedQuarterBiceps * tweak)
points.boxTopLeft = points.boxTopRight.flipX()
points.boxBottom = points.top.shift(
-90,
Expand Down
9 changes: 6 additions & 3 deletions designs/cornelius/src/front.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,21 @@ export const front = {
waistAngle -= 180
}

const flyConst = 14
store.set('flyConst',flyConst)

points.flyTop = points.pW.shift(
points.pW.angle(points.pZ) - 180 + waistAngle,
halfInch * flyWidth
flyConst * flyWidth
)
points.flyBottom = points.flyTop.shift(
points.pW.angle(points.pZ),
points.pW.dist(points.pZ) - halfInch * flyWidth
points.pW.dist(points.pZ) - flyConst * flyWidth
)

points.pZcpFB = points.pZ.shift(
points.pW.angle(points.pZ) - waistAngle,
halfInch * flyWidth * cc
flyConst * flyWidth * cc
)
points.pFBcpZ = points.flyBottom.shift(points.pW.angle(points.pZ), halfInch * flyWidth * cc)

Expand Down
4 changes: 2 additions & 2 deletions designs/cornelius/src/zipperguard.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ export const zipperguard = {
draft: ({ Point, Path, points, paths, Snippet, snippets, sa, store, macro, part }) => {
const cc = 0.551915024494 // circle constant

const halfInch = store.get('halfInch')
const flyWidth = store.get('flyWidth') * halfInch
const flyConst = store.get('flyConst')
const flyWidth = store.get('flyWidth') * flyConst
const flyLength = store.get('flyLength')

points.pA = new Point(0, 0)
Expand Down
10 changes: 6 additions & 4 deletions designs/gozer/src/ghost.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@ export const ghost = {
name: 'gozer.ghost',
measurements: ['hpsToWaistBack', 'waistToFloor', 'head'],
draft: ({ measurements, Point, points, Snippet, snippets, sa, macro, part }) => {
const eyeSize = measurements.head * 0.0416
const eyeSize = measurements.head * (1 / 24)
const eyeLine = measurements.head / 2.25
const eyeOffset = measurements.head * (1 / 12.7)
const size =
measurements.hpsToWaistBack + measurements.waistToFloor + measurements.head / Math.PI

points.middle = new Point(0, 0).addCircle(size, 'fabric')

points.eyeLine = points.middle.shift(270, measurements.head / Math.PI / 2)
points.eyeLeft = points.eyeLine.shift(180, measurements.head * 0.13)
points.eyeRight = points.eyeLine.shift(0, measurements.head * 0.13)
points.eyeLine = points.middle.shift(270, eyeLine)
points.eyeLeft = points.eyeLine.shift(180, eyeOffset)
points.eyeRight = points.eyeLine.shift(0, eyeOffset)
points.left = new Point(-1 * size, 0)
points.right = new Point(size, 0)

Expand Down
4 changes: 4 additions & 0 deletions designs/huey/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
"t": "Pocket height",
"d": "Controls the height of the pocket"
},
"pocketOpening": {
"t": "Pocket opening",
"d": "Controls the opening size of the pocket"
},
"hoodHeight": {
"t": "Hood height",
"d": "Controls the height of the hood"
Expand Down
3 changes: 2 additions & 1 deletion designs/huey/src/front.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function draftHueyFront({
points.pocketTopRight = points.pocketCfTop.shift(0, points.hem.x * options.pocketWidth)
points.pocketTip = new Point(
points.pocketTopRight.x * 1.2,
points.pocketTopRight.y + (points.hem.y - points.pocketTopRight.y) * 0.9
points.pocketTopRight.y + (points.hem.y - points.pocketTopRight.y) * options.pocketOpening
)
points.pocketHem = new Point(
points.pocketTopRight.x + points.pocketTopRight.dx(points.pocketTip) / 2,
Expand Down Expand Up @@ -134,6 +134,7 @@ export const front = {
pocket: { bool: true, menu: 'style' },
pocketHeight: { pct: 30, min: 25, max: 35, menu: 'style' },
pocketWidth: { pct: 60, min: 50, max: 70, menu: 'style' },
pocketOpening: { pct: 90, min: 60, max: 90, menu: 'style' },
},
draft: draftHueyFront,
}
1 change: 1 addition & 0 deletions designs/noble/src/options.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const bustDartCurve = 1
export const bustDartLength = 0.9
export const bustDartAngle = 0
export const bustDartMinimumFabric = 0
export const waistDartCurve = 1
// Percentages
export const bustSpanEase = { pct: 0, min: -5, max: 20, ...pctBasedOn('bustSpan'), menu: 'fit' }
export const backHemSlope = { deg: 2.5, min: 0, max: 5, menu: 'advanced' }
Expand Down
4 changes: 2 additions & 2 deletions designs/opal/src/back.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -639,8 +639,8 @@ export const back = {
after: bib,
draft: draftBack,
options: {
// What angle the back bib leaves the outseam at. 0 is horizontal, 90 is vertical.
backBibBaseAngle: { deg: 25, min: 0, max: 90, menu: 'style' },
// What angle the back bib leaves the outseam at. 0 is horizontal, 90 would be vertical.
backBibBaseAngle: { deg: 25, min: 0, max: 85, menu: 'style' },
// How deep to make the curve connecting the top of the outseam with the hexagon of the back bib.
backBibBaseCurve: { pct: 40, min: 0, max: 100, menu: 'style' },
// How high up the hexagon of the back bib is located. 0% refers to the waist, while 100% refers to the HPS.
Expand Down
13 changes: 7 additions & 6 deletions designs/simone/src/fba-front.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ function simoneFbaFront({
* Once drafted, we add the FBA, which is what happens in this file
*/

/*
* Locate bust point
*/
points.bust = new Point(measurements.bustSpan / 2, points.neck.y + measurements.hpsToBust)
points.cfBust = new Point(0, points.bust.y)

/*
* How much room to we need to create to fit the breasts?
* Note that:
Expand All @@ -37,18 +43,13 @@ function simoneFbaFront({
* If the FBA is negative, that means the high bust measurement is higher than the
* front bust. That's not uncommon for people who don't have much breast tissue but
* it generates a negative dart which is confusing and incorrect. So in that case, just
* return the original part from simon
* return the part from Simon without any adjustments.
*/
if (FBA < 0) {
log.info('No FBA required, using unaltered Simon front')
return part
}

/*
* Locate bust point
*/
points.bust = new Point(measurements.bustSpan / 2, points.neck.y + measurements.hpsToBust)

/*
* Figure out how much do we need to open a dart to create the required FBA room
*/
Expand Down
Loading

0 comments on commit 2e5e25e

Please sign in to comment.