1
0
Fork 0

chore(tutorial) Removed circumference suffix from measurements

This commit is contained in:
Joost De Cock 2020-06-28 12:27:34 +02:00
parent 721661b281
commit 2ef20d5693
5 changed files with 36 additions and 38 deletions

View file

@ -1,38 +1,36 @@
import { version } from "../package.json"; import { version } from '../package.json'
// ?? 🤔 ?? --> https://en.freesewing.dev/packages/core/config // ?? 🤔 ?? --> https://en.freesewing.dev/packages/core/config
export default { export default {
name: "tutorial", name: 'tutorial',
version, version,
design: "joostdecock", design: 'joostdecock',
code: "joostdecock", code: 'joostdecock',
department: "womenswear", department: 'womenswear',
type: "pattern", type: 'pattern',
difficulty: 1, difficulty: 1,
tags: [ tags: ['example'],
"example",
],
optionGroups: { optionGroups: {
fit: ["neckRatio", "widthRatio", "lengthRatio"], fit: ['neckRatio', 'widthRatio', 'lengthRatio'],
box: ["size"] box: ['size']
}, },
measurements: ["headCircumference"], measurements: ['head'],
inject: { inject: {
step4: "step3", step4: 'step3',
step5: "step4", step5: 'step4',
step6: "step5", step6: 'step5',
step7: "step6", step7: 'step6',
step8: "step7", step8: 'step7',
step9: "step8", step9: 'step8',
step10: "step9", step10: 'step9',
step11: "step10" step11: 'step10'
}, },
parts: ["step1", "step2", "bib"], parts: ['step1', 'step2', 'bib'],
options: { options: {
size: { pct: 50, min: 10, max: 100 }, size: { pct: 50, min: 10, max: 100 },
neckRatio: { pct: 80, min: 70, max: 90 }, neckRatio: { pct: 80, min: 70, max: 90 },
widthRatio: { pct: 45, min: 35, max: 55 }, widthRatio: { pct: 45, min: 35, max: 55 },
lengthRatio: { pct: 75, min: 55, max: 85 } lengthRatio: { pct: 75, min: 55, max: 85 }
} }
}; }

View file

@ -1,4 +1,4 @@
export default function(part) { export default function (part) {
let { let {
Point, Point,
points, points,
@ -15,11 +15,11 @@ export default function(part) {
// Construct the neck opening // Construct the neck opening
let tweak = 1 let tweak = 1
let target = (measurements.headCircumference * options.neckRatio) / 4 let target = (measurements.head * options.neckRatio) / 4
let delta let delta
do { do {
points.right = new Point((tweak * measurements.headCircumference) / 10, 0) points.right = new Point((tweak * measurements.head) / 10, 0)
points.bottom = new Point(0, (tweak * measurements.headCircumference) / 12) points.bottom = new Point(0, (tweak * measurements.head) / 12)
points.rightCp1 = points.right.shift(90, points.bottom.dy(points.right) / 2) points.rightCp1 = points.right.shift(90, points.bottom.dy(points.right) / 2)
points.bottomCp2 = points.bottom.shift(0, points.bottom.dx(points.right) / 2) points.bottomCp2 = points.bottom.shift(0, points.bottom.dx(points.right) / 2)
@ -45,8 +45,8 @@ export default function(part) {
points.topCp2 = points.bottomCp1.flipY() points.topCp2 = points.bottomCp1.flipY()
// Construct the outline // Construct the outline
let width = measurements.headCircumference * options.widthRatio let width = measurements.head * options.widthRatio
let length = measurements.headCircumference * options.lengthRatio let length = measurements.head * options.lengthRatio
points.topLeft = new Point(width / -2, points.top.y - (width / 2 - points.right.x)) points.topLeft = new Point(width / -2, points.top.y - (width / 2 - points.right.x))
points.topRight = points.topLeft.shift(0, width) points.topRight = points.topLeft.shift(0, width)

View file

@ -1,8 +1,8 @@
export default function(part) { export default function (part) {
let { Point, points, Path, paths, measurements } = part.shorthand() let { Point, points, Path, paths, measurements } = part.shorthand()
points.right = new Point(measurements.headCircumference / 10, 0) points.right = new Point(measurements.head / 10, 0)
points.bottom = new Point(0, measurements.headCircumference / 12) points.bottom = new Point(0, measurements.head / 12)
points.rightCp1 = points.right.shift(90, points.bottom.dy(points.right) / 2) points.rightCp1 = points.right.shift(90, points.bottom.dy(points.right) / 2)
points.bottomCp2 = points.bottom.shift(0, points.bottom.dx(points.right) / 2) points.bottomCp2 = points.bottom.shift(0, points.bottom.dx(points.right) / 2)

View file

@ -1,12 +1,12 @@
export default function(part) { export default function (part) {
let { Point, points, Path, paths, measurements, options } = part.shorthand() let { Point, points, Path, paths, measurements, options } = part.shorthand()
let tweak = 1 let tweak = 1
let target = (measurements.headCircumference * options.neckRatio) / 4 let target = (measurements.head * options.neckRatio) / 4
let delta let delta
do { do {
points.right = new Point((tweak * measurements.headCircumference) / 10, 0) points.right = new Point((tweak * measurements.head) / 10, 0)
points.bottom = new Point(0, (tweak * measurements.headCircumference) / 12) points.bottom = new Point(0, (tweak * measurements.head) / 12)
points.rightCp1 = points.right.shift(90, points.bottom.dy(points.right) / 2) points.rightCp1 = points.right.shift(90, points.bottom.dy(points.right) / 2)
points.bottomCp2 = points.bottom.shift(0, points.bottom.dx(points.right) / 2) points.bottomCp2 = points.bottom.shift(0, points.bottom.dx(points.right) / 2)

View file

@ -1,8 +1,8 @@
export default function(part) { export default function (part) {
let { Point, points, Path, paths, measurements, options } = part.shorthand() let { Point, points, Path, paths, measurements, options } = part.shorthand()
let width = measurements.headCircumference * options.widthRatio let width = measurements.head * options.widthRatio
let length = measurements.headCircumference * options.lengthRatio let length = measurements.head * options.lengthRatio
points.topLeft = new Point(width / -2, points.top.y - (width / 2 - points.right.x)) points.topLeft = new Point(width / -2, points.top.y - (width / 2 - points.right.x))
points.topRight = points.topLeft.shift(0, width) points.topRight = points.topLeft.shift(0, width)