1
0
Fork 0
This commit is contained in:
Wouter van Wageningen 2020-09-26 17:11:31 -07:00
parent 13848f8252
commit 31347b04b0
3 changed files with 131 additions and 7 deletions

View file

@ -51,6 +51,12 @@ export default function (part) {
points.pocketLeftBottom = points.pocketLeftTop.shift(270, pocketSize)
points.pocketRightBottom = points.pocketLeftBottom.shift(0, pocketSize)
points.crossBoxTo1 = new Point(points.topRightHem.x - strapWidth, points.topRightHem.y + hemWidth)
points.crossBoxTo2 = new Point(
points.topRightBack.x - strapWidth,
points.topRightBack.y + hemWidth
)
console.log('bibLength ' + measurements.hpsToWaistBack * options.bibLength)
console.log('hpsToWaistBack ' + measurements.hpsToWaistBack)
@ -69,7 +75,7 @@ export default function (part) {
.line(points.pocketRightTop)
.line(points.pocketRightBottom)
.line(points.pocketLeftBottom)
.attr('class', 'various dashed')
.attr('class', 'lining dotted stroke-sm')
.attr('data-text', 'pocket')
.attr('data-text-class', 'text-xs center')
@ -108,6 +114,16 @@ export default function (part) {
title: 'Front'
})
macro('crossBox', {
from: points.topRightHem,
to: points.crossBoxTo1
})
macro('crossBox', {
from: points.topRightBack,
to: points.crossBoxTo2,
text: 'attachment'
})
if (sa) {
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
}
@ -145,6 +161,21 @@ export default function (part) {
to: points.topRight,
x: points.topRightBack.x + sa + 15
})
macro('vd', {
from: points.topLeft,
to: points.topLeftHem,
x: points.topLeftHem.x + sa + 15
})
macro('vd', {
from: points.topLeftHem,
to: points.bottomLeftHem,
x: points.topLeftHem.x + sa + 15
})
macro('vd', {
from: points.bottomLeftHem,
to: points.bottomLeft,
x: points.bottomLeftHem.x + sa + 15
})
}
return part

View file

@ -5,8 +5,65 @@ import draftFront from './front'
import draftStrap from './strap'
import draftPocket from './pocket'
const crossBox = {
//name,
//version,
macros: {
crossBox: function (so) {
let id = this.getId()
let shiftFraction = 0.1
this.points[id + '_boxTopLeft'] = so.from.copy()
this.points[id + '_boxBottomRight'] = so.to.copy()
this.points[id + '_boxTopRight'] = new this.Point(so.to.x, so.from.y)
this.points[id + '_boxBottomLeft'] = new this.Point(so.from.x, so.to.y)
this.points[id + '_topCrossTL'] = this.points[id + '_boxTopLeft'].shiftFractionTowards(
this.points[id + '_boxBottomRight'],
shiftFraction
)
this.points[id + '_topCrossTR'] = this.points[id + '_boxTopRight'].shiftFractionTowards(
this.points[id + '_boxBottomLeft'],
shiftFraction
)
this.points[id + '_topCrossBL'] = this.points[id + '_boxBottomLeft'].shiftFractionTowards(
this.points[id + '_boxTopRight'],
shiftFraction
)
this.points[id + '_topCrossBR'] = this.points[id + '_boxBottomRight'].shiftFractionTowards(
this.points[id + '_boxTopLeft'],
shiftFraction
)
this.paths[id + 'crossBox'] = new this.Path()
.move(this.points[id + '_boxTopLeft'])
.line(this.points[id + '_boxTopRight'])
.line(this.points[id + '_boxBottomRight'])
.line(this.points[id + '_boxBottomLeft'])
.line(this.points[id + '_boxTopLeft'])
.close()
.attr('class', 'lining dotted stroke-sm')
this.paths[id + '_topCross'] = new this.Path()
.move(this.points[id + '_topCrossTL'])
.line(this.points[id + '_topCrossBR'])
.line(this.points[id + '_topCrossTR'])
.line(this.points[id + '_topCrossBL'])
.line(this.points[id + '_topCrossTL'])
.line(this.points[id + '_topCrossTR'])
.move(this.points[id + '_topCrossBR'])
.line(this.points[id + '_topCrossBL'])
.attr('class', 'lining dotted stroke-sm')
if (typeof so.text === 'string') {
this.points.textAnchor = this.points[id + '_boxTopLeft']
.shiftFractionTowards(this.points[id + '_boxBottomRight'], 0.5)
.attr('data-text', so.text)
.attr('data-text-class', 'center')
}
}
}
}
// Create new design
const Pattern = new freesewing.Design(config, plugins)
const Pattern = new freesewing.Design(config, [plugins, crossBox])
// Attach the draft methods to the prototype
Pattern.prototype.draftFront = draftFront

