Convert Waralee from mm to snapped percentage options (Issue #1421)
This commit is contained in:
parent
8677c0dc1b
commit
fc9a14da51
5 changed files with 27 additions and 23 deletions
|
@ -13,7 +13,7 @@ export default {
|
|||
difficulty: 2,
|
||||
optionGroups: {
|
||||
fit: ['backRaise', 'waistRaise'],
|
||||
style: ['hem', 'legShortening', 'waistOverlap', 'frontPocket', 'backPocket', 'waistBand'],
|
||||
style: ['hemWidth', 'legShortening', 'waistOverlap', 'frontPocket', 'backPocket', 'waistbandWidth'],
|
||||
advanced: [
|
||||
'crotchFront',
|
||||
'crotchBack',
|
||||
|
@ -40,8 +40,8 @@ export default {
|
|||
backPocketHorizontalOffset: 0.045,
|
||||
backPocketSize: 0.65,
|
||||
backPocket: { bool: true },
|
||||
hem: { mm: 15, min: 0, max: 100 },
|
||||
waistBand: { mm: 25, min: 0, max: 100 },
|
||||
hemWidth: { pct: 1.75, min: 1, max: 2.5 },
|
||||
waistbandWidth: { pct: 3.5, min: 2, max: 5 },
|
||||
waistRaise: { pct: 20, min: 0, max: 40 },
|
||||
crotchBack: { pct: 45, min: 10, max: 70 },
|
||||
crotchFront: { pct: 30, min: 10, max: 70 },
|
||||
|
|
|
@ -16,6 +16,7 @@ export default function (part) {
|
|||
sa,
|
||||
paperless,
|
||||
macro,
|
||||
store
|
||||
} = part.shorthand()
|
||||
|
||||
let mini = options.minimizer
|
||||
|
@ -26,15 +27,15 @@ export default function (part) {
|
|||
}
|
||||
|
||||
paths.waistFoldBack = paths.waistBack
|
||||
.offset((-1 * options.waistBand) / mini)
|
||||
.offset((-1 * store.get('waistBand')) / mini)
|
||||
.attr('class', 'fabric stroke-sm')
|
||||
paths.waistFoldFront = paths.waistFront
|
||||
.offset((-1 * options.waistBand) / mini)
|
||||
.offset((-1 * store.get('waistBand')) / mini)
|
||||
.attr('class', 'fabric stroke-sm')
|
||||
|
||||
paths.frontFold = paths.front.offset((-1 * options.hem) / mini).attr('class', 'fabric stroke-sm')
|
||||
paths.legFold = paths.leg.offset((-1 * options.hem) / mini).attr('class', 'fabric stroke-sm')
|
||||
paths.backFold = paths.back.offset((-1 * options.hem) / mini).attr('class', 'fabric stroke-sm')
|
||||
paths.frontFold = paths.front.offset((-1 * store.get('hem')) / mini).attr('class', 'fabric stroke-sm')
|
||||
paths.legFold = paths.leg.offset((-1 * store.get('hem')) / mini).attr('class', 'fabric stroke-sm')
|
||||
paths.backFold = paths.back.offset((-1 * store.get('hem')) / mini).attr('class', 'fabric stroke-sm')
|
||||
|
||||
// Complete?
|
||||
if (complete) {
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
export default function (part) {
|
||||
let { options, points, paths, Snippet, snippets, complete, sa, paperless, macro } =
|
||||
let { options, points, paths, Snippet, snippets, complete, sa, paperless, macro, store } =
|
||||
part.shorthand()
|
||||
|
||||
paths.waistFoldBack = paths.waistBack
|
||||
.offset(-1 * options.waistBand)
|
||||
.offset(-1 * store.get('waistBand'))
|
||||
.attr('class', 'fabric stroke-sm')
|
||||
paths.waistFoldFront = paths.waistFront
|
||||
.offset(-1 * options.waistBand)
|
||||
.offset(-1 * store.get('waistBand'))
|
||||
.attr('class', 'fabric stroke-sm')
|
||||
|
||||
paths.frontFold = paths.front.offset(-1 * options.hem).attr('class', 'fabric stroke-sm')
|
||||
paths.legFold = paths.leg.offset(-1 * options.hem).attr('class', 'fabric stroke-sm')
|
||||
paths.backFold = paths.back.offset(-1 * options.hem).attr('class', 'fabric stroke-sm')
|
||||
paths.frontFold = paths.front.offset(-1 * store.get('hem')).attr('class', 'fabric stroke-sm')
|
||||
paths.legFold = paths.leg.offset(-1 * store.get('hem')).attr('class', 'fabric stroke-sm')
|
||||
paths.backFold = paths.back.offset(-1 * store.get('hem')).attr('class', 'fabric stroke-sm')
|
||||
|
||||
// Complete?
|
||||
if (complete) {
|
||||
|
|
|
@ -1,11 +1,14 @@
|
|||
import { CreateCrotchPoints } from './util'
|
||||
|
||||
export default function (part) {
|
||||
let { options, measurements, Point, Path, points, paths } = part.shorthand()
|
||||
let { options, measurements, Point, Path, points, paths, store } = part.shorthand()
|
||||
|
||||
let seatDepth = (measurements.crotchDepth - measurements.waistToHips) * (1 + options.waistRaise)
|
||||
let circumference = measurements.seat
|
||||
let circumference4 = circumference / 4
|
||||
store.set('waistBand', measurements.inseam * options.waistbandWidth)
|
||||
store.set('hem', measurements.inseam * options.hemWidth)
|
||||
let waistBand = store.get('waistBand')
|
||||
|
||||
points.mWaist = new Point(0, 0)
|
||||
|
||||
|
@ -29,7 +32,7 @@ export default function (part) {
|
|||
)
|
||||
// Create a point that is this distance from the side.
|
||||
points.bWaistBack = points.mWaist
|
||||
.shift(90, options.waistBand)
|
||||
.shift(90, waistBand)
|
||||
.shift(0, options.crotchBack * circumference4 + bHorDistance)
|
||||
|
||||
points.bWaistBackOverlap = points.bWaistBack.shift(0, options.waistOverlap * circumference4)
|
||||
|
@ -81,7 +84,7 @@ export default function (part) {
|
|||
.shift(
|
||||
270,
|
||||
options.frontPocketVerticalOffset * (measurements.crotchDepth - measurements.waistToHips) +
|
||||
options.waistBand * 2
|
||||
waistBand * 2
|
||||
)
|
||||
.shift(180, options.frontPocketHorizontalOffset * measurements.seat)
|
||||
|
||||
|
@ -107,7 +110,7 @@ export default function (part) {
|
|||
.shift(
|
||||
270,
|
||||
options.backPocketVerticalOffset * (measurements.crotchDepth - measurements.waistToHips) +
|
||||
options.waistBand * 2
|
||||
waistBand * 2
|
||||
)
|
||||
points.backPocketLeft = points.bWaistBack
|
||||
.shiftTowards(
|
||||
|
@ -118,7 +121,7 @@ export default function (part) {
|
|||
.shift(
|
||||
270,
|
||||
options.backPocketVerticalOffset * (measurements.crotchDepth - measurements.waistToHips) +
|
||||
options.waistBand * 2
|
||||
waistBand * 2
|
||||
)
|
||||
points.backPocketRight2 = points.backPocketRight.shift(
|
||||
points.backPocketRight.angle(points.backPocketLeft) + 90,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
function CreateCrotchPoints(part) {
|
||||
let { options, measurements, points } = part.shorthand()
|
||||
let { options, measurements, points, store } = part.shorthand()
|
||||
|
||||
let seatDepth = (measurements.crotchDepth - measurements.waistToHips) * (1 + options.waistRaise)
|
||||
let circumference = measurements.seat
|
||||
|
@ -9,10 +9,10 @@ function CreateCrotchPoints(part) {
|
|||
|
||||
points.fWaistSide = points.mWaist
|
||||
.shift(180, options.crotchFront * circumference4)
|
||||
.shift(90, options.waistBand)
|
||||
.shift(90, store.get('waistBand'))
|
||||
points.fWaistCrotchCP = points.fWaistSide.shift(
|
||||
270,
|
||||
seatDepth * options.crotchFactorFrontVer + options.waistBand
|
||||
seatDepth * options.crotchFactorFrontVer + store.get('waistBand')
|
||||
)
|
||||
points.fHipCrotchCP = points.mHip.shift(
|
||||
180,
|
||||
|
@ -23,7 +23,7 @@ function CreateCrotchPoints(part) {
|
|||
|
||||
points.bWaistSide = points.mWaist
|
||||
.shift(0, options.crotchBack * circumference4)
|
||||
.shift(90, options.waistBand)
|
||||
.shift(90, store.get('waistBand'))
|
||||
.shift(90, options.backRaise * seatDepth)
|
||||
points.bWaistCrotchCP = points.bWaistSide.shift(270, seatDepth * options.crotchFactorBackVer)
|
||||
points.bHipCrotchCP = points.mHip.shift(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue