chore: Linter
This commit is contained in:
parent
adb9e93024
commit
1a46c8e724
227 changed files with 660 additions and 936 deletions
|
@ -10,11 +10,11 @@ import draftFront from './front'
|
||||||
const Pattern = new freesewing.Design(config, plugins)
|
const Pattern = new freesewing.Design(config, plugins)
|
||||||
|
|
||||||
// Attach draft methods to prototype
|
// Attach draft methods to prototype
|
||||||
Pattern.prototype.draftBase = function(part) {
|
Pattern.prototype.draftBase = function (part) {
|
||||||
// Getting the base part from Brian
|
// Getting the base part from Brian
|
||||||
return new Brian(this.settings).draftBase(part)
|
return new Brian(this.settings).draftBase(part)
|
||||||
}
|
}
|
||||||
Pattern.prototype.draftFront = part => draftFront(part)
|
Pattern.prototype.draftFront = (part) => draftFront(part)
|
||||||
Pattern.prototype.draftBack = part => draftBack(part)
|
Pattern.prototype.draftBack = (part) => draftBack(part)
|
||||||
|
|
||||||
export default Pattern
|
export default Pattern
|
||||||
|
|
|
@ -11,7 +11,7 @@ export default function (part) {
|
||||||
paperless,
|
paperless,
|
||||||
macro,
|
macro,
|
||||||
utils,
|
utils,
|
||||||
measurements,
|
measurements
|
||||||
} = part.shorthand()
|
} = part.shorthand()
|
||||||
|
|
||||||
// Get to work
|
// Get to work
|
||||||
|
@ -43,7 +43,10 @@ export default function (part) {
|
||||||
)
|
)
|
||||||
|
|
||||||
// Bust point
|
// Bust point
|
||||||
points.bust = new Point(measurements.bustSpan * 0.5 * (1 + options.bustSpanEase), measurements.hpsToBust)
|
points.bust = new Point(
|
||||||
|
measurements.bustSpan * 0.5 * (1 + options.bustSpanEase),
|
||||||
|
measurements.hpsToBust
|
||||||
|
)
|
||||||
|
|
||||||
// Construct armhole
|
// Construct armhole
|
||||||
points.armholeCp2 = points.armhole.shift(180, 40)
|
points.armholeCp2 = points.armhole.shift(180, 40)
|
||||||
|
@ -112,15 +115,22 @@ export default function (part) {
|
||||||
)
|
)
|
||||||
points.bustDartBottom = points.bustDartTop.rotate(angle * -1, points.bust)
|
points.bustDartBottom = points.bustDartTop.rotate(angle * -1, points.bust)
|
||||||
points.bustDartMiddle = points.bustDartTop.shiftFractionTowards(points.bustDartBottom, 0.5)
|
points.bustDartMiddle = points.bustDartTop.shiftFractionTowards(points.bustDartBottom, 0.5)
|
||||||
points.bustDartTip = points.bustDartMiddle.shiftFractionTowards(points.bust, options.bustDartLength)
|
points.bustDartTip = points.bustDartMiddle.shiftFractionTowards(
|
||||||
|
points.bust,
|
||||||
|
options.bustDartLength
|
||||||
|
)
|
||||||
points.bustDartEdge = utils.beamsIntersect(
|
points.bustDartEdge = utils.beamsIntersect(
|
||||||
points.bust,
|
points.bust,
|
||||||
points.bustDartMiddle,
|
points.bustDartMiddle,
|
||||||
points.armhole,
|
points.armhole,
|
||||||
points.bustDartTop
|
points.bustDartTop
|
||||||
)
|
)
|
||||||
points.bustDartCpTop = points.bust.shiftFractionTowards(points.bustDartTop, 0.666).rotate(5 * options.bustDartCurve, points.bust)
|
points.bustDartCpTop = points.bust
|
||||||
points.bustDartCpBottom = points.bust.shiftFractionTowards(points.bustDartBottom, 0.666).rotate(-5 * options.bustDartCurve, points.bust)
|
.shiftFractionTowards(points.bustDartTop, 0.666)
|
||||||
|
.rotate(5 * options.bustDartCurve, points.bust)
|
||||||
|
points.bustDartCpBottom = points.bust
|
||||||
|
.shiftFractionTowards(points.bustDartBottom, 0.666)
|
||||||
|
.rotate(-5 * options.bustDartCurve, points.bust)
|
||||||
|
|
||||||
// Side seam length
|
// Side seam length
|
||||||
let aboveDart = points.armhole.dist(points.bustDartTop)
|
let aboveDart = points.armhole.dist(points.bustDartTop)
|
||||||
|
@ -142,10 +152,7 @@ export default function (part) {
|
||||||
points.bust,
|
points.bust,
|
||||||
options.waistDartLength
|
options.waistDartLength
|
||||||
)
|
)
|
||||||
points.waistDartLeftCp = points.waistDartLeft.shift(
|
points.waistDartLeftCp = points.waistDartLeft.shift(90, points.waistDartHem.dist(points.bust) / 2)
|
||||||
90,
|
|
||||||
points.waistDartHem.dist(points.bust) / 2
|
|
||||||
)
|
|
||||||
points.waistDartRightCp = points.waistDartRight.shift(
|
points.waistDartRightCp = points.waistDartRight.shift(
|
||||||
90,
|
90,
|
||||||
points.waistDartHem.dist(points.bust) / 2
|
points.waistDartHem.dist(points.bust) / 2
|
||||||
|
@ -185,7 +192,7 @@ export default function (part) {
|
||||||
.setRender(false)
|
.setRender(false)
|
||||||
|
|
||||||
if (complete) {
|
if (complete) {
|
||||||
points.titleAnchor = new Point(points.armholePitch.x/2, points.armholePitchCp2.y)
|
points.titleAnchor = new Point(points.armholePitch.x / 2, points.armholePitchCp2.y)
|
||||||
macro('title', {
|
macro('title', {
|
||||||
at: points.titleAnchor,
|
at: points.titleAnchor,
|
||||||
nr: 1,
|
nr: 1,
|
||||||
|
@ -205,122 +212,113 @@ export default function (part) {
|
||||||
})
|
})
|
||||||
macro('sprinkle', {
|
macro('sprinkle', {
|
||||||
snippet: 'notch',
|
snippet: 'notch',
|
||||||
on: [
|
on: ['bust', 'armholePitch', 'cfBust']
|
||||||
'bust',
|
|
||||||
'armholePitch',
|
|
||||||
'cfBust',
|
|
||||||
]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
if (sa) {
|
if (sa) {
|
||||||
paths.sa = paths.saBase
|
paths.sa = paths.saBase.offset(sa).line(points.cfNeck).attr('class', 'fabric sa')
|
||||||
.offset(sa)
|
paths.sa = paths.sa.move(points.cfHem).line(paths.sa.start())
|
||||||
.line(points.cfNeck)
|
|
||||||
.attr('class', 'fabric sa')
|
|
||||||
paths.sa = paths.sa
|
|
||||||
.move(points.cfHem)
|
|
||||||
.line(paths.sa.start())
|
|
||||||
}
|
}
|
||||||
if (paperless) {
|
if (paperless) {
|
||||||
macro('vd', {
|
macro('vd', {
|
||||||
from: points.cfHem,
|
from: points.cfHem,
|
||||||
to: points.waistDartTip,
|
to: points.waistDartTip,
|
||||||
x: 0 - 15,
|
x: 0 - 15
|
||||||
})
|
})
|
||||||
macro('vd', {
|
macro('vd', {
|
||||||
from: points.cfHem,
|
from: points.cfHem,
|
||||||
to: points.bust,
|
to: points.bust,
|
||||||
x: 0 - 30,
|
x: 0 - 30
|
||||||
})
|
})
|
||||||
macro('vd', {
|
macro('vd', {
|
||||||
from: points.cfHem,
|
from: points.cfHem,
|
||||||
to: points.cfNeck,
|
to: points.cfNeck,
|
||||||
x: 0 - 45,
|
x: 0 - 45
|
||||||
})
|
})
|
||||||
macro('vd', {
|
macro('vd', {
|
||||||
from: points.cfHem,
|
from: points.cfHem,
|
||||||
to: points.hps,
|
to: points.hps,
|
||||||
x: 0 - 60,
|
x: 0 - 60
|
||||||
})
|
})
|
||||||
macro('hd', {
|
macro('hd', {
|
||||||
from: points.cfBust,
|
from: points.cfBust,
|
||||||
to: points.bust,
|
to: points.bust,
|
||||||
y: points.bust.y - 15,
|
y: points.bust.y - 15
|
||||||
})
|
})
|
||||||
macro('hd', {
|
macro('hd', {
|
||||||
from: points.cfBust,
|
from: points.cfBust,
|
||||||
to: points.bustDartTip,
|
to: points.bustDartTip,
|
||||||
y: points.bust.y - 30,
|
y: points.bust.y - 30
|
||||||
})
|
})
|
||||||
macro('hd', {
|
macro('hd', {
|
||||||
from: points.cfHem,
|
from: points.cfHem,
|
||||||
to: points.waistDartLeft,
|
to: points.waistDartLeft,
|
||||||
y: points.cfHem.y + sa + 15,
|
y: points.cfHem.y + sa + 15
|
||||||
})
|
})
|
||||||
macro('hd', {
|
macro('hd', {
|
||||||
from: points.cfHem,
|
from: points.cfHem,
|
||||||
to: points.waistDartRight,
|
to: points.waistDartRight,
|
||||||
y: points.cfHem.y + sa + 30,
|
y: points.cfHem.y + sa + 30
|
||||||
})
|
})
|
||||||
macro('hd', {
|
macro('hd', {
|
||||||
from: points.cfHem,
|
from: points.cfHem,
|
||||||
to: points.sideHem,
|
to: points.sideHem,
|
||||||
y: points.cfHem.y + sa + 45,
|
y: points.cfHem.y + sa + 45
|
||||||
})
|
})
|
||||||
macro('hd', {
|
macro('hd', {
|
||||||
from: points.cfHem,
|
from: points.cfHem,
|
||||||
to: points.bustDartBottom,
|
to: points.bustDartBottom,
|
||||||
y: points.cfHem.y + sa + 60,
|
y: points.cfHem.y + sa + 60
|
||||||
})
|
})
|
||||||
macro('hd', {
|
macro('hd', {
|
||||||
from: points.cfHem,
|
from: points.cfHem,
|
||||||
to: points.bustDartTop,
|
to: points.bustDartTop,
|
||||||
y: points.cfHem.y + sa + 75,
|
y: points.cfHem.y + sa + 75
|
||||||
})
|
})
|
||||||
macro('vd', {
|
macro('vd', {
|
||||||
from: points.sideHem,
|
from: points.sideHem,
|
||||||
to: points.bustDartBottom,
|
to: points.bustDartBottom,
|
||||||
x: points.bustDartTop.x + sa + 15,
|
x: points.bustDartTop.x + sa + 15
|
||||||
})
|
})
|
||||||
macro('vd', {
|
macro('vd', {
|
||||||
from: points.sideHem,
|
from: points.sideHem,
|
||||||
to: points.bustDartTop,
|
to: points.bustDartTop,
|
||||||
x: points.bustDartTop.x + sa + 30,
|
x: points.bustDartTop.x + sa + 30
|
||||||
})
|
})
|
||||||
macro('vd', {
|
macro('vd', {
|
||||||
from: points.sideHem,
|
from: points.sideHem,
|
||||||
to: points.armhole,
|
to: points.armhole,
|
||||||
x: points.bustDartTop.x + sa + 45,
|
x: points.bustDartTop.x + sa + 45
|
||||||
})
|
})
|
||||||
macro('vd', {
|
macro('vd', {
|
||||||
from: points.sideHem,
|
from: points.sideHem,
|
||||||
to: points.armholePitch,
|
to: points.armholePitch,
|
||||||
x: points.bustDartTop.x + sa + 60,
|
x: points.bustDartTop.x + sa + 60
|
||||||
})
|
})
|
||||||
macro('vd', {
|
macro('vd', {
|
||||||
from: points.sideHem,
|
from: points.sideHem,
|
||||||
to: points.shoulder,
|
to: points.shoulder,
|
||||||
x: points.bustDartTop.x + sa + 75,
|
x: points.bustDartTop.x + sa + 75
|
||||||
})
|
})
|
||||||
macro('hd', {
|
macro('hd', {
|
||||||
from: points.cfNeck,
|
from: points.cfNeck,
|
||||||
to: points.hps,
|
to: points.hps,
|
||||||
y: points.hps.y - sa - 15,
|
y: points.hps.y - sa - 15
|
||||||
})
|
})
|
||||||
macro('hd', {
|
macro('hd', {
|
||||||
from: points.cfNeck,
|
from: points.cfNeck,
|
||||||
to: points.armholePitch,
|
to: points.armholePitch,
|
||||||
y: points.hps.y - sa - 30,
|
y: points.hps.y - sa - 30
|
||||||
})
|
})
|
||||||
macro('hd', {
|
macro('hd', {
|
||||||
from: points.cfNeck,
|
from: points.cfNeck,
|
||||||
to: points.shoulder,
|
to: points.shoulder,
|
||||||
y: points.hps.y - sa - 45,
|
y: points.hps.y - sa - 45
|
||||||
})
|
})
|
||||||
macro('hd', {
|
macro('hd', {
|
||||||
from: points.cfNeck,
|
from: points.cfNeck,
|
||||||
to: points.armhole,
|
to: points.armhole,
|
||||||
y: points.hps.y - sa - 60,
|
y: points.hps.y - sa - 60
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default function(part) {
|
export default function (part) {
|
||||||
let { Point, points, Path, paths, complete, macro, sa, store, paperless } = part.shorthand()
|
let { Point, points, Path, paths, complete, macro, sa, store, paperless } = part.shorthand()
|
||||||
|
|
||||||
points.bandBottomLeft = points.bandBottomLeft.shift(0, 0)
|
points.bandBottomLeft = points.bandBottomLeft.shift(0, 0)
|
||||||
|
@ -30,10 +30,7 @@ export default function(part) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (sa) {
|
if (sa) {
|
||||||
paths.sa = paths.seam
|
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa').setRender(true)
|
||||||
.offset(sa)
|
|
||||||
.attr('class', 'fabric sa')
|
|
||||||
.setRender(true)
|
|
||||||
}
|
}
|
||||||
macro('title', {
|
macro('title', {
|
||||||
at: points.titleAnchor,
|
at: points.titleAnchor,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default function(part) {
|
export default function (part) {
|
||||||
let {
|
let {
|
||||||
options,
|
options,
|
||||||
Point,
|
Point,
|
||||||
|
@ -46,10 +46,7 @@ export default function(part) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (sa) {
|
if (sa) {
|
||||||
paths.sa = paths.seam
|
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa').setRender(true)
|
||||||
.offset(sa)
|
|
||||||
.attr('class', 'fabric sa')
|
|
||||||
.setRender(true)
|
|
||||||
}
|
}
|
||||||
macro('title', {
|
macro('title', {
|
||||||
at: points.titleAnchor,
|
at: points.titleAnchor,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default function(part) {
|
export default function (part) {
|
||||||
let {
|
let {
|
||||||
options,
|
options,
|
||||||
Point,
|
Point,
|
||||||
|
@ -46,10 +46,7 @@ export default function(part) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (sa) {
|
if (sa) {
|
||||||
paths.sa = paths.seam
|
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa').setRender(true)
|
||||||
.offset(sa)
|
|
||||||
.attr('class', 'fabric sa')
|
|
||||||
.setRender(true)
|
|
||||||
}
|
}
|
||||||
macro('title', {
|
macro('title', {
|
||||||
at: points.titleAnchor,
|
at: points.titleAnchor,
|
||||||
|
|
|
@ -11,13 +11,13 @@ import draftUnderSleeve from './undersleeve'
|
||||||
const Pattern = new freesewing.Design(config, plugins)
|
const Pattern = new freesewing.Design(config, plugins)
|
||||||
|
|
||||||
// Attach draft methods from Brian to prototype
|
// Attach draft methods from Brian to prototype
|
||||||
Pattern.prototype.draftBase = function(part) {
|
Pattern.prototype.draftBase = function (part) {
|
||||||
return new Brian(this.settings).draftBase(part)
|
return new Brian(this.settings).draftBase(part)
|
||||||
}
|
}
|
||||||
Pattern.prototype.draftFront = function(part) {
|
Pattern.prototype.draftFront = function (part) {
|
||||||
return new Brian(this.settings).draftFront(part)
|
return new Brian(this.settings).draftFront(part)
|
||||||
}
|
}
|
||||||
Pattern.prototype.draftBack = function(part) {
|
Pattern.prototype.draftBack = function (part) {
|
||||||
return new Brian(this.settings).draftBack(part)
|
return new Brian(this.settings).draftBack(part)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default function(part, s) {
|
export default function (part, s) {
|
||||||
let { macro, points, sa } = part.shorthand()
|
let { macro, points, sa } = part.shorthand()
|
||||||
|
|
||||||
macro('ld', {
|
macro('ld', {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import dimensions from './shared'
|
import dimensions from './shared'
|
||||||
|
|
||||||
export default function(part) {
|
export default function (part) {
|
||||||
let { macro, Path, points, paths, complete, paperless, snippets, Snippet, sa } = part.shorthand()
|
let { macro, Path, points, paths, complete, paperless, snippets, Snippet, sa } = part.shorthand()
|
||||||
|
|
||||||
// Extract seamline from sleeve
|
// Extract seamline from sleeve
|
||||||
|
@ -10,7 +10,7 @@ export default function(part) {
|
||||||
|
|
||||||
// Complete?
|
// Complete?
|
||||||
if (complete) {
|
if (complete) {
|
||||||
macro('scalebox', { at: points.elbowCenter, })
|
macro('scalebox', { at: points.elbowCenter })
|
||||||
snippets.logo = new Snippet('logo', points.elbowCenter.shift(90, 50))
|
snippets.logo = new Snippet('logo', points.elbowCenter.shift(90, 50))
|
||||||
macro('title', {
|
macro('title', {
|
||||||
at: points.armCenter,
|
at: points.armCenter,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let {
|
let {
|
||||||
sa,
|
sa,
|
||||||
points,
|
points,
|
||||||
|
@ -91,10 +91,7 @@ export default part => {
|
||||||
|
|
||||||
// Insert darts
|
// Insert darts
|
||||||
if (options.waistDart) {
|
if (options.waistDart) {
|
||||||
let dart = new Path()
|
let dart = new Path().line(points.waistDart1).line(points.waistDartTip).line(points.waistDart2)
|
||||||
.line(points.waistDart1)
|
|
||||||
.line(points.waistDartTip)
|
|
||||||
.line(points.waistDart2)
|
|
||||||
paths.seam = paths.seam.insop('waistDart', dart)
|
paths.seam = paths.seam.insop('waistDart', dart)
|
||||||
let saDart = new Path()
|
let saDart = new Path()
|
||||||
.line(points.waistDart1)
|
.line(points.waistDart1)
|
||||||
|
@ -165,10 +162,7 @@ export default part => {
|
||||||
store.set('backSideSeamLength', points.armhole.dist(points.waist))
|
store.set('backSideSeamLength', points.armhole.dist(points.waist))
|
||||||
store.set(
|
store.set(
|
||||||
'backCollarLength',
|
'backCollarLength',
|
||||||
new Path()
|
new Path().move(points.cbNeck)._curve(points.hpsCp2, points.hps).length() * 2
|
||||||
.move(points.cbNeck)
|
|
||||||
._curve(points.hpsCp2, points.hps)
|
|
||||||
.length() * 2
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Anchor point
|
// Anchor point
|
||||||
|
|
|
@ -46,7 +46,7 @@ export const getDartInsertionPoint = (points, utils, loc, angle) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// What points need to be rotated after cutting the primary bust dart
|
// What points need to be rotated after cutting the primary bust dart
|
||||||
export const getPrimaryDartRotationList = loc => {
|
export const getPrimaryDartRotationList = (loc) => {
|
||||||
let rotate = ['cfWaist']
|
let rotate = ['cfWaist']
|
||||||
if (loc >= 1100) rotate.push('cfNeck')
|
if (loc >= 1100) rotate.push('cfNeck')
|
||||||
if (loc >= 1130) rotate.push('hpsCp2')
|
if (loc >= 1130) rotate.push('hpsCp2')
|
||||||
|
@ -74,7 +74,7 @@ export const getSecondaryDartRotationList = (loc1, loc2) => {
|
||||||
return rotate
|
return rotate
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getDartLocationsAsNumbers = options => {
|
export const getDartLocationsAsNumbers = (options) => {
|
||||||
let loc1 = options.primaryBustDart
|
let loc1 = options.primaryBustDart
|
||||||
let loc2 = options.secondaryBustDart
|
let loc2 = options.secondaryBustDart
|
||||||
loc1 = Number(loc1.slice(0, 2) + loc1.slice(-2))
|
loc1 = Number(loc1.slice(0, 2) + loc1.slice(-2))
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { points, Path, store } = part.shorthand()
|
let { points, Path, store } = part.shorthand()
|
||||||
|
|
||||||
switch (store.get('secondaryBustDartLocation')) {
|
switch (store.get('secondaryBustDartLocation')) {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { points, Path, store } = part.shorthand()
|
let { points, Path, store } = part.shorthand()
|
||||||
|
|
||||||
switch (store.get('secondaryBustDartLocation')) {
|
switch (store.get('secondaryBustDartLocation')) {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { points, Path, store } = part.shorthand()
|
let { points, Path, store } = part.shorthand()
|
||||||
|
|
||||||
switch (store.get('secondaryBustDartLocation')) {
|
switch (store.get('secondaryBustDartLocation')) {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { points, Path, store } = part.shorthand()
|
let { points, Path, store } = part.shorthand()
|
||||||
|
|
||||||
switch (store.get('secondaryBustDartLocation')) {
|
switch (store.get('secondaryBustDartLocation')) {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { points, Path, store } = part.shorthand()
|
let { points, Path, store } = part.shorthand()
|
||||||
|
|
||||||
switch (store.get('secondaryBustDartLocation')) {
|
switch (store.get('secondaryBustDartLocation')) {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { points, Path, store } = part.shorthand()
|
let { points, Path, store } = part.shorthand()
|
||||||
|
|
||||||
switch (store.get('secondaryBustDartLocation')) {
|
switch (store.get('secondaryBustDartLocation')) {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { points, Path, store } = part.shorthand()
|
let { points, Path, store } = part.shorthand()
|
||||||
|
|
||||||
switch (store.get('secondaryBustDartLocation')) {
|
switch (store.get('secondaryBustDartLocation')) {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { points, Path, store } = part.shorthand()
|
let { points, Path, store } = part.shorthand()
|
||||||
|
|
||||||
switch (store.get('secondaryBustDartLocation')) {
|
switch (store.get('secondaryBustDartLocation')) {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { points, Path, store } = part.shorthand()
|
let { points, Path, store } = part.shorthand()
|
||||||
|
|
||||||
switch (store.get('secondaryBustDartLocation')) {
|
switch (store.get('secondaryBustDartLocation')) {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { points, Path, store } = part.shorthand()
|
let { points, Path, store } = part.shorthand()
|
||||||
|
|
||||||
switch (store.get('primaryBustDartLocation')) {
|
switch (store.get('primaryBustDartLocation')) {
|
||||||
|
|
|
@ -18,7 +18,7 @@ import {
|
||||||
getSaDartPaths
|
getSaDartPaths
|
||||||
} from './dart-utils'
|
} from './dart-utils'
|
||||||
|
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let {
|
let {
|
||||||
options,
|
options,
|
||||||
store,
|
store,
|
||||||
|
|
|
@ -39,10 +39,7 @@ export default (part) => {
|
||||||
|
|
||||||
macro('title', { at: points.title, nr: 2, title: 'back' })
|
macro('title', { at: points.title, nr: 2, title: 'back' })
|
||||||
snippets.armholePitchNotch = new Snippet('bnotch', points.armholePitch)
|
snippets.armholePitchNotch = new Snippet('bnotch', points.armholePitch)
|
||||||
paths.waist = new Path()
|
paths.waist = new Path().move(points.cbWaist).line(points.waist).attr('class', 'help')
|
||||||
.move(points.cbWaist)
|
|
||||||
.line(points.waist)
|
|
||||||
.attr('class', 'help')
|
|
||||||
if (sa) {
|
if (sa) {
|
||||||
paths.sa = paths.saBase
|
paths.sa = paths.saBase
|
||||||
.offset(sa)
|
.offset(sa)
|
||||||
|
|
|
@ -53,10 +53,7 @@ export default (part) => {
|
||||||
})
|
})
|
||||||
macro('title', { at: points.title, nr: 1, title: 'front' })
|
macro('title', { at: points.title, nr: 1, title: 'front' })
|
||||||
snippets.armholePitchNotch = new Snippet('notch', points.armholePitch)
|
snippets.armholePitchNotch = new Snippet('notch', points.armholePitch)
|
||||||
paths.waist = new Path()
|
paths.waist = new Path().move(points.cfWaist).line(points.waist).attr('class', 'help')
|
||||||
.move(points.cfWaist)
|
|
||||||
.line(points.waist)
|
|
||||||
.attr('class', 'help')
|
|
||||||
if (sa) {
|
if (sa) {
|
||||||
paths.sa = paths.saBase
|
paths.sa = paths.saBase
|
||||||
.offset(sa)
|
.offset(sa)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import init from './init'
|
import init from './init'
|
||||||
|
|
||||||
export default function(part) {
|
export default function (part) {
|
||||||
let {
|
let {
|
||||||
store,
|
store,
|
||||||
sa,
|
sa,
|
||||||
|
|
|
@ -11,9 +11,9 @@ import draftInset from './inset'
|
||||||
const Pattern = new freesewing.Design(config, plugins)
|
const Pattern = new freesewing.Design(config, plugins)
|
||||||
|
|
||||||
// Attach draft methods to prototype
|
// Attach draft methods to prototype
|
||||||
Pattern.prototype.draftBack = part => draftBack(part)
|
Pattern.prototype.draftBack = (part) => draftBack(part)
|
||||||
Pattern.prototype.draftSide = part => draftSide(part)
|
Pattern.prototype.draftSide = (part) => draftSide(part)
|
||||||
Pattern.prototype.draftInset = part => draftInset(part)
|
Pattern.prototype.draftInset = (part) => draftInset(part)
|
||||||
Pattern.prototype.draftFront = part => draftFront(part)
|
Pattern.prototype.draftFront = (part) => draftFront(part)
|
||||||
|
|
||||||
export default Pattern
|
export default Pattern
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import init from './init'
|
import init from './init'
|
||||||
|
|
||||||
export default function(part) {
|
export default function (part) {
|
||||||
let {
|
let {
|
||||||
store,
|
store,
|
||||||
sa,
|
sa,
|
||||||
|
@ -52,10 +52,7 @@ export default function(part) {
|
||||||
paths.hemBase = new Path().move(points.bottomRight).line(points.bottomLeft)
|
paths.hemBase = new Path().move(points.bottomRight).line(points.bottomLeft)
|
||||||
paths.saBase.render = false
|
paths.saBase.render = false
|
||||||
paths.hemBase.render = false
|
paths.hemBase.render = false
|
||||||
paths.seam = paths.saBase
|
paths.seam = paths.saBase.join(paths.hemBase).close().attr('class', 'fabric')
|
||||||
.join(paths.hemBase)
|
|
||||||
.close()
|
|
||||||
.attr('class', 'fabric')
|
|
||||||
|
|
||||||
// Anchor point for sampling
|
// Anchor point for sampling
|
||||||
points.anchor = points.topLeft
|
points.anchor = points.topLeft
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default function(part) {
|
export default function (part) {
|
||||||
let {
|
let {
|
||||||
paperless,
|
paperless,
|
||||||
sa,
|
sa,
|
||||||
|
@ -253,21 +253,14 @@ export default function(part) {
|
||||||
._curve(points.lapelStraightEndCp1, points.lapelStraightEnd)
|
._curve(points.lapelStraightEndCp1, points.lapelStraightEnd)
|
||||||
.line(points.hemEdge)
|
.line(points.hemEdge)
|
||||||
.line(points.flbHem)
|
.line(points.flbHem)
|
||||||
paths.seam = paths.saBase
|
paths.seam = paths.saBase.clone().line(points.psHem).close().attr('class', 'fabric')
|
||||||
.clone()
|
|
||||||
.line(points.psHem)
|
|
||||||
.close()
|
|
||||||
.attr('class', 'fabric')
|
|
||||||
|
|
||||||
paths.rollLine = new Path()
|
paths.rollLine = new Path()
|
||||||
.move(points.rollLineStart)
|
.move(points.rollLineStart)
|
||||||
.line(points.rollLineEnd)
|
.line(points.rollLineEnd)
|
||||||
.attr('class', 'lashed')
|
.attr('class', 'lashed')
|
||||||
|
|
||||||
paths.flb = new Path()
|
paths.flb = new Path().move(points.flbHem).line(points.flbTop).attr('class', 'lining lashed')
|
||||||
.move(points.flbHem)
|
|
||||||
.line(points.flbTop)
|
|
||||||
.attr('class', 'lining lashed')
|
|
||||||
|
|
||||||
paths.pocket = new Path()
|
paths.pocket = new Path()
|
||||||
.move(
|
.move(
|
||||||
|
|
|
@ -16,7 +16,7 @@ let fromBent = ['Base', 'Front', 'Back', 'Sleeve', 'TopSleeve', 'UnderSleeve']
|
||||||
|
|
||||||
// Attach draft methods from Bent to prototype
|
// Attach draft methods from Bent to prototype
|
||||||
for (let m of fromBent) {
|
for (let m of fromBent) {
|
||||||
Pattern.prototype['draftBent' + m] = function(part) {
|
Pattern.prototype['draftBent' + m] = function (part) {
|
||||||
return new Bent(this.settings)['draft' + m](part)
|
return new Bent(this.settings)['draft' + m](part)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,12 +40,12 @@ for (let m of [
|
||||||
'draftInnerPocketBag',
|
'draftInnerPocketBag',
|
||||||
'draftInnerPocketTab'
|
'draftInnerPocketTab'
|
||||||
]) {
|
]) {
|
||||||
Pattern.prototype[m] = function(part) {
|
Pattern.prototype[m] = function (part) {
|
||||||
return new Carlton(this.settings)[m](part)
|
return new Carlton(this.settings)[m](part)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Pattern.prototype.draftCarltonFront = function(part) {
|
Pattern.prototype.draftCarltonFront = function (part) {
|
||||||
return new Carlton(this.settings).draftFront(part)
|
return new Carlton(this.settings).draftFront(part)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default function(part) {
|
export default function (part) {
|
||||||
let {
|
let {
|
||||||
units,
|
units,
|
||||||
paperless,
|
paperless,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default function(part) {
|
export default function (part) {
|
||||||
let { paperless, sa, store, complete, points, macro, Point, paths, Path } = part.shorthand()
|
let { paperless, sa, store, complete, points, macro, Point, paths, Path } = part.shorthand()
|
||||||
|
|
||||||
points.topLeft = new Point(0, 0)
|
points.topLeft = new Point(0, 0)
|
||||||
|
@ -17,10 +17,7 @@ export default function(part) {
|
||||||
.close()
|
.close()
|
||||||
.attr('class', 'fabric')
|
.attr('class', 'fabric')
|
||||||
|
|
||||||
paths.fold = new Path()
|
paths.fold = new Path().move(points.topMid).line(points.bottomMid).attr('class', 'dashed')
|
||||||
.move(points.topMid)
|
|
||||||
.line(points.bottomMid)
|
|
||||||
.attr('class', 'dashed')
|
|
||||||
|
|
||||||
if (complete) {
|
if (complete) {
|
||||||
points.title = new Point(points.bottomRight.x / 4, points.bottomRight.y / 2)
|
points.title = new Point(points.bottomRight.x / 4, points.bottomRight.y / 2)
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* but gets complicated when doing it in code.
|
* but gets complicated when doing it in code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export default function(part) {
|
export default function (part) {
|
||||||
let { paperless, sa, complete, points, options, macro, paths, Path } = part.shorthand()
|
let { paperless, sa, complete, points, options, macro, paths, Path } = part.shorthand()
|
||||||
|
|
||||||
// We're going to slash and spread this collar. Slashing first:
|
// We're going to slash and spread this collar. Slashing first:
|
||||||
|
@ -165,11 +165,7 @@ export default function(part) {
|
||||||
.line(points.rot4bottomRight)
|
.line(points.rot4bottomRight)
|
||||||
.line(points.rot4topRight)
|
.line(points.rot4topRight)
|
||||||
._curve(points.topLeftCp, points.topLeft)
|
._curve(points.topLeftCp, points.topLeft)
|
||||||
paths.seam = paths.saBase
|
paths.seam = paths.saBase.clone().line(points.standTop).close().attr('class', 'fabric')
|
||||||
.clone()
|
|
||||||
.line(points.standTop)
|
|
||||||
.close()
|
|
||||||
.attr('class', 'fabric')
|
|
||||||
|
|
||||||
if (complete) {
|
if (complete) {
|
||||||
points.title = points.standTopCp.clone()
|
points.title = points.standTopCp.clone()
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default function(part) {
|
export default function (part) {
|
||||||
let { paperless, sa, store, complete, points, macro, Point, paths, Path } = part.shorthand()
|
let { paperless, sa, store, complete, points, macro, Point, paths, Path } = part.shorthand()
|
||||||
|
|
||||||
points.topLeft = new Point(0, 0)
|
points.topLeft = new Point(0, 0)
|
||||||
|
|
|
@ -26,22 +26,22 @@ import draftInnerPocketTab from './innerpockettab'
|
||||||
const Pattern = new freesewing.Design(config, [plugins, buttons])
|
const Pattern = new freesewing.Design(config, [plugins, buttons])
|
||||||
|
|
||||||
// Attach draft methods from Bent to prototype
|
// Attach draft methods from Bent to prototype
|
||||||
Pattern.prototype.draftBentBase = function(part) {
|
Pattern.prototype.draftBentBase = function (part) {
|
||||||
return new Bent(this.settings).draftBase(part)
|
return new Bent(this.settings).draftBase(part)
|
||||||
}
|
}
|
||||||
Pattern.prototype.draftBentFront = function(part) {
|
Pattern.prototype.draftBentFront = function (part) {
|
||||||
return new Bent(this.settings).draftFront(part)
|
return new Bent(this.settings).draftFront(part)
|
||||||
}
|
}
|
||||||
Pattern.prototype.draftBentBack = function(part) {
|
Pattern.prototype.draftBentBack = function (part) {
|
||||||
return new Bent(this.settings).draftBack(part)
|
return new Bent(this.settings).draftBack(part)
|
||||||
}
|
}
|
||||||
Pattern.prototype.draftBentSleeve = function(part) {
|
Pattern.prototype.draftBentSleeve = function (part) {
|
||||||
return new Bent(this.settings).draftSleeve(part)
|
return new Bent(this.settings).draftSleeve(part)
|
||||||
}
|
}
|
||||||
Pattern.prototype.draftBentTopSleeve = function(part) {
|
Pattern.prototype.draftBentTopSleeve = function (part) {
|
||||||
return new Bent(this.settings).draftTopSleeve(part)
|
return new Bent(this.settings).draftTopSleeve(part)
|
||||||
}
|
}
|
||||||
Pattern.prototype.draftBentUnderSleeve = function(part) {
|
Pattern.prototype.draftBentUnderSleeve = function (part) {
|
||||||
return new Bent(this.settings).draftUnderSleeve(part)
|
return new Bent(this.settings).draftUnderSleeve(part)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default function(part) {
|
export default function (part) {
|
||||||
let {
|
let {
|
||||||
units,
|
units,
|
||||||
paperless,
|
paperless,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default function(part) {
|
export default function (part) {
|
||||||
let { paperless, sa, store, complete, points, macro, Point, paths, Path } = part.shorthand()
|
let { paperless, sa, store, complete, points, macro, Point, paths, Path } = part.shorthand()
|
||||||
|
|
||||||
points.topLeft = new Point(0, 0)
|
points.topLeft = new Point(0, 0)
|
||||||
|
@ -17,10 +17,7 @@ export default function(part) {
|
||||||
.close()
|
.close()
|
||||||
.attr('class', 'lining')
|
.attr('class', 'lining')
|
||||||
|
|
||||||
paths.hint = new Path()
|
paths.hint = new Path().move(points.top).line(points.bottom).attr('class', 'lining dashed')
|
||||||
.move(points.top)
|
|
||||||
.line(points.bottom)
|
|
||||||
.attr('class', 'lining dashed')
|
|
||||||
|
|
||||||
if (complete) {
|
if (complete) {
|
||||||
points.title = points.top.shiftFractionTowards(points.bottom, 0.5)
|
points.title = points.top.shiftFractionTowards(points.bottom, 0.5)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default function(part) {
|
export default function (part) {
|
||||||
let { paperless, sa, store, complete, points, macro, Point, paths, Path } = part.shorthand()
|
let { paperless, sa, store, complete, points, macro, Point, paths, Path } = part.shorthand()
|
||||||
|
|
||||||
points.topLeft = new Point(0, 0)
|
points.topLeft = new Point(0, 0)
|
||||||
|
@ -27,10 +27,7 @@ export default function(part) {
|
||||||
.close()
|
.close()
|
||||||
.attr('class', 'fabric')
|
.attr('class', 'fabric')
|
||||||
|
|
||||||
paths.fold = new Path()
|
paths.fold = new Path().move(points.leftMid).line(points.rightMid).attr('class', 'dashed')
|
||||||
.move(points.leftMid)
|
|
||||||
.line(points.rightMid)
|
|
||||||
.attr('class', 'dashed')
|
|
||||||
|
|
||||||
paths.welt = new Path()
|
paths.welt = new Path()
|
||||||
.move(points.realTopLeft)
|
.move(points.realTopLeft)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default function(part) {
|
export default function (part) {
|
||||||
let {
|
let {
|
||||||
paperless,
|
paperless,
|
||||||
sa,
|
sa,
|
||||||
|
@ -41,10 +41,7 @@ export default function(part) {
|
||||||
.line(points.roundRightStart)
|
.line(points.roundRightStart)
|
||||||
.curve(points.roundRightCp1, points.roundRightCp2, points.roundRightEnd)
|
.curve(points.roundRightCp1, points.roundRightCp2, points.roundRightEnd)
|
||||||
} else {
|
} else {
|
||||||
paths.seam = new Path()
|
paths.seam = new Path().move(points.edgeLeft).line(points.bottomLeft).line(points.bottomRight)
|
||||||
.move(points.edgeLeft)
|
|
||||||
.line(points.bottomLeft)
|
|
||||||
.line(points.bottomRight)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
paths.seam = paths.seam
|
paths.seam = paths.seam
|
||||||
|
@ -53,10 +50,7 @@ export default function(part) {
|
||||||
.close()
|
.close()
|
||||||
.attr('class', 'fabric')
|
.attr('class', 'fabric')
|
||||||
|
|
||||||
paths.fold = new Path()
|
paths.fold = new Path().move(points.topLeft).line(points.topRight).attr('class', 'fabric dashed')
|
||||||
.move(points.topLeft)
|
|
||||||
.line(points.topRight)
|
|
||||||
.attr('class', 'fabric dashed')
|
|
||||||
|
|
||||||
if (complete) {
|
if (complete) {
|
||||||
points.title = points.topLeft.shiftFractionTowards(points.bottomRight, 0.5)
|
points.title = points.topLeft.shiftFractionTowards(points.bottomRight, 0.5)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default function(part) {
|
export default function (part) {
|
||||||
let {
|
let {
|
||||||
paperless,
|
paperless,
|
||||||
sa,
|
sa,
|
||||||
|
@ -39,17 +39,10 @@ export default function(part) {
|
||||||
.line(points.roundRightStart)
|
.line(points.roundRightStart)
|
||||||
.curve(points.roundRightCp1, points.roundRightCp2, points.roundRightEnd)
|
.curve(points.roundRightCp1, points.roundRightCp2, points.roundRightEnd)
|
||||||
} else {
|
} else {
|
||||||
paths.seam = new Path()
|
paths.seam = new Path().move(points.topLeft).line(points.bottomLeft).line(points.bottomRight)
|
||||||
.move(points.topLeft)
|
|
||||||
.line(points.bottomLeft)
|
|
||||||
.line(points.bottomRight)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
paths.seam = paths.seam
|
paths.seam = paths.seam.line(points.topRight).line(points.topLeft).close().attr('class', 'fabric')
|
||||||
.line(points.topRight)
|
|
||||||
.line(points.topLeft)
|
|
||||||
.close()
|
|
||||||
.attr('class', 'fabric')
|
|
||||||
|
|
||||||
if (complete) {
|
if (complete) {
|
||||||
points.title = points.topLeft.shiftFractionTowards(points.bottomRight, 0.5)
|
points.title = points.topLeft.shiftFractionTowards(points.bottomRight, 0.5)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default function(part) {
|
export default function (part) {
|
||||||
let {
|
let {
|
||||||
paperless,
|
paperless,
|
||||||
sa,
|
sa,
|
||||||
|
@ -37,17 +37,10 @@ export default function(part) {
|
||||||
.line(points.roundRightStart)
|
.line(points.roundRightStart)
|
||||||
.curve(points.roundRightCp1, points.roundRightCp2, points.roundRightEnd)
|
.curve(points.roundRightCp1, points.roundRightCp2, points.roundRightEnd)
|
||||||
} else {
|
} else {
|
||||||
paths.seam = new Path()
|
paths.seam = new Path().move(points.topLeft).line(points.bottomLeft).line(points.bottomRight)
|
||||||
.move(points.topLeft)
|
|
||||||
.line(points.bottomLeft)
|
|
||||||
.line(points.bottomRight)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
paths.seam = paths.seam
|
paths.seam = paths.seam.line(points.topRight).line(points.topLeft).close().attr('class', 'lining')
|
||||||
.line(points.topRight)
|
|
||||||
.line(points.topLeft)
|
|
||||||
.close()
|
|
||||||
.attr('class', 'lining')
|
|
||||||
|
|
||||||
delete paths.fold
|
delete paths.fold
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default function(part) {
|
export default function (part) {
|
||||||
let {
|
let {
|
||||||
units,
|
units,
|
||||||
paperless,
|
paperless,
|
||||||
|
@ -79,11 +79,7 @@ export default function(part) {
|
||||||
to: points.fold2Top.shift(0, 10)
|
to: points.fold2Top.shift(0, 10)
|
||||||
})
|
})
|
||||||
|
|
||||||
if (sa)
|
if (sa) paths.sa = paths.seam.offset(sa).close().attr('class', 'fabric sa')
|
||||||
paths.sa = paths.seam
|
|
||||||
.offset(sa)
|
|
||||||
.close()
|
|
||||||
.attr('class', 'fabric sa')
|
|
||||||
macro('vd', {
|
macro('vd', {
|
||||||
from: points.fold4Bottom.shift(0, 15),
|
from: points.fold4Bottom.shift(0, 15),
|
||||||
to: points.fold4Top.shift(0, 15),
|
to: points.fold4Top.shift(0, 15),
|
||||||
|
|
|
@ -3,7 +3,7 @@ function Attributes() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Adds an attribute */
|
/** Adds an attribute */
|
||||||
Attributes.prototype.add = function(name, value) {
|
Attributes.prototype.add = function (name, value) {
|
||||||
if (typeof this.list[name] === 'undefined') {
|
if (typeof this.list[name] === 'undefined') {
|
||||||
this.list[name] = []
|
this.list[name] = []
|
||||||
}
|
}
|
||||||
|
@ -13,33 +13,33 @@ Attributes.prototype.add = function(name, value) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets an attribute, overwriting existing value */
|
/** Sets an attribute, overwriting existing value */
|
||||||
Attributes.prototype.set = function(name, value) {
|
Attributes.prototype.set = function (name, value) {
|
||||||
this.list[name] = [value]
|
this.list[name] = [value]
|
||||||
|
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Removes an attribute */
|
/** Removes an attribute */
|
||||||
Attributes.prototype.remove = function(name) {
|
Attributes.prototype.remove = function (name) {
|
||||||
delete this.list[name]
|
delete this.list[name]
|
||||||
|
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Retrieves an attribute */
|
/** Retrieves an attribute */
|
||||||
Attributes.prototype.get = function(name) {
|
Attributes.prototype.get = function (name) {
|
||||||
if (typeof this.list[name] === 'undefined') return false
|
if (typeof this.list[name] === 'undefined') return false
|
||||||
else return this.list[name].join(' ')
|
else return this.list[name].join(' ')
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Retrieves an attribute as array*/
|
/** Retrieves an attribute as array*/
|
||||||
Attributes.prototype.getAsArray = function(name) {
|
Attributes.prototype.getAsArray = function (name) {
|
||||||
if (typeof this.list[name] === 'undefined') return false
|
if (typeof this.list[name] === 'undefined') return false
|
||||||
else return this.list[name]
|
else return this.list[name]
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns SVG code for attributes */
|
/** Returns SVG code for attributes */
|
||||||
Attributes.prototype.render = function() {
|
Attributes.prototype.render = function () {
|
||||||
let svg = ''
|
let svg = ''
|
||||||
for (let key in this.list) {
|
for (let key in this.list) {
|
||||||
svg += ` ${key}="${this.list[key].join(' ')}"`
|
svg += ` ${key}="${this.list[key].join(' ')}"`
|
||||||
|
@ -49,7 +49,7 @@ Attributes.prototype.render = function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns CSS code for attributes */
|
/** Returns CSS code for attributes */
|
||||||
Attributes.prototype.renderAsCss = function() {
|
Attributes.prototype.renderAsCss = function () {
|
||||||
let css = ''
|
let css = ''
|
||||||
for (let key in this.list) {
|
for (let key in this.list) {
|
||||||
css += ` ${key}:${this.list[key].join(' ')};`
|
css += ` ${key}:${this.list[key].join(' ')};`
|
||||||
|
@ -60,7 +60,7 @@ Attributes.prototype.renderAsCss = function() {
|
||||||
|
|
||||||
/** Returns SVG code for attributes with a fiven prefix
|
/** Returns SVG code for attributes with a fiven prefix
|
||||||
* typically used for data-text*/
|
* typically used for data-text*/
|
||||||
Attributes.prototype.renderIfPrefixIs = function(prefix = '') {
|
Attributes.prototype.renderIfPrefixIs = function (prefix = '') {
|
||||||
let svg = ''
|
let svg = ''
|
||||||
let prefixLen = prefix.length
|
let prefixLen = prefix.length
|
||||||
for (let key in this.list) {
|
for (let key in this.list) {
|
||||||
|
@ -74,7 +74,7 @@ Attributes.prototype.renderIfPrefixIs = function(prefix = '') {
|
||||||
|
|
||||||
/** Returns a props object for attributes with a fiven prefix
|
/** Returns a props object for attributes with a fiven prefix
|
||||||
* typically used for data-text*/
|
* typically used for data-text*/
|
||||||
Attributes.prototype.asPropsIfPrefixIs = function(prefix = '') {
|
Attributes.prototype.asPropsIfPrefixIs = function (prefix = '') {
|
||||||
let props = {}
|
let props = {}
|
||||||
let prefixLen = prefix.length
|
let prefixLen = prefix.length
|
||||||
for (let key in this.list) {
|
for (let key in this.list) {
|
||||||
|
@ -89,7 +89,7 @@ Attributes.prototype.asPropsIfPrefixIs = function(prefix = '') {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns a deep copy of this */
|
/** Returns a deep copy of this */
|
||||||
Attributes.prototype.clone = function() {
|
Attributes.prototype.clone = function () {
|
||||||
let clone = new Attributes()
|
let clone = new Attributes()
|
||||||
clone.list = JSON.parse(JSON.stringify(this.list))
|
clone.list = JSON.parse(JSON.stringify(this.list))
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ export function register(config) {
|
||||||
function registerValidSW(swUrl, config) {
|
function registerValidSW(swUrl, config) {
|
||||||
navigator.serviceWorker
|
navigator.serviceWorker
|
||||||
.register(swUrl)
|
.register(swUrl)
|
||||||
.then(registration => {
|
.then((registration) => {
|
||||||
registration.onupdatefound = () => {
|
registration.onupdatefound = () => {
|
||||||
const installingWorker = registration.installing
|
const installingWorker = registration.installing
|
||||||
installingWorker.onstatechange = () => {
|
installingWorker.onstatechange = () => {
|
||||||
|
@ -84,7 +84,7 @@ function registerValidSW(swUrl, config) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch((error) => {
|
||||||
console.error('Error during service worker registration:', error)
|
console.error('Error during service worker registration:', error)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -92,14 +92,14 @@ function registerValidSW(swUrl, config) {
|
||||||
function checkValidServiceWorker(swUrl, config) {
|
function checkValidServiceWorker(swUrl, config) {
|
||||||
// Check if the service worker can be found. If it can't reload the page.
|
// Check if the service worker can be found. If it can't reload the page.
|
||||||
fetch(swUrl)
|
fetch(swUrl)
|
||||||
.then(response => {
|
.then((response) => {
|
||||||
// Ensure service worker exists, and that we really are getting a JS file.
|
// Ensure service worker exists, and that we really are getting a JS file.
|
||||||
if (
|
if (
|
||||||
response.status === 404 ||
|
response.status === 404 ||
|
||||||
response.headers.get('content-type').indexOf('javascript') === -1
|
response.headers.get('content-type').indexOf('javascript') === -1
|
||||||
) {
|
) {
|
||||||
// No service worker found. Probably a different app. Reload the page.
|
// No service worker found. Probably a different app. Reload the page.
|
||||||
navigator.serviceWorker.ready.then(registration => {
|
navigator.serviceWorker.ready.then((registration) => {
|
||||||
registration.unregister().then(() => {
|
registration.unregister().then(() => {
|
||||||
window.location.reload()
|
window.location.reload()
|
||||||
})
|
})
|
||||||
|
@ -116,7 +116,7 @@ function checkValidServiceWorker(swUrl, config) {
|
||||||
|
|
||||||
export function unregister() {
|
export function unregister() {
|
||||||
if ('serviceWorker' in navigator) {
|
if ('serviceWorker' in navigator) {
|
||||||
navigator.serviceWorker.ready.then(registration => {
|
navigator.serviceWorker.ready.then((registration) => {
|
||||||
registration.unregister()
|
registration.unregister()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default function(part) {
|
export default function (part) {
|
||||||
let {
|
let {
|
||||||
options,
|
options,
|
||||||
Point,
|
Point,
|
||||||
|
|
|
@ -10,16 +10,16 @@ import draftSleeve from './sleeve'
|
||||||
const Pattern = new freesewing.Design(config, plugins)
|
const Pattern = new freesewing.Design(config, plugins)
|
||||||
|
|
||||||
// Attach draft methods to prototype
|
// Attach draft methods to prototype
|
||||||
Pattern.prototype.draftBase = function(part) {
|
Pattern.prototype.draftBase = function (part) {
|
||||||
return new Brian(this.settings).draftBase(part)
|
return new Brian(this.settings).draftBase(part)
|
||||||
}
|
}
|
||||||
Pattern.prototype.draftFrontBase = function(part) {
|
Pattern.prototype.draftFrontBase = function (part) {
|
||||||
return new Brian(this.settings).draftFront(part)
|
return new Brian(this.settings).draftFront(part)
|
||||||
}
|
}
|
||||||
Pattern.prototype.draftBackBase = function(part) {
|
Pattern.prototype.draftBackBase = function (part) {
|
||||||
return new Brian(this.settings).draftBack(part)
|
return new Brian(this.settings).draftBack(part)
|
||||||
}
|
}
|
||||||
Pattern.prototype.draftSleeveBase = function(part) {
|
Pattern.prototype.draftSleeveBase = function (part) {
|
||||||
let brian = new Brian(this.settings)
|
let brian = new Brian(this.settings)
|
||||||
return brian.draftSleeve(brian.draftSleevecap(part))
|
return brian.draftSleeve(brian.draftSleevecap(part))
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { box } from './shared'
|
import { box } from './shared'
|
||||||
|
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, paths, Path } = part.shorthand()
|
let { Point, points, paths, Path } = part.shorthand()
|
||||||
|
|
||||||
points.origin = new Point(10, 10)
|
points.origin = new Point(10, 10)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Path, paths, options } = part.shorthand()
|
let { Point, points, Path, paths, options } = part.shorthand()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { box } from './shared'
|
import { box } from './shared'
|
||||||
|
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Path, paths } = part.shorthand()
|
let { Point, points, Path, paths } = part.shorthand()
|
||||||
|
|
||||||
points.from = new Point(5, 20)
|
points.from = new Point(5, 20)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Path, paths } = part.shorthand()
|
let { Point, points, Path, paths } = part.shorthand()
|
||||||
|
|
||||||
points.B = new Point(10, 50)
|
points.B = new Point(10, 50)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Path, paths } = part.shorthand()
|
let { Point, points, Path, paths } = part.shorthand()
|
||||||
|
|
||||||
points.A = new Point(45, 60)
|
points.A = new Point(45, 60)
|
||||||
|
@ -7,10 +7,7 @@ export default part => {
|
||||||
points.C = new Point(90, 30)
|
points.C = new Point(90, 30)
|
||||||
points.CCp1 = new Point(50, -30)
|
points.CCp1 = new Point(50, -30)
|
||||||
|
|
||||||
paths.example = new Path()
|
paths.example = new Path().move(points.A).line(points.B).curve(points.BCp2, points.CCp1, points.C)
|
||||||
.move(points.A)
|
|
||||||
.line(points.B)
|
|
||||||
.curve(points.BCp2, points.CCp1, points.C)
|
|
||||||
|
|
||||||
paths.clone = paths.example
|
paths.clone = paths.example
|
||||||
.clone()
|
.clone()
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { box } from './shared'
|
import { box } from './shared'
|
||||||
|
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Path, paths } = part.shorthand()
|
let { Point, points, Path, paths } = part.shorthand()
|
||||||
|
|
||||||
points.from = new Point(10, 20)
|
points.from = new Point(10, 20)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { box } from './shared'
|
import { box } from './shared'
|
||||||
|
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Path, paths } = part.shorthand()
|
let { Point, points, Path, paths } = part.shorthand()
|
||||||
|
|
||||||
points.from = new Point(10, 20)
|
points.from = new Point(10, 20)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { box } from './shared'
|
import { box } from './shared'
|
||||||
|
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Path, paths } = part.shorthand()
|
let { Point, points, Path, paths } = part.shorthand()
|
||||||
|
|
||||||
points.from = new Point(10, 20)
|
points.from = new Point(10, 20)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Path, paths } = part.shorthand()
|
let { Point, points, Path, paths } = part.shorthand()
|
||||||
|
|
||||||
points.A = new Point(55, 40)
|
points.A = new Point(55, 40)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Path, paths, Snippet, snippets } = part.shorthand()
|
let { Point, points, Path, paths, Snippet, snippets } = part.shorthand()
|
||||||
|
|
||||||
points.A = new Point(45, 60)
|
points.A = new Point(45, 60)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Path, paths, Snippet, snippets } = part.shorthand()
|
let { Point, points, Path, paths, Snippet, snippets } = part.shorthand()
|
||||||
|
|
||||||
points.A = new Point(45, 60)
|
points.A = new Point(45, 60)
|
||||||
|
@ -7,10 +7,7 @@ export default part => {
|
||||||
points.C = new Point(90, 30)
|
points.C = new Point(90, 30)
|
||||||
points.CCp1 = new Point(50, -30)
|
points.CCp1 = new Point(50, -30)
|
||||||
|
|
||||||
paths.demo = new Path()
|
paths.demo = new Path().move(points.A).line(points.B).curve(points.BCp2, points.CCp1, points.C)
|
||||||
.move(points.A)
|
|
||||||
.line(points.B)
|
|
||||||
.curve(points.BCp2, points.CCp1, points.C)
|
|
||||||
|
|
||||||
snippets.end = new Snippet('notch', paths.demo.end())
|
snippets.end = new Snippet('notch', paths.demo.end())
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Path, paths, Snippet, snippets } = part.shorthand()
|
let { Point, points, Path, paths, Snippet, snippets } = part.shorthand()
|
||||||
|
|
||||||
points.A = new Point(45, 60)
|
points.A = new Point(45, 60)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Path, paths, Snippet, snippets } = part.shorthand()
|
let { Point, points, Path, paths, Snippet, snippets } = part.shorthand()
|
||||||
|
|
||||||
points.A = new Point(95, 50)
|
points.A = new Point(95, 50)
|
||||||
|
@ -12,10 +12,7 @@ export default part => {
|
||||||
points.top = new Point(60, -10)
|
points.top = new Point(60, -10)
|
||||||
points.bot = new Point(60, 140)
|
points.bot = new Point(60, 140)
|
||||||
|
|
||||||
paths.line = new Path()
|
paths.line = new Path().move(points.top).line(points.bot).attr('class', 'lining dashed')
|
||||||
.move(points.top)
|
|
||||||
.line(points.bot)
|
|
||||||
.attr('class', 'lining dashed')
|
|
||||||
|
|
||||||
paths.demo = new Path()
|
paths.demo = new Path()
|
||||||
.move(points.A)
|
.move(points.A)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Path, paths, Snippet, snippets } = part.shorthand()
|
let { Point, points, Path, paths, Snippet, snippets } = part.shorthand()
|
||||||
|
|
||||||
points.A = new Point(55, 40)
|
points.A = new Point(55, 40)
|
||||||
|
@ -12,10 +12,7 @@ export default part => {
|
||||||
points.top = new Point(10, 58)
|
points.top = new Point(10, 58)
|
||||||
points.bot = new Point(130, 58)
|
points.bot = new Point(130, 58)
|
||||||
|
|
||||||
paths.line = new Path()
|
paths.line = new Path().move(points.top).line(points.bot).attr('class', 'lining dashed')
|
||||||
.move(points.top)
|
|
||||||
.line(points.bot)
|
|
||||||
.attr('class', 'lining dashed')
|
|
||||||
|
|
||||||
paths.demo = new Path()
|
paths.demo = new Path()
|
||||||
.move(points.A)
|
.move(points.A)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Path, paths } = part.shorthand()
|
let { Point, points, Path, paths } = part.shorthand()
|
||||||
|
|
||||||
points.A = new Point(45, 60)
|
points.A = new Point(45, 60)
|
||||||
|
@ -7,10 +7,7 @@ export default part => {
|
||||||
points.C = new Point(90, 30)
|
points.C = new Point(90, 30)
|
||||||
points.CCp1 = new Point(50, -30)
|
points.CCp1 = new Point(50, -30)
|
||||||
|
|
||||||
paths.path1 = new Path()
|
paths.path1 = new Path().move(points.A).line(points.B).attr('class', 'various')
|
||||||
.move(points.A)
|
|
||||||
.line(points.B)
|
|
||||||
.attr('class', 'various')
|
|
||||||
|
|
||||||
paths.path2 = new Path()
|
paths.path2 = new Path()
|
||||||
.move(points.B)
|
.move(points.B)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Path, paths, macro } = part.shorthand()
|
let { Point, points, Path, paths, macro } = part.shorthand()
|
||||||
|
|
||||||
points.A = new Point(45, 60)
|
points.A = new Point(45, 60)
|
||||||
|
@ -7,10 +7,7 @@ export default part => {
|
||||||
points.C = new Point(90, 30)
|
points.C = new Point(90, 30)
|
||||||
points.CCp1 = new Point(50, -30)
|
points.CCp1 = new Point(50, -30)
|
||||||
|
|
||||||
paths.example = new Path()
|
paths.example = new Path().move(points.A).line(points.B).curve(points.BCp2, points.CCp1, points.C)
|
||||||
.move(points.A)
|
|
||||||
.line(points.B)
|
|
||||||
.curve(points.BCp2, points.CCp1, points.C)
|
|
||||||
|
|
||||||
macro('pd', {
|
macro('pd', {
|
||||||
path: paths.example,
|
path: paths.example,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { box } from './shared'
|
import { box } from './shared'
|
||||||
|
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Path, paths } = part.shorthand()
|
let { Point, points, Path, paths } = part.shorthand()
|
||||||
|
|
||||||
points.from = new Point(10, 10)
|
points.from = new Point(10, 10)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { box } from './shared'
|
import { box } from './shared'
|
||||||
|
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Path, paths } = part.shorthand()
|
let { Point, points, Path, paths } = part.shorthand()
|
||||||
|
|
||||||
points.to = new Point(50, 10)
|
points.to = new Point(50, 10)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Path, paths } = part.shorthand()
|
let { Point, points, Path, paths } = part.shorthand()
|
||||||
|
|
||||||
points.A = new Point(45, 60)
|
points.A = new Point(45, 60)
|
||||||
|
@ -16,11 +16,7 @@ export default part => {
|
||||||
|
|
||||||
paths.offset = paths.example.offset(-10).attr('class', 'interfacing')
|
paths.offset = paths.example.offset(-10).attr('class', 'interfacing')
|
||||||
|
|
||||||
paths.lineOffset = new Path()
|
paths.lineOffset = new Path().move(points.A).line(points.B).offset(-5).attr('class', 'various')
|
||||||
.move(points.A)
|
|
||||||
.line(points.B)
|
|
||||||
.offset(-5)
|
|
||||||
.attr('class', 'various')
|
|
||||||
|
|
||||||
paths.curveOffset = new Path()
|
paths.curveOffset = new Path()
|
||||||
.move(points.B)
|
.move(points.B)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Path, paths, options } = part.shorthand()
|
let { Point, points, Path, paths, options } = part.shorthand()
|
||||||
|
|
||||||
const textClasses = label =>
|
const textClasses = (label) =>
|
||||||
options.focus === label ? 'center text-xs fill-note' : 'center text-xs'
|
options.focus === label ? 'center text-xs fill-note' : 'center text-xs'
|
||||||
|
|
||||||
points.A = new Point(10, 10)
|
points.A = new Point(10, 10)
|
||||||
|
@ -46,11 +46,7 @@ export default part => {
|
||||||
.attr('data-text', 'Path.close()')
|
.attr('data-text', 'Path.close()')
|
||||||
.attr('data-text-class', textClasses('close'))
|
.attr('data-text-class', textClasses('close'))
|
||||||
|
|
||||||
paths.example = paths.line
|
paths.example = paths.line.join(paths.curve).join(paths._curve).join(paths.curve_).close()
|
||||||
.join(paths.curve)
|
|
||||||
.join(paths._curve)
|
|
||||||
.join(paths.curve_)
|
|
||||||
.close()
|
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Path, paths } = part.shorthand()
|
let { Point, points, Path, paths } = part.shorthand()
|
||||||
|
|
||||||
points.B = new Point(10, 30)
|
points.B = new Point(10, 30)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Path, paths, Snippet, snippets } = part.shorthand()
|
let { Point, points, Path, paths, Snippet, snippets } = part.shorthand()
|
||||||
|
|
||||||
points.A = new Point(45, 60)
|
points.A = new Point(45, 60)
|
||||||
|
@ -7,10 +7,7 @@ export default part => {
|
||||||
points.C = new Point(90, 30)
|
points.C = new Point(90, 30)
|
||||||
points.CCp1 = new Point(50, -30)
|
points.CCp1 = new Point(50, -30)
|
||||||
|
|
||||||
paths.example = new Path()
|
paths.example = new Path().move(points.A).line(points.B).curve(points.BCp2, points.CCp1, points.C)
|
||||||
.move(points.A)
|
|
||||||
.line(points.B)
|
|
||||||
.curve(points.BCp2, points.CCp1, points.C)
|
|
||||||
|
|
||||||
points.x1 = paths.example
|
points.x1 = paths.example
|
||||||
.shiftAlong(20)
|
.shiftAlong(20)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Path, paths, Snippet, snippets } = part.shorthand()
|
let { Point, points, Path, paths, Snippet, snippets } = part.shorthand()
|
||||||
|
|
||||||
points.A = new Point(45, 60)
|
points.A = new Point(45, 60)
|
||||||
|
@ -7,10 +7,7 @@ export default part => {
|
||||||
points.C = new Point(90, 30)
|
points.C = new Point(90, 30)
|
||||||
points.CCp1 = new Point(50, -30)
|
points.CCp1 = new Point(50, -30)
|
||||||
|
|
||||||
paths.example = new Path()
|
paths.example = new Path().move(points.A).line(points.B).curve(points.BCp2, points.CCp1, points.C)
|
||||||
.move(points.A)
|
|
||||||
.line(points.B)
|
|
||||||
.curve(points.BCp2, points.CCp1, points.C)
|
|
||||||
|
|
||||||
points.x1 = paths.example
|
points.x1 = paths.example
|
||||||
.shiftFractionAlong(0.2)
|
.shiftFractionAlong(0.2)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Path, paths, Snippet, snippets } = part.shorthand()
|
let { Point, points, Path, paths, Snippet, snippets } = part.shorthand()
|
||||||
|
|
||||||
points.A = new Point(45, 60)
|
points.A = new Point(45, 60)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Path, paths, Snippet, snippets } = part.shorthand()
|
let { Point, points, Path, paths, Snippet, snippets } = part.shorthand()
|
||||||
|
|
||||||
points.A = new Point(45, 60)
|
points.A = new Point(45, 60)
|
||||||
|
@ -7,10 +7,7 @@ export default part => {
|
||||||
points.C = new Point(90, 30)
|
points.C = new Point(90, 30)
|
||||||
points.CCp1 = new Point(50, -30)
|
points.CCp1 = new Point(50, -30)
|
||||||
|
|
||||||
paths.example = new Path()
|
paths.example = new Path().move(points.A).line(points.B).curve(points.BCp2, points.CCp1, points.C)
|
||||||
.move(points.A)
|
|
||||||
.line(points.B)
|
|
||||||
.curve(points.BCp2, points.CCp1, points.C)
|
|
||||||
|
|
||||||
snippets.start = new Snippet('notch', paths.example.start())
|
snippets.start = new Snippet('notch', paths.example.start())
|
||||||
return part
|
return part
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Path, paths, macro } = part.shorthand()
|
let { Point, points, Path, paths, macro } = part.shorthand()
|
||||||
|
|
||||||
points.A = new Point(45, 60)
|
points.A = new Point(45, 60)
|
||||||
|
@ -7,10 +7,7 @@ export default part => {
|
||||||
points.C = new Point(90, 30)
|
points.C = new Point(90, 30)
|
||||||
points.CCp1 = new Point(50, -30)
|
points.CCp1 = new Point(50, -30)
|
||||||
|
|
||||||
paths.A = new Path()
|
paths.A = new Path().move(points.A).line(points.B).curve(points.BCp2, points.CCp1, points.C)
|
||||||
.move(points.A)
|
|
||||||
.line(points.B)
|
|
||||||
.curve(points.BCp2, points.CCp1, points.C)
|
|
||||||
|
|
||||||
paths.B = paths.A.translate(60, 30)
|
paths.B = paths.A.translate(60, 30)
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Path, paths } = part.shorthand()
|
let { Point, points, Path, paths } = part.shorthand()
|
||||||
|
|
||||||
points.center = new Point(0, 0)
|
points.center = new Point(0, 0)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Path, paths, macro } = part.shorthand()
|
let { Point, points, Path, paths, macro } = part.shorthand()
|
||||||
|
|
||||||
points.A = new Point(0, 0)
|
points.A = new Point(0, 0)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { box } from './shared'
|
import { box } from './shared'
|
||||||
|
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, snippets, Snippet } = part.shorthand()
|
let { Point, snippets, Snippet } = part.shorthand()
|
||||||
|
|
||||||
snippets.logo = new Snippet('logo', new Point(50, 30))
|
snippets.logo = new Snippet('logo', new Point(50, 30))
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Path, paths, macro } = part.shorthand()
|
let { Point, points, Path, paths, macro } = part.shorthand()
|
||||||
|
|
||||||
points.topLeft = new Point(0, 0)
|
points.topLeft = new Point(0, 0)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, macro } = part.shorthand()
|
let { Point, points, macro } = part.shorthand()
|
||||||
|
|
||||||
points.anchor1 = new Point(0, 0)
|
points.anchor1 = new Point(0, 0)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { box } from './shared'
|
import { box } from './shared'
|
||||||
|
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, macro } = part.shorthand()
|
let { Point, points, macro } = part.shorthand()
|
||||||
|
|
||||||
points.a = new Point(10, 10)
|
points.a = new Point(10, 10)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { box } from './shared'
|
import { box } from './shared'
|
||||||
|
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, macro } = part.shorthand()
|
let { Point, points, macro } = part.shorthand()
|
||||||
|
|
||||||
points.title = new Point(90, 45)
|
points.title = new Point(90, 45)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Path, paths } = part.shorthand()
|
let { Point, points, Path, paths } = part.shorthand()
|
||||||
|
|
||||||
points.sun = new Point(10, 5)
|
points.sun = new Point(10, 5)
|
||||||
|
@ -8,10 +8,7 @@ export default part => {
|
||||||
.attr('data-text', points.sun.angle(points.moon) + '°')
|
.attr('data-text', points.sun.angle(points.moon) + '°')
|
||||||
.attr('data-text-class', 'text-sm fill-note center')
|
.attr('data-text-class', 'text-sm fill-note center')
|
||||||
|
|
||||||
paths.line = new Path()
|
paths.line = new Path().move(points.sun).line(points.moon).attr('class', 'dashed')
|
||||||
.move(points.sun)
|
|
||||||
.line(points.moon)
|
|
||||||
.attr('class', 'dashed')
|
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { box } from './shared'
|
import { box } from './shared'
|
||||||
|
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points } = part.shorthand()
|
let { Point, points } = part.shorthand()
|
||||||
|
|
||||||
points.anchor = new Point(100, 25)
|
points.anchor = new Point(100, 25)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { box } from './shared'
|
import { box } from './shared'
|
||||||
|
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Snippet, snippets } = part.shorthand()
|
let { Point, points, Snippet, snippets } = part.shorthand()
|
||||||
|
|
||||||
points.A = new Point(25, 25)
|
points.A = new Point(25, 25)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { box } from './shared'
|
import { box } from './shared'
|
||||||
|
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Snippet, snippets } = part.shorthand()
|
let { Point, points, Snippet, snippets } = part.shorthand()
|
||||||
|
|
||||||
points.A = new Point(50, 25).attr('data-text', 'Point A').attr('data-text-class', 'text-xl')
|
points.A = new Point(50, 25).attr('data-text', 'Point A').attr('data-text-class', 'text-xl')
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, macro } = part.shorthand()
|
let { Point, points, macro } = part.shorthand()
|
||||||
|
|
||||||
points.from = new Point(10, 10)
|
points.from = new Point(10, 10)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, macro } = part.shorthand()
|
let { Point, points, macro } = part.shorthand()
|
||||||
|
|
||||||
points.from = new Point(10, 10)
|
points.from = new Point(10, 10)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, macro } = part.shorthand()
|
let { Point, points, macro } = part.shorthand()
|
||||||
|
|
||||||
points.from = new Point(10, 10)
|
points.from = new Point(10, 10)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Path, paths } = part.shorthand()
|
let { Point, points, Path, paths } = part.shorthand()
|
||||||
|
|
||||||
points.top = new Point(50, 10)
|
points.top = new Point(50, 10)
|
||||||
|
@ -39,10 +39,7 @@ export default part => {
|
||||||
.line(points._out1)
|
.line(points._out1)
|
||||||
.close()
|
.close()
|
||||||
|
|
||||||
paths.mirror = new Path()
|
paths.mirror = new Path().move(points.top).line(points.bottom).attr('class', 'note dashed')
|
||||||
.move(points.top)
|
|
||||||
.line(points.bottom)
|
|
||||||
.attr('class', 'note dashed')
|
|
||||||
|
|
||||||
return part
|
return part
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Path, paths } = part.shorthand()
|
let { Point, points, Path, paths } = part.shorthand()
|
||||||
|
|
||||||
points.start = new Point(0, 50)
|
points.start = new Point(0, 50)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Path, paths } = part.shorthand()
|
let { Point, points, Path, paths } = part.shorthand()
|
||||||
|
|
||||||
points.sun = new Point(40, 40)
|
points.sun = new Point(40, 40)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { box } from './shared'
|
import { box } from './shared'
|
||||||
|
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, macro } = part.shorthand()
|
let { Point, points, macro } = part.shorthand()
|
||||||
|
|
||||||
points.A = new Point(90, 40).attr('data-text', 'Point A').attr('data-text-class', 'right')
|
points.A = new Point(90, 40).attr('data-text', 'Point A').attr('data-text-class', 'right')
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Path, paths, macro } = part.shorthand()
|
let { Point, points, Path, paths, macro } = part.shorthand()
|
||||||
|
|
||||||
points.A = new Point(90, 70).attr('data-text', 'Point A')
|
points.A = new Point(90, 70).attr('data-text', 'Point A')
|
||||||
|
@ -8,10 +8,7 @@ export default part => {
|
||||||
.attr('data-text-class', 'center')
|
.attr('data-text-class', 'center')
|
||||||
.attr('data-text-lineheight', 6)
|
.attr('data-text-lineheight', 6)
|
||||||
|
|
||||||
paths.direction = new Path()
|
paths.direction = new Path().move(points.A).line(points.B).attr('class', 'note dashed')
|
||||||
.move(points.A)
|
|
||||||
.line(points.B)
|
|
||||||
.attr('class', 'note dashed')
|
|
||||||
|
|
||||||
macro('ld', {
|
macro('ld', {
|
||||||
from: points.C,
|
from: points.C,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { box } from './shared'
|
import { box } from './shared'
|
||||||
|
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Path, paths, macro } = part.shorthand()
|
let { Point, points, Path, paths, macro } = part.shorthand()
|
||||||
|
|
||||||
points.A = new Point(90, 70).attr('data-text', 'Point A')
|
points.A = new Point(90, 70).attr('data-text', 'Point A')
|
||||||
|
@ -9,10 +9,7 @@ export default part => {
|
||||||
.attr('data-text', 'Point C is point A shifted 3cm\nbeyond point B')
|
.attr('data-text', 'Point C is point A shifted 3cm\nbeyond point B')
|
||||||
.attr('data-text-lineheight', 6)
|
.attr('data-text-lineheight', 6)
|
||||||
|
|
||||||
paths.direction = new Path()
|
paths.direction = new Path().move(points.A).line(points.C).attr('class', 'note dashed')
|
||||||
.move(points.A)
|
|
||||||
.line(points.C)
|
|
||||||
.attr('class', 'note dashed')
|
|
||||||
|
|
||||||
macro('ld', {
|
macro('ld', {
|
||||||
from: points.C,
|
from: points.C,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { box } from './shared'
|
import { box } from './shared'
|
||||||
|
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Path, paths, macro } = part.shorthand()
|
let { Point, points, Path, paths, macro } = part.shorthand()
|
||||||
|
|
||||||
points.A = new Point(90, 70).attr('data-text', 'Point A')
|
points.A = new Point(90, 70).attr('data-text', 'Point A')
|
||||||
|
@ -10,10 +10,7 @@ export default part => {
|
||||||
.attr('data-text-class', 'center')
|
.attr('data-text-class', 'center')
|
||||||
.attr('data-text-lineheight', 6)
|
.attr('data-text-lineheight', 6)
|
||||||
|
|
||||||
paths.direction = new Path()
|
paths.direction = new Path().move(points.A).line(points.B).attr('class', 'note dashed')
|
||||||
.move(points.A)
|
|
||||||
.line(points.B)
|
|
||||||
.attr('class', 'note dashed')
|
|
||||||
|
|
||||||
macro('ld', {
|
macro('ld', {
|
||||||
from: points.C,
|
from: points.C,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { box } from './shared'
|
import { box } from './shared'
|
||||||
|
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Snippet, snippets } = part.shorthand()
|
let { Point, points, Snippet, snippets } = part.shorthand()
|
||||||
|
|
||||||
let s
|
let s
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { box } from './shared'
|
import { box } from './shared'
|
||||||
|
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Snippet, snippets } = part.shorthand()
|
let { Point, points, Snippet, snippets } = part.shorthand()
|
||||||
|
|
||||||
box(part)
|
box(part)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { box } from './shared'
|
import { box } from './shared'
|
||||||
|
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, macro } = part.shorthand()
|
let { Point, points, macro } = part.shorthand()
|
||||||
|
|
||||||
points.A = new Point(20, 20).attr('data-text', 'Point A')
|
points.A = new Point(20, 20).attr('data-text', 'Point A')
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Path, paths } = part.shorthand()
|
let { Point, points, Path, paths } = part.shorthand()
|
||||||
|
|
||||||
points.A = new Point(45, 60)
|
points.A = new Point(45, 60)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { box } from './shared'
|
import { box } from './shared'
|
||||||
|
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Snippet, snippets } = part.shorthand()
|
let { Point, points, Snippet, snippets } = part.shorthand()
|
||||||
|
|
||||||
points.anchor1 = new Point(20, 15)
|
points.anchor1 = new Point(20, 15)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { box } from './shared'
|
import { box } from './shared'
|
||||||
|
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Snippet, snippets } = part.shorthand()
|
let { Point, points, Snippet, snippets } = part.shorthand()
|
||||||
|
|
||||||
points.anchor = new Point(50, 15)
|
points.anchor = new Point(50, 15)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { box } from './shared'
|
import { box } from './shared'
|
||||||
|
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Snippet, snippets } = part.shorthand()
|
let { Point, points, Snippet, snippets } = part.shorthand()
|
||||||
|
|
||||||
points.anchor = new Point(35, 35)
|
points.anchor = new Point(35, 35)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { box } from './shared'
|
import { box } from './shared'
|
||||||
|
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Path, paths, Snippet, snippets, utils } = part.shorthand()
|
let { Point, points, Path, paths, Snippet, snippets, utils } = part.shorthand()
|
||||||
|
|
||||||
points.A = new Point(95, 45).attr('data-circle', 35).attr('data-circle-class', 'fabric')
|
points.A = new Point(95, 45).attr('data-circle', 35).attr('data-circle-class', 'fabric')
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default part => {
|
export default (part) => {
|
||||||
let { Point, points, Path, paths, Snippet, snippets, utils } = part.shorthand()
|
let { Point, points, Path, paths, Snippet, snippets, utils } = part.shorthand()
|
||||||
|
|
||||||
points.A = new Point(10, 10)
|
points.A = new Point(10, 10)
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue