1
0
Fork 0

Merge branch 'develop' into eriese-fix-workflows

This commit is contained in:
Enoch Riese 2022-07-03 13:38:47 -05:00
commit 93d915d8b6
19 changed files with 75 additions and 26 deletions

View file

@ -1,8 +1,12 @@
Unreleased:
Added:
Changed:
charlie:
- Renamed back pocket jet to back pocket welt
theo:
- migrated `waistbandWidth` option from `mm` to snapped `pct` option
2.21.3:
date: 2022-07-03
date: 2022-07-02
Changed:
core:

View file

@ -71,7 +71,7 @@ export default {
frontPocketFacing: 'frontPocket',
backPocketFacing: 'backPocket',
backPocketInterfacing: 'backPocket',
backPocketJet: 'backPocketFacing',
backPocketWelt: 'backPocketFacing',
flyFacing: 'front',
flyExtension: 'flyFacing',
},

View file

@ -6,13 +6,13 @@ export default (part) => {
for (let id in paths) delete paths[id]
delete snippets.logo
const jetHeight = points.bottomRight.x / 5
const weltHeight = points.bottomRight.x / 5
points.bottomLeft = points.curveStartLeft.shift(-90, points.rightNotch.x / 1.75)
points.bottomRight = points.bottomLeft.flipX()
points.midLeft = points.bottomLeft.shift(90, jetHeight)
points.midRight = points.bottomRight.shift(90, jetHeight)
points.topLeft = points.bottomLeft.shift(90, jetHeight * 2)
points.topRight = points.bottomRight.shift(90, jetHeight * 2)
points.midLeft = points.bottomLeft.shift(90, weltHeight)
points.midRight = points.bottomRight.shift(90, weltHeight)
points.topLeft = points.bottomLeft.shift(90, weltHeight * 2)
points.topRight = points.bottomRight.shift(90, weltHeight * 2)
points.leftNotch = new Point(points.leftNotch.x, points.midRight.y)
points.rightNotch = points.leftNotch.flipX()
@ -34,7 +34,7 @@ export default (part) => {
macro('title', {
at: points.titleAnchor,
nr: 4,
title: 'backPocketJet',
title: 'backPocketWelt',
scale: 0.5,
})
points.grainlineTop = points.topLeft.shiftFractionTowards(points.topRight, 0.15)

View file

@ -15,7 +15,7 @@ import draftFrontPocketFacing from './front-pocket-facing'
import draftBackPocket from './back-pocket'
import draftBackPocketFacing from './back-pocket-facing'
import draftBackPocketInterfacing from './back-pocket-interfacing'
import draftBackPocketJet from './back-pocket-jet'
import draftBackPocketWelt from './back-pocket-welt'
import draftFlyFacing from './fly-facing'
import draftFlyExtension from './fly-extension'
import draftBeltLoops from './beltloops'
@ -40,7 +40,7 @@ Charlie.prototype.draftFrontPocketFacing = (part) => draftFrontPocketFacing(part
Charlie.prototype.draftBackPocket = (part) => draftBackPocket(part)
Charlie.prototype.draftBackPocketFacing = (part) => draftBackPocketFacing(part)
Charlie.prototype.draftBackPocketInterfacing = (part) => draftBackPocketInterfacing(part)
Charlie.prototype.draftBackPocketJet = (part) => draftBackPocketJet(part)
Charlie.prototype.draftBackPocketWelt = (part) => draftBackPocketWelt(part)
Charlie.prototype.draftFlyFacing = (part) => draftFlyFacing(part)
Charlie.prototype.draftFlyExtension = (part) => draftFlyExtension(part)
Charlie.prototype.draftBeltLoops = (part) => draftBeltLoops(part)

View file

@ -1,4 +1,6 @@
import { version } from '../package.json'
import configHelpers from '@freesewing/config-helpers'
const { steps, pctBasedOn } = configHelpers
export default {
version,
@ -34,7 +36,8 @@ export default {
// Constants
// Millimeter
waistbandWidth: { mm: 40, min: 5, max: 80 },
//waistbandWidth: { mm: 40, min: 5, max: 80 },
waistbandWidth: { pct: 3, min: 2, max: 6, snap: steps, ...pctBasedOn('waistToFloor') },
// Percentages
legWidth: { pct: 10, min: 0, max: 30 },

View file

@ -1,11 +1,12 @@
export default function (part) {
let {
const {
store,
sa,
Point,
points,
Path,
paths,
absoluteOptions,
options,
complete,
paperless,
@ -45,7 +46,7 @@ export default function (part) {
points[0] = new Point(0, 0)
points[1] = new Point(
0,
measurements.crotchDepth - measurements.waistToHips - options.waistbandWidth
measurements.crotchDepth - measurements.waistToHips - absoluteOptions.waistbandWidth
)
points[2] = new Point(0, points[1].y + measurements.inseam + store.get('lengthBonus'))
points[201] = points[2].shift(-90, 10)

View file

@ -1,7 +1,7 @@
export default function (part) {
let { options, Point, points, Path, paths, complete, paperless, macro } = part.shorthand()
let { absoluteOptions, Point, points, Path, paths, complete, paperless, macro } = part.shorthand()
let height = options.waistbandWidth + 30
let height = absoluteOptions.waistbandWidth + 30
let width = (height - 30) / 2
points.topRight = new Point(width / 2, 0)

View file

@ -4,7 +4,7 @@ export default function (part) {
points,
Path,
paths,
options,
absoluteOptions,
complete,
paperless,
measurements,
@ -14,7 +14,7 @@ export default function (part) {
} = part.shorthand()
points[0] = new Point(0, 0)
points[2] = new Point(options.waistbandWidth, measurements.hips / 2 + 60)
points[2] = new Point(absoluteOptions.waistbandWidth, measurements.hips / 2 + 60)
points[1] = new Point(points[2].x, points[0].y)
points[3] = new Point(points[0].x, points[2].y)

View file

@ -4,7 +4,7 @@ export default function (part) {
points,
Path,
paths,
options,
absoluteOptions,
complete,
paperless,
measurements,
@ -14,7 +14,7 @@ export default function (part) {
} = part.shorthand()
points[0] = new Point(0, 0)
points[2] = new Point(options.waistbandWidth, measurements.hips / 2 + 40)
points[2] = new Point(absoluteOptions.waistbandWidth, measurements.hips / 2 + 40)
points[1] = new Point(points[2].x, points[0].y)
points[3] = new Point(points[0].x, points[2].y)

View file

@ -1,6 +1,7 @@
---
back: Rückseite
backBase: Rückseite Basis
backPocketWelt: Back pocket welt
base: Basis
bentBack: Rückseite Bent
bentBase: Basis Bent

View file

@ -1,5 +1,6 @@
back: Back
backBase: Back base
backPocketWelt: Back pocket welt
base: Base
bentBack: Bent back
bentBase: Bent base

View file

@ -1,6 +1,7 @@
---
back: Atrás
backBase: Base trasera
backPocketWelt: Back pocket welt
base: Base
bentBack: Trasero Bent
bentBase: Base Bent

View file

@ -1,6 +1,7 @@
---
back: Retour
backBase: Base dos
backPocketWelt: Back pocket welt
base: Base
bentBack: Dos de Bent
bentBase: Base de Bent

View file

@ -1,6 +1,7 @@
---
back: Achterzijde
backBase: Basis rug
backPocketWelt: Back pocket welt
base: Basis
bentBack: Achterzijde Bent
bentBase: Basis Bent

View file

@ -1 +1,3 @@
export default () => null
const noSearch = () => null
export default noSearch

View file

@ -1,7 +1,7 @@
import React, { useState, useEffect, useMemo, useCallback, useRef } from 'react'
import { useTranslation } from 'next-i18next'
import { isDegreeMeasurement } from '../../../config/measurements'
import measurementAsMm from '@freesewing/utils/measurementAsMm'
import { measurementAsMm } from 'shared/utils'
/*
* This is a single input for a measurements

View file

@ -1,6 +1,7 @@
import PctDegOption from 'shared/components/workbench/inputs/design-option-pct-deg'
import CountOption from 'shared/components/workbench/inputs/design-option-count'
import ListOption from 'shared/components/workbench/inputs/design-option-list'
import Popout from 'shared/components/popout'
export const Tmp = props => <p>not yet</p>
@ -9,6 +10,6 @@ export const inputs = {
count: CountOption,
deg: props => (<PctDegOption {...props} type='deg' />),
list: ListOption,
mm: (<p>Mm options are not supported. Please report this.</p>),
mm: () => <Popout fixme compact>Mm options are deprecated. Please report this</Popout>,
constant: Tmp,
}

View file

@ -13,9 +13,7 @@ const Option = props => {
const Value = values[type]
const hide = opt.hide && opt.hide(props.draft.settings);
if (hide) {
return <Li></Li>
}
if (hide) return <Li></Li>
if (type === 'bool') {
const toggleBoolean = () => {

View file

@ -124,3 +124,38 @@ export const getCrumbs = (app, slug=false, title) => {
return crumbs
}
export const measurementAsMm = (value, units = "metric") => {
if (typeof value === "number")
return value * (units === "imperial" ? 25.4 : 10);
if (value.endsWith('.'))
return false;
if (units === "metric") {
value = Number(value);
if (isNaN(value)) return false;
return value * 10;
} else {
const imperialFractionToMm = value => {
let chunks = value.trim().split("/");
if (chunks.length !== 2 || chunks[1] === "") return false;
let num = Number(chunks[0]);
let denom = Number(chunks[1]);
if (isNaN(num) || isNaN(denom)) return false;
else return (num * 25.4) / denom;
};
let chunks = value.split(" ");
if (chunks.length === 1) {
let val = chunks[0];
if (!isNaN(Number(val))) return Number(val) * 25.4;
else return imperialFractionToMm(val);
} else if (chunks.length === 2) {
let inches = Number(chunks[0]);
if (isNaN(inches)) return false;
let fraction = imperialFractionToMm(chunks[1]);
if (fraction === false) return false;
return inches * 25.4 + fraction;
}
}
return false;
}