View file

@ -21,6 +21,7 @@ export default function (part) {
(1 - options.backOpening)
let backOpening =
apronWidth - Math.max(measurements.hipsCircumference, measurements.waistCircumference)
let hemWidth = 3 * sa
let hSpan = backOpening / 2 + bibWidth / 2
let vSpan =
@ -31,19 +32,23 @@ export default function (part) {
let strapLength =
Math.sqrt(hSpan * hSpan + vSpan * vSpan) + measurements.chestCircumference * options.chestDepth
let strapWidth = options.strapWidth * sa
/*
console.log('chestWidth ' + chestWidth)
console.log('backOpening ' + backOpening)
console.log('hSpan ' + hSpan)
console.log('vSpan ' + vSpan)
console.log('strapLength ' + strapLength)
*/
points.topLeft = new Point(0, 0)
points.topLeftHem = points.topLeft.shift(270, hemWidth)
points.topMiddle = new Point(strapWidth, 0)
points.topMiddleHem = new Point(strapWidth, hemWidth)
points.topRight = new Point(strapWidth * 2, 0)
points.bottomLeft = new Point(0, strapLength)
points.bottomMiddle = new Point(strapWidth, strapLength)
points.bottomRight = new Point(strapWidth * 2, strapLength)
points.bottomLeftHem = new Point(0, strapLength + hemWidth)
points.bottomLeft = new Point(0, strapLength + hemWidth * 2)
points.bottomMiddleHem = new Point(strapWidth, strapLength + hemWidth)
points.bottomMiddle = new Point(strapWidth, strapLength + hemWidth * 2)
points.bottomRight = new Point(strapWidth * 2, strapLength + hemWidth * 2)
paths.seam = new Path()
.move(points.topLeft)
@ -54,6 +59,19 @@ export default function (part) {
.close()
.attr('class', 'fabric')
paths.topHem = new Path()
.move(points.topLeftHem)
.line(points.topMiddleHem)
.attr('class', 'various dashed')
.attr('data-text', 'attach')
.attr('data-text-class', 'text-xs center')
paths.bottomHem = new Path()
.move(points.bottomLeftHem)
.line(points.bottomMiddleHem)
.attr('class', 'various dashed')
.attr('data-text', 'attach')
.attr('data-text-class', 'text-xs center')
paths.fold = new Path()
.move(points.topMiddle)
.line(points.bottomMiddle)
@ -61,6 +79,9 @@ export default function (part) {
.attr('data-text', 'fold')
.attr('data-text-class', 'text-xs center')
macro('crossBox', { from: points.topLeft, to: points.topMiddleHem })
macro('crossBox', { from: points.bottomLeftHem, to: points.bottomMiddle })
// Complete?
if (complete) {
points.logo = points.topLeft.shiftFractionTowards(points.bottomRight, 0.5)
@ -88,6 +109,21 @@ export default function (part) {
to: points.topLeft,
x: points.topLeft.x - sa - 15
})
macro('vd', {
from: points.topMiddle,
to: points.topMiddleHem,
x: points.topMiddleHem.x + sa + 15
})
macro('vd', {
from: points.topMiddleHem,
to: points.bottomMiddleHem,
x: points.topMiddleHem.x + sa + 15
})
macro('vd', {
from: points.bottomMiddleHem,
to: points.bottomMiddle,
x: points.bottomMiddleHem.x + sa + 15
})
}
return part