fix(tiberius): Some small fixes
This commit is contained in:
parent
85f1eae9ef
commit
fa02a40dab
3 changed files with 78 additions and 141 deletions
|
@ -26,7 +26,7 @@ export default {
|
||||||
style: [
|
style: [
|
||||||
'lengthBonus',
|
'lengthBonus',
|
||||||
'widthBonus',
|
'widthBonus',
|
||||||
{ clavi: ['clavi', 'clavusPosBonus', 'clavusWidth'] },
|
{ clavi: ['clavi', 'clavusLocation', 'clavusWidth'] },
|
||||||
'length',
|
'length',
|
||||||
'width',
|
'width',
|
||||||
],
|
],
|
||||||
|
@ -56,7 +56,7 @@ export default {
|
||||||
lengthBonus: { pct: 90, min: 60, max: 130 },
|
lengthBonus: { pct: 90, min: 60, max: 130 },
|
||||||
widthBonus: { pct: 100, min: 50, max: 130 },
|
widthBonus: { pct: 100, min: 50, max: 130 },
|
||||||
clavi: { bool: false },
|
clavi: { bool: false },
|
||||||
clavusPosBonus: { pct: 105, min: 90, max: 130 },
|
clavusLocation: { pct: 65, min: 50, max: 80 },
|
||||||
clavusWidth: { pct: 100, min: 50, max: 150 },
|
clavusWidth: { pct: 100, min: 50, max: 150 },
|
||||||
length: {
|
length: {
|
||||||
list: ['ToKnee', 'ToMidLeg', 'ToFloor'],
|
list: ['ToKnee', 'ToMidLeg', 'ToFloor'],
|
||||||
|
|
|
@ -1,49 +0,0 @@
|
||||||
export default function (part) {
|
|
||||||
const { options, Point, Path, points, paths, Snippet, snippets, complete, sa, paperless, macro } =
|
|
||||||
part.shorthand()
|
|
||||||
|
|
||||||
const w = 500 * options.size
|
|
||||||
points.topLeft = new Point(0, 0)
|
|
||||||
points.topRight = new Point(w, 0)
|
|
||||||
points.bottomLeft = new Point(0, w / 2)
|
|
||||||
points.bottomRight = new Point(w, w / 2)
|
|
||||||
|
|
||||||
paths.seam = new Path()
|
|
||||||
.move(points.topLeft)
|
|
||||||
.line(points.bottomLeft)
|
|
||||||
.line(points.bottomRight)
|
|
||||||
.line(points.topRight)
|
|
||||||
.line(points.topLeft)
|
|
||||||
.close()
|
|
||||||
.attr('class', 'fabric')
|
|
||||||
|
|
||||||
// Complete?
|
|
||||||
if (complete) {
|
|
||||||
points.logo = points.topLeft.shiftFractionTowards(points.bottomRight, 0.5)
|
|
||||||
snippets.logo = new Snippet('logo', points.logo)
|
|
||||||
points.text = points.logo
|
|
||||||
.shift(-90, w / 8)
|
|
||||||
.attr('data-text', 'hello')
|
|
||||||
.attr('data-text-class', 'center')
|
|
||||||
|
|
||||||
if (sa) {
|
|
||||||
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Paperless?
|
|
||||||
if (paperless) {
|
|
||||||
macro('hd', {
|
|
||||||
from: points.bottomLeft,
|
|
||||||
to: points.bottomRight,
|
|
||||||
y: points.bottomLeft.y + sa + 15,
|
|
||||||
})
|
|
||||||
macro('vd', {
|
|
||||||
from: points.bottomRight,
|
|
||||||
to: points.topRight,
|
|
||||||
x: points.topRight.x + sa + 15,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
return part
|
|
||||||
}
|
|
|
@ -1,5 +1,5 @@
|
||||||
export default function (part) {
|
export default function (part) {
|
||||||
let {
|
const {
|
||||||
Point,
|
Point,
|
||||||
points,
|
points,
|
||||||
Path,
|
Path,
|
||||||
|
@ -14,38 +14,14 @@ export default function (part) {
|
||||||
paperless,
|
paperless,
|
||||||
} = part.shorthand()
|
} = part.shorthand()
|
||||||
|
|
||||||
// define some variables
|
// Handle width
|
||||||
|
let width = (options.width === 'ToElbow')
|
||||||
let width
|
? measurements.shoulderToElbow
|
||||||
if (options.width === 'ToElbow') {
|
: (options.width === 'ToMidArm')
|
||||||
width = measurements.shoulderToElbow
|
? measurements.shoulderToElbow / 2
|
||||||
}
|
: 0
|
||||||
if (options.width === 'ToMidArm') {
|
|
||||||
width = measurements.shoulderToElbow / 2
|
|
||||||
}
|
|
||||||
if (options.width === 'ToShoulder') {
|
|
||||||
width = 0
|
|
||||||
} // careful! takes other measurements if those are bigger to ensure that the tunica actually fits your body, use forceWidth if you know what you're doing
|
|
||||||
|
|
||||||
let hem_pos
|
|
||||||
if (options.length === 'ToKnee') {
|
|
||||||
hem_pos = measurements.waistToKnee
|
|
||||||
}
|
|
||||||
if (options.length === 'ToMidLeg') {
|
|
||||||
hem_pos = measurements.waistToKnee / 1.3
|
|
||||||
} //UpperLeg}
|
|
||||||
if (options.length === 'ToFloor') {
|
|
||||||
hem_pos = measurements.waistToFloor * 0.95
|
|
||||||
}
|
|
||||||
|
|
||||||
let hwidth = (measurements.shoulderToShoulder / 2 + width) * options.widthBonus
|
let hwidth = (measurements.shoulderToShoulder / 2 + width) * options.widthBonus
|
||||||
let length = (measurements.hpsToWaistBack + hem_pos) * options.lengthBonus
|
// Some checks, can be circumvented with forceWidth
|
||||||
let hhead = (measurements.head / 4) * options.headRatio
|
|
||||||
let armhole = (measurements.biceps / 2) * 1.3 * options.armholeDrop
|
|
||||||
let clavusPos = hhead * options.clavusPosBonus
|
|
||||||
let clavusWidth = (options.clavusWidth * hwidth) / 13 / options.widthBonus
|
|
||||||
|
|
||||||
// some checks, can be circumvented with forceWidth
|
|
||||||
if (options.forceWidth === false) {
|
if (options.forceWidth === false) {
|
||||||
if (hwidth < measurements.waist / 4) {
|
if (hwidth < measurements.waist / 4) {
|
||||||
hwidth = (measurements.waist / 4) * options.widthBonus
|
hwidth = (measurements.waist / 4) * options.widthBonus
|
||||||
|
@ -60,44 +36,70 @@ export default function (part) {
|
||||||
hwidth = (measurements.seat / 4) * options.widthBonus
|
hwidth = (measurements.seat / 4) * options.widthBonus
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Other variables
|
||||||
|
const hem_pos = (options.length === 'ToKnee')
|
||||||
|
? measurements.waistToKnee
|
||||||
|
: (options.length === 'ToMidLeg')
|
||||||
|
? measurements.waistToKnee / 1.3
|
||||||
|
: measurements.waistToFloor * 0.95
|
||||||
|
const length = (measurements.hpsToWaistBack + hem_pos) * options.lengthBonus
|
||||||
|
const hhead = (measurements.head / 4) * options.headRatio
|
||||||
|
const armhole = (measurements.biceps / 2) * 1.3 * options.armholeDrop
|
||||||
|
const clavusPos = hhead * options.clavusPosBonus
|
||||||
|
const clavusWidth = (options.clavusWidth * hwidth) / 13 / options.widthBonus
|
||||||
|
|
||||||
// make points
|
// Add points
|
||||||
points.top = new Point(0, 0)
|
points.top = new Point(0, 0)
|
||||||
points.bottom = new Point(0, length)
|
points.bottom = new Point(0, length)
|
||||||
points.topLeft = points.top.shift(0, -hwidth)
|
points.topLeft = points.top.shift(0, -hwidth)
|
||||||
points.bottomLeft = points.bottom.shift(0, points.bottom.dx(points.topLeft))
|
|
||||||
points.headLeft = points.top.shift(180, hhead)
|
points.headLeft = points.top.shift(180, hhead)
|
||||||
|
// Don't go more narrow than head opening
|
||||||
|
points.topLeftMin = points.top.shiftFractionTowards(points.headLeft, 1.1)
|
||||||
|
if (points.topLeftMin.x < points.topLeft.x) points.topLeft.x = points.topLeftMin.x
|
||||||
|
points.bottomLeft = points.bottom.shift(0, points.bottom.dx(points.topLeft))
|
||||||
points.armholeLeft = points.topLeft.shift(-90, armhole)
|
points.armholeLeft = points.topLeft.shift(-90, armhole)
|
||||||
|
|
||||||
// draw paths
|
// draw paths
|
||||||
paths.seam = new Path()
|
paths.saBase = new Path()
|
||||||
.move(points.top)
|
.move(points.top)
|
||||||
.line(points.topLeft)
|
.line(points.topLeft)
|
||||||
.line(points.bottomLeft)
|
.line(points.bottomLeft)
|
||||||
|
.setRender(false)
|
||||||
|
paths.hem = new Path()
|
||||||
|
.move(points.bottomLeft)
|
||||||
|
.line(points.bottom)
|
||||||
|
.setRender(false)
|
||||||
|
paths.fold = new Path()
|
||||||
|
.move(points.bottom)
|
||||||
|
.line(points.top)
|
||||||
|
.setRender(false)
|
||||||
|
paths.seam = paths.saBase
|
||||||
|
.join(paths.hem)
|
||||||
|
.join(paths.fold)
|
||||||
|
.setRender(true)
|
||||||
.attr('class', 'fabric')
|
.attr('class', 'fabric')
|
||||||
|
|
||||||
paths.hem = new Path().move(points.bottomLeft).line(points.bottom).attr('class', 'fabric')
|
|
||||||
|
|
||||||
paths.fold = new Path().move(points.bottom).line(points.top).attr('class', 'fabric')
|
|
||||||
|
|
||||||
// clavi
|
// clavi
|
||||||
if (options.clavi) {
|
if (options.clavi) {
|
||||||
// make points
|
// make points
|
||||||
points.clavusTopRight = points.top.shift(180, clavusPos)
|
points.claviCenterTop = points.top.shiftFractionTowards(points.topLeft, options.clavusLocation)
|
||||||
points.clavusBottomRight = points.bottom.shift(0, points.top.dx(points.clavusTopRight))
|
points.claviRightTop = points.claviCenterTop.shift(0, clavusWidth)
|
||||||
points.clavusTopLeft = points.clavusTopRight.shift(180, clavusWidth)
|
points.claviLeftTop = points.claviRightTop.flipX(points.claviCenterTop)
|
||||||
points.clavusBottomLeft = points.bottom.shift(0, points.top.dx(points.clavusTopLeft))
|
points.claviRightBottom = new Point(points.claviRightTop.x, points.bottom.y)
|
||||||
|
points.claviLeftBottom = new Point(points.claviLeftTop.x, points.bottom.y)
|
||||||
|
|
||||||
// draw paths
|
// draw paths
|
||||||
paths.clavusRight = new Path()
|
paths.clavusRight = new Path()
|
||||||
.move(points.clavusTopRight)
|
.move(points.claviRightBottom)
|
||||||
.line(points.clavusBottomRight)
|
.line(points.claviRightTop)
|
||||||
.attr('class', 'various dashed')
|
.attr('class', 'various dashed')
|
||||||
|
.attr('data-text', 'biasTape')
|
||||||
|
.attr('data-text-class', 'center fill-various')
|
||||||
paths.clavusLeft = new Path()
|
paths.clavusLeft = new Path()
|
||||||
.move(points.clavusTopLeft)
|
.move(points.claviLeftBottom)
|
||||||
.line(points.clavusBottomLeft)
|
.line(points.claviLeftTop)
|
||||||
.attr('class', 'various dashed')
|
.attr('class', 'various dashed')
|
||||||
.attr('data-text', 'BiasTape')
|
.attr('data-text', 'biasTape')
|
||||||
.attr('data-text-class', 'center fill-various')
|
.attr('data-text-class', 'center fill-various')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,9 +117,11 @@ export default function (part) {
|
||||||
})
|
})
|
||||||
|
|
||||||
// logo & title
|
// logo & title
|
||||||
points.logo = points.top.shift(45, points.bottom.dy(points.top) / 3)
|
points.midTop = points.top.shiftFractionTowards(points.headLeft, 0.5)
|
||||||
|
points.midBottom = new Point(points.midTop.x, points.bottom.y)
|
||||||
|
points.logo = points.midTop.shiftFractionTowards(points.midBottom, 0.3)
|
||||||
snippets.logo = new Snippet('logo', points.logo)
|
snippets.logo = new Snippet('logo', points.logo)
|
||||||
points.title = points.logo.shift(90, points.bottom.dy(points.top) / 4)
|
points.title = points.midTop.shiftFractionTowards(points.midBottom, 0.5)
|
||||||
macro('title', {
|
macro('title', {
|
||||||
at: points.title,
|
at: points.title,
|
||||||
nr: 1,
|
nr: 1,
|
||||||
|
@ -128,12 +132,12 @@ export default function (part) {
|
||||||
points.__titlePattern.attr('data-text-class', 'center')
|
points.__titlePattern.attr('data-text-class', 'center')
|
||||||
|
|
||||||
// scalebox
|
// scalebox
|
||||||
points.scalebox = points.title.shift(90, points.bottom.dy(points.top) / 5)
|
points.scalebox = points.midTop.shiftFractionTowards(points.midBottom, 0.7)
|
||||||
macro('scalebox', { at: points.scalebox })
|
macro('scalebox', { at: points.scalebox })
|
||||||
|
|
||||||
// seam allowance
|
// seam allowance
|
||||||
if (sa) {
|
if (sa) {
|
||||||
paths.sa = paths.seam
|
paths.sa = paths.saBase
|
||||||
.offset(sa)
|
.offset(sa)
|
||||||
.join(paths.hem.offset(sa * 2.5))
|
.join(paths.hem.offset(sa * 2.5))
|
||||||
.close()
|
.close()
|
||||||
|
@ -143,60 +147,42 @@ export default function (part) {
|
||||||
// Paperless?
|
// Paperless?
|
||||||
if (paperless) {
|
if (paperless) {
|
||||||
macro('vd', {
|
macro('vd', {
|
||||||
from: points.top,
|
from: points.bottom,
|
||||||
to: points.bottom,
|
to: points.top,
|
||||||
x: points.bottomLeft.x + 10,
|
x: points.bottomLeft.x - 30 - sa,
|
||||||
|
})
|
||||||
|
macro('vd', {
|
||||||
|
from: points.bottomLeft,
|
||||||
|
to: points.armholeLeft,
|
||||||
|
x: points.armholeLeft.x - 15 - sa,
|
||||||
})
|
})
|
||||||
|
|
||||||
macro('vd', {
|
macro('vd', {
|
||||||
from: points.armholeLeft,
|
from: points.armholeLeft,
|
||||||
to: points.bottomLeft,
|
to: points.topLeft,
|
||||||
x: points.armholeLeft.x - 15,
|
x: points.armholeLeft.x - 15 - sa,
|
||||||
})
|
})
|
||||||
macro('vd', {
|
|
||||||
from: points.topLeft,
|
|
||||||
to: points.armholeLeft,
|
|
||||||
x: points.armholeLeft.x - 15,
|
|
||||||
})
|
|
||||||
|
|
||||||
macro('hd', {
|
macro('hd', {
|
||||||
from: points.topLeft,
|
from: points.topLeft,
|
||||||
to: points.top,
|
to: points.top,
|
||||||
y: points.top.y + 15,
|
y: points.top.y - sa - (options.clavi ? 60 : 30),
|
||||||
})
|
})
|
||||||
|
|
||||||
macro('hd', {
|
macro('hd', {
|
||||||
|
to: points.top,
|
||||||
from: points.headLeft,
|
from: points.headLeft,
|
||||||
to: points.top,
|
y: points.top.y - 15 - sa,
|
||||||
y: points.top.y - 15,
|
|
||||||
})
|
|
||||||
macro('hd', {
|
|
||||||
from: points.topLeft,
|
|
||||||
to: points.headLeft,
|
|
||||||
y: points.top.y - 15,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// for clavi
|
// for clavi
|
||||||
if (options.clavi) {
|
if (options.clavi) {
|
||||||
macro('hd', {
|
macro('hd', {
|
||||||
from: points.clavusTopLeft,
|
from: points.claviRightTop,
|
||||||
to: points.clavusTopRight,
|
|
||||||
y: points.clavusTopLeft.y + 25,
|
|
||||||
})
|
|
||||||
macro('hd', {
|
|
||||||
from: points.clavusTopRight,
|
|
||||||
to: points.headLeft,
|
|
||||||
y: points.clavusTopRight.y + 25,
|
|
||||||
})
|
|
||||||
macro('hd', {
|
|
||||||
from: points.topLeft,
|
|
||||||
to: points.clavusTopLeft,
|
|
||||||
y: points.clavusTopLeft.y + 25,
|
|
||||||
})
|
|
||||||
macro('hd', {
|
|
||||||
from: points.clavusTopRight,
|
|
||||||
to: points.top,
|
to: points.top,
|
||||||
y: points.clavusTopLeft.y + 30,
|
y: points.top.y - 30 - sa,
|
||||||
|
})
|
||||||
|
macro('hd', {
|
||||||
|
from: points.claviLeftTop,
|
||||||
|
to: points.top,
|
||||||
|
y: points.top.y - 45 - sa,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue