chore(sven): Prepare for v3 beta
This commit is contained in:
parent
0becde35af
commit
f3026d6466
7 changed files with 265 additions and 189 deletions
|
@ -342,7 +342,7 @@
|
|||
"design": "Joost De Cock",
|
||||
"difficulty": 3,
|
||||
"tags": ["tops"],
|
||||
"techniques": []
|
||||
"techniques": ["curvedSeam", "flatSleeve", "ribbing"]
|
||||
},
|
||||
"tamiko": {
|
||||
"description": "A FreeSewing pattern for a zero-waste top",
|
||||
|
|
|
@ -8,7 +8,12 @@
|
|||
"sleeve": "Sleeve",
|
||||
"waistband": "Waistband"
|
||||
},
|
||||
"s": {},
|
||||
"s": {
|
||||
"cutCuff.t": "The cuff is not shown",
|
||||
"cutCuff.d": "The **Cuff** (6) is a rectangular piece of ribbing fabric {{{ w }}} wide and {{{ l }}} long (this includes seam allowance). It is not shown because the **expand** core setting is currently disabled. Enable it to show this pattern part.",
|
||||
"cutWaistband.t": "The waistband is not shown",
|
||||
"cutWaistband.d": "The **Waistband** (4) is a rectangular piece of ribbing fabric {{{ w }}} wide and {{{ l }}} long (this includes seam allowance). It is not shown because the **expand** core setting is currently disabled. Enable it to show this pattern part."
|
||||
},
|
||||
"o": {
|
||||
"hipsEase": {
|
||||
"t": "Hips ease",
|
||||
|
@ -18,6 +23,14 @@
|
|||
"t": "Ribbing",
|
||||
"d": "Whether to finish the hem and cuffs with ribbing or not."
|
||||
},
|
||||
"ribbingNo": {
|
||||
"t": "Do not use ribbing",
|
||||
"d": "Do not finish the hem and cuffs with ribbing but rather use a classic hem"
|
||||
},
|
||||
"ribbingYes": {
|
||||
"t": "Use ribbing",
|
||||
"d": "Finish the hem and cuffs with ribbing fabric"
|
||||
},
|
||||
"ribbingHeight": {
|
||||
"t": "Ribbing height",
|
||||
"d": "The height of the ribbing on cuffs and hem."
|
||||
|
|
|
@ -3,23 +3,51 @@ import { ribbing } from './frontback.mjs'
|
|||
import { sleeve } from './sleeve.mjs'
|
||||
|
||||
function svenCuff(params) {
|
||||
const { measurements, sa, points, complete, macro, options, part } = params
|
||||
const { measurements, sa, points, macro, options, store, expand, units, part } = params
|
||||
|
||||
if (!options.ribbing) return part
|
||||
const length = measurements.wrist * (1 + options.cuffEase) * (1 - options.ribbingStretch)
|
||||
|
||||
if (expand) store.flag.preset('expandIsOn')
|
||||
else {
|
||||
// Expand is on, do not draw the part but flag this to the user
|
||||
store.flag.note({
|
||||
msg: `sven:cutCuff`,
|
||||
replace: {
|
||||
w: units(
|
||||
(measurements.hpsToWaistBack + measurements.waistToHips) * options.ribbingHeight + 2 * sa
|
||||
),
|
||||
l: units(length + 2 * sa),
|
||||
},
|
||||
suggest: {
|
||||
text: 'flag:show',
|
||||
icon: 'expand',
|
||||
update: {
|
||||
settings: ['expand', 1],
|
||||
},
|
||||
},
|
||||
})
|
||||
// Also hint about expand
|
||||
store.flag.preset('expandIsOff')
|
||||
|
||||
return part.hide()
|
||||
}
|
||||
|
||||
draftRibbing(params, length)
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
/*
|
||||
* Annotations
|
||||
*/
|
||||
// Cutlist
|
||||
store.cutlist.setCut({ cut: 2, from: 'ribbing' })
|
||||
|
||||
// Title
|
||||
macro('title', {
|
||||
at: points.title,
|
||||
nr: 5,
|
||||
title: 'cuff',
|
||||
align: 'center',
|
||||
})
|
||||
if (sa) {
|
||||
// FIXME: Don't we need SA here?
|
||||
}
|
||||
}
|
||||
|
||||
return part
|
||||
}
|
||||
|
|
|
@ -9,8 +9,6 @@ function svenFrontBack({
|
|||
points,
|
||||
Path,
|
||||
paths,
|
||||
complete,
|
||||
paperless,
|
||||
macro,
|
||||
options,
|
||||
part,
|
||||
|
@ -55,7 +53,6 @@ function svenFrontBack({
|
|||
paths.seam.attr('class', 'fabric')
|
||||
|
||||
// Seam allowance
|
||||
if (complete) {
|
||||
if (sa) {
|
||||
paths.sa = paths.hemBase.offset(sa * (options.ribbing ? 1 : 3)).join(paths.saBase.offset(sa))
|
||||
if (front) paths.sa.line(points.cfNeck).move(points.cfHem)
|
||||
|
@ -63,11 +60,14 @@ function svenFrontBack({
|
|||
paths.sa.line(paths.sa.start())
|
||||
paths.sa.attr('class', 'fabric sa')
|
||||
}
|
||||
}
|
||||
|
||||
// Paperless
|
||||
if (paperless) {
|
||||
/*
|
||||
* Annotations
|
||||
*/
|
||||
// Dimensions
|
||||
macro('rmad')
|
||||
macro('pd', {
|
||||
id: 'lArmhole',
|
||||
path: new Path()
|
||||
.move(points.armhole)
|
||||
.curve(points.armholeCp2, points.armholeHollowCp1, points.armholeHollow)
|
||||
|
@ -76,38 +76,81 @@ function svenFrontBack({
|
|||
d: sa + 15,
|
||||
})
|
||||
macro('pd', {
|
||||
id: 'lShoulderToArmholePitch',
|
||||
path: new Path()
|
||||
.move(points.armholePitch)
|
||||
.curve(points.armholePitchCp2, points.shoulderCp1, points.shoulder),
|
||||
d: -15,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.hips,
|
||||
id: 'hHemToHips',
|
||||
from: points.hem,
|
||||
to: points.waist,
|
||||
x: points.hips.x + sa + 15,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.hips,
|
||||
id: 'hHemToArmhole',
|
||||
from: points.hem,
|
||||
to: points.armhole,
|
||||
x: points.hips.x + sa + 30,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.hips,
|
||||
id: 'hHemToArmholePitch',
|
||||
from: points.hem,
|
||||
to: points.armholePitch,
|
||||
x: points.hips.x + sa + 45,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.hips,
|
||||
id: 'hHemToShoulder',
|
||||
from: points.hem,
|
||||
to: points.shoulder,
|
||||
x: points.hips.x + sa + 60,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.hips,
|
||||
id: 'hFull',
|
||||
from: points.hem,
|
||||
to: points.neck,
|
||||
x: points.hips.x + sa + 75,
|
||||
})
|
||||
macro('ld', { from: points.neck, to: points.shoulder, d: sa + 15 })
|
||||
}
|
||||
macro('ld', { from: points.neck, to: points.shoulder, d: sa + 15, id: 'lShoulderSeam' })
|
||||
points.cxHem = new Point(0, points.hem.y)
|
||||
points.cxNeck = points.cbNeck ? points.cbNeck.copy() : points.cfNeck.copy()
|
||||
macro('hd', {
|
||||
id: 'wAtHem',
|
||||
from: points.cxHem,
|
||||
to: points.hem,
|
||||
y: points.hem.y + sa + 15,
|
||||
})
|
||||
macro('hd', {
|
||||
id: 'wAtArmhole',
|
||||
from: points.cxHem,
|
||||
to: points.armhole,
|
||||
y: points.hem.y + sa + 30,
|
||||
})
|
||||
macro('hd', {
|
||||
id: 'wNeckToHps',
|
||||
from: points.cxNeck,
|
||||
to: points.s3CollarSplit,
|
||||
y: points.s3CollarSplit.y - sa - 15,
|
||||
})
|
||||
macro('hd', {
|
||||
id: 'wNeckToShoulder',
|
||||
from: points.cxNeck,
|
||||
to: points.s3ArmholeSplit,
|
||||
y: points.s3CollarSplit.y - sa - 15,
|
||||
})
|
||||
macro('hd', {
|
||||
id: 'wNeckToArmhole',
|
||||
from: points.cxNeck,
|
||||
to: points.armhole,
|
||||
y: points.s3CollarSplit.y - sa - 45,
|
||||
})
|
||||
macro('hd', {
|
||||
id: 'wArmholeToPitch',
|
||||
from: points.armholePitch,
|
||||
to: points.armhole,
|
||||
y: points.armhole.y,
|
||||
})
|
||||
|
||||
return part
|
||||
}
|
||||
|
|
|
@ -1,72 +1,28 @@
|
|||
export const draftRibbing = function (
|
||||
{
|
||||
store,
|
||||
measurements,
|
||||
options,
|
||||
points,
|
||||
paths,
|
||||
Path,
|
||||
Point,
|
||||
sa,
|
||||
complete,
|
||||
paperless,
|
||||
macro,
|
||||
units,
|
||||
part,
|
||||
},
|
||||
{ store, measurements, options, points, paths, Path, Point, sa, macro, units, part },
|
||||
length
|
||||
) {
|
||||
let height = (measurements.hpsToWaistBack + measurements.waistToHips) * options.ribbingHeight
|
||||
const height = (measurements.hpsToWaistBack + measurements.waistToHips) * options.ribbingHeight
|
||||
if (part.context.settings.sample) store.set('ribbingHeight', height)
|
||||
else store.setIfUnset('ribbingHeight', height)
|
||||
|
||||
let gap = 25
|
||||
let lead = 50
|
||||
if (length < 125) lead = length / 3
|
||||
|
||||
points.topLeft = new Point(0, 0)
|
||||
points.topRight = new Point(height * 2, 0)
|
||||
points.leftGapStart = new Point(0, lead)
|
||||
points.rightGapEnd = new Point(points.topRight.x, lead)
|
||||
points.leftGapEnd = new Point(0, lead + gap)
|
||||
points.rightGapStart = new Point(points.topRight.x, lead + gap)
|
||||
points.bottomLeft = new Point(0, gap + 2 * lead)
|
||||
points.bottomRight = new Point(points.topRight.x, gap + 2 * lead)
|
||||
points.bottomLeft = new Point(0, length)
|
||||
points.bottomRight = new Point(height * 2, length)
|
||||
|
||||
paths.seam = new Path()
|
||||
.move(points.rightGapEnd)
|
||||
.line(points.topRight)
|
||||
.line(points.topLeft)
|
||||
.line(points.leftGapStart)
|
||||
.move(points.leftGapEnd)
|
||||
.line(points.bottomLeft)
|
||||
.line(points.bottomRight)
|
||||
.line(points.rightGapStart)
|
||||
.attr('class', 'various')
|
||||
|
||||
paths.hint = new Path()
|
||||
.move(points.leftGapStart)
|
||||
.line(points.leftGapEnd)
|
||||
.move(points.rightGapStart)
|
||||
.line(points.rightGapEnd)
|
||||
.attr('class', 'various dashed')
|
||||
|
||||
if (complete) {
|
||||
points.title = new Point(points.bottomRight.x / 2, points.bottomRight.y / 2)
|
||||
if (sa) {
|
||||
paths.sa = new Path()
|
||||
.move(points.topLeft)
|
||||
.line(points.bottomLeft)
|
||||
.line(points.bottomRight)
|
||||
.line(points.topRight)
|
||||
.line(points.topLeft)
|
||||
.close()
|
||||
.offset(sa)
|
||||
.attr('class', 'various sa')
|
||||
}
|
||||
}
|
||||
.attr('class', 'various')
|
||||
if (sa) paths.sa = paths.seam.offset(sa).addClass('various sa')
|
||||
|
||||
points.title = new Point(points.bottomRight.x / 2, points.bottomRight.y / 2)
|
||||
|
||||
if (paperless) {
|
||||
macro('vd', {
|
||||
from: points.bottomRight,
|
||||
to: points.topRight,
|
||||
|
@ -78,5 +34,4 @@ export const draftRibbing = function (
|
|||
to: points.topRight,
|
||||
y: points.topRight.y - sa - 15,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ import { sleeve as brianSleeve } from '@freesewing/brian'
|
|||
import { ribbing, front, back } from './frontback.mjs'
|
||||
import { hidePresets } from '@freesewing/core'
|
||||
|
||||
function svenSleeve({ store, sa, points, paths, Path, complete, paperless, macro, options, part }) {
|
||||
function svenSleeve({ store, sa, points, paths, Path, macro, options, part }) {
|
||||
if (options.ribbing) {
|
||||
const ribbingHeight = store.get('ribbingHeight')
|
||||
points.wristLeft = points.wristLeft.shift(90, ribbingHeight)
|
||||
|
@ -19,12 +19,6 @@ function svenSleeve({ store, sa, points, paths, Path, complete, paperless, macro
|
|||
.close()
|
||||
.attr('class', 'fabric')
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
macro('grainline', {
|
||||
from: points.centerWrist,
|
||||
to: points.grainlineTo,
|
||||
})
|
||||
if (sa) {
|
||||
paths.saBase = new Path()
|
||||
.move(points.wristRight)
|
||||
|
@ -37,35 +31,47 @@ function svenSleeve({ store, sa, points, paths, Path, complete, paperless, macro
|
|||
paths.sa = paths.saBase.offset(sa).join(paths.hemBase.offset(sa * (options.ribbing ? 1 : 3)))
|
||||
paths.sa.line(paths.sa.start()).close().attr('class', 'fabric sa')
|
||||
}
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
/*
|
||||
* Annotations
|
||||
*/
|
||||
// Grainline
|
||||
macro('grainline', {
|
||||
from: points.centerWrist,
|
||||
to: points.sleeveTop,
|
||||
})
|
||||
|
||||
// Dimensions
|
||||
macro('rmad')
|
||||
macro('vd', {
|
||||
id: 'hWristToArmhole',
|
||||
from: points.wristLeft,
|
||||
to: points.bicepsLeft,
|
||||
x: points.bicepsLeft.x - sa - 15,
|
||||
})
|
||||
macro('vd', {
|
||||
id: 'hFull',
|
||||
from: points.wristLeft,
|
||||
to: points.sleeveTip,
|
||||
x: points.bicepsLeft.x - sa - 30,
|
||||
})
|
||||
macro('hd', {
|
||||
id: 'wFull',
|
||||
from: points.bicepsLeft,
|
||||
to: points.bicepsRight,
|
||||
y: points.sleeveTip.y - sa - 30,
|
||||
})
|
||||
macro('hd', {
|
||||
id: 'wCuff',
|
||||
from: points.wristLeft,
|
||||
to: points.wristRight,
|
||||
y: points.wristLeft.y + sa * (options.ribbing ? 1 : 3) + 15,
|
||||
})
|
||||
macro('pd', {
|
||||
id: 'lSleevecap',
|
||||
path: paths.sleevecap.reverse(),
|
||||
d: -1 * sa - 15,
|
||||
})
|
||||
}
|
||||
|
||||
return part
|
||||
}
|
||||
|
|
|
@ -3,21 +3,52 @@ import { ribbing, hipsEase } from './frontback.mjs'
|
|||
import { ribbingStretch } from './cuff.mjs'
|
||||
|
||||
function svenWaistband(params) {
|
||||
const { measurements, points, complete, macro, options, part } = params
|
||||
const { measurements, points, macro, options, store, expand, units, sa, part } = params
|
||||
|
||||
if (!options.ribbing) return part
|
||||
|
||||
let length = measurements.hips * (1 + options.hipsEase) * (1 - options.ribbingStretch)
|
||||
const length = measurements.hips * (1 + options.hipsEase) * (1 - options.ribbingStretch)
|
||||
|
||||
if (expand) store.flag.preset('expandIsOn')
|
||||
else {
|
||||
// Expand is on, do not draw the part but flag this to the user
|
||||
store.flag.note({
|
||||
msg: `sven:cutWaistband`,
|
||||
replace: {
|
||||
w: units(
|
||||
(measurements.hpsToWaistBack + measurements.waistToHips) * options.ribbingHeight + 2 * sa
|
||||
),
|
||||
l: units(length + 2 * sa),
|
||||
},
|
||||
suggest: {
|
||||
text: 'flag:show',
|
||||
icon: 'expand',
|
||||
update: {
|
||||
settings: ['expand', 1],
|
||||
},
|
||||
},
|
||||
})
|
||||
// Also hint about expand
|
||||
store.flag.preset('expandIsOff')
|
||||
|
||||
return part.hide()
|
||||
}
|
||||
|
||||
draftRibbing(params, length)
|
||||
|
||||
// Complete pattern?
|
||||
if (complete) {
|
||||
/*
|
||||
* Annotations
|
||||
*/
|
||||
// Cutlist
|
||||
store.cutlist.setCut({ cut: 2, from: 'ribbing' })
|
||||
|
||||
// Title
|
||||
macro('title', {
|
||||
at: points.title,
|
||||
nr: 4,
|
||||
title: 'waistband',
|
||||
align: 'center',
|
||||
})
|
||||
}
|
||||
|
||||
return part
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue