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: [
|
||||
'lengthBonus',
|
||||
'widthBonus',
|
||||
{ clavi: ['clavi', 'clavusPosBonus', 'clavusWidth'] },
|
||||
{ clavi: ['clavi', 'clavusLocation', 'clavusWidth'] },
|
||||
'length',
|
||||
'width',
|
||||
],
|
||||
|
@ -56,7 +56,7 @@ export default {
|
|||
lengthBonus: { pct: 90, min: 60, max: 130 },
|
||||
widthBonus: { pct: 100, min: 50, max: 130 },
|
||||
clavi: { bool: false },
|
||||
clavusPosBonus: { pct: 105, min: 90, max: 130 },
|
||||
clavusLocation: { pct: 65, min: 50, max: 80 },
|
||||
clavusWidth: { pct: 100, min: 50, max: 150 },
|
||||
length: {
|
||||
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) {
|
||||
let {
|
||||
const {
|
||||
Point,
|
||||
points,
|
||||
Path,
|
||||
|
@ -14,38 +14,14 @@ export default function (part) {
|
|||
paperless,
|
||||
} = part.shorthand()
|
||||
|
||||
// define some variables
|
||||
|
||||
let width
|
||||
if (options.width === 'ToElbow') {
|
||||
width = measurements.shoulderToElbow
|
||||
}
|
||||
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
|
||||
}
|
||||
|
||||
// Handle width
|
||||
let width = (options.width === 'ToElbow')
|
||||
? measurements.shoulderToElbow
|
||||
: (options.width === 'ToMidArm')
|
||||
? measurements.shoulderToElbow / 2
|
||||
: 0
|
||||
let hwidth = (measurements.shoulderToShoulder / 2 + width) * options.widthBonus
|
||||
let length = (measurements.hpsToWaistBack + hem_pos) * options.lengthBonus
|
||||
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
|
||||
// Some checks, can be circumvented with forceWidth
|
||||
if (options.forceWidth === false) {
|
||||
if (hwidth < measurements.waist / 4) {
|
||||
hwidth = (measurements.waist / 4) * options.widthBonus
|
||||
|
@ -60,44 +36,70 @@ export default function (part) {
|
|||
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.bottom = new Point(0, length)
|
||||
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)
|
||||
// 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)
|
||||
|
||||
// draw paths
|
||||
paths.seam = new Path()
|
||||
paths.saBase = new Path()
|
||||
.move(points.top)
|
||||
.line(points.topLeft)
|
||||
.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')
|
||||
|
||||
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
|
||||
if (options.clavi) {
|
||||
// make points
|
||||
points.clavusTopRight = points.top.shift(180, clavusPos)
|
||||
points.clavusBottomRight = points.bottom.shift(0, points.top.dx(points.clavusTopRight))
|
||||
points.clavusTopLeft = points.clavusTopRight.shift(180, clavusWidth)
|
||||
points.clavusBottomLeft = points.bottom.shift(0, points.top.dx(points.clavusTopLeft))
|
||||
points.claviCenterTop = points.top.shiftFractionTowards(points.topLeft, options.clavusLocation)
|
||||
points.claviRightTop = points.claviCenterTop.shift(0, clavusWidth)
|
||||
points.claviLeftTop = points.claviRightTop.flipX(points.claviCenterTop)
|
||||
points.claviRightBottom = new Point(points.claviRightTop.x, points.bottom.y)
|
||||
points.claviLeftBottom = new Point(points.claviLeftTop.x, points.bottom.y)
|
||||
|
||||
// draw paths
|
||||
paths.clavusRight = new Path()
|
||||
.move(points.clavusTopRight)
|
||||
.line(points.clavusBottomRight)
|
||||
.move(points.claviRightBottom)
|
||||
.line(points.claviRightTop)
|
||||
.attr('class', 'various dashed')
|
||||
.attr('data-text', 'biasTape')
|
||||
.attr('data-text-class', 'center fill-various')
|
||||
paths.clavusLeft = new Path()
|
||||
.move(points.clavusTopLeft)
|
||||
.line(points.clavusBottomLeft)
|
||||
.move(points.claviLeftBottom)
|
||||
.line(points.claviLeftTop)
|
||||
.attr('class', 'various dashed')
|
||||
.attr('data-text', 'BiasTape')
|
||||
.attr('data-text', 'biasTape')
|
||||
.attr('data-text-class', 'center fill-various')
|
||||
}
|
||||
|
||||
|
@ -115,9 +117,11 @@ export default function (part) {
|
|||
})
|
||||
|
||||
// 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)
|
||||
points.title = points.logo.shift(90, points.bottom.dy(points.top) / 4)
|
||||
points.title = points.midTop.shiftFractionTowards(points.midBottom, 0.5)
|
||||
macro('title', {
|
||||
at: points.title,
|
||||
nr: 1,
|
||||
|
@ -128,12 +132,12 @@ export default function (part) {
|
|||
points.__titlePattern.attr('data-text-class', 'center')
|
||||
|
||||
// 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 })
|
||||
|
||||
// seam allowance
|
||||
if (sa) {
|
||||
paths.sa = paths.seam
|
||||
paths.sa = paths.saBase
|
||||
.offset(sa)
|
||||
.join(paths.hem.offset(sa * 2.5))
|
||||
.close()
|
||||
|
@ -143,60 +147,42 @@ export default function (part) {
|
|||
// Paperless?
|
||||
if (paperless) {
|
||||
macro('vd', {
|
||||
from: points.top,
|
||||
to: points.bottom,
|
||||
x: points.bottomLeft.x + 10,
|
||||
from: points.bottom,
|
||||
to: points.top,
|
||||
x: points.bottomLeft.x - 30 - sa,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.bottomLeft,
|
||||
to: points.armholeLeft,
|
||||
x: points.armholeLeft.x - 15 - sa,
|
||||
})
|
||||
|
||||
macro('vd', {
|
||||
from: points.armholeLeft,
|
||||
to: points.bottomLeft,
|
||||
x: points.armholeLeft.x - 15,
|
||||
to: points.topLeft,
|
||||
x: points.armholeLeft.x - 15 - sa,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.topLeft,
|
||||
to: points.armholeLeft,
|
||||
x: points.armholeLeft.x - 15,
|
||||
})
|
||||
|
||||
macro('hd', {
|
||||
from: points.topLeft,
|
||||
to: points.top,
|
||||
y: points.top.y + 15,
|
||||
y: points.top.y - sa - (options.clavi ? 60 : 30),
|
||||
})
|
||||
|
||||
macro('hd', {
|
||||
to: points.top,
|
||||
from: points.headLeft,
|
||||
to: points.top,
|
||||
y: points.top.y - 15,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.topLeft,
|
||||
to: points.headLeft,
|
||||
y: points.top.y - 15,
|
||||
y: points.top.y - 15 - sa,
|
||||
})
|
||||
|
||||
// for clavi
|
||||
if (options.clavi) {
|
||||
macro('hd', {
|
||||
from: points.clavusTopLeft,
|
||||
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,
|
||||
from: points.claviRightTop,
|
||||
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