Merge branch 'develop' into joost
This commit is contained in:
commit
1154d2de93
101 changed files with 3719 additions and 3498 deletions
|
@ -184,7 +184,7 @@
|
|||
"design": "Wouter Van Wageningen",
|
||||
"difficulty": 4,
|
||||
"tags": ["accessories", "toys"],
|
||||
"techniques": []
|
||||
"techniques": ["curvedSeam", "dart"]
|
||||
},
|
||||
"holmes": {
|
||||
"description": "A FreeSewing pattern for a Sherlock Holmes hat",
|
||||
|
@ -270,7 +270,7 @@
|
|||
"design": "Wouter Van Wageningen",
|
||||
"difficulty": 3,
|
||||
"tags": ["blocks", "tops"],
|
||||
"techniques": []
|
||||
"techniques": ["curvedSeam", "precision", "princessSeam"]
|
||||
},
|
||||
"octoplushy": {
|
||||
"description": "A FreeSewing pattern for an octopus plushy toy",
|
||||
|
@ -278,7 +278,7 @@
|
|||
"design": "Wouter Van Wageningen",
|
||||
"difficulty": 4,
|
||||
"tags": ["accessories", "toys"],
|
||||
"techniques": []
|
||||
"techniques": ["curvedSeam", "precision"]
|
||||
},
|
||||
"paco": {
|
||||
"description": "A FreeSewing pattern for summer pants",
|
||||
|
@ -294,7 +294,7 @@
|
|||
"design": "Wouter Van Wageningen",
|
||||
"difficulty": 3,
|
||||
"tags": ["bottoms", "skirts"],
|
||||
"techniques": []
|
||||
"techniques": ["hem", "curvedSeam", "precision", "zipper"]
|
||||
},
|
||||
"plugintest": {
|
||||
"description": "A FreeSewing pattern to test (y)our plugins",
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -2,21 +2,21 @@
|
|||
"t": "Hi the shark",
|
||||
"d": "The world's friendliest shark",
|
||||
"p": {
|
||||
"aboveMouth": "Above mouth",
|
||||
"aboveMouth": "Above mouth piece",
|
||||
"belly": "Belly",
|
||||
"body": "Body",
|
||||
"bottomFin": "Bottom fin",
|
||||
"lowerTeeth": "Lower teetch",
|
||||
"bottomOfFin": "Bottom of fin",
|
||||
"lowerTeeth": "Lower teeth",
|
||||
"mouth": "Mouth",
|
||||
"tail": "Tail",
|
||||
"topFin": "Top fin",
|
||||
"topOfFin": "Top of fin",
|
||||
"upperTeeth": "Upper teeth"
|
||||
},
|
||||
"s": {},
|
||||
"o": {
|
||||
"hungry": {
|
||||
"t": "Hungry",
|
||||
"d": "Changes the mouth shape to convey Hi is hungry"
|
||||
"d": "Changes the belly shape to convey if Hi has just eaten"
|
||||
},
|
||||
"nosePointiness": {
|
||||
"t": "Nose pointiness",
|
||||
|
@ -26,6 +26,14 @@
|
|||
"t": "Aggressive",
|
||||
"d": "Give Hi pointy teeth, or not"
|
||||
},
|
||||
"aggressiveNo": {
|
||||
"t": "Friendly",
|
||||
"d": "Hi will have rounded teeth"
|
||||
},
|
||||
"aggressiveYes": {
|
||||
"t": "Aggressive",
|
||||
"d": "Hi will have pointy teeth"
|
||||
},
|
||||
"size": {
|
||||
"t": "Size",
|
||||
"d": "Sharks come in all sizes, and so does Hi"
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -1,118 +1,117 @@
|
|||
import { body } from './body.mjs'
|
||||
import { mouth } from './mouth.mjs'
|
||||
|
||||
function draftHiAboveMouth({
|
||||
store,
|
||||
sa,
|
||||
Point,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
Snippet,
|
||||
snippets,
|
||||
options,
|
||||
complete,
|
||||
paperless,
|
||||
macro,
|
||||
part,
|
||||
}) {
|
||||
let aboveMouth01_02d = 266.7238454769277 * options.size
|
||||
const aboveMouth01_02a = 353.4089695458119
|
||||
const aboveMouth02_03d = 28.348200101593726 * options.size
|
||||
const aboveMouth02_03a = 233.13495309848912
|
||||
let aboveMouth01_04d = 57.858419828059574 * options.size
|
||||
const aboveMouth01_04a = 208.91023166349467
|
||||
const aboveMouth01cp1d = 62.927189989701574 * options.size
|
||||
const aboveMouth01cp1a = 298.7196048714283
|
||||
const aboveMouth02cp2d = 169.53367533325053 * options.size
|
||||
const aboveMouth02cp2a = 195.1209034747764
|
||||
const aboveMouth03cp1d = 172.36585117998288 * options.size
|
||||
const aboveMouth03cp1a = 197.87876803095696
|
||||
const aboveMouth04cp2d = 66.94005927693816 * options.size
|
||||
const aboveMouth04cp2a = 308.8121959753343
|
||||
export const aboveMouth = {
|
||||
name: 'hi.aboveMouth',
|
||||
after: [body, mouth],
|
||||
draft: ({ store, sa, Point, points, Path, paths, Snippet, snippets, macro, part }) => {
|
||||
const multiplier = store.get('multiplier')
|
||||
const faceTopLength = store.get('faceTopLength')
|
||||
|
||||
const faceTopLength = store.get('faceTopLength')
|
||||
let aboveMouth01_02d = 266.7238454769277 * multiplier
|
||||
const aboveMouth01_02a = 353.4089695458119
|
||||
const aboveMouth02_03d = 28.348200101593726 * multiplier
|
||||
const aboveMouth02_03a = 233.13495309848912
|
||||
let aboveMouth01_04d = 57.858419828059574 * multiplier
|
||||
const aboveMouth01_04a = 208.91023166349467
|
||||
const aboveMouth01cp1d = 62.927189989701574 * multiplier
|
||||
const aboveMouth01cp1a = 298.7196048714283
|
||||
const aboveMouth02cp2d = 169.53367533325053 * multiplier
|
||||
const aboveMouth02cp2a = 195.1209034747764
|
||||
const aboveMouth03cp1d = 172.36585117998288 * multiplier
|
||||
const aboveMouth03cp1a = 197.87876803095696
|
||||
const aboveMouth04cp2d = 66.94005927693816 * multiplier
|
||||
const aboveMouth04cp2a = 308.8121959753343
|
||||
|
||||
let diff = 0
|
||||
let iteration = 0
|
||||
do {
|
||||
points.aboveMouth01 = new Point(0, 0)
|
||||
points.aboveMouth02 = points.aboveMouth01.shift(aboveMouth01_02a, aboveMouth01_02d)
|
||||
points.aboveMouth03 = points.aboveMouth02.shift(aboveMouth02_03a, aboveMouth02_03d)
|
||||
points.aboveMouth04 = points.aboveMouth01.shift(aboveMouth01_04a, aboveMouth01_04d)
|
||||
let diff = 0
|
||||
let iteration = 0
|
||||
do {
|
||||
points.aboveMouth01 = new Point(0, 0)
|
||||
points.aboveMouth02 = points.aboveMouth01.shift(aboveMouth01_02a, aboveMouth01_02d)
|
||||
points.aboveMouth03 = points.aboveMouth02.shift(aboveMouth02_03a, aboveMouth02_03d)
|
||||
points.aboveMouth04 = points.aboveMouth01.shift(aboveMouth01_04a, aboveMouth01_04d)
|
||||
|
||||
points.aboveMouth01cp1 = points.aboveMouth01.shift(aboveMouth01cp1a, aboveMouth01cp1d)
|
||||
points.aboveMouth02cp2 = points.aboveMouth02.shift(aboveMouth02cp2a, aboveMouth02cp2d)
|
||||
points.aboveMouth03cp1 = points.aboveMouth03.shift(aboveMouth03cp1a, aboveMouth03cp1d)
|
||||
points.aboveMouth04cp2 = points.aboveMouth04.shift(aboveMouth04cp2a, aboveMouth04cp2d)
|
||||
points.aboveMouth01cp1 = points.aboveMouth01.shift(aboveMouth01cp1a, aboveMouth01cp1d)
|
||||
points.aboveMouth02cp2 = points.aboveMouth02.shift(aboveMouth02cp2a, aboveMouth02cp2d)
|
||||
points.aboveMouth03cp1 = points.aboveMouth03.shift(aboveMouth03cp1a, aboveMouth03cp1d)
|
||||
points.aboveMouth04cp2 = points.aboveMouth04.shift(aboveMouth04cp2a, aboveMouth04cp2d)
|
||||
|
||||
diff =
|
||||
faceTopLength -
|
||||
new Path()
|
||||
.move(points.aboveMouth03)
|
||||
.curve(points.aboveMouth03cp1, points.aboveMouth04cp2, points.aboveMouth04)
|
||||
.length()
|
||||
diff =
|
||||
faceTopLength -
|
||||
new Path()
|
||||
.move(points.aboveMouth03)
|
||||
.curve(points.aboveMouth03cp1, points.aboveMouth04cp2, points.aboveMouth04)
|
||||
.length()
|
||||
|
||||
aboveMouth01_02d = aboveMouth01_02d + diff
|
||||
aboveMouth01_04d = aboveMouth01_04d + diff
|
||||
iteration++
|
||||
} while (Math.abs(diff) > store.get('tolerance') && iteration < 100)
|
||||
aboveMouth01_02d = aboveMouth01_02d + diff
|
||||
aboveMouth01_04d = aboveMouth01_04d + diff
|
||||
iteration++
|
||||
} while (Math.abs(diff) > store.get('tolerance') && iteration < 100)
|
||||
|
||||
paths.aboveMouthAttachment = new Path()
|
||||
.move(points.aboveMouth01)
|
||||
.line(points.aboveMouth04)
|
||||
.attr('data-text-class', 'text-xs')
|
||||
paths.bodyAttachment = new Path()
|
||||
.move(points.aboveMouth04)
|
||||
.curve(points.aboveMouth04cp2, points.aboveMouth03cp1, points.aboveMouth03)
|
||||
.attr('data-text-class', 'text-xs')
|
||||
paths.finAttachment = new Path()
|
||||
.move(points.aboveMouth03)
|
||||
.line(points.aboveMouth02)
|
||||
.attr('data-text-class', 'text-xs')
|
||||
paths.bellyAndMouthAttachment = new Path()
|
||||
.move(points.aboveMouth02)
|
||||
.curve(points.aboveMouth02cp2, points.aboveMouth01cp1, points.aboveMouth01)
|
||||
paths.seam = new Path()
|
||||
.move(points.aboveMouth01)
|
||||
.join(paths.aboveMouthAttachment)
|
||||
.join(paths.bodyAttachment)
|
||||
.join(paths.finAttachment)
|
||||
.join(paths.bellyAndMouthAttachment)
|
||||
.close()
|
||||
paths.aboveMouthAttachment = new Path()
|
||||
.move(points.aboveMouth01)
|
||||
.line(points.aboveMouth04)
|
||||
.attr('data-text-class', 'text-xs')
|
||||
paths.bodyAttachment = new Path()
|
||||
.move(points.aboveMouth04)
|
||||
.curve(points.aboveMouth04cp2, points.aboveMouth03cp1, points.aboveMouth03)
|
||||
.attr('data-text-class', 'text-xs')
|
||||
paths.finAttachment = new Path()
|
||||
.move(points.aboveMouth03)
|
||||
.line(points.aboveMouth02)
|
||||
.attr('data-text-class', 'text-xs')
|
||||
paths.bellyAndMouthAttachment = new Path()
|
||||
.move(points.aboveMouth02)
|
||||
.curve(points.aboveMouth02cp2, points.aboveMouth01cp1, points.aboveMouth01)
|
||||
paths.seam = new Path()
|
||||
.move(points.aboveMouth01)
|
||||
.join(paths.aboveMouthAttachment)
|
||||
.join(paths.bodyAttachment)
|
||||
.join(paths.finAttachment)
|
||||
.join(paths.bellyAndMouthAttachment)
|
||||
.close()
|
||||
|
||||
store.set('aboveMouthTopLength', paths.bodyAttachment.length())
|
||||
store.set('aboveMouthBottomLength', paths.bellyAndMouthAttachment.length())
|
||||
store.set('aboveMouthFinLength', points.aboveMouth02.dist(points.aboveMouth03))
|
||||
store.set('aboveMouthTopLength', paths.bodyAttachment.length())
|
||||
store.set('aboveMouthBottomLength', paths.bellyAndMouthAttachment.length())
|
||||
store.set('aboveMouthFinLength', points.aboveMouth02.dist(points.aboveMouth03))
|
||||
|
||||
store.cutlist.addCut({ material: 'color2Belly' })
|
||||
store.cutlist.addCut({ cut: 2, material: 'color2Belly' })
|
||||
points.gridAnchor = points.aboveMouth04.clone()
|
||||
|
||||
// Complete?
|
||||
if (complete) {
|
||||
points.aboveMouthSnippet = new Path()
|
||||
.move(points.aboveMouth01)
|
||||
.curve(points.aboveMouth01cp1, points.aboveMouth02cp2, points.aboveMouth02)
|
||||
.shiftAlong(store.get('mouthTopLength'))
|
||||
snippets.mouth = new Snippet('bnotch', points.aboveMouthSnippet)
|
||||
|
||||
points.aboveMouthBottom = paths.seam.edge('bottom')
|
||||
points.aboveMouthTop = new Path()
|
||||
.move(points.aboveMouth01)
|
||||
.curve(points.aboveMouth01cp1, points.aboveMouth02cp2, points.aboveMouth02)
|
||||
.edge('bottom')
|
||||
|
||||
points.titleAnchor = points.aboveMouth04.shiftFractionTowards(points.aboveMouth01cp1, 0.5)
|
||||
points.logoAnchor = points.aboveMouth01cp1.shiftFractionTowards(points.aboveMouth02cp2, 0.5)
|
||||
|
||||
snippets.logo = new Snippet('logo', points.logoAnchor).attr(
|
||||
'data-scale',
|
||||
(options.size > 1 ? 1 : options.size) / 4
|
||||
(multiplier > 1 ? 1 : multiplier) / 4
|
||||
)
|
||||
|
||||
macro('title', {
|
||||
at: points.titleAnchor,
|
||||
nr: 5,
|
||||
title: 'aboveMouth',
|
||||
scale: options.size / 2,
|
||||
scale: multiplier / 2,
|
||||
})
|
||||
|
||||
let split = paths.bellyAndMouthAttachment.split(points.aboveMouthSnippet)
|
||||
paths.bellyAttachment = split[0].attr('data-text-class', 'text-xs')
|
||||
paths.mouthAttachment = split[1].attr('data-text-class', 'text-xs')
|
||||
macro('banner', {
|
||||
path: paths.aboveMouthAttachment,
|
||||
text: 'aboveMouth',
|
||||
id: 'aboveMouth',
|
||||
dy: -0,
|
||||
spaces: 0,
|
||||
repeat: 1,
|
||||
|
@ -120,6 +119,7 @@ function draftHiAboveMouth({
|
|||
macro('banner', {
|
||||
path: paths.bodyAttachment,
|
||||
text: 'body',
|
||||
id: 'body',
|
||||
dy: 0,
|
||||
spaces: 10,
|
||||
repeat: 7,
|
||||
|
@ -127,97 +127,80 @@ function draftHiAboveMouth({
|
|||
macro('banner', {
|
||||
path: paths.finAttachment,
|
||||
text: '+',
|
||||
id: 'plus',
|
||||
dy: 0,
|
||||
spaces: 0,
|
||||
repeat: 4,
|
||||
})
|
||||
let split = paths.bellyAndMouthAttachment.split(points.aboveMouthSnippet)
|
||||
paths.bellyAttachment = split[0].attr('data-text-class', 'text-xs')
|
||||
macro('banner', {
|
||||
path: paths.bellyAttachment,
|
||||
text: 'belly',
|
||||
id: 'belly',
|
||||
dy: 0,
|
||||
spaces: 4,
|
||||
repeat: 3,
|
||||
})
|
||||
paths.mouthAttachment = split[1].attr('data-text-class', 'text-xs')
|
||||
macro('banner', {
|
||||
path: paths.mouthAttachment,
|
||||
text: 'mouth',
|
||||
id: 'mouth',
|
||||
dy: 0,
|
||||
spaces: 4,
|
||||
repeat: 3,
|
||||
})
|
||||
|
||||
if (paperless) {
|
||||
macro('hd', {
|
||||
from: points.aboveMouth04,
|
||||
to: points.aboveMouth01,
|
||||
y: points.aboveMouth01.y - sa - 10,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.aboveMouth01,
|
||||
to: points.aboveMouth02,
|
||||
y: points.aboveMouth01.y - sa - 10,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.aboveMouthSnippet,
|
||||
to: points.aboveMouth02,
|
||||
y: points.aboveMouth01.y,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.aboveMouth04,
|
||||
to: points.aboveMouth01,
|
||||
x: points.aboveMouth04.x - sa - 15,
|
||||
noStartMarker: true,
|
||||
noEndMarker: true,
|
||||
})
|
||||
points.aboveMouthBottom = paths.seam.edge('bottom')
|
||||
points.aboveMouthTop = new Path()
|
||||
.move(points.aboveMouth01)
|
||||
.curve(points.aboveMouth01cp1, points.aboveMouth02cp2, points.aboveMouth02)
|
||||
.edge('bottom')
|
||||
|
||||
macro('vd', {
|
||||
from: points.aboveMouthBottom,
|
||||
to: points.aboveMouth04,
|
||||
x: points.aboveMouth04.x - sa - 15,
|
||||
noStartMarker: true,
|
||||
noEndMarker: true,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.aboveMouthBottom,
|
||||
to: points.aboveMouthTop,
|
||||
x: points.aboveMouth04.x - sa,
|
||||
noStartMarker: true,
|
||||
noEndMarker: true,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.aboveMouth02,
|
||||
to: points.aboveMouth03,
|
||||
x: points.aboveMouth02.x + sa + 10,
|
||||
noStartMarker: true,
|
||||
noEndMarker: true,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.aboveMouth03,
|
||||
to: points.aboveMouthBottom,
|
||||
x: points.aboveMouth02.x + sa + 10,
|
||||
noStartMarker: true,
|
||||
noEndMarker: true,
|
||||
})
|
||||
}
|
||||
macro('hd', {
|
||||
from: points.aboveMouth04,
|
||||
to: points.aboveMouth01,
|
||||
y: points.aboveMouth01.y - sa - 10,
|
||||
id: 'widthCorners',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.aboveMouth01,
|
||||
to: points.aboveMouth02,
|
||||
y: points.aboveMouth01.y - sa - 10,
|
||||
id: 'cornerToMid',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.aboveMouthSnippet,
|
||||
to: points.aboveMouth02,
|
||||
y: points.aboveMouth01.y,
|
||||
id: 'widthToSnippet',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.aboveMouth04,
|
||||
to: points.aboveMouth01,
|
||||
x: points.aboveMouth04.x - sa - 15,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.aboveMouthBottom,
|
||||
to: points.aboveMouth04,
|
||||
x: points.aboveMouth04.x - sa - 15,
|
||||
id: 'bottomToCornerLeft',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.aboveMouthBottom,
|
||||
to: points.aboveMouthTop,
|
||||
x: points.aboveMouth04.x - sa,
|
||||
id: 'minimalHeight',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.aboveMouth02,
|
||||
to: points.aboveMouth03,
|
||||
x: points.aboveMouth02.x + sa + 10,
|
||||
id: 'heightCornersRight',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.aboveMouth03,
|
||||
to: points.aboveMouthBottom,
|
||||
x: points.aboveMouth02.x + sa + 10,
|
||||
id: 'bottomToCornerRight',
|
||||
})
|
||||
|
||||
if (sa) {
|
||||
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
|
||||
}
|
||||
}
|
||||
|
||||
return part
|
||||
}
|
||||
|
||||
export const aboveMouth = {
|
||||
name: 'hi.aboveMouth',
|
||||
after: [body, mouth],
|
||||
draft: draftHiAboveMouth,
|
||||
return part
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,202 +1,209 @@
|
|||
import { body } from './body.mjs'
|
||||
import { aboveMouth } from './aboveMouth.mjs'
|
||||
|
||||
function draftHiBelly({
|
||||
store,
|
||||
sa,
|
||||
Point,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
Snippet,
|
||||
snippets,
|
||||
options,
|
||||
complete,
|
||||
paperless,
|
||||
macro,
|
||||
part,
|
||||
}) {
|
||||
const belly01_02d = 224.8451041 * options.size
|
||||
const belly02_03d = 108.1988389 * options.size
|
||||
const belly03_04d = 216.7485605 * options.size
|
||||
const belly01_10d = 129.2449198 * options.size
|
||||
const belly01_02a = 25.7020193
|
||||
const belly02_03a = 2.2164353
|
||||
const belly03_04a = 338.0869319
|
||||
export const belly = {
|
||||
name: 'hi.belly',
|
||||
after: [body, aboveMouth],
|
||||
options: {
|
||||
hungry: { pct: 50, min: 0, max: 100, menu: 'style' },
|
||||
},
|
||||
draft: ({ store, sa, Point, points, Path, paths, Snippet, snippets, options, macro, part }) => {
|
||||
const multiplier = store.get('multiplier')
|
||||
const bellyTailLength = store.get('bellyTailLength')
|
||||
|
||||
const belly01_10a = 163.4959859
|
||||
const belly10_05d = 231.4386252 * options.size
|
||||
const belly10_05a = 0
|
||||
const belly01_02d = 224.8451041 * multiplier
|
||||
const belly02_03d = 108.1988389 * multiplier
|
||||
const belly03_04d = 216.7485605 * multiplier
|
||||
const belly01_10d = 129.2449198 * multiplier
|
||||
const belly01_02a = 25.7020193
|
||||
const belly02_03a = 2.2164353
|
||||
const belly03_04a = 338.0869319
|
||||
|
||||
const belly01cp1d = 65.65512143 * options.size
|
||||
const belly01cp2d = 38.20949996 * options.size
|
||||
const belly02cp1d = 37.73513423 * options.size
|
||||
const belly02cp2d = 118.6453123 * options.size
|
||||
const belly03cp1d = 54.50254779 * options.size
|
||||
const belly03cp2d = 40.6827883 * options.size
|
||||
const belly04cp1d = 52.08589469 * options.size
|
||||
const belly04cp2d = 62.46560129 * options.size
|
||||
const belly05cp1d = 48.20828587 * options.size
|
||||
const belly05cp2d = 68 * options.size
|
||||
const belly10cp2d = 65.42602302 * options.size
|
||||
const belly01_10a = 163.4959859
|
||||
const belly10_05d = 231.4386252 * multiplier
|
||||
const belly10_05a = 0
|
||||
|
||||
const belly01cp1a = 60.117233
|
||||
const belly01cp2a = 327.4394109
|
||||
const belly02cp1a = 331.7898702
|
||||
const belly02cp2a = 182.9449647
|
||||
const belly03cp1a = 349.861397
|
||||
const belly03cp2a = 200.1533738
|
||||
const belly04cp1a = 204.8857575
|
||||
const belly04cp2a = 145.9357065
|
||||
const belly05cp1a = 8.1545383
|
||||
const belly05cp2a = 5
|
||||
const belly10cp2a = 175.9644604
|
||||
const belly01cp1d = 65.65512143 * multiplier
|
||||
const belly01cp2d = 38.20949996 * multiplier
|
||||
const belly02cp1d = 37.73513423 * multiplier
|
||||
const belly02cp2d = 118.6453123 * multiplier
|
||||
const belly03cp1d = 54.50254779 * multiplier
|
||||
const belly03cp2d = 40.6827883 * multiplier
|
||||
const belly04cp1d = 52.08589469 * multiplier
|
||||
const belly04cp2d = 62.46560129 * multiplier
|
||||
const belly05cp1d = 48.20828587 * multiplier
|
||||
const belly05cp2d = 68 * multiplier
|
||||
const belly10cp2d = 65.42602302 * multiplier
|
||||
|
||||
points.belly10 = new Point(0, 0)
|
||||
points.belly01 = points.belly10.shift(belly01_10a, belly01_10d)
|
||||
points.belly02 = points.belly01.shift(belly01_02a, belly01_02d)
|
||||
points.belly03 = points.belly02.shift(belly02_03a, belly02_03d)
|
||||
points.belly04 = points.belly03.shift(belly03_04a, belly03_04d)
|
||||
points.belly05 = points.belly10.shift(belly10_05a, belly10_05d)
|
||||
const belly01cp1a = 60.117233
|
||||
const belly01cp2a = 327.4394109
|
||||
const belly02cp1a = 331.7898702
|
||||
const belly02cp2a = 182.9449647
|
||||
const belly03cp1a = 349.861397
|
||||
const belly03cp2a = 200.1533738
|
||||
const belly04cp1a = 204.8857575
|
||||
const belly04cp2a = 145.9357065
|
||||
const belly05cp1a = 8.1545383
|
||||
const belly05cp2a = 5
|
||||
const belly10cp2a = 175.9644604
|
||||
|
||||
points.belly01.y = points.belly01.y * (1.1 - options.hungry / 5)
|
||||
points.belly02.y = points.belly02.y * (1.1 - options.hungry / 5)
|
||||
points.belly03.y = points.belly03.y * (1.1 - options.hungry / 5)
|
||||
points.belly04.y = points.belly04.y * (1.1 - options.hungry / 5)
|
||||
points.belly10 = new Point(0, 0)
|
||||
points.belly01 = points.belly10.shift(belly01_10a, belly01_10d)
|
||||
points.belly02 = points.belly01.shift(belly01_02a, belly01_02d)
|
||||
points.belly03 = points.belly02.shift(belly02_03a, belly02_03d)
|
||||
points.belly04 = points.belly03.shift(belly03_04a, belly03_04d)
|
||||
points.belly05 = points.belly10.shift(belly10_05a, belly10_05d)
|
||||
|
||||
points.belly01cp1 = points.belly01.shift(belly01cp1a, belly01cp1d)
|
||||
points.belly02cp1 = points.belly02.shift(belly02cp1a, belly02cp1d)
|
||||
points.belly03cp1 = points.belly03.shift(belly03cp1a, belly03cp1d)
|
||||
points.belly04cp1 = points.belly04.shift(belly04cp1a, belly04cp1d)
|
||||
points.belly05cp1 = points.belly05.shift(belly05cp1a, belly05cp1d)
|
||||
points.belly01cp2 = points.belly01.shift(belly01cp2a, belly01cp2d)
|
||||
points.belly02cp2 = points.belly02.shift(belly02cp2a, belly02cp2d)
|
||||
points.belly03cp2 = points.belly03.shift(belly03cp2a, belly03cp2d)
|
||||
points.belly04cp2 = points.belly04.shift(belly04cp2a, belly04cp2d)
|
||||
points.belly05cp2 = points.belly05.shift(belly05cp2a, belly05cp2d)
|
||||
points.belly10cp1 = points.belly10.shift(belly10cp2a, belly10cp2d)
|
||||
points.belly01.y = points.belly01.y * (1.1 - options.hungry / 5)
|
||||
points.belly02.y = points.belly02.y * (1.1 - options.hungry / 5)
|
||||
points.belly03.y = points.belly03.y * (1.1 - options.hungry / 5)
|
||||
points.belly04.y = points.belly04.y * (1.1 - options.hungry / 5)
|
||||
|
||||
const mouthPartLength =
|
||||
store.get('aboveMouthBottomLength') -
|
||||
store.get('mouthTopLength') +
|
||||
store.get('mouthBottomLength')
|
||||
points.belly01cp1 = points.belly01.shift(belly01cp1a, belly01cp1d)
|
||||
points.belly02cp1 = points.belly02.shift(belly02cp1a, belly02cp1d)
|
||||
points.belly03cp1 = points.belly03.shift(belly03cp1a, belly03cp1d)
|
||||
points.belly04cp1 = points.belly04.shift(belly04cp1a, belly04cp1d)
|
||||
points.belly05cp1 = points.belly05.shift(belly05cp1a, belly05cp1d)
|
||||
points.belly01cp2 = points.belly01.shift(belly01cp2a, belly01cp2d)
|
||||
points.belly02cp2 = points.belly02.shift(belly02cp2a, belly02cp2d)
|
||||
points.belly03cp2 = points.belly03.shift(belly03cp2a, belly03cp2d)
|
||||
points.belly04cp2 = points.belly04.shift(belly04cp2a, belly04cp2d)
|
||||
points.belly05cp2 = points.belly05.shift(belly05cp2a, belly05cp2d)
|
||||
points.belly10cp1 = points.belly10.shift(belly10cp2a, belly10cp2d)
|
||||
|
||||
let diff = 0
|
||||
let iteration = 0
|
||||
do {
|
||||
points.belly01.x -= diff
|
||||
points.belly01cp1.x -= diff
|
||||
points.belly01cp2.x -= diff
|
||||
const mouthPartLength =
|
||||
store.get('aboveMouthBottomLength') -
|
||||
store.get('mouthTopLength') +
|
||||
store.get('mouthBottomLength')
|
||||
|
||||
iteration++
|
||||
diff =
|
||||
mouthPartLength -
|
||||
new Path()
|
||||
.move(points.belly01)
|
||||
.curve(points.belly01cp1, points.belly02cp2, points.belly02)
|
||||
.length()
|
||||
} while (Math.abs(diff) > store.get('tolerance') && iteration < 100)
|
||||
let diff = 0
|
||||
let iteration = 0
|
||||
do {
|
||||
points.belly01.x -= diff
|
||||
points.belly01cp1.x -= diff
|
||||
points.belly01cp2.x -= diff
|
||||
|
||||
const bellyTailLength = store.get('bellyTailLength')
|
||||
iteration++
|
||||
diff =
|
||||
mouthPartLength -
|
||||
new Path()
|
||||
.move(points.belly01)
|
||||
.curve(points.belly01cp1, points.belly02cp2, points.belly02)
|
||||
.length()
|
||||
} while (Math.abs(diff) > store.get('tolerance') && iteration < 100)
|
||||
|
||||
diff = 0
|
||||
iteration = 0
|
||||
do {
|
||||
points.belly04.x += diff
|
||||
points.belly04cp1.x += diff
|
||||
points.belly04cp2.x += diff
|
||||
points.belly05.x += diff
|
||||
points.belly05cp2.x += diff
|
||||
diff = 0
|
||||
iteration = 0
|
||||
do {
|
||||
points.belly04.x += diff
|
||||
points.belly04cp1.x += diff
|
||||
points.belly04cp2.x += diff
|
||||
points.belly05.x += diff
|
||||
points.belly05cp2.x += diff
|
||||
|
||||
iteration++
|
||||
diff =
|
||||
bellyTailLength -
|
||||
new Path()
|
||||
.move(points.belly03)
|
||||
.curve(points.belly03cp1, points.belly04cp2, points.belly04)
|
||||
.length()
|
||||
} while (Math.abs(diff) > store.get('tolerance') && iteration < 100)
|
||||
iteration++
|
||||
diff =
|
||||
bellyTailLength -
|
||||
new Path()
|
||||
.move(points.belly03)
|
||||
.curve(points.belly03cp1, points.belly04cp2, points.belly04)
|
||||
.length()
|
||||
} while (Math.abs(diff) > store.get('tolerance') && iteration < 100)
|
||||
|
||||
points.belly05cp1 = points.belly05cp2.flipY()
|
||||
points.belly06 = points.belly04.flipY()
|
||||
points.belly06cp1 = points.belly04cp2.flipY()
|
||||
points.belly06cp2 = points.belly04cp1.flipY()
|
||||
points.belly07 = points.belly03.flipY()
|
||||
points.belly07cp1 = points.belly03cp2.flipY()
|
||||
points.belly07cp2 = points.belly03cp1.flipY()
|
||||
points.belly08 = points.belly02.flipY()
|
||||
points.belly08cp1 = points.belly02cp2.flipY()
|
||||
points.belly08cp2 = points.belly02cp1.flipY()
|
||||
points.belly09 = points.belly01.flipY()
|
||||
points.belly09cp1 = points.belly01cp2.flipY()
|
||||
points.belly09cp2 = points.belly01cp1.flipY()
|
||||
points.belly10cp2 = points.belly10cp1.flipY()
|
||||
points.belly05cp1 = points.belly05cp2.flipY()
|
||||
points.belly06 = points.belly04.flipY()
|
||||
points.belly06cp1 = points.belly04cp2.flipY()
|
||||
points.belly06cp2 = points.belly04cp1.flipY()
|
||||
points.belly07 = points.belly03.flipY()
|
||||
points.belly07cp1 = points.belly03cp2.flipY()
|
||||
points.belly07cp2 = points.belly03cp1.flipY()
|
||||
points.belly08 = points.belly02.flipY()
|
||||
points.belly08cp1 = points.belly02cp2.flipY()
|
||||
points.belly08cp2 = points.belly02cp1.flipY()
|
||||
points.belly09 = points.belly01.flipY()
|
||||
points.belly09cp1 = points.belly01cp2.flipY()
|
||||
points.belly09cp2 = points.belly01cp1.flipY()
|
||||
points.belly10cp2 = points.belly10cp1.flipY()
|
||||
|
||||
paths.body1 = new Path()
|
||||
.move(points.belly04)
|
||||
.curve(points.belly04cp2, points.belly03cp1, points.belly03)
|
||||
.attr('data-text-class', 'text-xs')
|
||||
paths.body2 = new Path()
|
||||
.move(points.belly07)
|
||||
.curve(points.belly07cp2, points.belly06cp1, points.belly06)
|
||||
.attr('data-text-class', 'text-xs')
|
||||
paths.finAttachmentBelly1 = new Path()
|
||||
.move(points.belly03)
|
||||
.curve(points.belly03cp2, points.belly02cp1, points.belly02)
|
||||
.attr('data-text-class', 'text-xs')
|
||||
paths.finAttachmentBelly2 = new Path()
|
||||
.move(points.belly08)
|
||||
.curve(points.belly08cp2, points.belly07cp1, points.belly07)
|
||||
.attr('data-text-class', 'text-xs')
|
||||
paths.mouthAttachment1 = new Path()
|
||||
.move(points.belly02)
|
||||
.curve(points.belly02cp2, points.belly01cp1, points.belly01)
|
||||
paths.mouthAttachment2 = new Path()
|
||||
.move(points.belly09)
|
||||
.curve(points.belly09cp2, points.belly08cp1, points.belly08)
|
||||
|
||||
paths.top = new Path()
|
||||
.move(points.belly04)
|
||||
.join(paths.body1)
|
||||
.join(paths.finAttachmentBelly1)
|
||||
.join(paths.mouthAttachment1)
|
||||
.hide()
|
||||
paths.bottom = new Path()
|
||||
.move(points.belly09)
|
||||
.join(paths.mouthAttachment2)
|
||||
.join(paths.finAttachmentBelly2)
|
||||
.join(paths.body2)
|
||||
.hide()
|
||||
paths.seam = new Path()
|
||||
.move(points.belly01)
|
||||
.curve(points.belly01cp2, points.belly10cp1, points.belly10)
|
||||
.curve(points.belly10cp2, points.belly09cp1, points.belly09)
|
||||
.join(paths.bottom)
|
||||
.curve(points.belly06cp2, points.belly05cp1, points.belly05)
|
||||
.curve(points.belly05cp2, points.belly04cp1, points.belly04)
|
||||
.join(paths.top)
|
||||
.close()
|
||||
.unhide()
|
||||
|
||||
store.set(
|
||||
'bellyFinLength',
|
||||
new Path()
|
||||
paths.body1 = new Path()
|
||||
.move(points.belly04)
|
||||
.curve(points.belly04cp2, points.belly03cp1, points.belly03)
|
||||
.attr('data-text-class', 'text-xs')
|
||||
paths.body2 = new Path()
|
||||
.move(points.belly07)
|
||||
.curve(points.belly07cp2, points.belly06cp1, points.belly06)
|
||||
.attr('data-text-class', 'text-xs')
|
||||
paths.finAttachmentBelly1 = new Path()
|
||||
.move(points.belly03)
|
||||
.curve(points.belly03cp2, points.belly02cp1, points.belly02)
|
||||
.attr('data-text-class', 'text-xs')
|
||||
paths.finAttachmentBelly2 = new Path()
|
||||
.move(points.belly08)
|
||||
.curve(points.belly08cp2, points.belly07cp1, points.belly07)
|
||||
.attr('data-text-class', 'text-xs')
|
||||
paths.mouthAttachment1 = new Path()
|
||||
.move(points.belly02)
|
||||
.curve(points.belly02cp1, points.belly03cp2, points.belly03)
|
||||
.length()
|
||||
)
|
||||
.curve(points.belly02cp2, points.belly01cp1, points.belly01)
|
||||
paths.mouthAttachment2 = new Path()
|
||||
.move(points.belly09)
|
||||
.curve(points.belly09cp2, points.belly08cp1, points.belly08)
|
||||
|
||||
points.grainlineFrom = new Point(points.belly10.x, points.belly02.y * 0.7)
|
||||
points.grainlineTo = new Point(points.belly05.x, points.belly02.y * 0.7)
|
||||
macro('grainline', {
|
||||
from: points.grainlineFrom,
|
||||
to: points.grainlineTo,
|
||||
})
|
||||
paths.top = new Path()
|
||||
.move(points.belly04)
|
||||
.join(paths.body1)
|
||||
.join(paths.finAttachmentBelly1)
|
||||
.join(paths.mouthAttachment1)
|
||||
.hide()
|
||||
paths.bottom = new Path()
|
||||
.move(points.belly09)
|
||||
.join(paths.mouthAttachment2)
|
||||
.join(paths.finAttachmentBelly2)
|
||||
.join(paths.body2)
|
||||
.hide()
|
||||
paths.seam = new Path()
|
||||
.move(points.belly01)
|
||||
.curve(points.belly01cp2, points.belly10cp1, points.belly10)
|
||||
.curve(points.belly10cp2, points.belly09cp1, points.belly09)
|
||||
.join(paths.bottom)
|
||||
.curve(points.belly06cp2, points.belly05cp1, points.belly05)
|
||||
.curve(points.belly05cp2, points.belly04cp1, points.belly04)
|
||||
.join(paths.top)
|
||||
.close()
|
||||
.unhide()
|
||||
|
||||
store.cutlist.addCut({ cut: 1, material: 'color2Belly' })
|
||||
store.set(
|
||||
'bellyFinLength',
|
||||
new Path()
|
||||
.move(points.belly02)
|
||||
.curve(points.belly02cp1, points.belly03cp2, points.belly03)
|
||||
.length()
|
||||
)
|
||||
|
||||
points.grainlineFrom = new Point(points.belly10.x, points.belly02.y * 0.7)
|
||||
points.grainlineTo = new Point(points.belly05.x, points.belly02.y * 0.7)
|
||||
macro('grainline', {
|
||||
from: points.grainlineFrom,
|
||||
to: points.grainlineTo,
|
||||
})
|
||||
|
||||
store.cutlist.addCut({ cut: 1, material: 'color2Belly' })
|
||||
|
||||
points.titleAnchor = points.belly05.shiftFractionTowards(points.belly10, 0.5)
|
||||
points.logoAnchor = points.belly10.shiftFractionTowards(points.titleAnchor, 0.5)
|
||||
points.gridAnchor = points.titleAnchor.clone()
|
||||
|
||||
snippets.logo = new Snippet('logo', points.logoAnchor).attr(
|
||||
'data-scale',
|
||||
multiplier > 1 ? 1 : multiplier
|
||||
)
|
||||
|
||||
macro('title', {
|
||||
at: points.titleAnchor,
|
||||
nr: 2,
|
||||
title: 'belly',
|
||||
scale: multiplier,
|
||||
})
|
||||
|
||||
// Complete?
|
||||
if (complete) {
|
||||
points.bellyMouthSnippet1 = paths.mouthAttachment1
|
||||
.reverse()
|
||||
.shiftAlong(store.get('mouthBottomLength'))
|
||||
|
@ -210,6 +217,7 @@ function draftHiBelly({
|
|||
macro('banner', {
|
||||
path: paths.finAttachmentBelly1,
|
||||
text: '-o-',
|
||||
id: 'circles1',
|
||||
dy: 0,
|
||||
spaces: 3,
|
||||
repeat: 7,
|
||||
|
@ -217,6 +225,7 @@ function draftHiBelly({
|
|||
macro('banner', {
|
||||
path: paths.finAttachmentBelly2,
|
||||
text: '-o-',
|
||||
id: 'circles2',
|
||||
dy: 0,
|
||||
spaces: 3,
|
||||
repeat: 7,
|
||||
|
@ -232,6 +241,7 @@ function draftHiBelly({
|
|||
macro('banner', {
|
||||
path: paths.mouth1,
|
||||
text: 'mouth',
|
||||
id: 'mouth1',
|
||||
dy: 0,
|
||||
spaces: 3,
|
||||
repeat: 3,
|
||||
|
@ -239,6 +249,7 @@ function draftHiBelly({
|
|||
macro('banner', {
|
||||
path: paths.mouth2,
|
||||
text: 'mouth',
|
||||
id: 'mouth2',
|
||||
dy: 0,
|
||||
spaces: 3,
|
||||
repeat: 3,
|
||||
|
@ -246,6 +257,7 @@ function draftHiBelly({
|
|||
macro('banner', {
|
||||
path: paths.body1,
|
||||
text: 'body',
|
||||
id: 'body1',
|
||||
dy: 0,
|
||||
spaces: 3,
|
||||
repeat: 3,
|
||||
|
@ -253,6 +265,7 @@ function draftHiBelly({
|
|||
macro('banner', {
|
||||
path: paths.body2,
|
||||
text: 'body',
|
||||
id: 'body2',
|
||||
dy: 0,
|
||||
spaces: 3,
|
||||
repeat: 3,
|
||||
|
@ -260,6 +273,7 @@ function draftHiBelly({
|
|||
macro('banner', {
|
||||
path: paths.aboveMouth1,
|
||||
text: 'aboveMouth',
|
||||
id: 'aboveMouth1',
|
||||
dy: 0,
|
||||
spaces: 3,
|
||||
repeat: 3,
|
||||
|
@ -267,139 +281,96 @@ function draftHiBelly({
|
|||
macro('banner', {
|
||||
path: paths.aboveMouth2,
|
||||
text: 'aboveMouth',
|
||||
id: 'aboveMouth2',
|
||||
dy: 0,
|
||||
spaces: 3,
|
||||
repeat: 3,
|
||||
})
|
||||
|
||||
if (paperless) {
|
||||
macro('hd', {
|
||||
from: points.belly01,
|
||||
to: points.belly10,
|
||||
y: points.belly01.y,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.belly05,
|
||||
to: points.belly04,
|
||||
y: points.belly04.y,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.belly10,
|
||||
to: points.belly05,
|
||||
y: (points.belly04.y + points.belly01.y) / 2,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.belly01,
|
||||
to: points.belly02,
|
||||
y: points.belly02.y - sa - 10,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.belly02,
|
||||
to: points.belly03,
|
||||
y: points.belly02.y - sa - 10,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.belly03,
|
||||
to: points.belly04,
|
||||
y: points.belly02.y - sa - 10,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.bellyMouthSnippet1,
|
||||
to: points.belly02,
|
||||
y: points.bellyMouthSnippet1.y,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.belly01,
|
||||
to: points.belly10,
|
||||
y: points.belly01.y,
|
||||
id: 'depthLeftDart',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.belly05,
|
||||
to: points.belly04,
|
||||
y: points.belly04.y,
|
||||
id: 'depthRightDart',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.belly10,
|
||||
to: points.belly05,
|
||||
y: (points.belly04.y + points.belly01.y) / 2,
|
||||
id: 'widthbetweenDarts',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.belly01,
|
||||
to: points.belly02,
|
||||
y: points.belly02.y - sa - 10,
|
||||
id: 'leftToFin',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.belly02,
|
||||
to: points.belly03,
|
||||
y: points.belly02.y - sa - 10,
|
||||
id: 'finWidth',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.belly03,
|
||||
to: points.belly04,
|
||||
y: points.belly02.y - sa - 10,
|
||||
id: 'rightToFin',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.bellyMouthSnippet1,
|
||||
to: points.belly02,
|
||||
y: points.bellyMouthSnippet1.y,
|
||||
id: 'finToSnippet',
|
||||
})
|
||||
|
||||
macro('vd', {
|
||||
from: points.belly03,
|
||||
to: points.belly05,
|
||||
x: points.belly03.x,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.belly05,
|
||||
to: points.belly07,
|
||||
x: points.belly03.x,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.belly10,
|
||||
to: points.belly02,
|
||||
x: points.belly02.x,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.belly08,
|
||||
to: points.belly10,
|
||||
x: points.belly02.x,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.belly10,
|
||||
to: points.belly01,
|
||||
x: points.belly01.x - sa - 10,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.belly09,
|
||||
to: points.belly10,
|
||||
x: points.belly01.x - sa - 10,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.belly09,
|
||||
to: points.belly08,
|
||||
x: points.belly01.x - sa - 10,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.belly02,
|
||||
to: points.belly01,
|
||||
x: points.belly01.x - sa - 10,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.belly05,
|
||||
to: points.belly06,
|
||||
x: points.belly04.x + sa + 10,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.belly04,
|
||||
to: points.belly05,
|
||||
x: points.belly04.x + sa + 10,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.belly06,
|
||||
to: points.belly07,
|
||||
x: points.belly04.x + sa + 10,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.belly03,
|
||||
to: points.belly04,
|
||||
x: points.belly04.x + sa + 10,
|
||||
})
|
||||
|
||||
points.titleAnchor = points.belly02.shiftFractionTowards(points.belly07, 0.5)
|
||||
} else {
|
||||
points.titleAnchor = points.belly03.shiftFractionTowards(points.belly07, 0.5)
|
||||
points.logoAnchor = points.belly02.shiftFractionTowards(points.belly08, 0.5)
|
||||
|
||||
snippets.logo = new Snippet('logo', points.logoAnchor).attr(
|
||||
'data-scale',
|
||||
options.size > 1 ? 1 : options.size
|
||||
)
|
||||
}
|
||||
macro('title', {
|
||||
at: points.titleAnchor,
|
||||
nr: 2,
|
||||
title: 'belly',
|
||||
scale: options.size,
|
||||
macro('vd', {
|
||||
from: points.belly05,
|
||||
to: points.belly07,
|
||||
x: points.belly03.x,
|
||||
id: 'rightFinToMiddle',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.belly08,
|
||||
to: points.belly10,
|
||||
x: points.belly02.x,
|
||||
id: 'leftFinToMiddle',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.belly09,
|
||||
to: points.belly10,
|
||||
x: points.belly01.x - sa - 10,
|
||||
id: 'heightLeftDart',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.belly09,
|
||||
to: points.belly08,
|
||||
x: points.belly01.x - sa - 10,
|
||||
id: 'heightLeft',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.belly05,
|
||||
to: points.belly06,
|
||||
x: points.belly04.x + sa + 10,
|
||||
id: 'heightRightDart',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.belly06,
|
||||
to: points.belly07,
|
||||
x: points.belly04.x + sa + 10,
|
||||
id: 'heightRight',
|
||||
})
|
||||
|
||||
if (sa) {
|
||||
paths.sa = paths.bottom.join(paths.top).close().offset(sa).attr('class', 'fabric sa')
|
||||
}
|
||||
}
|
||||
|
||||
return part
|
||||
}
|
||||
|
||||
export const belly = {
|
||||
name: 'hi.belly',
|
||||
after: [body, aboveMouth],
|
||||
options: {
|
||||
hungry: { pct: 50, min: 0, max: 100, menu: 'style' },
|
||||
return part
|
||||
},
|
||||
draft: draftHiBelly,
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -2,110 +2,99 @@ import { body } from './body.mjs'
|
|||
import { belly } from './belly.mjs'
|
||||
import { aboveMouth } from './aboveMouth.mjs'
|
||||
|
||||
function draftHiBottomFin({
|
||||
store,
|
||||
sa,
|
||||
Point,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
Snippet,
|
||||
snippets,
|
||||
options,
|
||||
complete,
|
||||
paperless,
|
||||
macro,
|
||||
part,
|
||||
}) {
|
||||
let bottomFin01_02d = 250.63638754690027 * options.size
|
||||
const bottomFin01_02a = 119.34849371430543
|
||||
let bottomFin01_03d = 137.70322741678933 * options.size
|
||||
const bottomFin01_03a = 175.11970494988498
|
||||
const bottomFin01cp1d = 133.21819413653674 * options.size
|
||||
const bottomFin01cp2d = 51.94197687805115 * options.size
|
||||
const bottomFin01cp1a = 95.20910872095476
|
||||
const bottomFin01cp2a = 158.66090918215986
|
||||
const bottomFin02cp1d = 29.25974733588791 * options.size
|
||||
const bottomFin02cp2d = 31.28292571739416 * options.size
|
||||
const bottomFin02cp1a = 208.55316756249104
|
||||
const bottomFin02cp2a = 28.113642612639804
|
||||
const bottomFin03cp1d = 53.31550082293142 * options.size
|
||||
const bottomFin03cp2d = 177.65809391356197 * options.size
|
||||
const bottomFin03cp1a = 9.79694130335566
|
||||
const bottomFin03cp2a = 80.81868300891519
|
||||
export const bottomOfFin = {
|
||||
name: 'hi.bottomOfFin',
|
||||
after: [body, belly, aboveMouth],
|
||||
draft: ({ store, sa, Point, points, Path, paths, Snippet, snippets, macro, part }) => {
|
||||
const multiplier = store.get('multiplier')
|
||||
|
||||
const finLength = store.get('aboveMouthFinLength') + store.get('bellyFinLength')
|
||||
const finCircumference = store.get('topFinCircumference')
|
||||
let bottomOfFin01_02d = 250.63638754690027 * multiplier
|
||||
const bottomOfFin01_02a = 119.34849371430543
|
||||
let bottomOfFin01_03d = 137.70322741678933 * multiplier
|
||||
const bottomOfFin01_03a = 175.11970494988498
|
||||
const bottomOfFin01cp1d = 133.21819413653674 * multiplier
|
||||
const bottomOfFin01cp2d = 51.94197687805115 * multiplier
|
||||
const bottomOfFin01cp1a = 95.20910872095476
|
||||
const bottomOfFin01cp2a = 158.66090918215986
|
||||
const bottomOfFin02cp1d = 29.25974733588791 * multiplier
|
||||
const bottomOfFin02cp2d = 31.28292571739416 * multiplier
|
||||
const bottomOfFin02cp1a = 208.55316756249104
|
||||
const bottomOfFin02cp2a = 28.113642612639804
|
||||
const bottomOfFin03cp1d = 53.31550082293142 * multiplier
|
||||
const bottomOfFin03cp2d = 177.65809391356197 * multiplier
|
||||
const bottomOfFin03cp1a = 9.79694130335566
|
||||
const bottomOfFin03cp2a = 80.81868300891519
|
||||
|
||||
let diff = 0
|
||||
let iteration = 0
|
||||
do {
|
||||
points.bottomFin01 = new Point(0, 0)
|
||||
points.bottomFin02 = points.bottomFin01.shift(bottomFin01_02a, bottomFin01_02d)
|
||||
points.bottomFin03 = points.bottomFin01.shift(bottomFin01_03a, bottomFin01_03d)
|
||||
const finLength = store.get('aboveMouthFinLength') + store.get('bellyFinLength')
|
||||
const finCircumference = store.get('topFinCircumference')
|
||||
|
||||
points.bottomFin01cp1 = points.bottomFin01.shift(bottomFin01cp1a, bottomFin01cp1d)
|
||||
points.bottomFin01cp2 = points.bottomFin01.shift(bottomFin01cp2a, bottomFin01cp2d)
|
||||
points.bottomFin02cp1 = points.bottomFin02.shift(bottomFin02cp1a, bottomFin02cp1d)
|
||||
points.bottomFin02cp2 = points.bottomFin02.shift(bottomFin02cp2a, bottomFin02cp2d)
|
||||
points.bottomFin03cp1 = points.bottomFin03.shift(bottomFin03cp1a, bottomFin03cp1d)
|
||||
points.bottomFin03cp2 = points.bottomFin03.shift(bottomFin03cp2a, bottomFin03cp2d)
|
||||
let diff = 0
|
||||
let iteration = 0
|
||||
do {
|
||||
points.bottomOfFin01 = new Point(0, 0)
|
||||
points.bottomOfFin02 = points.bottomOfFin01.shift(bottomOfFin01_02a, bottomOfFin01_02d)
|
||||
points.bottomOfFin03 = points.bottomOfFin01.shift(bottomOfFin01_03a, bottomOfFin01_03d)
|
||||
|
||||
diff =
|
||||
finLength -
|
||||
new Path()
|
||||
.move(points.bottomFin03)
|
||||
.curve(points.bottomFin03cp1, points.bottomFin01cp2, points.bottomFin01)
|
||||
.length()
|
||||
points.bottomOfFin01cp1 = points.bottomOfFin01.shift(bottomOfFin01cp1a, bottomOfFin01cp1d)
|
||||
points.bottomOfFin01cp2 = points.bottomOfFin01.shift(bottomOfFin01cp2a, bottomOfFin01cp2d)
|
||||
points.bottomOfFin02cp1 = points.bottomOfFin02.shift(bottomOfFin02cp1a, bottomOfFin02cp1d)
|
||||
points.bottomOfFin02cp2 = points.bottomOfFin02.shift(bottomOfFin02cp2a, bottomOfFin02cp2d)
|
||||
points.bottomOfFin03cp1 = points.bottomOfFin03.shift(bottomOfFin03cp1a, bottomOfFin03cp1d)
|
||||
points.bottomOfFin03cp2 = points.bottomOfFin03.shift(bottomOfFin03cp2a, bottomOfFin03cp2d)
|
||||
|
||||
bottomFin01_03d = bottomFin01_03d + diff
|
||||
iteration++
|
||||
} while (Math.abs(diff) > store.get('tolerance') && iteration < 100)
|
||||
diff =
|
||||
finLength -
|
||||
new Path()
|
||||
.move(points.bottomOfFin03)
|
||||
.curve(points.bottomOfFin03cp1, points.bottomOfFin01cp2, points.bottomOfFin01)
|
||||
.length()
|
||||
|
||||
diff = 0
|
||||
iteration = 0
|
||||
do {
|
||||
points.bottomFin01 = new Point(0, 0)
|
||||
points.bottomFin02 = points.bottomFin01.shift(bottomFin01_02a, bottomFin01_02d)
|
||||
points.bottomFin03 = points.bottomFin01.shift(bottomFin01_03a, bottomFin01_03d)
|
||||
bottomOfFin01_03d = bottomOfFin01_03d + diff
|
||||
iteration++
|
||||
} while (Math.abs(diff) > store.get('tolerance') && iteration < 100)
|
||||
|
||||
points.bottomFin01cp1 = points.bottomFin01.shift(bottomFin01cp1a, bottomFin01cp1d)
|
||||
points.bottomFin01cp2 = points.bottomFin01.shift(bottomFin01cp2a, bottomFin01cp2d)
|
||||
points.bottomFin02cp1 = points.bottomFin02.shift(bottomFin02cp1a, bottomFin02cp1d)
|
||||
points.bottomFin02cp2 = points.bottomFin02.shift(bottomFin02cp2a, bottomFin02cp2d)
|
||||
points.bottomFin03cp1 = points.bottomFin03.shift(bottomFin03cp1a, bottomFin03cp1d)
|
||||
points.bottomFin03cp2 = points.bottomFin03.shift(bottomFin03cp2a, bottomFin03cp2d)
|
||||
diff = 0
|
||||
iteration = 0
|
||||
do {
|
||||
points.bottomOfFin01 = new Point(0, 0)
|
||||
points.bottomOfFin02 = points.bottomOfFin01.shift(bottomOfFin01_02a, bottomOfFin01_02d)
|
||||
points.bottomOfFin03 = points.bottomOfFin01.shift(bottomOfFin01_03a, bottomOfFin01_03d)
|
||||
|
||||
diff =
|
||||
finCircumference -
|
||||
new Path()
|
||||
.move(points.bottomFin01)
|
||||
.curve(points.bottomFin01cp1, points.bottomFin02cp2, points.bottomFin02)
|
||||
.curve(points.bottomFin02cp1, points.bottomFin03cp2, points.bottomFin03)
|
||||
.length()
|
||||
points.bottomOfFin01cp1 = points.bottomOfFin01.shift(bottomOfFin01cp1a, bottomOfFin01cp1d)
|
||||
points.bottomOfFin01cp2 = points.bottomOfFin01.shift(bottomOfFin01cp2a, bottomOfFin01cp2d)
|
||||
points.bottomOfFin02cp1 = points.bottomOfFin02.shift(bottomOfFin02cp1a, bottomOfFin02cp1d)
|
||||
points.bottomOfFin02cp2 = points.bottomOfFin02.shift(bottomOfFin02cp2a, bottomOfFin02cp2d)
|
||||
points.bottomOfFin03cp1 = points.bottomOfFin03.shift(bottomOfFin03cp1a, bottomOfFin03cp1d)
|
||||
points.bottomOfFin03cp2 = points.bottomOfFin03.shift(bottomOfFin03cp2a, bottomOfFin03cp2d)
|
||||
|
||||
bottomFin01_02d = bottomFin01_02d + diff
|
||||
iteration++
|
||||
} while (Math.abs(diff) > store.get('tolerance') && iteration < 100)
|
||||
diff =
|
||||
finCircumference -
|
||||
new Path()
|
||||
.move(points.bottomOfFin01)
|
||||
.curve(points.bottomOfFin01cp1, points.bottomOfFin02cp2, points.bottomOfFin02)
|
||||
.curve(points.bottomOfFin02cp1, points.bottomOfFin03cp2, points.bottomOfFin03)
|
||||
.length()
|
||||
|
||||
paths.seam = new Path()
|
||||
.move(points.bottomFin01)
|
||||
.curve(points.bottomFin01cp1, points.bottomFin02cp2, points.bottomFin02)
|
||||
.curve(points.bottomFin02cp1, points.bottomFin03cp2, points.bottomFin03)
|
||||
.curve(points.bottomFin03cp1, points.bottomFin01cp2, points.bottomFin01)
|
||||
.close()
|
||||
bottomOfFin01_02d = bottomOfFin01_02d + diff
|
||||
iteration++
|
||||
} while (Math.abs(diff) > store.get('tolerance') && iteration < 100)
|
||||
|
||||
store.cutlist.addCut({ material: 'color1UpperBody' })
|
||||
paths.seam = new Path()
|
||||
.move(points.bottomOfFin01)
|
||||
.curve(points.bottomOfFin01cp1, points.bottomOfFin02cp2, points.bottomOfFin02)
|
||||
.curve(points.bottomOfFin02cp1, points.bottomOfFin03cp2, points.bottomOfFin03)
|
||||
.curve(points.bottomOfFin03cp1, points.bottomOfFin01cp2, points.bottomOfFin01)
|
||||
.close()
|
||||
|
||||
store.cutlist.addCut({ cut: 2, material: 'color1UpperBody' })
|
||||
|
||||
// Complete?
|
||||
if (complete) {
|
||||
const finAttachment = new Path()
|
||||
.move(points.bottomFin01)
|
||||
.curve(points.bottomFin01cp2, points.bottomFin03cp1, points.bottomFin03)
|
||||
points.bottomFinSnippet = finAttachment.shiftAlong(store.get('aboveMouthFinLength'))
|
||||
snippets.bottomFin = new Snippet('bnotch', points.bottomFinSnippet)
|
||||
.move(points.bottomOfFin01)
|
||||
.curve(points.bottomOfFin01cp2, points.bottomOfFin03cp1, points.bottomOfFin03)
|
||||
points.bottomOfFinSnippet = finAttachment.shiftAlong(store.get('aboveMouthFinLength'))
|
||||
snippets.bottomOfFin = new Snippet('bnotch', points.bottomOfFinSnippet)
|
||||
|
||||
const attachments = finAttachment.split(points.bottomFinSnippet)
|
||||
const attachments = finAttachment.split(points.bottomOfFinSnippet)
|
||||
paths.finAttachmentAboveMouth = attachments[0].reverse().attr('data-text-class', 'text-xs')
|
||||
paths.finAttachmentBelly = attachments[1].reverse().attr('data-text-class', 'text-xs')
|
||||
macro('banner', {
|
||||
|
@ -114,6 +103,7 @@ function draftHiBottomFin({
|
|||
dy: 0,
|
||||
spaces: 0,
|
||||
repeat: 4,
|
||||
id: 'plusses',
|
||||
})
|
||||
macro('banner', {
|
||||
path: paths.finAttachmentBelly,
|
||||
|
@ -121,98 +111,90 @@ function draftHiBottomFin({
|
|||
dy: 0,
|
||||
spaces: 4,
|
||||
repeat: 7,
|
||||
id: 'circles',
|
||||
})
|
||||
|
||||
points.titleAnchor = points.bottomFin02
|
||||
.shiftFractionTowards(points.bottomFin01, 0.4)
|
||||
.shiftFractionTowards(points.bottomFin03, 0.1)
|
||||
points.logoAnchor = points.titleAnchor.shiftFractionTowards(points.bottomFin03, 0.4)
|
||||
points.titleAnchor = points.bottomOfFin02
|
||||
.shiftFractionTowards(points.bottomOfFin01, 0.4)
|
||||
.shiftFractionTowards(points.bottomOfFin03, 0.1)
|
||||
points.logoAnchor = points.titleAnchor.shiftFractionTowards(points.bottomOfFin03, 0.4)
|
||||
points.gridAnchor = points.titleAnchor.clone()
|
||||
|
||||
snippets.logo = new Snippet('logo', points.logoAnchor).attr(
|
||||
'data-scale',
|
||||
(options.size > 1 ? 1 : options.size) / 2
|
||||
(multiplier > 1 ? 1 : multiplier) / 2
|
||||
)
|
||||
|
||||
macro('title', {
|
||||
at: points.titleAnchor,
|
||||
nr: 6,
|
||||
title: 'bottomFin',
|
||||
scale: (options.size > 1 ? 1 : options.size) / 2,
|
||||
title: 'bottomOfFin',
|
||||
scale: (multiplier > 1 ? 1 : multiplier) / 2,
|
||||
})
|
||||
|
||||
if (paperless) {
|
||||
points.bottomFinTop = paths.seam.edge('top')
|
||||
let tempPath = new Path()
|
||||
.move(points.bottomFin03)
|
||||
.curve(points.bottomFin03cp2, points.bottomFin02cp1, points.bottomFin02)
|
||||
const tempPoint = tempPath.shiftFractionAlong(0.8)
|
||||
points.bottomFinInsideLeft = tempPath.split(tempPoint)[0].edge('right')
|
||||
tempPath = new Path()
|
||||
.move(points.bottomFin01)
|
||||
.curve(points.bottomFin01cp2, points.bottomFin03cp1, points.bottomFin03)
|
||||
points.bottomFinInsideBottom = tempPath.edge('top')
|
||||
points.bottomOfFinTop = paths.seam.edge('top')
|
||||
let tempPath = new Path()
|
||||
.move(points.bottomOfFin03)
|
||||
.curve(points.bottomOfFin03cp2, points.bottomOfFin02cp1, points.bottomOfFin02)
|
||||
const tempPoint = tempPath.shiftFractionAlong(0.8)
|
||||
points.bottomOfFinInsideLeft = tempPath.split(tempPoint)[0].edge('right')
|
||||
tempPath = new Path()
|
||||
.move(points.bottomOfFin01)
|
||||
.curve(points.bottomOfFin01cp2, points.bottomOfFin03cp1, points.bottomOfFin03)
|
||||
points.bottomOfFinInsideBottom = tempPath.edge('top')
|
||||
|
||||
macro('hd', {
|
||||
from: points.bottomFin03,
|
||||
to: points.bottomFin01,
|
||||
y: points.bottomFin01.y + sa + 20,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.bottomFinTop,
|
||||
to: points.bottomFin01,
|
||||
y: points.bottomFinTop.y - sa - 10,
|
||||
// id: 'smallTop',
|
||||
// noStartMarker: true,
|
||||
// noEndMarker: true,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.bottomFinInsideLeft,
|
||||
to: points.bottomFin01,
|
||||
y: points.bottomFin03.y + sa + 20,
|
||||
// id: 'smallBottom',
|
||||
// noStartMarker: true,
|
||||
// noEndMarker: true,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.bottomFin03,
|
||||
to: points.bottomFinSnippet,
|
||||
y: points.bottomFin03.y + sa + 10,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.bottomFin03,
|
||||
to: points.bottomFinTop,
|
||||
x: points.bottomFin03.x - sa - 10,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.bottomFinTop,
|
||||
to: points.bottomFin01,
|
||||
x: points.bottomFin01.x + sa + 20,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.bottomFinTop,
|
||||
to: points.bottomFinInsideBottom,
|
||||
x: points.bottomFin01.x + sa + 10,
|
||||
// id: 'smallRight',
|
||||
// noStartMarker: true,
|
||||
// noEndMarker: true,
|
||||
})
|
||||
// if( options.size < 1.5 ) {
|
||||
// paths.smallTop.attr('data-text-class', 'text-xs')
|
||||
// paths.smallBottom.attr('data-text-class', 'text-xs')
|
||||
// paths.smallRight.attr('data-text-class', 'text-xs')
|
||||
// }
|
||||
}
|
||||
macro('hd', {
|
||||
from: points.bottomOfFin03,
|
||||
to: points.bottomOfFin01,
|
||||
y: points.bottomOfFin01.y + sa + 20,
|
||||
id: 'width',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.bottomOfFinTop,
|
||||
to: points.bottomOfFin01,
|
||||
y: points.bottomOfFinTop.y - sa - 10,
|
||||
id: 'smallTop',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.bottomOfFinInsideLeft,
|
||||
to: points.bottomOfFin01,
|
||||
y: points.bottomOfFin03.y + sa + 20,
|
||||
id: 'widthToSmallest',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.bottomOfFin03,
|
||||
to: points.bottomOfFinSnippet,
|
||||
y: points.bottomOfFin03.y + sa + 10,
|
||||
id: 'widthToSnippet',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.bottomOfFin03,
|
||||
to: points.bottomOfFinTop,
|
||||
x: points.bottomOfFin03.x - sa - 10,
|
||||
id: 'heightLeft',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.bottomOfFinTop,
|
||||
to: points.bottomOfFin01,
|
||||
x: points.bottomOfFin01.x + sa + 20,
|
||||
id: 'heightRight',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.bottomOfFinTop,
|
||||
to: points.bottomOfFinInsideBottom,
|
||||
x: points.bottomOfFin01.x + sa + 10,
|
||||
id: 'heightToSmallest',
|
||||
})
|
||||
// if( multiplier < 1.5 ) {
|
||||
// paths.smallTop.attr('data-text-class', 'text-xs')
|
||||
// paths.smallBottom.attr('data-text-class', 'text-xs')
|
||||
// paths.smallRight.attr('data-text-class', 'text-xs')
|
||||
// }
|
||||
|
||||
if (sa) {
|
||||
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
|
||||
}
|
||||
}
|
||||
|
||||
return part
|
||||
}
|
||||
|
||||
export const bottomFin = {
|
||||
name: 'hi.bottomFin',
|
||||
after: [body, belly, aboveMouth],
|
||||
draft: draftHiBottomFin,
|
||||
return part
|
||||
},
|
||||
}
|
||||
|
|
|
@ -7,16 +7,28 @@ import { tail } from './tail.mjs'
|
|||
import { mouth } from './mouth.mjs'
|
||||
import { aboveMouth } from './aboveMouth.mjs'
|
||||
import { belly } from './belly.mjs'
|
||||
import { topFin } from './topFin.mjs'
|
||||
import { bottomFin } from './bottomFin.mjs'
|
||||
import { topOfFin } from './topFin.mjs'
|
||||
import { bottomOfFin } from './bottomFin.mjs'
|
||||
import { lowerTeeth } from './lowerTeeth.mjs'
|
||||
import { upperTeeth } from './upperTeeth.mjs'
|
||||
|
||||
// Create design
|
||||
const Hi = new Design({
|
||||
data,
|
||||
parts: [body, tail, mouth, aboveMouth, belly, topFin, bottomFin, lowerTeeth, upperTeeth],
|
||||
parts: [body, tail, mouth, aboveMouth, belly, topOfFin, bottomOfFin, lowerTeeth, upperTeeth],
|
||||
})
|
||||
|
||||
// Named exports
|
||||
export { body, tail, mouth, aboveMouth, belly, topFin, bottomFin, lowerTeeth, upperTeeth, Hi, i18n }
|
||||
export {
|
||||
body,
|
||||
tail,
|
||||
mouth,
|
||||
aboveMouth,
|
||||
belly,
|
||||
topOfFin,
|
||||
bottomOfFin,
|
||||
lowerTeeth,
|
||||
upperTeeth,
|
||||
Hi,
|
||||
i18n,
|
||||
}
|
||||
|
|
|
@ -1,68 +1,59 @@
|
|||
import { body } from './body.mjs'
|
||||
import { createTeeth } from './teeth.mjs'
|
||||
|
||||
function draftHiLowerTeeth({
|
||||
store,
|
||||
sa,
|
||||
Point,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
Snippet,
|
||||
snippets,
|
||||
options,
|
||||
complete,
|
||||
paperless,
|
||||
macro,
|
||||
part,
|
||||
}) {
|
||||
const lowerTeeth01_02d = 75.74338717643937 * options.size
|
||||
const lowerTeeth01_02a = 25.414236606099728 + 180
|
||||
const lowerTeeth02cp1d = 47.74891452755759 * options.size
|
||||
const lowerTeeth02cp1a = 42.59332849750379
|
||||
const lowerTeeth01cp2d = 27.774046078481962 * options.size
|
||||
const lowerTeeth01cp2a = 180
|
||||
export const lowerTeeth = {
|
||||
name: 'hi.lowerTeeth',
|
||||
after: body,
|
||||
draft: ({ store, sa, Point, points, Path, paths, Snippet, snippets, macro, part }) => {
|
||||
const multiplier = store.get('multiplier')
|
||||
|
||||
points.lowerTeeth01 = new Point(0, 0)
|
||||
points.lowerTeeth02 = points.lowerTeeth01.shift(lowerTeeth01_02a, lowerTeeth01_02d)
|
||||
points.lowerTeeth01cp2 = points.lowerTeeth01.shift(lowerTeeth01cp2a, lowerTeeth01cp2d)
|
||||
points.lowerTeeth02cp1 = points.lowerTeeth02.shift(lowerTeeth02cp1a, lowerTeeth02cp1d)
|
||||
// Make seam symmetric to optimize generating teeth
|
||||
points.lowerTeeth02cp1 = points.lowerTeeth02.shiftTowards(
|
||||
points.lowerTeeth02cp1,
|
||||
points.lowerTeeth01cp2.dist(points.lowerTeeth01)
|
||||
)
|
||||
points.lowerTeeth03 = points.lowerTeeth02.flipX()
|
||||
points.lowerTeeth01cp1 = points.lowerTeeth01cp2.flipX()
|
||||
points.lowerTeeth03cp2 = points.lowerTeeth02cp1.flipX()
|
||||
const lowerTeeth01_02d = 75.74338717643937 * multiplier
|
||||
const lowerTeeth01_02a = 25.414236606099728 + 180
|
||||
const lowerTeeth02cp1d = 47.74891452755759 * multiplier
|
||||
const lowerTeeth02cp1a = 42.59332849750379
|
||||
const lowerTeeth01cp2d = 27.774046078481962 * multiplier
|
||||
const lowerTeeth01cp2a = 180
|
||||
|
||||
paths.seam = new Path()
|
||||
.move(points.lowerTeeth02)
|
||||
.curve(points.lowerTeeth02cp1, points.lowerTeeth01cp2, points.lowerTeeth01)
|
||||
.curve(points.lowerTeeth01cp1, points.lowerTeeth03cp2, points.lowerTeeth03)
|
||||
points.lowerTeeth01 = new Point(0, 0)
|
||||
points.lowerTeeth02 = points.lowerTeeth01.shift(lowerTeeth01_02a, lowerTeeth01_02d)
|
||||
points.lowerTeeth01cp2 = points.lowerTeeth01.shift(lowerTeeth01cp2a, lowerTeeth01cp2d)
|
||||
points.lowerTeeth02cp1 = points.lowerTeeth02.shift(lowerTeeth02cp1a, lowerTeeth02cp1d)
|
||||
// Make seam symmetric to optimize generating teeth
|
||||
points.lowerTeeth02cp1 = points.lowerTeeth02.shiftTowards(
|
||||
points.lowerTeeth02cp1,
|
||||
points.lowerTeeth01cp2.dist(points.lowerTeeth01)
|
||||
)
|
||||
points.lowerTeeth03 = points.lowerTeeth02.flipX()
|
||||
points.lowerTeeth01cp1 = points.lowerTeeth01cp2.flipX()
|
||||
points.lowerTeeth03cp2 = points.lowerTeeth02cp1.flipX()
|
||||
|
||||
store.set('lowerTeethLength', paths.seam.length())
|
||||
paths.seam = new Path()
|
||||
.move(points.lowerTeeth02)
|
||||
.curve(points.lowerTeeth02cp1, points.lowerTeeth01cp2, points.lowerTeeth01)
|
||||
.curve(points.lowerTeeth01cp1, points.lowerTeeth03cp2, points.lowerTeeth03)
|
||||
|
||||
paths.teeth = createTeeth(
|
||||
[
|
||||
// Array holding the points for half a mouth (bezier, not path)
|
||||
points.lowerTeeth02, // start
|
||||
points.lowerTeeth02cp1, // cp1
|
||||
points.lowerTeeth01cp2, // cp2
|
||||
points.lowerTeeth01, // end
|
||||
],
|
||||
10, // number of teeth
|
||||
8 * options.size, // starting size
|
||||
16 * options.size, // ending size
|
||||
part
|
||||
)
|
||||
store.set('lowerTeethLength', paths.seam.length())
|
||||
|
||||
store.cutlist.addCut({ cut: 1, material: 'color4Teeth' })
|
||||
paths.teeth = createTeeth(
|
||||
[
|
||||
// Array holding the points for half a mouth (bezier, not path)
|
||||
points.lowerTeeth02, // start
|
||||
points.lowerTeeth02cp1, // cp1
|
||||
points.lowerTeeth01cp2, // cp2
|
||||
points.lowerTeeth01, // end
|
||||
],
|
||||
10, // number of teeth
|
||||
8 * multiplier, // starting size
|
||||
16 * multiplier, // ending size
|
||||
part
|
||||
)
|
||||
|
||||
store.cutlist.addCut({ cut: 1, material: 'color4Teeth' })
|
||||
|
||||
// Complete?
|
||||
if (complete) {
|
||||
snippets.lowerTeeth = new Snippet('bnotch', points.lowerTeeth01)
|
||||
|
||||
points.titleAnchor = points.lowerTeeth02.shiftFractionTowards(points.lowerTeeth03, 0.5) //.shiftFractionTowards(points.lowerTeeth01, 0.5)
|
||||
points.gridAnchor = points.titleAnchor.clone()
|
||||
|
||||
// Bounding box to prevent title clipping
|
||||
paths.bbox = new Path()
|
||||
|
@ -73,39 +64,42 @@ function draftHiLowerTeeth({
|
|||
at: points.titleAnchor,
|
||||
nr: 9,
|
||||
title: 'lowerTeeth',
|
||||
scale: options.size / 2,
|
||||
scale: multiplier / 2,
|
||||
})
|
||||
|
||||
if (paperless) {
|
||||
macro('hd', {
|
||||
from: points.lowerTeeth01,
|
||||
to: points.lowerTeeth03,
|
||||
y: points.lowerTeeth02.y + sa + 10,
|
||||
noStartMarker: true,
|
||||
noEndMarker: true,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.lowerTeeth02,
|
||||
to: points.lowerTeeth01,
|
||||
y: points.lowerTeeth02.y + sa + 10,
|
||||
noStartMarker: true,
|
||||
noEndMarker: true,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.lowerTeeth02,
|
||||
to: points.lowerTeeth01,
|
||||
x: points.lowerTeeth02.x - sa - 10,
|
||||
noStartMarker: true,
|
||||
noEndMarker: true,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.lowerTeeth01,
|
||||
to: paths.teeth.edge('top'),
|
||||
x: points.lowerTeeth02.x - sa - 10,
|
||||
noStartMarker: true,
|
||||
noEndMarker: true,
|
||||
})
|
||||
}
|
||||
macro('hd', {
|
||||
from: points.lowerTeeth01,
|
||||
to: points.lowerTeeth03,
|
||||
y: points.lowerTeeth02.y + sa + 10,
|
||||
noStartMarker: true,
|
||||
noEndMarker: true,
|
||||
id: 'right',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.lowerTeeth02,
|
||||
to: points.lowerTeeth01,
|
||||
y: points.lowerTeeth02.y + sa + 10,
|
||||
noStartMarker: true,
|
||||
noEndMarker: true,
|
||||
id: 'left',
|
||||
})
|
||||
|
||||
macro('vd', {
|
||||
from: points.lowerTeeth02,
|
||||
to: points.lowerTeeth01,
|
||||
x: points.lowerTeeth02.x - sa - 10,
|
||||
noStartMarker: true,
|
||||
noEndMarker: true,
|
||||
id: 'height',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.lowerTeeth01,
|
||||
to: paths.teeth.edge('top'),
|
||||
x: points.lowerTeeth02.x - sa - 10,
|
||||
noStartMarker: true,
|
||||
noEndMarker: true,
|
||||
id: 'teethHeight',
|
||||
})
|
||||
|
||||
if (sa) {
|
||||
let pSA = paths.seam.offset(sa)
|
||||
|
@ -116,12 +110,7 @@ function draftHiLowerTeeth({
|
|||
.line(paths.seam.end())
|
||||
.attr('class', 'fabric sa')
|
||||
}
|
||||
}
|
||||
|
||||
return part
|
||||
}
|
||||
|
||||
export const lowerTeeth = {
|
||||
name: 'hi.lowerTeeth',
|
||||
draft: draftHiLowerTeeth,
|
||||
return part
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,81 +1,70 @@
|
|||
import { lowerTeeth } from './lowerTeeth.mjs'
|
||||
import { upperTeeth } from './upperTeeth.mjs'
|
||||
|
||||
function draftHiMouth({
|
||||
store,
|
||||
sa,
|
||||
Point,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
Snippet,
|
||||
snippets,
|
||||
options,
|
||||
complete,
|
||||
paperless,
|
||||
macro,
|
||||
part,
|
||||
}) {
|
||||
const mouth01_02d = 141.93684055893488 * options.size
|
||||
const mouth01_02a = 312.8254216093024
|
||||
const mouth01_03d = 42.496 * options.size
|
||||
const mouth01_03a = 270
|
||||
const mouth01cp1d = 38.6204 * options.size
|
||||
const mouth01cp1a = 0
|
||||
const mouth02cp1d = 59.58739935676417 * options.size
|
||||
const mouth02cp2d = 73.53520117766728 * options.size
|
||||
const mouth02cp1a = 128.07726051101747
|
||||
const mouth02cp2a = 95.21339058299296
|
||||
const mouth03cp2d = 33.142 * options.size
|
||||
const mouth03cp2a = 0
|
||||
export const mouth = {
|
||||
name: 'hi.mouth',
|
||||
after: [lowerTeeth, upperTeeth],
|
||||
draft: ({ store, sa, Point, points, Path, paths, Snippet, snippets, macro, part }) => {
|
||||
const multiplier = store.get('multiplier')
|
||||
|
||||
points.mouth01 = new Point(0, 0)
|
||||
points.mouth02 = points.mouth01.shift(mouth01_02a, mouth01_02d)
|
||||
points.mouth03 = points.mouth01.shift(mouth01_03a, mouth01_03d)
|
||||
const mouth01_02d = 141.93684055893488 * multiplier
|
||||
const mouth01_02a = 312.8254216093024
|
||||
const mouth01_03d = 42.496 * multiplier
|
||||
const mouth01_03a = 270
|
||||
const mouth01cp1d = 38.6204 * multiplier
|
||||
const mouth01cp1a = 0
|
||||
const mouth02cp1d = 59.58739935676417 * multiplier
|
||||
const mouth02cp2d = 73.53520117766728 * multiplier
|
||||
const mouth02cp1a = 128.07726051101747
|
||||
const mouth02cp2a = 95.21339058299296
|
||||
const mouth03cp2d = 33.142 * multiplier
|
||||
const mouth03cp2a = 0
|
||||
|
||||
points.mouth01cp1 = points.mouth01.shift(mouth01cp1a, mouth01cp1d)
|
||||
points.mouth02cp1 = points.mouth02.shift(mouth02cp1a, mouth02cp1d)
|
||||
points.mouth02cp2 = points.mouth02.shift(mouth02cp2a, mouth02cp2d)
|
||||
points.mouth03cp2 = points.mouth03.shift(mouth03cp2a, mouth03cp2d)
|
||||
points.mouth01 = new Point(0, 0)
|
||||
points.mouth02 = points.mouth01.shift(mouth01_02a, mouth01_02d)
|
||||
points.mouth03 = points.mouth01.shift(mouth01_03a, mouth01_03d)
|
||||
|
||||
points.mouth04 = points.mouth02.flipX()
|
||||
points.mouth01cp1 = points.mouth01.shift(mouth01cp1a, mouth01cp1d)
|
||||
points.mouth02cp1 = points.mouth02.shift(mouth02cp1a, mouth02cp1d)
|
||||
points.mouth02cp2 = points.mouth02.shift(mouth02cp2a, mouth02cp2d)
|
||||
points.mouth03cp2 = points.mouth03.shift(mouth03cp2a, mouth03cp2d)
|
||||
|
||||
points.mouth01cp2 = points.mouth01cp1.flipX()
|
||||
points.mouth04cp2 = points.mouth02cp1.flipX()
|
||||
points.mouth04cp1 = points.mouth02cp2.flipX()
|
||||
points.mouth03cp1 = points.mouth03cp2.flipX()
|
||||
points.mouth04 = points.mouth02.flipX()
|
||||
|
||||
paths.aboveMouth = new Path()
|
||||
.move(points.mouth02)
|
||||
.curve(points.mouth02cp2, points.mouth01cp1, points.mouth01)
|
||||
.curve(points.mouth01cp2, points.mouth04cp1, points.mouth04)
|
||||
.attr('data-text-class', 'text-xs')
|
||||
paths.belly = new Path()
|
||||
.move(points.mouth04)
|
||||
.curve(points.mouth04cp2, points.mouth03cp1, points.mouth03)
|
||||
.curve(points.mouth03cp2, points.mouth02cp1, points.mouth02)
|
||||
.attr('data-text-class', 'text-xs')
|
||||
paths.seam = new Path().move(points.mouth02).join(paths.aboveMouth).join(paths.belly).close()
|
||||
points.mouth01cp2 = points.mouth01cp1.flipX()
|
||||
points.mouth04cp2 = points.mouth02cp1.flipX()
|
||||
points.mouth04cp1 = points.mouth02cp2.flipX()
|
||||
points.mouth03cp1 = points.mouth03cp2.flipX()
|
||||
|
||||
store.set(
|
||||
'mouthTopLength',
|
||||
new Path()
|
||||
.move(points.mouth01)
|
||||
.curve(points.mouth01cp1, points.mouth02cp2, points.mouth02)
|
||||
.length()
|
||||
)
|
||||
store.set(
|
||||
'mouthBottomLength',
|
||||
new Path()
|
||||
.move(points.mouth03)
|
||||
.curve(points.mouth03cp1, points.mouth04cp2, points.mouth04)
|
||||
.length()
|
||||
)
|
||||
paths.aboveMouth = new Path()
|
||||
.move(points.mouth02)
|
||||
.curve(points.mouth02cp2, points.mouth01cp1, points.mouth01)
|
||||
.curve(points.mouth01cp2, points.mouth04cp1, points.mouth04)
|
||||
.attr('data-text-class', 'text-xs')
|
||||
paths.belly = new Path()
|
||||
.move(points.mouth04)
|
||||
.curve(points.mouth04cp2, points.mouth03cp1, points.mouth03)
|
||||
.curve(points.mouth03cp2, points.mouth02cp1, points.mouth02)
|
||||
.attr('data-text-class', 'text-xs')
|
||||
paths.seam = new Path().move(points.mouth02).join(paths.aboveMouth).join(paths.belly).close()
|
||||
|
||||
store.cutlist.addCut({ cut: 1, material: 'color3Mouth' })
|
||||
store.set(
|
||||
'mouthTopLength',
|
||||
new Path()
|
||||
.move(points.mouth01)
|
||||
.curve(points.mouth01cp1, points.mouth02cp2, points.mouth02)
|
||||
.length()
|
||||
)
|
||||
store.set(
|
||||
'mouthBottomLength',
|
||||
new Path()
|
||||
.move(points.mouth03)
|
||||
.curve(points.mouth03cp1, points.mouth04cp2, points.mouth04)
|
||||
.length()
|
||||
)
|
||||
|
||||
store.cutlist.addCut({ cut: 1, material: 'color3Mouth' })
|
||||
|
||||
// Complete?
|
||||
if (complete) {
|
||||
points.mouthUpperTeeth1 = new Path()
|
||||
.move(points.mouth01)
|
||||
.curve(points.mouth01cp1, points.mouth02cp2, points.mouth02)
|
||||
|
@ -102,6 +91,7 @@ function draftHiMouth({
|
|||
macro('banner', {
|
||||
path: paths.aboveMouth,
|
||||
text: 'aboveMouth',
|
||||
id: 'aboveMouth',
|
||||
dy: 0,
|
||||
spaces: 4,
|
||||
repeat: 6,
|
||||
|
@ -109,6 +99,7 @@ function draftHiMouth({
|
|||
macro('banner', {
|
||||
path: paths.belly,
|
||||
text: 'belly',
|
||||
id: 'belly',
|
||||
dy: 0,
|
||||
spaces: 4,
|
||||
repeat: 6,
|
||||
|
@ -116,51 +107,50 @@ function draftHiMouth({
|
|||
|
||||
points.titleAnchor = points.mouth01.shiftFractionTowards(points.mouth02, 0.33)
|
||||
points.logoAnchor = points.mouth01.shiftFractionTowards(points.mouth04, 0.3)
|
||||
points.gridAnchor = points.mouth03.clone()
|
||||
|
||||
snippets.logo = new Snippet('logo', points.logoAnchor).attr(
|
||||
'data-scale',
|
||||
(options.size > 1 ? 1 : options.size) / 2
|
||||
(multiplier > 1 ? 1 : multiplier) / 2
|
||||
)
|
||||
|
||||
macro('title', {
|
||||
at: points.titleAnchor,
|
||||
nr: 4,
|
||||
title: 'mouth',
|
||||
scale: (options.size > 1 ? 1 : options.size) / 2,
|
||||
scale: (multiplier > 1 ? 1 : multiplier) / 2,
|
||||
})
|
||||
|
||||
macro('hd', {
|
||||
from: points.mouth03,
|
||||
to: points.mouth02,
|
||||
y: points.mouth02.y + sa + 10,
|
||||
id: 'right',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.mouth04,
|
||||
to: points.mouth03,
|
||||
y: points.mouth02.y + sa + 10,
|
||||
id: 'left',
|
||||
})
|
||||
|
||||
macro('vd', {
|
||||
from: points.mouth04,
|
||||
to: points.mouth03,
|
||||
x: points.mouth04.x - sa - 10,
|
||||
id: 'heightInside',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.mouth03,
|
||||
to: points.mouth01,
|
||||
x: points.mouth04.x - sa - 10,
|
||||
id: 'heightOutside',
|
||||
})
|
||||
|
||||
if (paperless) {
|
||||
macro('hd', {
|
||||
from: points.mouth03,
|
||||
to: points.mouth02,
|
||||
y: points.mouth02.y + sa + 10,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.mouth04,
|
||||
to: points.mouth03,
|
||||
y: points.mouth02.y + sa + 10,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.mouth04,
|
||||
to: points.mouth03,
|
||||
x: points.mouth04.x - sa - 10,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.mouth03,
|
||||
to: points.mouth01,
|
||||
x: points.mouth04.x - sa - 10,
|
||||
})
|
||||
}
|
||||
if (sa) {
|
||||
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
|
||||
}
|
||||
}
|
||||
|
||||
return part
|
||||
}
|
||||
|
||||
export const mouth = {
|
||||
name: 'hi.mouth',
|
||||
after: [lowerTeeth, upperTeeth],
|
||||
draft: draftHiMouth,
|
||||
return part
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,90 +1,79 @@
|
|||
import { body } from './body.mjs'
|
||||
|
||||
function draftHiTail({
|
||||
store,
|
||||
sa,
|
||||
Point,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
Snippet,
|
||||
snippets,
|
||||
options,
|
||||
complete,
|
||||
paperless,
|
||||
macro,
|
||||
part,
|
||||
}) {
|
||||
const tail01_02d = 192.0129724628 * options.size
|
||||
const tail01_02a = 53.242955551234914
|
||||
const tail01_03d = 115.38057785000036 * options.size
|
||||
const tail01_03a = 106.95066736265407
|
||||
const tail01_04d = 230.05210782342334 * options.size
|
||||
const tail01_04a = 138.66344842617497
|
||||
const tail01_05d = 95.12771141996424 * options.size
|
||||
const tail01_05a = 173.38284569091573
|
||||
const tail01cp1d = 156.52907796955816 * options.size
|
||||
const tail01cp2d = 33.33694275124821 * options.size
|
||||
const tail01cp1a = 40.69161792982998
|
||||
const tail01cp2a = 150.8191939475001
|
||||
const tail02cp1d = 20.1307852802616 * options.size
|
||||
const tail02cp2d = 26.418081118809575 * options.size
|
||||
const tail02cp1a = 129.66709301725697
|
||||
const tail02cp2a = 303.9168409570558
|
||||
const tail03cp1d = 41.577 * options.size
|
||||
const tail03cp2d = 41.575999999999965 * options.size
|
||||
const tail03cp1a = 180
|
||||
const tail03cp2a = -0
|
||||
const tail04cp1d = 18.83137554720844 * options.size
|
||||
const tail04cp2d = 18.830271479721173 * options.size
|
||||
const tail04cp1a = 218.47354143777738
|
||||
const tail04cp2a = 38.483984913053284
|
||||
const tail05cp1d = 38.59528397356339 * options.size
|
||||
const tail05cp2d = 126.7372982195849 * options.size
|
||||
const tail05cp1a = 14.169822482118544
|
||||
const tail05cp2a = 128.3396902984
|
||||
export const tail = {
|
||||
name: 'hi.tail',
|
||||
after: body,
|
||||
draft: ({ store, sa, Point, points, Path, paths, Snippet, snippets, macro, part }) => {
|
||||
const multiplier = store.get('multiplier')
|
||||
|
||||
points.tail01 = new Point(0, 0)
|
||||
points.tail02 = points.tail01.shift(tail01_02a, tail01_02d)
|
||||
points.tail03 = points.tail01.shift(tail01_03a, tail01_03d)
|
||||
points.tail04 = points.tail01.shift(tail01_04a, tail01_04d)
|
||||
points.tail05 = points.tail01.shift(tail01_05a, tail01_05d)
|
||||
const tail01_02d = 192.0129724628 * multiplier
|
||||
const tail01_02a = 53.242955551234914
|
||||
const tail01_03d = 115.38057785000036 * multiplier
|
||||
const tail01_03a = 106.95066736265407
|
||||
const tail01_04d = 230.05210782342334 * multiplier
|
||||
const tail01_04a = 138.66344842617497
|
||||
const tail01_05d = 95.12771141996424 * multiplier
|
||||
const tail01_05a = 173.38284569091573
|
||||
const tail01cp1d = 156.52907796955816 * multiplier
|
||||
const tail01cp2d = 33.33694275124821 * multiplier
|
||||
const tail01cp1a = 40.69161792982998
|
||||
const tail01cp2a = 150.8191939475001
|
||||
const tail02cp1d = 20.1307852802616 * multiplier
|
||||
const tail02cp2d = 26.418081118809575 * multiplier
|
||||
const tail02cp1a = 129.66709301725697
|
||||
const tail02cp2a = 303.9168409570558
|
||||
const tail03cp1d = 41.577 * multiplier
|
||||
const tail03cp2d = 41.575999999999965 * multiplier
|
||||
const tail03cp1a = 180
|
||||
const tail03cp2a = -0
|
||||
const tail04cp1d = 18.83137554720844 * multiplier
|
||||
const tail04cp2d = 18.830271479721173 * multiplier
|
||||
const tail04cp1a = 218.47354143777738
|
||||
const tail04cp2a = 38.483984913053284
|
||||
const tail05cp1d = 38.59528397356339 * multiplier
|
||||
const tail05cp2d = 126.7372982195849 * multiplier
|
||||
const tail05cp1a = 14.169822482118544
|
||||
const tail05cp2a = 128.3396902984
|
||||
|
||||
points.tail01cp1 = points.tail01.shift(tail01cp1a, tail01cp1d)
|
||||
points.tail01cp2 = points.tail01.shift(tail01cp2a, tail01cp2d)
|
||||
points.tail02cp1 = points.tail02.shift(tail02cp1a, tail02cp1d)
|
||||
points.tail02cp2 = points.tail02.shift(tail02cp2a, tail02cp2d)
|
||||
points.tail03cp1 = points.tail03.shift(tail03cp1a, tail03cp1d)
|
||||
points.tail03cp2 = points.tail03.shift(tail03cp2a, tail03cp2d)
|
||||
points.tail04cp1 = points.tail04.shift(tail04cp1a, tail04cp1d)
|
||||
points.tail04cp2 = points.tail04.shift(tail04cp2a, tail04cp2d)
|
||||
points.tail05cp1 = points.tail05.shift(tail05cp1a, tail05cp1d)
|
||||
points.tail05cp2 = points.tail05.shift(tail05cp2a, tail05cp2d)
|
||||
points.tail01 = new Point(0, 0)
|
||||
points.tail02 = points.tail01.shift(tail01_02a, tail01_02d)
|
||||
points.tail03 = points.tail01.shift(tail01_03a, tail01_03d)
|
||||
points.tail04 = points.tail01.shift(tail01_04a, tail01_04d)
|
||||
points.tail05 = points.tail01.shift(tail01_05a, tail01_05d)
|
||||
|
||||
// Adjust tail opening:
|
||||
points.tail05 = points.tail01.shift(points.tail01.angle(points.tail05), store.get('tailWidth'))
|
||||
points.tail01cp2 = points.tail01.shift(
|
||||
points.tail01.angle(points.tail05) - store.get('tailCpAngle'),
|
||||
store.get('tailCpDist')
|
||||
)
|
||||
points.tail05cp1 = points.tail05.shift(
|
||||
points.tail05.angle(points.tail01) + store.get('tailCpAngle'),
|
||||
store.get('tailCpDist')
|
||||
)
|
||||
points.tail01cp1 = points.tail01.shift(tail01cp1a, tail01cp1d)
|
||||
points.tail01cp2 = points.tail01.shift(tail01cp2a, tail01cp2d)
|
||||
points.tail02cp1 = points.tail02.shift(tail02cp1a, tail02cp1d)
|
||||
points.tail02cp2 = points.tail02.shift(tail02cp2a, tail02cp2d)
|
||||
points.tail03cp1 = points.tail03.shift(tail03cp1a, tail03cp1d)
|
||||
points.tail03cp2 = points.tail03.shift(tail03cp2a, tail03cp2d)
|
||||
points.tail04cp1 = points.tail04.shift(tail04cp1a, tail04cp1d)
|
||||
points.tail04cp2 = points.tail04.shift(tail04cp2a, tail04cp2d)
|
||||
points.tail05cp1 = points.tail05.shift(tail05cp1a, tail05cp1d)
|
||||
points.tail05cp2 = points.tail05.shift(tail05cp2a, tail05cp2d)
|
||||
|
||||
paths.seam = new Path()
|
||||
.move(points.tail01)
|
||||
.curve(points.tail01cp1, points.tail02cp2, points.tail02)
|
||||
.curve(points.tail02cp1, points.tail03cp2, points.tail03)
|
||||
.curve(points.tail03cp1, points.tail04cp2, points.tail04)
|
||||
.curve(points.tail04cp1, points.tail05cp2, points.tail05)
|
||||
.curve(points.tail05cp1, points.tail01cp2, points.tail01)
|
||||
.close()
|
||||
// Adjust tail opening:
|
||||
points.tail05 = points.tail01.shift(points.tail01.angle(points.tail05), store.get('tailWidth'))
|
||||
points.tail01cp2 = points.tail01.shift(
|
||||
points.tail01.angle(points.tail05) - store.get('tailCpAngle'),
|
||||
store.get('tailCpDist')
|
||||
)
|
||||
points.tail05cp1 = points.tail05.shift(
|
||||
points.tail05.angle(points.tail01) + store.get('tailCpAngle'),
|
||||
store.get('tailCpDist')
|
||||
)
|
||||
|
||||
store.cutlist.addCut({ material: 'color1UpperBody' })
|
||||
paths.seam = new Path()
|
||||
.move(points.tail01)
|
||||
.curve(points.tail01cp1, points.tail02cp2, points.tail02)
|
||||
.curve(points.tail02cp1, points.tail03cp2, points.tail03)
|
||||
.curve(points.tail03cp1, points.tail04cp2, points.tail04)
|
||||
.curve(points.tail04cp1, points.tail05cp2, points.tail05)
|
||||
.curve(points.tail05cp1, points.tail01cp2, points.tail01)
|
||||
.close()
|
||||
|
||||
store.cutlist.addCut({ material: 'color1UpperBody' })
|
||||
|
||||
// Complete?
|
||||
if (complete) {
|
||||
points.tailSnippet = new Path()
|
||||
.move(points.tail01)
|
||||
.curve(points.tail01cp2, points.tail05cp1, points.tail05)
|
||||
|
@ -96,117 +85,119 @@ function draftHiTail({
|
|||
.curve(points.tail05cp1, points.tail01cp2, points.tail01)
|
||||
.attr('class', 'hidden')
|
||||
.attr('data-text-class', 'text-xs')
|
||||
macro('banner', {
|
||||
path: paths.body,
|
||||
text: 'body',
|
||||
dy: 0,
|
||||
spaces: 10,
|
||||
repeat: 3,
|
||||
})
|
||||
|
||||
points.titleAnchor = points.tail03.shiftFractionTowards(points.tail01, 0.4)
|
||||
points.logoAnchor = points.tail03.shiftFractionTowards(points.tail05, 0.5)
|
||||
points.gridAnchor = points.tail03.clone()
|
||||
|
||||
points.tailLeft = new Path()
|
||||
.move(points.tail03)
|
||||
.curve(points.tail03cp1, points.tail04cp2, points.tail04)
|
||||
.curve(points.tail04cp1, points.tail05cp2, points.tail05)
|
||||
.edge('left')
|
||||
points.tailRight = new Path()
|
||||
.move(points.tail01)
|
||||
.curve(points.tail01cp1, points.tail02cp2, points.tail02)
|
||||
.curve(points.tail02cp1, points.tail03cp2, points.tail03)
|
||||
.edge('right')
|
||||
points.tailTopLeft = new Path()
|
||||
.move(points.tail03)
|
||||
.curve(points.tail03cp1, points.tail04cp2, points.tail04)
|
||||
.curve(points.tail04cp1, points.tail05cp2, points.tail05)
|
||||
.edge('top')
|
||||
points.tailTopRight = new Path()
|
||||
.move(points.tail01)
|
||||
.curve(points.tail01cp1, points.tail02cp2, points.tail02)
|
||||
.curve(points.tail02cp1, points.tail03cp2, points.tail03)
|
||||
.edge('top')
|
||||
|
||||
snippets.logo = new Snippet('logo', points.logoAnchor).attr(
|
||||
'data-scale',
|
||||
(options.size > 1 ? 1 : options.size) / 2
|
||||
(multiplier > 1 ? 1 : multiplier) / 2
|
||||
)
|
||||
|
||||
macro('title', {
|
||||
at: points.titleAnchor,
|
||||
nr: 3,
|
||||
title: 'tail',
|
||||
scale: (options.size > 1 ? 1 : options.size) / 2,
|
||||
scale: (multiplier > 1 ? 1 : multiplier) / 2,
|
||||
})
|
||||
|
||||
if (paperless) {
|
||||
points.tailLeft = new Path()
|
||||
.move(points.tail03)
|
||||
.curve(points.tail03cp1, points.tail04cp2, points.tail04)
|
||||
.curve(points.tail04cp1, points.tail05cp2, points.tail05)
|
||||
.edge('left')
|
||||
points.tailRight = new Path()
|
||||
.move(points.tail01)
|
||||
.curve(points.tail01cp1, points.tail02cp2, points.tail02)
|
||||
.curve(points.tail02cp1, points.tail03cp2, points.tail03)
|
||||
.edge('right')
|
||||
points.tailTopLeft = new Path()
|
||||
.move(points.tail03)
|
||||
.curve(points.tail03cp1, points.tail04cp2, points.tail04)
|
||||
.curve(points.tail04cp1, points.tail05cp2, points.tail05)
|
||||
.edge('top')
|
||||
points.tailTopRight = new Path()
|
||||
.move(points.tail01)
|
||||
.curve(points.tail01cp1, points.tail02cp2, points.tail02)
|
||||
.curve(points.tail02cp1, points.tail03cp2, points.tail03)
|
||||
.edge('top')
|
||||
macro('hd', {
|
||||
from: points.tailLeft,
|
||||
to: points.tail05,
|
||||
y: points.tail01.y + sa + 10,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.tail05,
|
||||
to: points.tail01,
|
||||
y: points.tail01.y + sa + 10,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.tail01,
|
||||
to: points.tailRight,
|
||||
y: points.tail01.y + sa + 10,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.tailLeft,
|
||||
to: points.tail03,
|
||||
y: points.tailTopLeft.y - sa - 10,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.tail03,
|
||||
to: points.tailRight,
|
||||
y: points.tailTopRight.y - sa - 10,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.tailTopLeft,
|
||||
to: points.tail03,
|
||||
x: points.tail03.x - 20,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.tail05,
|
||||
to: points.tailTopLeft,
|
||||
x: points.tailLeft.x - sa - 20,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.tailTopRight,
|
||||
to: points.tail01,
|
||||
x: points.tailRight.x + sa + 20,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.tail01,
|
||||
to: points.tailTopRight,
|
||||
x: points.tail03.x + 20,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.tail03,
|
||||
to: points.tail01,
|
||||
x: points.tail01.x + 20,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.tail05,
|
||||
to: points.tail03,
|
||||
x: points.tail05.x - 20,
|
||||
})
|
||||
}
|
||||
macro('banner', {
|
||||
path: paths.body,
|
||||
text: 'body',
|
||||
id: 'body',
|
||||
dy: 0,
|
||||
spaces: 10,
|
||||
repeat: 3,
|
||||
})
|
||||
|
||||
macro('hd', {
|
||||
from: points.tailLeft,
|
||||
to: points.tail05,
|
||||
y: points.tail01.y + sa + 10,
|
||||
id: 'leftToBody',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.tail05,
|
||||
to: points.tail01,
|
||||
y: points.tail01.y + sa + 10,
|
||||
id: 'bodyWidth',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.tail01,
|
||||
to: points.tailRight,
|
||||
y: points.tail01.y + sa + 10,
|
||||
id: 'bodyToRight',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.tailLeft,
|
||||
to: points.tail03,
|
||||
y: points.tailTopRight.y - sa - 10,
|
||||
id: 'leftToMid',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.tail03,
|
||||
to: points.tailRight,
|
||||
y: points.tailTopRight.y - sa - 10,
|
||||
id: 'midToRight',
|
||||
})
|
||||
|
||||
macro('vd', {
|
||||
from: points.tailTopLeft,
|
||||
to: points.tail03,
|
||||
x: points.tail03.x - 20,
|
||||
id: 'leftToMid',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.tail05,
|
||||
to: points.tailTopLeft,
|
||||
x: points.tailLeft.x - sa - 20,
|
||||
id: 'heightLeft',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.tailTopRight,
|
||||
to: points.tail01,
|
||||
x: points.tailRight.x + sa + 20,
|
||||
id: 'heightRight',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.tail03,
|
||||
to: points.tail01,
|
||||
x: points.tail01.x + 20,
|
||||
id: 'rightToMid',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.tail05,
|
||||
to: points.tail03,
|
||||
x: points.tail05.x - 20,
|
||||
id: 'leftToMid',
|
||||
})
|
||||
|
||||
if (sa) {
|
||||
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
|
||||
}
|
||||
}
|
||||
|
||||
return part
|
||||
}
|
||||
|
||||
export const tail = {
|
||||
name: 'hi.tail',
|
||||
after: body,
|
||||
draft: draftHiTail,
|
||||
return part
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,87 +1,76 @@
|
|||
import { body } from './body.mjs'
|
||||
|
||||
function draftHiTopFin({
|
||||
store,
|
||||
sa,
|
||||
Point,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
Snippet,
|
||||
snippets,
|
||||
options,
|
||||
complete,
|
||||
paperless,
|
||||
macro,
|
||||
part,
|
||||
}) {
|
||||
let topFinOpening = store.get('topFinOpening')
|
||||
const topFinOpeningLength = store.get('topFinOpeningLength')
|
||||
export const topOfFin = {
|
||||
name: 'hi.topOfFin',
|
||||
after: body,
|
||||
draft: ({ store, sa, Point, points, Path, paths, Snippet, snippets, macro, part }) => {
|
||||
const multiplier = store.get('multiplier')
|
||||
|
||||
const topFin01_02d = 256.9537569065251 * options.size
|
||||
const topFin01_02a = 325.46697637215823
|
||||
const topFin01_03a = 275.4353725228365
|
||||
const topFin01cp1d = 178.52481158058 * options.size
|
||||
const topFin01cp2d = 27.240286624072077 * options.size
|
||||
const topFin01cp1a = 346.31732410079576
|
||||
const topFin01cp2a = 254.05347154462484
|
||||
const topFin02cp1d = 25.871054481794893 * options.size
|
||||
const topFin02cp2d = 12.154549189501026 * options.size
|
||||
const topFin02cp1a = 236.80010054081936
|
||||
const topFin02cp2a = 56.66685795767527
|
||||
const topFin03cp1d = 39.024661651837555 * options.size
|
||||
const topFin03cp2d = 76.08965682877273 * options.size
|
||||
const topFin03cp1a = 113.40393219481112
|
||||
const topFin03cp2a = 22.511206474810457
|
||||
let topOfFinOpening = store.get('topOfFinOpening')
|
||||
const topOfFinOpeningLength = store.get('topOfFinOpeningLength')
|
||||
|
||||
let diff = 0
|
||||
let iteration = 0
|
||||
do {
|
||||
points.topFin01 = new Point(0, 0)
|
||||
points.topFin02 = points.topFin01.shift(topFin01_02a, topFin01_02d)
|
||||
points.topFin03 = points.topFin01.shift(topFin01_03a, topFinOpening) // topFin01_03d
|
||||
const topOfFin01_02d = 256.9537569065251 * multiplier
|
||||
const topOfFin01_02a = 325.46697637215823
|
||||
const topOfFin01_03a = 275.4353725228365
|
||||
const topOfFin01cp1d = 178.52481158058 * multiplier
|
||||
const topOfFin01cp2d = 27.240286624072077 * multiplier
|
||||
const topOfFin01cp1a = 346.31732410079576
|
||||
const topOfFin01cp2a = 254.05347154462484
|
||||
const topOfFin02cp1d = 25.871054481794893 * multiplier
|
||||
const topOfFin02cp2d = 12.154549189501026 * multiplier
|
||||
const topOfFin02cp1a = 236.80010054081936
|
||||
const topOfFin02cp2a = 56.66685795767527
|
||||
const topOfFin03cp1d = 39.024661651837555 * multiplier
|
||||
const topOfFin03cp2d = 76.08965682877273 * multiplier
|
||||
const topOfFin03cp1a = 113.40393219481112
|
||||
const topOfFin03cp2a = 22.511206474810457
|
||||
|
||||
points.topFin01cp1 = points.topFin01.shift(topFin01cp1a, topFin01cp1d)
|
||||
points.topFin01cp2 = points.topFin01.shift(topFin01cp2a, topFin01cp2d)
|
||||
points.topFin02cp1 = points.topFin02.shift(topFin02cp1a, topFin02cp1d)
|
||||
points.topFin02cp2 = points.topFin02.shift(topFin02cp2a, topFin02cp2d)
|
||||
points.topFin03cp1 = points.topFin03.shift(topFin03cp1a, topFin03cp1d)
|
||||
points.topFin03cp2 = points.topFin03.shift(topFin03cp2a, topFin03cp2d)
|
||||
let diff = 0
|
||||
let iteration = 0
|
||||
do {
|
||||
points.topOfFin01 = new Point(0, 0)
|
||||
points.topOfFin02 = points.topOfFin01.shift(topOfFin01_02a, topOfFin01_02d)
|
||||
points.topOfFin03 = points.topOfFin01.shift(topOfFin01_03a, topOfFinOpening) // topOfFin01_03d
|
||||
|
||||
diff =
|
||||
topFinOpeningLength -
|
||||
points.topOfFin01cp1 = points.topOfFin01.shift(topOfFin01cp1a, topOfFin01cp1d)
|
||||
points.topOfFin01cp2 = points.topOfFin01.shift(topOfFin01cp2a, topOfFin01cp2d)
|
||||
points.topOfFin02cp1 = points.topOfFin02.shift(topOfFin02cp1a, topOfFin02cp1d)
|
||||
points.topOfFin02cp2 = points.topOfFin02.shift(topOfFin02cp2a, topOfFin02cp2d)
|
||||
points.topOfFin03cp1 = points.topOfFin03.shift(topOfFin03cp1a, topOfFin03cp1d)
|
||||
points.topOfFin03cp2 = points.topOfFin03.shift(topOfFin03cp2a, topOfFin03cp2d)
|
||||
|
||||
diff =
|
||||
topOfFinOpeningLength -
|
||||
new Path()
|
||||
.move(points.topOfFin03)
|
||||
.curve(points.topOfFin03cp1, points.topOfFin01cp2, points.topOfFin01)
|
||||
.length()
|
||||
|
||||
topOfFinOpening = topOfFinOpening + diff
|
||||
iteration++
|
||||
} while (Math.abs(diff) > store.get('tolerance') && iteration < 100)
|
||||
|
||||
paths.seam = new Path()
|
||||
.move(points.topOfFin01)
|
||||
.curve(points.topOfFin01cp2, points.topOfFin03cp1, points.topOfFin03)
|
||||
.curve(points.topOfFin03cp2, points.topOfFin02cp1, points.topOfFin02)
|
||||
.curve(points.topOfFin02cp2, points.topOfFin01cp1, points.topOfFin01)
|
||||
.close()
|
||||
|
||||
store.set(
|
||||
'topOfFinCircumference',
|
||||
new Path()
|
||||
.move(points.topFin03)
|
||||
.curve(points.topFin03cp1, points.topFin01cp2, points.topFin01)
|
||||
.move(points.topOfFin01)
|
||||
.curve(points.topOfFin01cp1, points.topOfFin02cp2, points.topOfFin02)
|
||||
.curve(points.topOfFin02cp1, points.topOfFin03cp2, points.topOfFin03)
|
||||
.length()
|
||||
)
|
||||
|
||||
topFinOpening = topFinOpening + diff
|
||||
iteration++
|
||||
} while (Math.abs(diff) > store.get('tolerance') && iteration < 100)
|
||||
store.cutlist.addCut({ cut: 2, material: 'color1UpperBody' })
|
||||
|
||||
paths.seam = new Path()
|
||||
.move(points.topFin01)
|
||||
.curve(points.topFin01cp2, points.topFin03cp1, points.topFin03)
|
||||
.curve(points.topFin03cp2, points.topFin02cp1, points.topFin02)
|
||||
.curve(points.topFin02cp2, points.topFin01cp1, points.topFin01)
|
||||
.close()
|
||||
|
||||
store.set(
|
||||
'topFinCircumference',
|
||||
new Path()
|
||||
.move(points.topFin01)
|
||||
.curve(points.topFin01cp1, points.topFin02cp2, points.topFin02)
|
||||
.curve(points.topFin02cp1, points.topFin03cp2, points.topFin03)
|
||||
.length()
|
||||
)
|
||||
|
||||
store.cutlist.addCut({ material: 'color1UpperBody' })
|
||||
|
||||
// Complete?
|
||||
if (complete) {
|
||||
paths.body = new Path()
|
||||
.move(points.topFin01)
|
||||
.curve(points.topFin01cp2, points.topFin03cp1, points.topFin03)
|
||||
.move(points.topOfFin01)
|
||||
.curve(points.topOfFin01cp2, points.topOfFin03cp1, points.topOfFin03)
|
||||
.attr('class', 'hidden')
|
||||
.attr('data-text-class', 'text-xs')
|
||||
macro('banner', {
|
||||
|
@ -92,85 +81,75 @@ function draftHiTopFin({
|
|||
repeat: 3,
|
||||
})
|
||||
|
||||
points.titleAnchor = points.topFin01
|
||||
.shiftFractionTowards(points.topFin02, 0.5)
|
||||
.shiftFractionTowards(points.topFin03, 0.1)
|
||||
points.logoAnchor = points.titleAnchor.shiftFractionTowards(points.topFin03, 0.4)
|
||||
points.titleAnchor = points.topOfFin01
|
||||
.shiftFractionTowards(points.topOfFin02, 0.5)
|
||||
.shiftFractionTowards(points.topOfFin03, 0.1)
|
||||
points.logoAnchor = points.titleAnchor.shiftFractionTowards(points.topOfFin03, 0.4)
|
||||
points.gridAnchor = points.titleAnchor.clone()
|
||||
|
||||
snippets.logo = new Snippet('logo', points.logoAnchor).attr(
|
||||
'data-scale',
|
||||
(options.size > 1 ? 1 : options.size) / 2
|
||||
(multiplier > 1 ? 1 : multiplier) / 2
|
||||
)
|
||||
|
||||
macro('title', {
|
||||
at: points.titleAnchor,
|
||||
nr: 7,
|
||||
title: 'topFin',
|
||||
scale: (options.size > 1 ? 1 : options.size) / 2,
|
||||
title: 'topOfFin',
|
||||
scale: (multiplier > 1 ? 1 : multiplier) / 2,
|
||||
})
|
||||
|
||||
if (paperless) {
|
||||
points.topFinLeft = paths.seam.edge('left')
|
||||
const tempPath = new Path()
|
||||
.move(points.topFin02)
|
||||
.curve(points.topFin02cp1, points.topFin03cp2, points.topFin03)
|
||||
points.topFinInsideTop = tempPath.edge('top')
|
||||
const tempPoint = tempPath.shiftFractionAlong(0.5)
|
||||
points.topFinInsideBottom = tempPath.split(tempPoint)[0].edge('bottom')
|
||||
points.topFinRight = paths.seam.edge('right')
|
||||
points.topOfFinLeft = paths.seam.edge('left')
|
||||
const tempPath = new Path()
|
||||
.move(points.topOfFin02)
|
||||
.curve(points.topOfFin02cp1, points.topOfFin03cp2, points.topOfFin03)
|
||||
points.topOfFinInsideTop = tempPath.edge('top')
|
||||
const tempPoint = tempPath.shiftFractionAlong(0.5)
|
||||
points.topOfFinInsideBottom = tempPath.split(tempPoint)[0].edge('bottom')
|
||||
points.topOfFinRight = paths.seam.edge('right')
|
||||
|
||||
macro('hd', {
|
||||
from: points.topFin01,
|
||||
to: points.topFinRight,
|
||||
y: points.topFin01.y - sa - 10,
|
||||
// id: 'smallTop',
|
||||
// noStartMarker: true,
|
||||
// noEndMarker: true,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.topFin03,
|
||||
to: points.topFinRight,
|
||||
y: points.topFin03.y + sa + 20,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.topFinLeft,
|
||||
to: points.topFinRight,
|
||||
y: points.topFin03.y + sa + 10,
|
||||
// id: 'smallBottom',
|
||||
// noStartMarker: true,
|
||||
// noEndMarker: true,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.topFin03,
|
||||
to: points.topFin01,
|
||||
x: points.topFinLeft.x - sa - 10,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.topFin01,
|
||||
to: points.topFinInsideBottom,
|
||||
x: points.topFin02.x + sa + 10,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.topFinInsideTop,
|
||||
to: points.topFin01,
|
||||
x: points.topFinLeft.x - sa - 20,
|
||||
})
|
||||
}
|
||||
// if( options.size < 1.5 ) {
|
||||
// paths.smallTop.attr('data-text-class', 'text-xs')
|
||||
// paths.smallBottom.attr('data-text-class', 'text-xs')
|
||||
// }
|
||||
macro('hd', {
|
||||
from: points.topOfFin01,
|
||||
to: points.topOfFinRight,
|
||||
y: points.topOfFin01.y - sa - 10,
|
||||
id: 'topWidth',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.topOfFin03,
|
||||
to: points.topOfFinRight,
|
||||
y: points.topOfFin03.y + sa + 20,
|
||||
id: 'bottomWidth',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.topOfFinLeft,
|
||||
to: points.topOfFinRight,
|
||||
y: points.topOfFin03.y + sa + 10,
|
||||
id: 'width',
|
||||
})
|
||||
|
||||
macro('vd', {
|
||||
from: points.topOfFin03,
|
||||
to: points.topOfFin01,
|
||||
x: points.topOfFinLeft.x - sa - 10,
|
||||
id: 'leftHeight',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.topOfFin01,
|
||||
to: points.topOfFinInsideBottom,
|
||||
x: points.topOfFin02.x + sa + 10,
|
||||
id: 'rightHeight',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.topOfFinInsideTop,
|
||||
to: points.topOfFin01,
|
||||
x: points.topOfFinLeft.x - sa - 20,
|
||||
id: 'minHeight',
|
||||
})
|
||||
|
||||
if (sa) {
|
||||
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
|
||||
}
|
||||
}
|
||||
|
||||
return part
|
||||
}
|
||||
|
||||
export const topFin = {
|
||||
name: 'hi.topFin',
|
||||
after: body,
|
||||
draft: draftHiTopFin,
|
||||
return part
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,111 +1,93 @@
|
|||
import { body } from './body.mjs'
|
||||
import { createTeeth } from './teeth.mjs'
|
||||
|
||||
function draftHiUpperTeeth({
|
||||
store,
|
||||
sa,
|
||||
Point,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
Snippet,
|
||||
snippets,
|
||||
options,
|
||||
complete,
|
||||
paperless,
|
||||
macro,
|
||||
part,
|
||||
}) {
|
||||
const upperTeeth01_02d = 131.305041182736 * options.size
|
||||
const upperTeeth01_02a = 34.147056946748805
|
||||
const upperTeeth02cp1d = 64.30113337316406 * options.size
|
||||
const upperTeeth02cp1a = 55.1335930733262 + 180
|
||||
const upperTeeth01cp2d = 48.331000000000017 * options.size
|
||||
const upperTeeth01cp2a = 0
|
||||
export const upperTeeth = {
|
||||
name: 'hi.upperTeeth',
|
||||
after: body,
|
||||
draft: ({ store, sa, Point, points, Path, paths, Snippet, snippets, macro, part }) => {
|
||||
const multiplier = store.get('multiplier')
|
||||
|
||||
points.upperTeeth01 = new Point(0, 0)
|
||||
points.upperTeeth02 = points.upperTeeth01.shift(upperTeeth01_02a, upperTeeth01_02d)
|
||||
points.upperTeeth01cp2 = points.upperTeeth01.shift(upperTeeth01cp2a, upperTeeth01cp2d)
|
||||
points.upperTeeth02cp1 = points.upperTeeth02.shift(upperTeeth02cp1a, upperTeeth02cp1d)
|
||||
// Make seam symmetric to optimize generating teeth
|
||||
points.upperTeeth02cp1 = points.upperTeeth02.shiftTowards(
|
||||
points.upperTeeth02cp1,
|
||||
points.upperTeeth01cp2.dist(points.upperTeeth01)
|
||||
)
|
||||
points.upperTeeth03 = points.upperTeeth02.flipX()
|
||||
points.upperTeeth01cp1 = points.upperTeeth01cp2.flipX()
|
||||
points.upperTeeth03cp2 = points.upperTeeth02cp1.flipX()
|
||||
const upperTeeth01_02d = 131.305041182736 * multiplier
|
||||
const upperTeeth01_02a = 34.147056946748805
|
||||
const upperTeeth02cp1d = 64.30113337316406 * multiplier
|
||||
const upperTeeth02cp1a = 55.1335930733262 + 180
|
||||
const upperTeeth01cp2d = 48.331000000000017 * multiplier
|
||||
const upperTeeth01cp2a = 0
|
||||
|
||||
paths.seam = new Path()
|
||||
.move(points.upperTeeth02)
|
||||
.curve(points.upperTeeth02cp1, points.upperTeeth01cp2, points.upperTeeth01)
|
||||
.curve(points.upperTeeth01cp1, points.upperTeeth03cp2, points.upperTeeth03)
|
||||
points.upperTeeth01 = new Point(0, 0)
|
||||
points.upperTeeth02 = points.upperTeeth01.shift(upperTeeth01_02a, upperTeeth01_02d)
|
||||
points.upperTeeth01cp2 = points.upperTeeth01.shift(upperTeeth01cp2a, upperTeeth01cp2d)
|
||||
points.upperTeeth02cp1 = points.upperTeeth02.shift(upperTeeth02cp1a, upperTeeth02cp1d)
|
||||
// Make seam symmetric to optimize generating teeth
|
||||
points.upperTeeth02cp1 = points.upperTeeth02.shiftTowards(
|
||||
points.upperTeeth02cp1,
|
||||
points.upperTeeth01cp2.dist(points.upperTeeth01)
|
||||
)
|
||||
points.upperTeeth03 = points.upperTeeth02.flipX()
|
||||
points.upperTeeth01cp1 = points.upperTeeth01cp2.flipX()
|
||||
points.upperTeeth03cp2 = points.upperTeeth02cp1.flipX()
|
||||
|
||||
store.set('upperTeethLength', paths.seam.length())
|
||||
paths.seam = new Path()
|
||||
.move(points.upperTeeth02)
|
||||
.curve(points.upperTeeth02cp1, points.upperTeeth01cp2, points.upperTeeth01)
|
||||
.curve(points.upperTeeth01cp1, points.upperTeeth03cp2, points.upperTeeth03)
|
||||
|
||||
//paths.teeth = new Path().move(paths.seam.start())
|
||||
store.set('upperTeethLength', paths.seam.length())
|
||||
|
||||
paths.teeth = createTeeth(
|
||||
[
|
||||
// Array holding the points for half a mouth (bezier, not path)
|
||||
points.upperTeeth03, // end
|
||||
points.upperTeeth03cp2, // cp2
|
||||
points.upperTeeth01cp1, // cp1
|
||||
points.upperTeeth01, // start
|
||||
],
|
||||
14, // number of teeth
|
||||
9 * options.size, // start size
|
||||
18 * options.size, // end size
|
||||
part
|
||||
)
|
||||
//createTeeth(paths.seam, 18 * options.size, 9 * options.size, 15, options.aggressive, paths.teeth)
|
||||
paths.teeth = createTeeth(
|
||||
[
|
||||
// Array holding the points for half a mouth (bezier, not path)
|
||||
points.upperTeeth03, // end
|
||||
points.upperTeeth03cp2, // cp2
|
||||
points.upperTeeth01cp1, // cp1
|
||||
points.upperTeeth01, // start
|
||||
],
|
||||
14, // number of teeth
|
||||
9 * multiplier, // start size
|
||||
18 * multiplier, // end size
|
||||
part
|
||||
)
|
||||
|
||||
store.cutlist.addCut({ cut: 1, material: 'color4Teeth' })
|
||||
store.cutlist.addCut({ cut: 1, material: 'color4Teeth' })
|
||||
|
||||
// Complete?
|
||||
if (complete) {
|
||||
snippets.upperTeeth = new Snippet('bnotch', points.upperTeeth01)
|
||||
|
||||
points.titleAnchor = points.upperTeeth02
|
||||
.shiftFractionTowards(points.upperTeeth03, 0.5)
|
||||
.shiftFractionTowards(points.upperTeeth01, 0.5)
|
||||
points.gridAnchor = points.upperTeeth01
|
||||
|
||||
macro('title', {
|
||||
at: points.titleAnchor,
|
||||
nr: 8,
|
||||
title: 'upperTeeth',
|
||||
scale: options.size / 2,
|
||||
scale: multiplier / 2,
|
||||
})
|
||||
|
||||
if (paperless) {
|
||||
macro('hd', {
|
||||
from: points.upperTeeth01,
|
||||
to: points.upperTeeth03,
|
||||
y: points.upperTeeth02.y + sa + 10,
|
||||
noStartMarker: true,
|
||||
noEndMarker: true,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.upperTeeth02,
|
||||
to: points.upperTeeth01,
|
||||
y: points.upperTeeth02.y + sa + 10,
|
||||
noStartMarker: true,
|
||||
noEndMarker: true,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.upperTeeth02,
|
||||
to: points.upperTeeth01,
|
||||
x: points.upperTeeth02.x - sa - 10,
|
||||
noStartMarker: true,
|
||||
noEndMarker: true,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.upperTeeth01,
|
||||
to: paths.teeth.edge('top'),
|
||||
x: points.upperTeeth02.x - sa - 10,
|
||||
noStartMarker: true,
|
||||
noEndMarker: true,
|
||||
})
|
||||
}
|
||||
macro('hd', {
|
||||
from: points.upperTeeth03,
|
||||
to: points.upperTeeth01,
|
||||
y: points.upperTeeth02.y - 10,
|
||||
noStartMarker: true,
|
||||
noEndMarker: true,
|
||||
id: 'left',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.upperTeeth01,
|
||||
to: points.upperTeeth02,
|
||||
y: points.upperTeeth02.y - 10,
|
||||
noStartMarker: true,
|
||||
noEndMarker: true,
|
||||
id: 'right',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.upperTeeth01,
|
||||
to: paths.teeth.edge('top'),
|
||||
x: points.leftTooth0.x - sa - 10,
|
||||
noStartMarker: true,
|
||||
noEndMarker: true,
|
||||
id: 'height',
|
||||
})
|
||||
|
||||
if (sa) {
|
||||
let pSA = paths.seam.reverse().offset(sa)
|
||||
|
@ -116,12 +98,7 @@ function draftHiUpperTeeth({
|
|||
.line(paths.seam.start())
|
||||
.attr('class', 'fabric sa')
|
||||
}
|
||||
}
|
||||
|
||||
return part
|
||||
}
|
||||
|
||||
export const upperTeeth = {
|
||||
name: 'hi.upperTeeth',
|
||||
draft: draftHiUpperTeeth,
|
||||
return part
|
||||
},
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -2,9 +2,11 @@
|
|||
"t": "Noble body block",
|
||||
"d": "Noble is a body block with prince(ess) seams",
|
||||
"p": {
|
||||
"back": "Back",
|
||||
"backInside": "Back inside",
|
||||
"backOutside": "Back outside",
|
||||
"backPoints": "Back base",
|
||||
"front": "Front",
|
||||
"frontInside": "Front inside",
|
||||
"frontOutside": "Front outside",
|
||||
"frontPoints": "Front base"
|
||||
|
@ -15,6 +17,14 @@
|
|||
"t": "Dart position",
|
||||
"d": "Controls whether to split at the shoulder or armhole"
|
||||
},
|
||||
"dartPosition.armhole": {
|
||||
"t": "Dart position at the armhole",
|
||||
"d": "This moves the prince(ss) seam to the armhole"
|
||||
},
|
||||
"dartPosition.shoulder": {
|
||||
"t": "Dart position at the shoulder",
|
||||
"d": "This moves the prince(ss) seam to the shoulder"
|
||||
},
|
||||
"chestEase": {
|
||||
"t": "Chest ease",
|
||||
"d": "Controls the amount of ease at the chest"
|
||||
|
@ -93,7 +103,7 @@
|
|||
},
|
||||
"fullChestEaseReduction": {
|
||||
"t": "Full chest ease reduction",
|
||||
"d": "FIXME: Document this option"
|
||||
"d": "Allows you to independently reduce the ease around the chest to make it fit tight(er) in that area"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -1,163 +1,162 @@
|
|||
import { backPoints } from './backpoints.mjs'
|
||||
|
||||
function nobleBackInside({
|
||||
sa,
|
||||
Point,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
Snippet,
|
||||
snippets,
|
||||
options,
|
||||
complete,
|
||||
paperless,
|
||||
macro,
|
||||
part,
|
||||
}) {
|
||||
if (options.dartPosition != 'shoulder') {
|
||||
paths.insideSeam = paths.seam.clone().unhide()
|
||||
} else {
|
||||
// Hide Bella paths
|
||||
for (let key of Object.keys(paths)) paths[key].hide()
|
||||
for (let i in snippets) delete snippets[i]
|
||||
export const backInside = {
|
||||
name: 'noble.backInside',
|
||||
from: backPoints,
|
||||
draft: ({ sa, Point, points, Path, paths, Snippet, snippets, options, macro, part }) => {
|
||||
if (options.dartPosition != 'shoulder') {
|
||||
paths.insideSeam = paths.seam.clone().unhide()
|
||||
} else {
|
||||
// Hide Bella paths
|
||||
for (let key of Object.keys(paths)) paths[key].hide()
|
||||
for (let i in snippets) delete snippets[i]
|
||||
|
||||
paths.insideSeam = new Path()
|
||||
.move(points.cbNeck)
|
||||
.curve_(points.cbNeckCp2, points.waistCenter)
|
||||
.line(points.dartBottomLeft)
|
||||
.curve(points.dartLeftCp, points.shoulderDartCpDown, points.dartTip)
|
||||
.curve(points.shoulderDartCpUp, points.shoulderDart, points.shoulderDart)
|
||||
.line(points.hps)
|
||||
._curve(points.cbNeckCp1, points.cbNeck)
|
||||
.close()
|
||||
.attr('class', 'fabric')
|
||||
}
|
||||
paths.insideSeam = new Path()
|
||||
.move(points.cbNeck)
|
||||
.curve_(points.cbNeckCp2, points.waistCenter)
|
||||
.line(points.dartBottomLeft)
|
||||
.curve(points.dartLeftCp, points.shoulderDartCpDown, points.dartTip)
|
||||
.curve(points.shoulderDartCpUp, points.shoulderDart, points.shoulderDart)
|
||||
.line(points.hps)
|
||||
._curve(points.cbNeckCp1, points.cbNeck)
|
||||
.close()
|
||||
.attr('class', 'fabric')
|
||||
}
|
||||
|
||||
points.grainlineFrom = new Point(points.hps.x / 2, points.shoulder.y)
|
||||
points.grainlineTo = new Point(points.hps.x / 2, points.waistSide.y)
|
||||
macro('grainline', {
|
||||
from: points.grainlineFrom,
|
||||
to: points.grainlineTo,
|
||||
})
|
||||
points.grainlineFrom = new Point(points.hps.x / 2, points.shoulder.y)
|
||||
points.grainlineTo = new Point(points.hps.x / 2, points.waistSide.y)
|
||||
macro('grainline', {
|
||||
from: points.grainlineFrom,
|
||||
to: points.grainlineTo,
|
||||
})
|
||||
|
||||
if (complete) {
|
||||
snippets.dartTip = new Snippet('notch', points.dartTip)
|
||||
|
||||
macro('title', {
|
||||
at: points.titleAnchor,
|
||||
nr: 3,
|
||||
title: options.dartPosition != 'shoulder' ? 'Back' : 'Inside Back',
|
||||
title: options.dartPosition != 'shoulder' ? 'back' : 'backInside',
|
||||
})
|
||||
points.gridAnchor = points.hps.clone()
|
||||
|
||||
if (sa) paths.sa = paths.insideSeam.offset(sa).attr('class', 'fabric sa')
|
||||
|
||||
if (paperless) {
|
||||
if (options.dartPosition == 'shoulder') {
|
||||
points.shoulderPoint = points.shoulderDart.clone()
|
||||
} else {
|
||||
points.shoulderPoint = points.shoulder.clone()
|
||||
}
|
||||
if (options.dartPosition == 'shoulder') {
|
||||
points.shoulderPoint = points.shoulderDart.clone()
|
||||
} else {
|
||||
points.shoulderPoint = points.shoulder.clone()
|
||||
}
|
||||
macro('hd', {
|
||||
from: points.waistCenter,
|
||||
to: points.shoulderPoint,
|
||||
y: points.waistCenter.y + sa + 15,
|
||||
id: 'middleToShoulder',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.waistCenter,
|
||||
to: points.dartTip,
|
||||
y: points.waistCenter.y + sa + 25,
|
||||
id: 'middleToDartPoint',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.waistCenter,
|
||||
to: points.dartBottomLeft,
|
||||
y: points.waistCenter.y + sa + 35,
|
||||
id: 'middleToDart',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.cbNeck,
|
||||
to: points.dartBottomLeft,
|
||||
y: points.waistCenter.y + sa + 45,
|
||||
id: 'neckToDart',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.cbNeck,
|
||||
to: points.hps,
|
||||
y: points.hps.y - sa - 15,
|
||||
id: 'neckToHps',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.hps,
|
||||
to: points.shoulderPoint,
|
||||
y: points.hps.y - sa - 15,
|
||||
id: 'hpsToShoulder',
|
||||
})
|
||||
if (options.dartPosition != 'shoulder') {
|
||||
macro('hd', {
|
||||
from: points.waistCenter,
|
||||
to: points.shoulderPoint,
|
||||
y: points.waistCenter.y + sa + 15,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.waistCenter,
|
||||
to: points.dartTip,
|
||||
from: points.dartTip,
|
||||
to: points.waistSide,
|
||||
y: points.waistCenter.y + sa + 25,
|
||||
id: 'dartPointToSide',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.waistCenter,
|
||||
to: points.dartBottomLeft,
|
||||
from: points.dartBottomRight,
|
||||
to: points.waistSide,
|
||||
y: points.waistCenter.y + sa + 35,
|
||||
id: 'dartToSide',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.cbNeck,
|
||||
to: points.dartBottomLeft,
|
||||
from: points.dartBottomRight,
|
||||
to: points.armhole,
|
||||
y: points.waistCenter.y + sa + 45,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.cbNeck,
|
||||
to: points.hps,
|
||||
y: points.hps.y - sa - 15,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.hps,
|
||||
to: points.shoulderPoint,
|
||||
y: points.hps.y - sa - 15,
|
||||
})
|
||||
if (options.dartPosition != 'shoulder') {
|
||||
macro('hd', {
|
||||
from: points.dartTip,
|
||||
to: points.waistSide,
|
||||
y: points.waistCenter.y + sa + 25,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.dartBottomRight,
|
||||
to: points.waistSide,
|
||||
y: points.waistCenter.y + sa + 35,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.dartBottomRight,
|
||||
to: points.armhole,
|
||||
y: points.waistCenter.y + sa + 45,
|
||||
})
|
||||
}
|
||||
|
||||
let extraOffset = 0
|
||||
if (options.dartPosition != 'shoulder') {
|
||||
macro('vd', {
|
||||
from: points.shoulderPoint,
|
||||
to: points.waistSide,
|
||||
x: points.shoulderPoint.x + sa + 25,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.armhole,
|
||||
to: points.waistSide,
|
||||
x: points.shoulderPoint.x + sa + 15,
|
||||
})
|
||||
extraOffset = 10
|
||||
}
|
||||
|
||||
macro('vd', {
|
||||
from: points.shoulderPoint,
|
||||
to: points.dartTip,
|
||||
x: points.shoulderPoint.x + sa + 15,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.shoulderPoint,
|
||||
to: points.dartBottomLeft,
|
||||
x: points.shoulderPoint.x + sa + 25 + extraOffset,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.shoulderPoint,
|
||||
to: points.waistCenter,
|
||||
x: points.shoulderPoint.x + sa + 35 + extraOffset,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.hps,
|
||||
to: points.waistCenter,
|
||||
x: points.shoulderPoint.x + sa + 45 + extraOffset,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.waistCenter,
|
||||
to: points.cbNeck,
|
||||
x: points.cbNeck.x - sa - 15,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.waistCenter,
|
||||
to: points.hps,
|
||||
x: points.cbNeck.x - sa - 25,
|
||||
id: 'dartToArmhole',
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
return part
|
||||
}
|
||||
let extraOffset = 0
|
||||
if (options.dartPosition != 'shoulder') {
|
||||
macro('vd', {
|
||||
from: points.shoulderPoint,
|
||||
to: points.waistSide,
|
||||
x: points.shoulderPoint.x + sa + 25,
|
||||
id: 'sideToShoulder',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.armhole,
|
||||
to: points.waistSide,
|
||||
x: points.shoulderPoint.x + sa + 15,
|
||||
id: 'sideToArmhole',
|
||||
})
|
||||
extraOffset = 10
|
||||
}
|
||||
|
||||
export const backInside = {
|
||||
name: 'noble.backInside',
|
||||
from: backPoints,
|
||||
draft: nobleBackInside,
|
||||
macro('vd', {
|
||||
from: points.shoulderPoint,
|
||||
to: points.dartTip,
|
||||
x: points.shoulderPoint.x + sa + 15,
|
||||
id: 'dartPointToShoulder',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.shoulderPoint,
|
||||
to: points.dartBottomLeft,
|
||||
x: points.shoulderPoint.x + sa + 25 + extraOffset,
|
||||
id: 'dartToShoulder',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.shoulderPoint,
|
||||
to: points.waistCenter,
|
||||
x: points.shoulderPoint.x + sa + 35 + extraOffset,
|
||||
id: 'middleToShoulder',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.hps,
|
||||
to: points.waistCenter,
|
||||
x: points.shoulderPoint.x + sa + 45 + extraOffset,
|
||||
id: 'middleToHps',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.waistCenter,
|
||||
to: points.cbNeck,
|
||||
x: points.cbNeck.x - sa - 15,
|
||||
id: 'hemToNeck',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.waistCenter,
|
||||
to: points.hps,
|
||||
x: points.cbNeck.x - sa - 25,
|
||||
id: 'hemToHps',
|
||||
})
|
||||
|
||||
return part
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,55 +1,44 @@
|
|||
import { backPoints } from './backpoints.mjs'
|
||||
|
||||
function nobleBackOutside({
|
||||
sa,
|
||||
Point,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
Snippet,
|
||||
snippets,
|
||||
options,
|
||||
complete,
|
||||
paperless,
|
||||
macro,
|
||||
part,
|
||||
}) {
|
||||
if (options.dartPosition != 'shoulder') {
|
||||
return part
|
||||
}
|
||||
export const backOutside = {
|
||||
name: 'noble.backOutside',
|
||||
from: backPoints,
|
||||
draft: ({ sa, Point, points, Path, paths, Snippet, snippets, options, macro, part }) => {
|
||||
if (options.dartPosition != 'shoulder') {
|
||||
return part
|
||||
}
|
||||
|
||||
paths.dart = new Path()
|
||||
.move(points.shoulderDart)
|
||||
.curve(points.shoulderDart, points.shoulderDartCpUp, points.dartTip)
|
||||
.curve(points.shoulderDartCpDown, points.dartRightCp, points.dartBottomRight)
|
||||
.hide()
|
||||
paths.dart = new Path()
|
||||
.move(points.shoulderDart)
|
||||
.curve(points.shoulderDart, points.shoulderDartCpUp, points.dartTip)
|
||||
.curve(points.shoulderDartCpDown, points.dartRightCp, points.dartBottomRight)
|
||||
.hide()
|
||||
|
||||
paths.outsideSeam = new Path()
|
||||
.move(points.dartBottomRight)
|
||||
.line(points.waistSide)
|
||||
.curve_(points.waistSideCp2, points.armhole)
|
||||
.curve(points.armholeCp2, points.armholePitchCp1, points.armholePitch)
|
||||
.curve_(points.armholePitchCp2, points.shoulder)
|
||||
.line(points.shoulderDart)
|
||||
.join(paths.dart)
|
||||
.close()
|
||||
.attr('class', 'fabric')
|
||||
paths.outsideSeam = new Path()
|
||||
.move(points.dartBottomRight)
|
||||
.line(points.waistSide)
|
||||
.curve_(points.waistSideCp2, points.armhole)
|
||||
.curve(points.armholeCp2, points.armholePitchCp1, points.armholePitch)
|
||||
.curve_(points.armholePitchCp2, points.shoulder)
|
||||
.line(points.shoulderDart)
|
||||
.join(paths.dart)
|
||||
.close()
|
||||
.attr('class', 'fabric')
|
||||
|
||||
points.grainlineFrom = new Point(
|
||||
Math.max(points.shoulderDart.x, points.dartBottomRight.x),
|
||||
points.shoulder.y
|
||||
)
|
||||
points.grainlineTo = new Point(
|
||||
points.grainlineFrom.x,
|
||||
points.waistSide.y - (points.waistSide.y - points.shoulder.y) * 0.4
|
||||
)
|
||||
points.grainlineFrom = new Point(
|
||||
Math.max(points.shoulderDart.x, points.dartBottomRight.x),
|
||||
points.shoulder.y
|
||||
)
|
||||
points.grainlineTo = new Point(
|
||||
points.grainlineFrom.x,
|
||||
points.waistSide.y - (points.waistSide.y - points.shoulder.y) * 0.4
|
||||
)
|
||||
|
||||
macro('grainline', {
|
||||
from: points.grainlineFrom,
|
||||
to: points.grainlineTo,
|
||||
})
|
||||
macro('grainline', {
|
||||
from: points.grainlineFrom,
|
||||
to: points.grainlineTo,
|
||||
})
|
||||
|
||||
if (complete) {
|
||||
snippets.dartTip = new Snippet('notch', points.dartTip)
|
||||
|
||||
points.titleAnchor = points.dartBottomRight
|
||||
|
@ -58,81 +47,87 @@ function nobleBackOutside({
|
|||
macro('title', {
|
||||
at: points.titleAnchor,
|
||||
nr: 4,
|
||||
title: 'Outside Back',
|
||||
title: 'backOutside',
|
||||
})
|
||||
points.gridAnchor = points.armholeCpTarget.clone()
|
||||
|
||||
if (sa) paths.sa = paths.outsideSeam.offset(sa).attr('class', 'fabric sa')
|
||||
if (paperless) {
|
||||
let pLeft = paths.dart.edge('left')
|
||||
macro('hd', {
|
||||
from: pLeft,
|
||||
to: points.waistSide,
|
||||
y: points.waistCenter.y + sa + 15,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.dartBottomRight,
|
||||
to: points.armhole,
|
||||
y: points.waistCenter.y + sa + 25,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.dartTip,
|
||||
to: points.waistSide,
|
||||
y: points.waistCenter.y + sa + 35,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.dartBottomRight,
|
||||
to: points.waistSide,
|
||||
y: points.waistCenter.y + sa + 45,
|
||||
})
|
||||
macro('hd', {
|
||||
from: pLeft,
|
||||
to: points.shoulder,
|
||||
y: points.shoulderDart.y - sa - 15,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.shoulderDart,
|
||||
to: points.shoulder,
|
||||
y: points.shoulderDart.y - sa - 25,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.shoulderDart,
|
||||
to: points.armhole,
|
||||
y: points.shoulderDart.y - sa - 35,
|
||||
})
|
||||
|
||||
macro('vd', {
|
||||
from: points.shoulder,
|
||||
to: points.dartTip,
|
||||
x: points.armhole.x + sa + 15,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.armhole,
|
||||
to: points.waistSide,
|
||||
x: points.armhole.x + sa + 15,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.shoulder,
|
||||
to: points.waistSide,
|
||||
x: points.armhole.x + sa + 25,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.shoulder,
|
||||
to: points.dartBottomRight,
|
||||
x: points.armhole.x + sa + 35,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.shoulderDart,
|
||||
to: points.dartBottomRight,
|
||||
x: points.armhole.x + sa + 45,
|
||||
})
|
||||
}
|
||||
}
|
||||
let pLeft = paths.dart.edge('left')
|
||||
macro('hd', {
|
||||
from: pLeft,
|
||||
to: points.waistSide,
|
||||
y: points.waistCenter.y + sa + 15,
|
||||
id: 'leftToSide',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.dartBottomRight,
|
||||
to: points.armhole,
|
||||
y: points.waistCenter.y + sa + 25,
|
||||
id: 'dartToArmhole',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.dartTip,
|
||||
to: points.waistSide,
|
||||
y: points.waistCenter.y + sa + 35,
|
||||
id: 'leftToSide',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.dartBottomRight,
|
||||
to: points.waistSide,
|
||||
y: points.waistCenter.y + sa + 45,
|
||||
id: 'dartToSide',
|
||||
})
|
||||
macro('hd', {
|
||||
from: pLeft,
|
||||
to: points.shoulder,
|
||||
y: points.shoulderDart.y - sa - 15,
|
||||
id: 'leftToShoulder',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.shoulderDart,
|
||||
to: points.shoulder,
|
||||
y: points.shoulderDart.y - sa - 25,
|
||||
id: 'dartToShoulder',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.shoulderDart,
|
||||
to: points.armhole,
|
||||
y: points.shoulderDart.y - sa - 35,
|
||||
id: 'dartToArmhole',
|
||||
})
|
||||
|
||||
return part
|
||||
}
|
||||
|
||||
export const backOutside = {
|
||||
name: 'noble.backOutside',
|
||||
from: backPoints,
|
||||
draft: nobleBackOutside,
|
||||
macro('vd', {
|
||||
from: points.shoulder,
|
||||
to: points.dartTip,
|
||||
x: points.armhole.x + sa + 15,
|
||||
id: 'dartPointToShoulder',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.armhole,
|
||||
to: points.waistSide,
|
||||
x: points.armhole.x + sa + 15,
|
||||
id: 'sideToArmhole',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.shoulder,
|
||||
to: points.waistSide,
|
||||
x: points.armhole.x + sa + 25,
|
||||
id: 'sideToShoulder',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.shoulder,
|
||||
to: points.dartBottomRight,
|
||||
x: points.armhole.x + sa + 35,
|
||||
id: 'dartToShoulder',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.shoulderDart,
|
||||
to: points.dartBottomRight,
|
||||
x: points.armhole.x + sa + 45,
|
||||
id: 'dartToDart',
|
||||
})
|
||||
|
||||
return part
|
||||
},
|
||||
}
|
||||
|
|
|
@ -2,71 +2,69 @@ import { back as bellaBack } from '@freesewing/bella'
|
|||
import { hidePresets } from '@freesewing/core'
|
||||
import * as options from './options.mjs'
|
||||
|
||||
function nobleBackPoints({ points, Path, paths, options, snippets, log, part }) {
|
||||
// Hide Bella paths
|
||||
for (let key of Object.keys(paths)) paths[key].hide()
|
||||
for (let i in snippets) delete snippets[i]
|
||||
|
||||
delete points.bustDartLeft
|
||||
delete points.bustDartLeftCp
|
||||
|
||||
points.shoulderDart = points.hps.shiftFractionTowards(
|
||||
points.shoulder,
|
||||
options.shoulderDartPosition
|
||||
)
|
||||
|
||||
let aUp = points.dartTip.angle(points.shoulderDart)
|
||||
let aDown = points.dartBottomRight.angle(points.dartTip)
|
||||
let aDiff = Math.abs(aUp - aDown)
|
||||
|
||||
// let dartCpAdjustment = Math.abs( options.shoulderDartPosition -.5) +.05
|
||||
let dartCpAdjustment = aDiff / 50
|
||||
|
||||
points.shoulderDartCpUp = points.shoulderDart.shiftFractionTowards(
|
||||
points.dartTip,
|
||||
1 - dartCpAdjustment
|
||||
)
|
||||
points.shoulderDartCpDown = points.shoulderDart.shiftFractionTowards(
|
||||
points.dartTip,
|
||||
1 + dartCpAdjustment
|
||||
)
|
||||
|
||||
const length = {
|
||||
i: new Path()
|
||||
.move(points.dartBottomLeft)
|
||||
.curve(points.dartLeftCp, points.shoulderDartCpDown, points.dartTip)
|
||||
.curve(points.shoulderDartCpUp, points.shoulderDart, points.shoulderDart)
|
||||
.length(),
|
||||
}
|
||||
|
||||
let iteration = 0
|
||||
let diff = 0
|
||||
let angle = 0
|
||||
do {
|
||||
if (length.o) angle = diff * (length.o > length.i ? -0.1 : 0.1)
|
||||
|
||||
points.dartBottomRight = points.dartBottomRight.rotate(angle, points.waistSide)
|
||||
|
||||
length.o = new Path()
|
||||
.move(points.shoulderDart)
|
||||
.curve(points.shoulderDart, points.shoulderDartCpUp, points.dartTip)
|
||||
.curve(points.shoulderDartCpDown, points.dartRightCp, points.dartBottomRight)
|
||||
.length()
|
||||
|
||||
diff = length.o - length.i
|
||||
iteration++
|
||||
} while (diff < -0.5 || (diff > 0.5 && iteration < 100))
|
||||
if (iteration >= 100) {
|
||||
log.error('Something is not quite right here!')
|
||||
}
|
||||
|
||||
return part
|
||||
}
|
||||
|
||||
export const backPoints = {
|
||||
name: 'noble.backPoints',
|
||||
from: bellaBack,
|
||||
hide: hidePresets.HIDE_ALL,
|
||||
options,
|
||||
draft: nobleBackPoints,
|
||||
draft: ({ points, Path, paths, options, snippets, log, part }) => {
|
||||
// Hide Bella paths
|
||||
for (const key of Object.keys(paths)) paths[key].hide()
|
||||
for (const i in snippets) delete snippets[i]
|
||||
|
||||
delete points.bustDartLeft
|
||||
delete points.bustDartLeftCp
|
||||
|
||||
points.shoulderDart = points.hps.shiftFractionTowards(
|
||||
points.shoulder,
|
||||
options.shoulderDartPosition
|
||||
)
|
||||
|
||||
const aUp = points.dartTip.angle(points.shoulderDart)
|
||||
const aDown = points.dartBottomRight.angle(points.dartTip)
|
||||
const aDiff = Math.abs(aUp - aDown)
|
||||
|
||||
// let dartCpAdjustment = Math.abs( options.shoulderDartPosition -.5) +.05
|
||||
const dartCpAdjustment = aDiff / 50
|
||||
|
||||
points.shoulderDartCpUp = points.shoulderDart.shiftFractionTowards(
|
||||
points.dartTip,
|
||||
1 - dartCpAdjustment
|
||||
)
|
||||
points.shoulderDartCpDown = points.shoulderDart.shiftFractionTowards(
|
||||
points.dartTip,
|
||||
1 + dartCpAdjustment
|
||||
)
|
||||
|
||||
const length = {
|
||||
i: new Path()
|
||||
.move(points.dartBottomLeft)
|
||||
.curve(points.dartLeftCp, points.shoulderDartCpDown, points.dartTip)
|
||||
.curve(points.shoulderDartCpUp, points.shoulderDart, points.shoulderDart)
|
||||
.length(),
|
||||
}
|
||||
|
||||
let iteration = 0
|
||||
let diff = 0
|
||||
let angle = 0
|
||||
do {
|
||||
if (length.o) angle = diff * (length.o > length.i ? -0.1 : 0.1)
|
||||
|
||||
points.dartBottomRight = points.dartBottomRight.rotate(angle, points.waistSide)
|
||||
|
||||
length.o = new Path()
|
||||
.move(points.shoulderDart)
|
||||
.curve(points.shoulderDart, points.shoulderDartCpUp, points.dartTip)
|
||||
.curve(points.shoulderDartCpDown, points.dartRightCp, points.dartBottomRight)
|
||||
.length()
|
||||
|
||||
diff = length.o - length.i
|
||||
iteration++
|
||||
} while (diff < -0.5 || (diff > 0.5 && iteration < 100))
|
||||
if (iteration >= 100) {
|
||||
log.error('Something is not quite right here!')
|
||||
}
|
||||
|
||||
return part
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,102 +1,94 @@
|
|||
import { frontPoints } from './frontpoints.mjs'
|
||||
|
||||
function nobleFrontInside({
|
||||
store,
|
||||
sa,
|
||||
Point,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
Snippet,
|
||||
snippets,
|
||||
options,
|
||||
complete,
|
||||
paperless,
|
||||
macro,
|
||||
part,
|
||||
}) {
|
||||
delete points.waistDartHem
|
||||
delete points.waistDartRight
|
||||
delete points.waistDartRightCp
|
||||
delete points.waistDartCpBottom
|
||||
delete points.bustDartBottom
|
||||
delete points.bustDartCpBottom
|
||||
delete points.bustDartTip
|
||||
delete points.bustDartTop
|
||||
delete points.shoulderDartTipCpDownOutside
|
||||
delete points.ex
|
||||
delete points.bustB
|
||||
delete points.shoulder
|
||||
delete points.shoulderDartShoulder
|
||||
delete points.shoulderDartOutside
|
||||
delete points.pitchMax
|
||||
delete points.armholeCpTarget
|
||||
delete points.armholePitch
|
||||
delete points.armholePitchCp1
|
||||
delete points.armholePitchCp2
|
||||
delete points.armhole
|
||||
delete points.armholeCp2
|
||||
delete points.bustDartCpTop
|
||||
delete points.bustSide
|
||||
delete points.bustDartMiddle
|
||||
delete points.bustDartEdge
|
||||
export const frontInside = {
|
||||
name: 'noble.frontInside',
|
||||
from: frontPoints,
|
||||
draft: ({ store, sa, Point, points, Path, paths, Snippet, snippets, options, macro, part }) => {
|
||||
delete points.waistDartHem
|
||||
delete points.waistDartRight
|
||||
delete points.waistDartRightCp
|
||||
delete points.waistDartCpBottom
|
||||
delete points.bustDartBottom
|
||||
delete points.bustDartCpBottom
|
||||
delete points.bustDartTip
|
||||
delete points.bustDartTop
|
||||
delete points.shoulderDartTipCpDownOutside
|
||||
delete points.ex
|
||||
delete points.bustB
|
||||
delete points.shoulder
|
||||
delete points.shoulderDartShoulder
|
||||
delete points.shoulderDartOutside
|
||||
delete points.pitchMax
|
||||
delete points.armholeCpTarget
|
||||
delete points.armholePitch
|
||||
delete points.armholePitchCp1
|
||||
delete points.armholePitchCp2
|
||||
delete points.armhole
|
||||
delete points.armholeCp2
|
||||
delete points.bustDartCpTop
|
||||
delete points.bustSide
|
||||
delete points.bustDartMiddle
|
||||
delete points.bustDartEdge
|
||||
|
||||
if (options.dartPosition == 'shoulder') {
|
||||
paths.insideSeam = new Path()
|
||||
.move(points.cfHem)
|
||||
.line(points.waistDartLeft)
|
||||
.curve(points.waistDartLeftCp, points.shoulderDartTipCpDownInside, points.shoulderDartTip)
|
||||
.line(points.shoulderDartInside)
|
||||
.line(points.hps)
|
||||
.curve(points.hpsCp2, points.cfNeckCp1, points.cfNeck)
|
||||
|
||||
paths.seam = paths.insideSeam
|
||||
.join(new Path().move(points.cfNeck).line(points.cfHem))
|
||||
.close()
|
||||
.attr('class', 'fabric')
|
||||
|
||||
store.set(
|
||||
'shoulderDartTipNotch',
|
||||
new Path()
|
||||
.move(points.waistDartLeft)
|
||||
if (options.dartPosition == 'shoulder') {
|
||||
paths.insideSeam = new Path()
|
||||
.move(points.cfHem)
|
||||
.line(points.waistDartLeft)
|
||||
.curve(points.waistDartLeftCp, points.shoulderDartTipCpDownInside, points.shoulderDartTip)
|
||||
.length()
|
||||
)
|
||||
} else {
|
||||
paths.insideSeam = new Path()
|
||||
.move(points.cfHem)
|
||||
.line(points.waistDartLeft)
|
||||
.curve(points.waistDartLeftCp, points.armholeDartTipCpDownInside, points.armholeDartTipInside)
|
||||
.curve(points.waistCircleInsideCp1, points.armholeCircleInsideCp1, points.armholeDartInside)
|
||||
.join(paths.armholeInside)
|
||||
.line(points.hps)
|
||||
.curve(points.hpsCp2, points.cfNeckCp1, points.cfNeck)
|
||||
.line(points.shoulderDartInside)
|
||||
.line(points.hps)
|
||||
.curve(points.hpsCp2, points.cfNeckCp1, points.cfNeck)
|
||||
|
||||
paths.seam = paths.insideSeam
|
||||
.join(new Path().move(points.cfNeck).line(points.cfHem))
|
||||
.close()
|
||||
.attr('class', 'fabric')
|
||||
paths.seam = paths.insideSeam
|
||||
.join(new Path().move(points.cfNeck).line(points.cfHem))
|
||||
.close()
|
||||
.attr('class', 'fabric')
|
||||
|
||||
store.set(
|
||||
'shoulderDartTipNotch',
|
||||
new Path()
|
||||
.move(points.waistDartLeft)
|
||||
store.set(
|
||||
'shoulderDartTipNotch',
|
||||
new Path()
|
||||
.move(points.waistDartLeft)
|
||||
.curve(points.waistDartLeftCp, points.shoulderDartTipCpDownInside, points.shoulderDartTip)
|
||||
.length()
|
||||
)
|
||||
} else {
|
||||
paths.insideSeam = new Path()
|
||||
.move(points.cfHem)
|
||||
.line(points.waistDartLeft)
|
||||
.curve(
|
||||
points.waistDartLeftCp,
|
||||
points.armholeDartTipCpDownInside,
|
||||
points.armholeDartTipInside
|
||||
)
|
||||
.length()
|
||||
)
|
||||
}
|
||||
.curve(points.waistCircleInsideCp1, points.armholeCircleInsideCp1, points.armholeDartInside)
|
||||
.join(paths.armholeInside)
|
||||
.line(points.hps)
|
||||
.curve(points.hpsCp2, points.cfNeckCp1, points.cfNeck)
|
||||
|
||||
macro('cutonfold', {
|
||||
from: points.cfNeck,
|
||||
to: points.cfHem,
|
||||
grainline: true,
|
||||
})
|
||||
paths.seam = paths.insideSeam
|
||||
.join(new Path().move(points.cfNeck).line(points.cfHem))
|
||||
.close()
|
||||
.attr('class', 'fabric')
|
||||
|
||||
store.set(
|
||||
'shoulderDartTipNotch',
|
||||
new Path()
|
||||
.move(points.waistDartLeft)
|
||||
.curve(
|
||||
points.waistDartLeftCp,
|
||||
points.armholeDartTipCpDownInside,
|
||||
points.armholeDartTipInside
|
||||
)
|
||||
.length()
|
||||
)
|
||||
}
|
||||
|
||||
macro('cutonfold', {
|
||||
from: points.cfNeck,
|
||||
to: points.cfHem,
|
||||
grainline: true,
|
||||
})
|
||||
|
||||
if (complete) {
|
||||
if (options.dartPosition == 'shoulder') {
|
||||
snippets.shoulderDartTip = new Snippet('notch', points.shoulderDartTip)
|
||||
} else {
|
||||
|
@ -106,8 +98,10 @@ function nobleFrontInside({
|
|||
macro('title', {
|
||||
at: points.titleAnchor,
|
||||
nr: 1,
|
||||
title: 'Inside Front',
|
||||
title: 'frontInside',
|
||||
})
|
||||
points.gridAnchor = points.hps.clone()
|
||||
|
||||
points.scaleboxAnchor = points.titleAnchor.shift(-90, 90).shift(0, 10)
|
||||
macro('scalebox', { at: points.scaleboxAnchor, rotate: 270 })
|
||||
|
||||
|
@ -116,81 +110,97 @@ function nobleFrontInside({
|
|||
paths.sa = paths.sa.move(points.cfHem).line(paths.sa.start())
|
||||
}
|
||||
|
||||
if (paperless) {
|
||||
let extraOffset = 0
|
||||
if (options.dartPosition == 'shoulder') {
|
||||
macro('hd', {
|
||||
from: points.cfNeck,
|
||||
to: points.shoulderDartInside,
|
||||
y: points.hps.y - 25,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.cfHem,
|
||||
to: points.shoulderDartInside,
|
||||
x: 0 - 30,
|
||||
})
|
||||
} else {
|
||||
extraOffset = 10
|
||||
macro('hd', {
|
||||
from: points.cfNeck,
|
||||
to: points.shoulderCp1,
|
||||
y: points.hps.y - 35,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.cfNeck,
|
||||
to: points.armholeDartInsideCp2,
|
||||
y: points.hps.y - 25,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.cfHem,
|
||||
to: points.armholeDartInsideCp2,
|
||||
x: 0 - 20,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.cfHem,
|
||||
to: points.shoulderCp1,
|
||||
x: 0 - 40,
|
||||
})
|
||||
}
|
||||
|
||||
let extraOffset = 0
|
||||
if (options.dartPosition == 'shoulder') {
|
||||
macro('hd', {
|
||||
from: points.cfNeck,
|
||||
to: points.shoulderDartInside,
|
||||
y: points.hps.y - 25,
|
||||
id: 'hpsToDart',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.cfHem,
|
||||
to: points.shoulderDartInside,
|
||||
x: 0 - 30,
|
||||
id: 'hemToDart',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.cfHem,
|
||||
to: points.shoulderDartTip,
|
||||
x: 0 - 10,
|
||||
id: 'hemToDartTip',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.cfBust,
|
||||
to: points.shoulderDartTip,
|
||||
y: points.cfHem.y + sa + 25,
|
||||
id: 'middleToDartTip',
|
||||
})
|
||||
} else {
|
||||
extraOffset = 10
|
||||
macro('hd', {
|
||||
from: points.hps,
|
||||
to: points.shoulderCp1,
|
||||
y: points.hps.y - 35,
|
||||
id: 'hpsToShoulder',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.hps,
|
||||
to: points.armholeDartInsideCp2,
|
||||
y: points.hps.y - 25,
|
||||
id: 'hpsToDart',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.cfHem,
|
||||
to: points.armholeDartInsideCp2,
|
||||
x: 0 - 20,
|
||||
id: 'hemToDart',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.cfHem,
|
||||
to: points.shoulderCp1,
|
||||
x: 0 - 40,
|
||||
id: 'hemToShoulder',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.cfHem,
|
||||
to: points.armholeDartTipInside,
|
||||
x: 0 - 10,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.cfHem,
|
||||
to: points.cfNeck,
|
||||
x: 0 - 20 - extraOffset,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.cfHem,
|
||||
to: points.hps,
|
||||
x: 0 - 40 - extraOffset,
|
||||
id: 'hemToDartTip',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.cfBust,
|
||||
to: points.armholeDartTipInside,
|
||||
y: points.cfHem.y + sa + 25,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.cfHem,
|
||||
to: points.waistDartLeft,
|
||||
y: points.cfHem.y + sa + 15,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.cfNeck,
|
||||
to: points.hps,
|
||||
y: points.hps.y - sa - 15,
|
||||
id: 'middleToDartTip',
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
return part
|
||||
}
|
||||
macro('vd', {
|
||||
from: points.cfHem,
|
||||
to: points.cfNeck,
|
||||
x: 0 - 20 - extraOffset,
|
||||
id: 'hemToNeck',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.cfHem,
|
||||
to: points.hps,
|
||||
x: 0 - 40 - extraOffset,
|
||||
id: 'hemToHps',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.cfHem,
|
||||
to: points.waistDartLeft,
|
||||
y: points.cfHem.y + sa + 15,
|
||||
id: 'middleToDart',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.cfNeck,
|
||||
to: points.hps,
|
||||
y: points.hps.y - sa - 15,
|
||||
id: 'middleToHps',
|
||||
})
|
||||
|
||||
export const frontInside = {
|
||||
name: 'noble.frontInside',
|
||||
from: frontPoints,
|
||||
draft: nobleFrontInside,
|
||||
return part
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,82 +1,77 @@
|
|||
import { frontPoints } from './frontpoints.mjs'
|
||||
import { frontInside } from './frontinside.mjs'
|
||||
|
||||
function nobleFrontOutside({
|
||||
store,
|
||||
sa,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
Snippet,
|
||||
snippets,
|
||||
options,
|
||||
complete,
|
||||
paperless,
|
||||
macro,
|
||||
part,
|
||||
}) {
|
||||
delete points.bustDartTop
|
||||
delete points.bustSide
|
||||
delete points.bustDartMiddle
|
||||
delete points.bustDartBottom
|
||||
delete points.bustDartCpBottom
|
||||
delete points.bustB
|
||||
delete points.bustDartEdge
|
||||
macro('cutonfold', false)
|
||||
export const frontOutside = {
|
||||
name: 'noble.frontOutside',
|
||||
from: frontPoints,
|
||||
after: frontInside,
|
||||
draft: ({ store, sa, points, Path, paths, Snippet, snippets, options, macro, part }) => {
|
||||
delete points.bustDartTop
|
||||
delete points.bustSide
|
||||
delete points.bustDartMiddle
|
||||
delete points.bustDartBottom
|
||||
delete points.bustDartCpBottom
|
||||
delete points.bustB
|
||||
delete points.bustDartEdge
|
||||
|
||||
if (options.dartPosition == 'shoulder') {
|
||||
paths.princessSeam = new Path()
|
||||
.move(points.shoulderDartOutside)
|
||||
.curve(
|
||||
points.shoulderDartTipCpDownOutside,
|
||||
points.waistUpDartRightCpUp,
|
||||
points.waistUpDartRight
|
||||
)
|
||||
.curve(points.waistUpDartRightCpDown, points.waistCpUp, points.waistDartRight)
|
||||
.hide()
|
||||
paths.armhole = new Path()
|
||||
.move(points.armhole)
|
||||
.curve(points.armholeCp2, points.armholePitchCp1, points.armholePitch)
|
||||
.curve_(points.armholePitchCp2, points.shoulder)
|
||||
.hide()
|
||||
macro('rmcutonfold')
|
||||
|
||||
paths.seam = new Path()
|
||||
.move(points.waistDartRight)
|
||||
.line(points.sideHem)
|
||||
.line(points.armhole)
|
||||
.join(paths.armhole)
|
||||
.line(points.shoulderDartOutside)
|
||||
.join(paths.princessSeam)
|
||||
.close()
|
||||
.attr('class', 'fabric')
|
||||
} else {
|
||||
paths.princessSeam = new Path()
|
||||
.move(points.armholeDartOutside)
|
||||
.curve(points.armholeCircleOutsideCp1, points.waistCircleOutsideCp1, points.waistUpDartRight)
|
||||
.curve(points.waistUpDartRightCpDown, points.waistCpUp, points.waistDartRight)
|
||||
.hide()
|
||||
if (options.dartPosition == 'shoulder') {
|
||||
paths.princessSeam = new Path()
|
||||
.move(points.shoulderDartOutside)
|
||||
.curve(
|
||||
points.shoulderDartTipCpDownOutside,
|
||||
points.waistUpDartRightCpUp,
|
||||
points.waistUpDartRight
|
||||
)
|
||||
.curve(points.waistUpDartRightCpDown, points.waistCpUp, points.waistDartRight)
|
||||
.hide()
|
||||
paths.armhole = new Path()
|
||||
.move(points.armhole)
|
||||
.curve(points.armholeCp2, points.armholePitchCp1, points.armholePitch)
|
||||
.curve_(points.armholePitchCp2, points.shoulder)
|
||||
.hide()
|
||||
|
||||
paths.seam = new Path()
|
||||
.move(points.waistDartRight)
|
||||
.line(points.sideHem)
|
||||
.line(points.armhole)
|
||||
.join(paths.armholeOutside.reverse())
|
||||
.join(paths.princessSeam)
|
||||
.close()
|
||||
.attr('class', 'fabric')
|
||||
}
|
||||
paths.seam = new Path()
|
||||
.move(points.waistDartRight)
|
||||
.line(points.sideHem)
|
||||
.line(points.armhole)
|
||||
.join(paths.armhole)
|
||||
.line(points.shoulderDartOutside)
|
||||
.join(paths.princessSeam)
|
||||
.close()
|
||||
.attr('class', 'fabric')
|
||||
} else {
|
||||
paths.princessSeam = new Path()
|
||||
.move(points.armholeDartOutside)
|
||||
.curve(
|
||||
points.armholeCircleOutsideCp1,
|
||||
points.waistCircleOutsideCp1,
|
||||
points.waistUpDartRight
|
||||
)
|
||||
.curve(points.waistUpDartRightCpDown, points.waistCpUp, points.waistDartRight)
|
||||
.hide()
|
||||
|
||||
points.grainTop = points.armhole.shift(225, 20)
|
||||
points.grainBottom = points.sideHemInitial.shift(135, 20)
|
||||
macro('grainline', {
|
||||
from: points.grainBottom,
|
||||
to: points.grainTop,
|
||||
})
|
||||
paths.seam = new Path()
|
||||
.move(points.waistDartRight)
|
||||
.line(points.sideHem)
|
||||
.line(points.armhole)
|
||||
.join(paths.armholeOutside.reverse())
|
||||
.join(paths.princessSeam)
|
||||
.close()
|
||||
.attr('class', 'fabric')
|
||||
}
|
||||
|
||||
store.cutlist.removeCut()
|
||||
store.cutlist.addCut()
|
||||
points.grainTop = points.armhole.shift(225, 20)
|
||||
points.grainBottom = points.sideHemInitial.shift(135, 20)
|
||||
macro('grainline', {
|
||||
from: points.grainBottom,
|
||||
to: points.grainTop,
|
||||
})
|
||||
|
||||
store.cutlist.removeCut()
|
||||
store.cutlist.addCut()
|
||||
|
||||
if (complete) {
|
||||
points.snippet = paths.princessSeam.shiftAlong(
|
||||
paths.princessSeam.length() - store.get('shoulderDartTipNotch')
|
||||
)
|
||||
|
@ -88,140 +83,154 @@ function nobleFrontOutside({
|
|||
macro('title', {
|
||||
at: points.titleAnchor,
|
||||
nr: 2,
|
||||
title: 'Outside Front',
|
||||
title: 'frontOutside',
|
||||
})
|
||||
points.gridAnchor = points.armholeCpTarget.clone()
|
||||
|
||||
if (sa) paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
|
||||
|
||||
if (paperless) {
|
||||
let pLeft = paths.princessSeam.edge('left')
|
||||
let pLeft = paths.princessSeam.edge('left')
|
||||
macro('hd', {
|
||||
from: points.waistDartRight,
|
||||
to: points.armholeOutsidePitchCp1,
|
||||
y: points.sideHemInitial.y + sa + 35,
|
||||
id: 'dartToArmhole',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.waistDartRight,
|
||||
to: points.sideHemInitial,
|
||||
y: points.sideHemInitial.y + sa + 25,
|
||||
id: 'dartToSide',
|
||||
})
|
||||
macro('hd', {
|
||||
from: pLeft,
|
||||
to: points.sideHemInitial,
|
||||
y: points.sideHemInitial.y + sa + 15,
|
||||
id: 'leftToSide',
|
||||
})
|
||||
|
||||
macro('vd', {
|
||||
from: points.armholeOutsidePitchCp1,
|
||||
to: points.sideHemInitial,
|
||||
x: points.sideHemInitial.x + sa + 15,
|
||||
id: 'hemToArmhole',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.waistDartRight,
|
||||
to: pLeft,
|
||||
x: pLeft.x - sa - 15,
|
||||
id: 'hemToLeft',
|
||||
})
|
||||
|
||||
if (options.dartPosition == 'shoulder') {
|
||||
macro('hd', {
|
||||
from: points.waistDartRight,
|
||||
to: points.armholeOutsidePitchCp1,
|
||||
y: points.sideHemInitial.y + sa + 35,
|
||||
from: points.shoulderDartOutside,
|
||||
to: points.shoulder,
|
||||
y: points.shoulderDartOutside.y - sa - 15,
|
||||
id: 'dartToShoulder',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.waistDartRight,
|
||||
to: points.sideHemInitial,
|
||||
y: points.sideHemInitial.y + sa + 25,
|
||||
from: points.snippet,
|
||||
to: points.shoulder,
|
||||
y: points.shoulderDartOutside.y - sa - 25,
|
||||
id: 'dartPointToShoulder',
|
||||
})
|
||||
macro('hd', {
|
||||
from: pLeft,
|
||||
to: points.sideHemInitial,
|
||||
y: points.sideHemInitial.y + sa + 15,
|
||||
to: points.shoulder,
|
||||
y: points.shoulderDartOutside.y - sa - 35,
|
||||
id: 'leftToShoulder',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.waistDartRight,
|
||||
to: points.shoulder,
|
||||
y: points.sideHemInitial.y + sa + 45,
|
||||
id: 'hemDartToShoulder',
|
||||
})
|
||||
|
||||
macro('vd', {
|
||||
from: points.armholeOutsidePitchCp1,
|
||||
from: points.shoulder,
|
||||
to: points.sideHemInitial,
|
||||
x: points.sideHemInitial.x + sa + 15,
|
||||
x: points.shoulder.x,
|
||||
id: 'hemToShoulder',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.shoulderDartOutside,
|
||||
to: points.sideHemInitial,
|
||||
x: points.shoulderDartOutside.x,
|
||||
id: 'sideHemToShoulderDart',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.waistDartRight,
|
||||
to: pLeft,
|
||||
to: points.shoulderDartOutside,
|
||||
x: pLeft.x - sa - 25,
|
||||
id: 'hemToShoulderDart',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.snippet,
|
||||
to: points.shoulderDartOutside,
|
||||
x: pLeft.x - sa - 15,
|
||||
id: 'shoulderDartToDartPoint',
|
||||
})
|
||||
|
||||
if (options.dartPosition == 'shoulder') {
|
||||
macro('hd', {
|
||||
from: points.shoulderDartOutside,
|
||||
to: points.shoulder,
|
||||
y: points.shoulderDartOutside.y - sa - 15,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.snippet,
|
||||
to: points.shoulder,
|
||||
y: points.shoulderDartOutside.y - sa - 25,
|
||||
})
|
||||
macro('hd', {
|
||||
from: pLeft,
|
||||
to: points.shoulder,
|
||||
y: points.shoulderDartOutside.y - sa - 35,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.waistDartRight,
|
||||
to: points.shoulder,
|
||||
y: points.sideHemInitial.y + sa + 45,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.shoulder,
|
||||
to: points.sideHemInitial,
|
||||
x: points.shoulder.x, //+sa + 15,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.shoulderDartOutside,
|
||||
to: points.sideHemInitial,
|
||||
x: points.shoulder.x + sa + 15,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.waistDartRight,
|
||||
to: points.shoulderDartOutside,
|
||||
x: pLeft.x - sa - 25,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.snippet,
|
||||
to: points.shoulderDartOutside,
|
||||
x: pLeft.x - sa - 15,
|
||||
})
|
||||
|
||||
let pArmholeLeft = paths.armhole.edge('left')
|
||||
macro('hd', {
|
||||
from: points.waistDartRight,
|
||||
to: pArmholeLeft,
|
||||
y: points.sideHemInitial.y + sa + 5,
|
||||
})
|
||||
macro('vd', {
|
||||
from: pArmholeLeft,
|
||||
to: points.sideHemInitial,
|
||||
x: points.sideHemInitial.x + sa + 25,
|
||||
})
|
||||
} else {
|
||||
let pTop = paths.princessSeam.edge('top')
|
||||
macro('hd', {
|
||||
from: pLeft,
|
||||
to: points.armholeOutsidePitchCp1,
|
||||
y: pTop.y - sa - 35,
|
||||
})
|
||||
macro('hd', {
|
||||
from: pLeft,
|
||||
to: points.armholeDartOutside,
|
||||
y: pTop.y - sa - 25,
|
||||
})
|
||||
macro('hd', {
|
||||
from: pLeft,
|
||||
to: pTop,
|
||||
y: pTop.y - sa - 15,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.waistDartRight,
|
||||
to: pTop,
|
||||
x: pLeft.x - sa - 25,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.snippet,
|
||||
to: pTop,
|
||||
x: pLeft.x - sa - 15,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.armholeDartOutside,
|
||||
to: points.sideHemInitial,
|
||||
x: points.sideHemInitial.x + sa + 25,
|
||||
})
|
||||
macro('vd', {
|
||||
from: pTop,
|
||||
to: points.sideHemInitial,
|
||||
x: points.sideHemInitial.x + sa + 35,
|
||||
})
|
||||
}
|
||||
const pArmholeLeft = paths.armhole.edge('left')
|
||||
macro('hd', {
|
||||
from: points.waistDartRight,
|
||||
to: pArmholeLeft,
|
||||
y: points.sideHemInitial.y + sa + 5,
|
||||
id: 'hemDartToRight',
|
||||
})
|
||||
macro('vd', {
|
||||
from: pArmholeLeft,
|
||||
to: points.sideHemInitial,
|
||||
x: points.sideHemInitial.x + sa + 25,
|
||||
id: 'hemSideToRight',
|
||||
})
|
||||
} else {
|
||||
let pTop = paths.princessSeam.edge('top')
|
||||
macro('hd', {
|
||||
from: pLeft,
|
||||
to: points.armholeOutsidePitchCp1,
|
||||
y: pTop.y - sa - 35,
|
||||
id: 'leftToArmhole',
|
||||
})
|
||||
macro('hd', {
|
||||
from: pLeft,
|
||||
to: points.armholeDartOutside,
|
||||
y: pTop.y - sa - 25,
|
||||
id: 'leftToArmholeDart',
|
||||
})
|
||||
macro('hd', {
|
||||
from: pLeft,
|
||||
to: pTop,
|
||||
y: pTop.y - sa - 15,
|
||||
id: 'leftToTop',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.waistDartRight,
|
||||
to: pTop,
|
||||
x: pLeft.x - sa - 25,
|
||||
id: 'hemToTop',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.snippet,
|
||||
to: pTop,
|
||||
x: pLeft.x - sa - 15,
|
||||
id: 'topToDartPoint',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.armholeDartOutside,
|
||||
to: points.sideHemInitial,
|
||||
x: points.sideHemInitial.x + sa + 25,
|
||||
id: 'sideHemToArmholeDart',
|
||||
})
|
||||
macro('vd', {
|
||||
from: pTop,
|
||||
to: points.sideHemInitial,
|
||||
x: points.sideHemInitial.x + sa + 35,
|
||||
id: 'sideHemToTop',
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
return part
|
||||
}
|
||||
|
||||
export const frontOutside = {
|
||||
name: 'noble.frontOutside',
|
||||
from: frontPoints,
|
||||
after: frontInside,
|
||||
draft: nobleFrontOutside,
|
||||
return part
|
||||
},
|
||||
}
|
||||
|
|
|
@ -2,324 +2,329 @@ import { frontSideDart as bellaFront } from '@freesewing/bella'
|
|||
import { hidePresets } from '@freesewing/core'
|
||||
import * as options from './options.mjs'
|
||||
|
||||
function nobleFrontPoints({ log, points, Path, paths, snippets, options, macro, part }) {
|
||||
const bCircle = 0.552284749831
|
||||
|
||||
// Hide Bella paths
|
||||
for (let key of Object.keys(paths)) paths[key].hide()
|
||||
for (let i in snippets) delete snippets[i]
|
||||
|
||||
// Remove macros from Bella
|
||||
macro('title', false)
|
||||
macro('scalebox', false)
|
||||
|
||||
points.shoulderDartInside = points.hps.shiftFractionTowards(
|
||||
points.shoulder,
|
||||
options.dartPosition == 'shoulder' ? options.shoulderDartPosition : 0.5
|
||||
)
|
||||
points.orgShoulder = points.shoulder.clone()
|
||||
points.orgArmhole = points.armhole.clone()
|
||||
points.orgArmholeCp2 = points.armholeCp2.clone()
|
||||
points.orgArmholePitch = points.armholePitch.clone()
|
||||
points.orgArmholePitchCp1 = points.armholePitchCp1.clone()
|
||||
points.orgArmholePitchCp2 = points.armholePitchCp2.clone()
|
||||
let armholePath = new Path()
|
||||
.move(points.shoulder)
|
||||
._curve(points.armholePitchCp2, points.armholePitch)
|
||||
.curve(points.armholePitchCp1, points.armholeCp2, points.armhole)
|
||||
|
||||
points.armholeDartInside = armholePath.shiftFractionAlong(options.armholeDartPosition)
|
||||
points.armholeDartOutside = points.armholeDartInside.clone()
|
||||
|
||||
let armholePaths = armholePath.split(points.armholeDartInside)
|
||||
|
||||
let armholePathInside = armholePaths[0].clone().hide()
|
||||
let armholePathOutside = armholePaths[1].clone().hide()
|
||||
let armholeDartAngle =
|
||||
armholePathInside.reverse().shiftAlong(1).angle(armholePathOutside.shiftAlong(1)) - 90
|
||||
|
||||
points.armholeDartArmhole = points.armholeDartInside.shiftFractionTowards(
|
||||
points.armholeDartOutside,
|
||||
0.5
|
||||
)
|
||||
points.armholeDartTip = points.armholeDartArmhole.shiftFractionTowards(
|
||||
points.bust,
|
||||
options.upperDartLength
|
||||
)
|
||||
|
||||
points.armholeCircleInsideCp1 = points.armholeDartInside.shift(
|
||||
armholeDartAngle,
|
||||
bCircle * points.armholeDartInside.dist(points.armholeDartTip)
|
||||
)
|
||||
points.armholeCircleOutsideCp1 = points.armholeCircleInsideCp1.clone()
|
||||
|
||||
points.shoulderCp1 = armholePathInside.ops[1].cp1.clone()
|
||||
points.armholeInsidePitch = armholePathInside.ops[1].to.clone()
|
||||
points.armholeInsidePitchCp2 = armholePathInside.ops[1].cp2.clone()
|
||||
if (armholePathInside.ops.length == 2) {
|
||||
points.armholeInsidePitchCp1 = points.armholeDartInside.clone()
|
||||
points.armholeDartInsideCp2 = points.armholeDartInside.clone()
|
||||
} else {
|
||||
points.armholeInsidePitchCp1 = armholePathInside.ops[2].cp1.clone()
|
||||
points.armholeDartInsideCp2 = armholePathInside.ops[2].cp2.clone()
|
||||
}
|
||||
points.armholeDartOutsideCp1 = armholePathOutside.ops[1].cp1.clone()
|
||||
points.armholeOutsidePitch = armholePathOutside.ops[1].to.clone()
|
||||
points.armholeOutsidePitchCp2 = armholePathOutside.ops[1].cp2.clone()
|
||||
if (armholePathOutside.ops.length == 2) {
|
||||
points.armholeOutsidePitchCp1 = points.armhole.clone()
|
||||
points.armholeCp2 = points.armhole.clone()
|
||||
} else {
|
||||
points.armholeOutsidePitchCp1 = armholePathOutside.ops[2].cp1.clone()
|
||||
points.armholeCp2 = armholePathOutside.ops[2].cp2.clone()
|
||||
}
|
||||
|
||||
if (points.armholeDartInside.sitsRoughlyOn(points.armholeInsidePitch)) {
|
||||
paths.armholeInside = new Path()
|
||||
.move(points.armholeDartInside)
|
||||
.curve(points.armholeInsidePitchCp2, points.shoulderCp1, points.shoulder)
|
||||
.hide()
|
||||
} else {
|
||||
paths.armholeInside = new Path()
|
||||
.move(points.armholeDartInside)
|
||||
.curve(points.armholeDartInsideCp2, points.armholeInsidePitchCp1, points.armholeInsidePitch)
|
||||
.curve(points.armholeInsidePitchCp2, points.shoulderCp1, points.shoulder)
|
||||
.hide()
|
||||
}
|
||||
|
||||
let rotateAngle =
|
||||
points.shoulderDartInside.angle(points.bustA) - points.bustDartTop.angle(points.bustA)
|
||||
if (rotateAngle < 0) {
|
||||
rotateAngle += 360
|
||||
}
|
||||
if (rotateAngle > 360) {
|
||||
rotateAngle -= 360
|
||||
}
|
||||
|
||||
points.shoulderDartCpTop = points.bustDartCpTop.rotate(rotateAngle, points.bustA)
|
||||
points.shoulderDartCpBottom = points.bustDartCpBottom.rotate(rotateAngle, points.bustA)
|
||||
|
||||
rotateAngle =
|
||||
points.armholeDartInside.angle(points.bustA) - points.bustDartTop.angle(points.bustA)
|
||||
if (rotateAngle < 0) {
|
||||
rotateAngle += 360
|
||||
}
|
||||
if (rotateAngle > 360) {
|
||||
rotateAngle -= 360
|
||||
}
|
||||
|
||||
points.armholeDartCpTop = points.bustDartCpTop.rotate(rotateAngle, points.bustA)
|
||||
points.armholeDartCpBottom = points.bustDartCpBottom.rotate(rotateAngle, points.bustA)
|
||||
|
||||
let spreadAngle =
|
||||
/*360 -*/ points.bustA.angle(points.bustDartBottom) - points.bustA.angle(points.bustDartTop)
|
||||
|
||||
points.shoulderDartOutside = points.shoulderDartInside.rotate(spreadAngle, points.bustA)
|
||||
points.shoulderDartShoulder = points.shoulderDartInside.shiftFractionTowards(
|
||||
points.shoulderDartOutside,
|
||||
0.5
|
||||
)
|
||||
|
||||
points.shoulderDartTip = points.shoulderDartShoulder.shiftFractionTowards(
|
||||
points.bust,
|
||||
options.upperDartLength
|
||||
)
|
||||
let dartRatio =
|
||||
new Path().move(points.waistDartHem).line(points.waistDartTip).length() /
|
||||
new Path().move(points.shoulderDartShoulder).line(points.shoulderDartTip).length()
|
||||
|
||||
points.shoulder = points.shoulder.rotate(spreadAngle, points.bustA)
|
||||
points.armhole = points.armhole.rotate(spreadAngle, points.bustA)
|
||||
points.armholeCp2 = points.armholeCp2.rotate(spreadAngle, points.bustA)
|
||||
points.armholePitch = points.armholePitch.rotate(spreadAngle, points.bustA)
|
||||
points.armholePitchCp1 = points.armholePitchCp1.rotate(spreadAngle, points.bustA)
|
||||
points.armholePitchCp2 = points.armholePitchCp2.rotate(spreadAngle, points.bustA)
|
||||
points.armholeCircleOutsideCp1 = points.armholeCircleOutsideCp1.rotate(spreadAngle, points.bustA)
|
||||
points.armholeDartOutside = points.armholeDartOutside.rotate(spreadAngle, points.bustA)
|
||||
points.armholeDartOutsideCp1 = points.armholeDartOutsideCp1.rotate(spreadAngle, points.bustA)
|
||||
points.armholeOutsidePitchCp2 = points.armholeOutsidePitchCp2.rotate(spreadAngle, points.bustA)
|
||||
points.armholeOutsidePitch = points.armholeOutsidePitch.rotate(spreadAngle, points.bustA)
|
||||
points.armholeOutsidePitchCp1 = points.armholeOutsidePitchCp1.rotate(spreadAngle, points.bustA)
|
||||
|
||||
if (points.armhole.sitsRoughlyOn(points.armholeOutsidePitch)) {
|
||||
paths.armholeOutside = new Path()
|
||||
.move(points.armholeDartOutside)
|
||||
.curve(points.armholeDartOutsideCp1, points.armholeOutsidePitchCp2, points.armhole)
|
||||
.hide()
|
||||
} else {
|
||||
paths.armholeOutside = new Path()
|
||||
.move(points.armholeDartOutside)
|
||||
.curve(
|
||||
points.armholeDartOutsideCp1,
|
||||
points.armholeOutsidePitchCp2,
|
||||
points.armholeOutsidePitch
|
||||
)
|
||||
.curve(points.armholeOutsidePitchCp1, points.armholeCp2, points.armhole)
|
||||
.hide()
|
||||
}
|
||||
|
||||
paths.armholeTempDart = new Path()
|
||||
.move(points.armholeDartOutside)
|
||||
._curve(points.armholeDartCpBottom, points.armholeDartTip)
|
||||
.curve_(points.armholeDartCpTop, points.armholeDartInside)
|
||||
.hide()
|
||||
|
||||
points.shoulderDartTipCpDownOutside = points.shoulderDartOutside.shiftFractionTowards(
|
||||
points.bust,
|
||||
1 + (1 - options.upperDartLength) + (1 - options.waistDartLength) * dartRatio
|
||||
)
|
||||
// points.shoulderDartTipCpDownOutside = points.shoulderDartTipCpDownOutside.rotate( options.dartOutsideCP *10, points.shoulderDartOutside )
|
||||
|
||||
points.shoulderDartTipCpDownInside = points.shoulderDartInside.shiftFractionTowards(
|
||||
points.shoulderDartTip,
|
||||
1 + (1 - options.upperDartLength) + (1 - options.waistDartLength) * dartRatio
|
||||
)
|
||||
points.armholeDartTipCpDownInside = points.armholeDartTip.shiftFractionTowards(
|
||||
// points.waistDartHem,
|
||||
points.waistDartLeft,
|
||||
1 - options.upperDartLength + (1 - options.waistDartLength) * dartRatio
|
||||
)
|
||||
|
||||
points.bustAcp = points.waistDartRight.shiftOutwards(points.bustA, 10)
|
||||
|
||||
paths.shoulderInsideSeam = new Path()
|
||||
.move(points.waistDartLeft)
|
||||
.curve(points.waistDartLeftCp, points.shoulderDartTipCpDownInside, points.shoulderDartTip)
|
||||
.line(points.shoulderDartInside)
|
||||
.hide()
|
||||
|
||||
paths.armholeInsideSeam = new Path()
|
||||
.move(points.waistDartLeft)
|
||||
.curve(points.waistDartLeftCp, points.armholeDartTipCpDownInside, points.armholeDartTip)
|
||||
.hide()
|
||||
|
||||
paths.sOutsideSeam = new Path()
|
||||
.move(points.waistDartRight)
|
||||
.curve(points.bustAcp, points.shoulderDartTipCpDownOutside, points.shoulderDartOutside)
|
||||
.hide()
|
||||
|
||||
points.waistDartRightCp = points.bustAcp.clone()
|
||||
|
||||
let shoulderInsideSeam = new Path()
|
||||
.move(points.waistDartLeft)
|
||||
.curve(points.waistDartLeftCp, points.shoulderDartTipCpDownInside, points.shoulderDartTip)
|
||||
.line(points.shoulderDartInside)
|
||||
.hide()
|
||||
|
||||
points.waistUpDartLeft = paths.armholeInsideSeam.shiftAlong(
|
||||
points.waistDartLeft.dist(points.armholeDartTip) * 0.5
|
||||
)
|
||||
points.waistCircleInsideCp1 = points.waistUpDartLeft.shiftTowards(
|
||||
points.waistDartLeft,
|
||||
-0.5 * bCircle * points.armholeDartOutside.dist(points.armholeDartTip)
|
||||
)
|
||||
points.shoulderDartTipCpDownOutside = points.shoulderDartTipCpDownOutside
|
||||
.rotate(-2.5, points.shoulderDartOutside)
|
||||
.shiftFractionTowards(points.shoulderDartOutside, 0.2)
|
||||
|
||||
let iteration = 1
|
||||
let diff = 0
|
||||
do {
|
||||
points.waistDartRight = points.waistDartRight.rotate(diff * 0.1, points.sideHemInitial)
|
||||
|
||||
let outsideSeam = new Path()
|
||||
.move(points.waistDartRight)
|
||||
.curve(points.bustAcp, points.shoulderDartTipCpDownOutside, points.shoulderDartOutside)
|
||||
|
||||
points.waistUpDartRight = outsideSeam.shiftAlong(
|
||||
points.waistDartRight.dist(points.waistDartRightCp) * 0.5
|
||||
)
|
||||
points.waistUpDartRightCpDown = points.waistUpDartRight.shiftFractionTowards(
|
||||
points.waistDartRight,
|
||||
0.25
|
||||
)
|
||||
// points.waistUpDartRightCpUp = points.waistUpDartRight.shiftFractionTowards( points.waistDartRight, -.25 )
|
||||
points.waistUpDartRightCpUp = points.waistUpDartRight.shiftFractionTowards(
|
||||
points.waistDartRight,
|
||||
-0.6
|
||||
)
|
||||
points.waistCpUp = points.waistDartRight
|
||||
.shiftTowards(
|
||||
points.sideHemInitial,
|
||||
points.waistDartRight.dist(points.waistUpDartRight) * 0.25
|
||||
)
|
||||
.rotate(90, points.waistDartRight)
|
||||
points.waistCircleInsideCp1 = points.armholeDartTip.shiftTowards(
|
||||
points.armholeDartTipCpDownInside,
|
||||
-0.5 * bCircle * points.armholeDartInside.dist(points.armholeDartTip)
|
||||
)
|
||||
|
||||
outsideSeam = new Path()
|
||||
.move(points.waistDartRight)
|
||||
.curve(points.waistCpUp, points.waistUpDartRightCpDown, points.waistUpDartRight)
|
||||
.curve(
|
||||
points.waistUpDartRightCpUp,
|
||||
points.shoulderDartTipCpDownOutside,
|
||||
points.shoulderDartOutside
|
||||
)
|
||||
|
||||
diff = shoulderInsideSeam.length() - outsideSeam.length()
|
||||
iteration++
|
||||
} while ((diff > 1 || diff < -1) && iteration < 200)
|
||||
if (iteration >= 200) {
|
||||
log.error('Something is not quite right here!')
|
||||
}
|
||||
points.waistDartRightCp = points.bustAcp.clone()
|
||||
points.armholeDartTipInside = points.armholeDartTip.clone()
|
||||
points.waistCircleOutsideCp1 = points.waistUpDartRight.shiftTowards(
|
||||
points.waistDartRight,
|
||||
-1 * bCircle * points.armholeDartOutside.dist(points.armholeDartTip)
|
||||
)
|
||||
|
||||
diff = 0
|
||||
iteration = 0
|
||||
do {
|
||||
let dist = points.armholeDartTipInside.dist(points.armholeDartTipCpDownInside)
|
||||
if (points.armholeDartTipInside.x > points.waistCircleOutsideCp1) {
|
||||
points.armholeDartTipInside.x = points.armholeDartTipInside.x - 0.5
|
||||
points.armholeDartTipInside.y = points.armholeDartTipInside.y + 0.5
|
||||
} else {
|
||||
points.waistCircleOutsideCp1 = points.waistCircleOutsideCp1.shiftTowards(
|
||||
points.waistUpDartRight,
|
||||
diff > 0 ? 1 : -1
|
||||
)
|
||||
}
|
||||
points.armholeDartTipCpDownInside = points.waistCircleInsideCp1.shiftOutwards(
|
||||
points.armholeDartTipInside,
|
||||
dist
|
||||
)
|
||||
|
||||
paths.armholeTempCircleOutside = new Path()
|
||||
.move(points.armholeDartOutside)
|
||||
.curve(points.armholeCircleOutsideCp1, points.waistCircleOutsideCp1, points.waistUpDartRight)
|
||||
.curve(points.waistUpDartRightCpDown, points.waistCpUp, points.waistDartRight)
|
||||
.hide()
|
||||
.attr('class', 'lining')
|
||||
paths.armholeTempCircleInside = new Path()
|
||||
.move(points.armholeDartInside)
|
||||
.curve(
|
||||
points.armholeCircleInsideCp1,
|
||||
points.waistCircleInsideCp1,
|
||||
points.armholeDartTipInside
|
||||
)
|
||||
.curve(points.armholeDartTipCpDownInside, points.waistDartLeftCp, points.waistDartLeft)
|
||||
.hide()
|
||||
.attr('class', 'lining')
|
||||
|
||||
diff = paths.armholeTempCircleOutside.length() - paths.armholeTempCircleInside.length()
|
||||
iteration++
|
||||
} while ((diff < -1 || diff > 1) && iteration < 200)
|
||||
if (iteration >= 200) {
|
||||
log.error('Something is not quite right here!')
|
||||
}
|
||||
|
||||
return part
|
||||
}
|
||||
|
||||
export const frontPoints = {
|
||||
name: 'noble.frontPoints',
|
||||
from: bellaFront,
|
||||
hide: hidePresets.HIDE_ALL,
|
||||
options,
|
||||
draft: nobleFrontPoints,
|
||||
draft: ({ log, points, Path, paths, snippets, options, macro, part }) => {
|
||||
const bCircle = 0.552284749831
|
||||
|
||||
// Hide Bella paths
|
||||
for (const key of Object.keys(paths)) paths[key].hide()
|
||||
for (const i in snippets) delete snippets[i]
|
||||
|
||||
// Remove macros from Bella
|
||||
macro('rmtitle')
|
||||
macro('rmscalebox')
|
||||
|
||||
points.shoulderDartInside = points.hps.shiftFractionTowards(
|
||||
points.shoulder,
|
||||
options.dartPosition == 'shoulder' ? options.shoulderDartPosition : 0.5
|
||||
)
|
||||
points.orgShoulder = points.shoulder.clone()
|
||||
points.orgArmhole = points.armhole.clone()
|
||||
points.orgArmholeCp2 = points.armholeCp2.clone()
|
||||
points.orgArmholePitch = points.armholePitch.clone()
|
||||
points.orgArmholePitchCp1 = points.armholePitchCp1.clone()
|
||||
points.orgArmholePitchCp2 = points.armholePitchCp2.clone()
|
||||
const armholePath = new Path()
|
||||
.move(points.shoulder)
|
||||
._curve(points.armholePitchCp2, points.armholePitch)
|
||||
.curve(points.armholePitchCp1, points.armholeCp2, points.armhole)
|
||||
|
||||
points.armholeDartInside = armholePath.shiftFractionAlong(options.armholeDartPosition)
|
||||
points.armholeDartOutside = points.armholeDartInside.clone()
|
||||
|
||||
const armholePaths = armholePath.split(points.armholeDartInside)
|
||||
|
||||
const armholePathInside = armholePaths[0].clone().hide()
|
||||
const armholePathOutside = armholePaths[1].clone().hide()
|
||||
const armholeDartAngle =
|
||||
armholePathInside.reverse().shiftAlong(1).angle(armholePathOutside.shiftAlong(1)) - 90
|
||||
|
||||
points.armholeDartArmhole = points.armholeDartInside.shiftFractionTowards(
|
||||
points.armholeDartOutside,
|
||||
0.5
|
||||
)
|
||||
points.armholeDartTip = points.armholeDartArmhole.shiftFractionTowards(
|
||||
points.bust,
|
||||
options.upperDartLength
|
||||
)
|
||||
|
||||
points.armholeCircleInsideCp1 = points.armholeDartInside.shift(
|
||||
armholeDartAngle,
|
||||
bCircle * points.armholeDartInside.dist(points.armholeDartTip)
|
||||
)
|
||||
points.armholeCircleOutsideCp1 = points.armholeCircleInsideCp1.clone()
|
||||
|
||||
points.shoulderCp1 = armholePathInside.ops[1].cp1.clone()
|
||||
points.armholeInsidePitch = armholePathInside.ops[1].to.clone()
|
||||
points.armholeInsidePitchCp2 = armholePathInside.ops[1].cp2.clone()
|
||||
if (armholePathInside.ops.length == 2) {
|
||||
points.armholeInsidePitchCp1 = points.armholeDartInside.clone()
|
||||
points.armholeDartInsideCp2 = points.armholeDartInside.clone()
|
||||
} else {
|
||||
points.armholeInsidePitchCp1 = armholePathInside.ops[2].cp1.clone()
|
||||
points.armholeDartInsideCp2 = armholePathInside.ops[2].cp2.clone()
|
||||
}
|
||||
points.armholeDartOutsideCp1 = armholePathOutside.ops[1].cp1.clone()
|
||||
points.armholeOutsidePitch = armholePathOutside.ops[1].to.clone()
|
||||
points.armholeOutsidePitchCp2 = armholePathOutside.ops[1].cp2.clone()
|
||||
if (armholePathOutside.ops.length == 2) {
|
||||
points.armholeOutsidePitchCp1 = points.armhole.clone()
|
||||
points.armholeCp2 = points.armhole.clone()
|
||||
} else {
|
||||
points.armholeOutsidePitchCp1 = armholePathOutside.ops[2].cp1.clone()
|
||||
points.armholeCp2 = armholePathOutside.ops[2].cp2.clone()
|
||||
}
|
||||
|
||||
if (points.armholeDartInside.sitsRoughlyOn(points.armholeInsidePitch)) {
|
||||
paths.armholeInside = new Path()
|
||||
.move(points.armholeDartInside)
|
||||
.curve(points.armholeInsidePitchCp2, points.shoulderCp1, points.shoulder)
|
||||
.hide()
|
||||
} else {
|
||||
paths.armholeInside = new Path()
|
||||
.move(points.armholeDartInside)
|
||||
.curve(points.armholeDartInsideCp2, points.armholeInsidePitchCp1, points.armholeInsidePitch)
|
||||
.curve(points.armholeInsidePitchCp2, points.shoulderCp1, points.shoulder)
|
||||
.hide()
|
||||
}
|
||||
|
||||
let rotateAngle =
|
||||
points.shoulderDartInside.angle(points.bustA) - points.bustDartTop.angle(points.bustA)
|
||||
if (rotateAngle < 0) {
|
||||
rotateAngle += 360
|
||||
}
|
||||
if (rotateAngle > 360) {
|
||||
rotateAngle -= 360
|
||||
}
|
||||
|
||||
points.shoulderDartCpTop = points.bustDartCpTop.rotate(rotateAngle, points.bustA)
|
||||
points.shoulderDartCpBottom = points.bustDartCpBottom.rotate(rotateAngle, points.bustA)
|
||||
|
||||
rotateAngle =
|
||||
points.armholeDartInside.angle(points.bustA) - points.bustDartTop.angle(points.bustA)
|
||||
if (rotateAngle < 0) {
|
||||
rotateAngle += 360
|
||||
}
|
||||
if (rotateAngle > 360) {
|
||||
rotateAngle -= 360
|
||||
}
|
||||
|
||||
points.armholeDartCpTop = points.bustDartCpTop.rotate(rotateAngle, points.bustA)
|
||||
points.armholeDartCpBottom = points.bustDartCpBottom.rotate(rotateAngle, points.bustA)
|
||||
|
||||
const spreadAngle =
|
||||
/*360 -*/ points.bustA.angle(points.bustDartBottom) - points.bustA.angle(points.bustDartTop)
|
||||
|
||||
points.shoulderDartOutside = points.shoulderDartInside.rotate(spreadAngle, points.bustA)
|
||||
points.shoulderDartShoulder = points.shoulderDartInside.shiftFractionTowards(
|
||||
points.shoulderDartOutside,
|
||||
0.5
|
||||
)
|
||||
|
||||
points.shoulderDartTip = points.shoulderDartShoulder.shiftFractionTowards(
|
||||
points.bust,
|
||||
options.upperDartLength
|
||||
)
|
||||
const dartRatio =
|
||||
new Path().move(points.waistDartHem).line(points.waistDartTip).length() /
|
||||
new Path().move(points.shoulderDartShoulder).line(points.shoulderDartTip).length()
|
||||
|
||||
points.shoulder = points.shoulder.rotate(spreadAngle, points.bustA)
|
||||
points.armhole = points.armhole.rotate(spreadAngle, points.bustA)
|
||||
points.armholeCp2 = points.armholeCp2.rotate(spreadAngle, points.bustA)
|
||||
points.armholePitch = points.armholePitch.rotate(spreadAngle, points.bustA)
|
||||
points.armholePitchCp1 = points.armholePitchCp1.rotate(spreadAngle, points.bustA)
|
||||
points.armholePitchCp2 = points.armholePitchCp2.rotate(spreadAngle, points.bustA)
|
||||
points.armholeCircleOutsideCp1 = points.armholeCircleOutsideCp1.rotate(
|
||||
spreadAngle,
|
||||
points.bustA
|
||||
)
|
||||
points.armholeDartOutside = points.armholeDartOutside.rotate(spreadAngle, points.bustA)
|
||||
points.armholeDartOutsideCp1 = points.armholeDartOutsideCp1.rotate(spreadAngle, points.bustA)
|
||||
points.armholeOutsidePitchCp2 = points.armholeOutsidePitchCp2.rotate(spreadAngle, points.bustA)
|
||||
points.armholeOutsidePitch = points.armholeOutsidePitch.rotate(spreadAngle, points.bustA)
|
||||
points.armholeOutsidePitchCp1 = points.armholeOutsidePitchCp1.rotate(spreadAngle, points.bustA)
|
||||
|
||||
if (points.armhole.sitsRoughlyOn(points.armholeOutsidePitch)) {
|
||||
paths.armholeOutside = new Path()
|
||||
.move(points.armholeDartOutside)
|
||||
.curve(points.armholeDartOutsideCp1, points.armholeOutsidePitchCp2, points.armhole)
|
||||
.hide()
|
||||
} else {
|
||||
paths.armholeOutside = new Path()
|
||||
.move(points.armholeDartOutside)
|
||||
.curve(
|
||||
points.armholeDartOutsideCp1,
|
||||
points.armholeOutsidePitchCp2,
|
||||
points.armholeOutsidePitch
|
||||
)
|
||||
.curve(points.armholeOutsidePitchCp1, points.armholeCp2, points.armhole)
|
||||
.hide()
|
||||
}
|
||||
|
||||
paths.armholeTempDart = new Path()
|
||||
.move(points.armholeDartOutside)
|
||||
._curve(points.armholeDartCpBottom, points.armholeDartTip)
|
||||
.curve_(points.armholeDartCpTop, points.armholeDartInside)
|
||||
.hide()
|
||||
|
||||
points.shoulderDartTipCpDownOutside = points.shoulderDartOutside.shiftFractionTowards(
|
||||
points.bust,
|
||||
1 + (1 - options.upperDartLength) + (1 - options.waistDartLength) * dartRatio
|
||||
)
|
||||
// points.shoulderDartTipCpDownOutside = points.shoulderDartTipCpDownOutside.rotate( options.dartOutsideCP *10, points.shoulderDartOutside )
|
||||
|
||||
points.shoulderDartTipCpDownInside = points.shoulderDartInside.shiftFractionTowards(
|
||||
points.shoulderDartTip,
|
||||
1 + (1 - options.upperDartLength) + (1 - options.waistDartLength) * dartRatio
|
||||
)
|
||||
points.armholeDartTipCpDownInside = points.armholeDartTip.shiftFractionTowards(
|
||||
// points.waistDartHem,
|
||||
points.waistDartLeft,
|
||||
1 - options.upperDartLength + (1 - options.waistDartLength) * dartRatio
|
||||
)
|
||||
|
||||
points.bustAcp = points.waistDartRight.shiftOutwards(points.bustA, 10)
|
||||
|
||||
paths.shoulderInsideSeam = new Path()
|
||||
.move(points.waistDartLeft)
|
||||
.curve(points.waistDartLeftCp, points.shoulderDartTipCpDownInside, points.shoulderDartTip)
|
||||
.line(points.shoulderDartInside)
|
||||
.hide()
|
||||
|
||||
paths.armholeInsideSeam = new Path()
|
||||
.move(points.waistDartLeft)
|
||||
.curve(points.waistDartLeftCp, points.armholeDartTipCpDownInside, points.armholeDartTip)
|
||||
.hide()
|
||||
|
||||
paths.sOutsideSeam = new Path()
|
||||
.move(points.waistDartRight)
|
||||
.curve(points.bustAcp, points.shoulderDartTipCpDownOutside, points.shoulderDartOutside)
|
||||
.hide()
|
||||
|
||||
points.waistDartRightCp = points.bustAcp.clone()
|
||||
|
||||
const shoulderInsideSeam = new Path()
|
||||
.move(points.waistDartLeft)
|
||||
.curve(points.waistDartLeftCp, points.shoulderDartTipCpDownInside, points.shoulderDartTip)
|
||||
.line(points.shoulderDartInside)
|
||||
.hide()
|
||||
|
||||
points.waistUpDartLeft = paths.armholeInsideSeam.shiftAlong(
|
||||
points.waistDartLeft.dist(points.armholeDartTip) * 0.5
|
||||
)
|
||||
points.waistCircleInsideCp1 = points.waistUpDartLeft.shiftTowards(
|
||||
points.waistDartLeft,
|
||||
-0.5 * bCircle * points.armholeDartOutside.dist(points.armholeDartTip)
|
||||
)
|
||||
points.shoulderDartTipCpDownOutside = points.shoulderDartTipCpDownOutside
|
||||
.rotate(-2.5, points.shoulderDartOutside)
|
||||
.shiftFractionTowards(points.shoulderDartOutside, 0.2)
|
||||
|
||||
let iteration = 1
|
||||
let diff = 0
|
||||
do {
|
||||
points.waistDartRight = points.waistDartRight.rotate(diff * 0.1, points.sideHemInitial)
|
||||
|
||||
let outsideSeam = new Path()
|
||||
.move(points.waistDartRight)
|
||||
.curve(points.bustAcp, points.shoulderDartTipCpDownOutside, points.shoulderDartOutside)
|
||||
|
||||
points.waistUpDartRight = outsideSeam.shiftAlong(
|
||||
points.waistDartRight.dist(points.waistDartRightCp) * 0.5
|
||||
)
|
||||
points.waistUpDartRightCpDown = points.waistUpDartRight.shiftFractionTowards(
|
||||
points.waistDartRight,
|
||||
0.25
|
||||
)
|
||||
// points.waistUpDartRightCpUp = points.waistUpDartRight.shiftFractionTowards( points.waistDartRight, -.25 )
|
||||
points.waistUpDartRightCpUp = points.waistUpDartRight.shiftFractionTowards(
|
||||
points.waistDartRight,
|
||||
-0.6
|
||||
)
|
||||
points.waistCpUp = points.waistDartRight
|
||||
.shiftTowards(
|
||||
points.sideHemInitial,
|
||||
points.waistDartRight.dist(points.waistUpDartRight) * 0.25
|
||||
)
|
||||
.rotate(90, points.waistDartRight)
|
||||
points.waistCircleInsideCp1 = points.armholeDartTip.shiftTowards(
|
||||
points.armholeDartTipCpDownInside,
|
||||
-0.5 * bCircle * points.armholeDartInside.dist(points.armholeDartTip)
|
||||
)
|
||||
|
||||
outsideSeam = new Path()
|
||||
.move(points.waistDartRight)
|
||||
.curve(points.waistCpUp, points.waistUpDartRightCpDown, points.waistUpDartRight)
|
||||
.curve(
|
||||
points.waistUpDartRightCpUp,
|
||||
points.shoulderDartTipCpDownOutside,
|
||||
points.shoulderDartOutside
|
||||
)
|
||||
|
||||
diff = shoulderInsideSeam.length() - outsideSeam.length()
|
||||
iteration++
|
||||
} while ((diff > 1 || diff < -1) && iteration < 200)
|
||||
if (iteration >= 200) {
|
||||
log.error('Something is not quite right here!')
|
||||
}
|
||||
points.waistDartRightCp = points.bustAcp.clone()
|
||||
points.armholeDartTipInside = points.armholeDartTip.clone()
|
||||
points.waistCircleOutsideCp1 = points.waistUpDartRight.shiftTowards(
|
||||
points.waistDartRight,
|
||||
-1 * bCircle * points.armholeDartOutside.dist(points.armholeDartTip)
|
||||
)
|
||||
|
||||
diff = 0
|
||||
iteration = 0
|
||||
do {
|
||||
const dist = points.armholeDartTipInside.dist(points.armholeDartTipCpDownInside)
|
||||
if (points.armholeDartTipInside.x > points.waistCircleOutsideCp1) {
|
||||
points.armholeDartTipInside.x = points.armholeDartTipInside.x - 0.5
|
||||
points.armholeDartTipInside.y = points.armholeDartTipInside.y + 0.5
|
||||
} else {
|
||||
points.waistCircleOutsideCp1 = points.waistCircleOutsideCp1.shiftTowards(
|
||||
points.waistUpDartRight,
|
||||
diff > 0 ? 1 : -1
|
||||
)
|
||||
}
|
||||
points.armholeDartTipCpDownInside = points.waistCircleInsideCp1.shiftOutwards(
|
||||
points.armholeDartTipInside,
|
||||
dist
|
||||
)
|
||||
|
||||
paths.armholeTempCircleOutside = new Path()
|
||||
.move(points.armholeDartOutside)
|
||||
.curve(
|
||||
points.armholeCircleOutsideCp1,
|
||||
points.waistCircleOutsideCp1,
|
||||
points.waistUpDartRight
|
||||
)
|
||||
.curve(points.waistUpDartRightCpDown, points.waistCpUp, points.waistDartRight)
|
||||
.hide()
|
||||
.attr('class', 'lining')
|
||||
paths.armholeTempCircleInside = new Path()
|
||||
.move(points.armholeDartInside)
|
||||
.curve(
|
||||
points.armholeCircleInsideCp1,
|
||||
points.waistCircleInsideCp1,
|
||||
points.armholeDartTipInside
|
||||
)
|
||||
.curve(points.armholeDartTipCpDownInside, points.waistDartLeftCp, points.waistDartLeft)
|
||||
.hide()
|
||||
.attr('class', 'lining')
|
||||
|
||||
diff = paths.armholeTempCircleOutside.length() - paths.armholeTempCircleInside.length()
|
||||
iteration++
|
||||
} while ((diff < -1 || diff > 1) && iteration < 200)
|
||||
if (iteration >= 200) {
|
||||
log.error('Something is not quite right here!')
|
||||
}
|
||||
|
||||
return part
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
import { pctBasedOn } from '@freesewing/core'
|
||||
|
||||
// Constants
|
||||
export const shoulderToShoulderCorrection = 0.995
|
||||
export const bustDartCurve = 1
|
||||
export const bustDartLength = 0.9
|
||||
// Percentages
|
||||
export const bustSpanEase = { pct: 0, min: -5, max: 20, menu: 'fit' }
|
||||
export const bustSpanEase = { pct: 0, min: -5, max: 20, ...pctBasedOn('bustSpan'), menu: 'fit' }
|
||||
export const backHemSlope = { deg: 2.5, min: 0, max: 5, menu: 'advanced' }
|
||||
export const upperDartLength = { pct: 90, min: 80, max: 95, menu: 'darts' }
|
||||
export const dartPosition = { dflt: 'shoulder', list: ['shoulder', 'armhole'], menu: 'darts' }
|
||||
|
@ -11,13 +13,11 @@ export const shoulderDartPosition = {
|
|||
pct: 50,
|
||||
min: 10,
|
||||
max: 90,
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
menu: (settings, mergedOptions) => (mergedOptions?.dartPosition != 'shoulder' ? 'darts' : false),
|
||||
menu: (settings, mergedOptions) => (mergedOptions.dartPosition === 'shoulder' ? 'darts' : false),
|
||||
}
|
||||
export const armholeDartPosition = {
|
||||
pct: 50,
|
||||
min: 10,
|
||||
max: 90,
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
menu: (settings, mergedOptions) => (mergedOptions?.dartPosition == 'shoulder' ? 'darts' : false),
|
||||
menu: (settings, mergedOptions) => (mergedOptions.dartPosition === 'armhole' ? 'darts' : false),
|
||||
}
|
||||
|
|
|
@ -10,16 +10,45 @@
|
|||
"headSection1": "Head section 1",
|
||||
"headSection2": "Head section 2"
|
||||
},
|
||||
"s": {},
|
||||
"s": {
|
||||
"eye": "Eye",
|
||||
"mouth": "Mouth",
|
||||
"stichLine": "Stitch line",
|
||||
"foldLine": "Fold lines",
|
||||
"octopusEye.t": "The octopus eye is not shown",
|
||||
"octopusEye.d": "The **Octopus eye** is a circular piece of fabric with a diameter of {{{ width }}} (this includes seam allowance). It is not shown because the **expand** core setting is currently disabled. Enable it to show this pattern part.",
|
||||
"octopusPupil.t": "The octopus pupil is not shown",
|
||||
"octopusPupil.d": "The **Octopus pupil** is a circular piece of fabric with a diameter of {{{ width }}} (this includes seam allowance). It is not shown because the **expand** core setting is currently disabled. Enable it to show this pattern part.",
|
||||
"octopusEyebrow.t": "The octopus eyebrow is not shown",
|
||||
"octopusEyebrow.d": "The **Octopus eyebrow** is a rectangular piece of fabric {{{ width }}} wide and {{{ length }}} long (this includes seam allowance). It is not shown because the **expand** core setting is currently disabled. Enable it to show this pattern part.",
|
||||
"squidEye.t": "The squid eye is not shown",
|
||||
"squidEye.d": "The **Squid eye** is a circular piece of fabric with a diameter of {{{ width }}} (this includes seam allowance). It is not shown because the **expand** core setting is currently disabled. Enable it to show this pattern part.",
|
||||
"squidPupil.t": "The squid pupil is not shown",
|
||||
"squidPupil.d": "The **Squid pupil** is a circular piece of fabric with a diameter of {{{ width }}} (this includes seam allowance). It is not shown because the **expand** core setting is currently disabled. Enable it to show this pattern part.",
|
||||
"squidEyebrow.t": "The squid eyebrow is not shown",
|
||||
"squidEyebrow.d": "The **Squid eyebrow** is a rectangular piece of fabric {{{ width }}} wide and {{{ length }}} long (this includes seam allowance). It is not shown because the **expand** core setting is currently disabled. Enable it to show this pattern part."
|
||||
},
|
||||
"o": {
|
||||
"size": {
|
||||
"t": "Size",
|
||||
"d": "Controls the overall size"
|
||||
"d": "Controls the overall size (value shown is the size of the head)"
|
||||
},
|
||||
"type": {
|
||||
"t": "Type",
|
||||
"d": "Allows you to choose one of the variants of this design"
|
||||
},
|
||||
"type.octoplushy": {
|
||||
"t": "Octoplushy",
|
||||
"d": "Draft the octoplushy variant"
|
||||
},
|
||||
"type.octopus": {
|
||||
"t": "Octopus",
|
||||
"d": "Draft the octopus variant"
|
||||
},
|
||||
"type.squid": {
|
||||
"t": "Squid",
|
||||
"d": "Draft the squid variant"
|
||||
},
|
||||
"armWidth": {
|
||||
"t": "Arm width",
|
||||
"d": "Controls the width of the arms"
|
||||
|
@ -38,15 +67,15 @@
|
|||
},
|
||||
"bottomTopArmRatio": {
|
||||
"t": "Bottom/Top arm ratio",
|
||||
"d": "FIXME: No idea what this does"
|
||||
"d": "Changes the ratio between the fabric on the top of the arms versus that on the bottom of the arms"
|
||||
},
|
||||
"bottomArmReduction": {
|
||||
"t": "Bottom arm reduction",
|
||||
"d": "FIXME: No idea what this does"
|
||||
"d": "This changes how long the bottom fabric of the arms is compared to the top fabric. It makes the arms more curly"
|
||||
},
|
||||
"bottomArmReductionPlushy": {
|
||||
"t": "Bottom arm reduction (plushy)",
|
||||
"d": "FIXME: No idea what this does"
|
||||
"d": "This changes how long the bottom fabric of the arms is compared to the top fabric. It makes the arms more curly"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -10,12 +10,11 @@ function octoplushyArmSection(
|
|||
paths,
|
||||
Snippet,
|
||||
snippets,
|
||||
complete,
|
||||
sa,
|
||||
paperless,
|
||||
macro,
|
||||
utils,
|
||||
store,
|
||||
complete,
|
||||
part,
|
||||
}
|
||||
) {
|
||||
|
@ -27,9 +26,9 @@ function octoplushyArmSection(
|
|||
const w = options.sizeConstant * options.size
|
||||
const sections = options.type == 'squid' ? 10 : 8
|
||||
|
||||
let sectionWidth = (w * 2) / sections
|
||||
let armWidth = (w * options.armWidth * options.bottomTopArmRatio * 3.1415) / 2
|
||||
let armAdjustedWidth = armWidth * options.bottomTopArmRatio
|
||||
const sectionWidth = (w * 2) / sections
|
||||
const armWidth = w * options.armWidth * (1 - options.bottomTopArmRatio) * 3.1415
|
||||
const armAdjustedWidth = armWidth * (1 - options.bottomTopArmRatio)
|
||||
let armLength = ((w * 2) / 3.1415) * options.armLength
|
||||
switch (options.type) {
|
||||
case 'octopus':
|
||||
|
@ -67,7 +66,8 @@ function octoplushyArmSection(
|
|||
points.armMiddleCp1 = points.armMiddle.shiftFractionTowards(points.skirtLeft2, c)
|
||||
points.skirtLeft3 = new Point((-1 * armAdjustedWidth) / 2, points.skirtLeft2.y)
|
||||
points.skirtLeft = points.skirtLeft3.clone()
|
||||
let pHelper = points.skirtLeft.shift(store.get('armSkirtToTopAngle'), 10)
|
||||
|
||||
const pHelper = points.skirtLeft.shift(store.get('armSkirtToTopAngle'), 10)
|
||||
if (Math.round(pHelper.x * 1000) <= Math.round((armAdjustedWidth / -2) * 1000)) {
|
||||
points.armTopLeft = points.skirtLeft.clone()
|
||||
} else {
|
||||
|
@ -98,7 +98,7 @@ function octoplushyArmSection(
|
|||
)
|
||||
|
||||
if (options.type == 'octopus') {
|
||||
let pSkirtLeft = new Path()
|
||||
const pSkirtLeft = new Path()
|
||||
.move(points.armTopLeft)
|
||||
.curve(points.armTopLeftCp2, points.armMiddleCp1, points.armMiddle)
|
||||
|
||||
|
@ -195,119 +195,132 @@ function octoplushyArmSection(
|
|||
.join(paths.topRight)
|
||||
.close()
|
||||
|
||||
// Complete?
|
||||
points.logo = points.armMiddle.shiftFractionTowards(points.armBottom, 0.08)
|
||||
snippets.logo = new Snippet('logo', points.logo).attr('data-scale', 0.4)
|
||||
points.gridAnchor = points.logo.clone()
|
||||
|
||||
if (complete) {
|
||||
points.logo = points.armMiddle.shiftFractionTowards(points.armBottom, 0.08)
|
||||
snippets.logo = new Snippet('logo', points.logo).attr('data-scale', 0.4)
|
||||
points.armMiddle.addText('C', 'center')
|
||||
points.armTopLeft.addText('D', 'center')
|
||||
points.armTopRight.addText('D', 'center')
|
||||
}
|
||||
|
||||
points.armMiddle.attr('data-text', 'C').attr('data-text-class', 'center')
|
||||
points.armTopLeft.attr('data-text', 'D').attr('data-text-class', 'center')
|
||||
points.armTopRight.attr('data-text', 'D').attr('data-text-class', 'center')
|
||||
points.titleAnchor = points.armMiddle
|
||||
.shiftFractionTowards(points.armBottom, 0.2)
|
||||
.shift(180, sectionWidth * 0.1)
|
||||
|
||||
points.titleAnchor = points.armMiddle
|
||||
.shiftFractionTowards(points.armBottom, 0.2)
|
||||
.shift(180, sectionWidth * 0.1)
|
||||
macro('title', {
|
||||
at: points.titleAnchor,
|
||||
nr: 2 + partNumber * 3,
|
||||
title: 'arm' + (partNumber == 0 ? '' : ' (a)'),
|
||||
rotation: 90,
|
||||
scale: 0.3,
|
||||
})
|
||||
|
||||
macro('title', {
|
||||
at: points.titleAnchor,
|
||||
nr: 2 + partNumber * 3,
|
||||
title: 'Arm' + (partNumber == 0 ? '' : ' (a)'),
|
||||
rotation: 90,
|
||||
scale: 0.3,
|
||||
})
|
||||
if (partNumber == 1) {
|
||||
store.cutlist.addCut({ cut: 2, from: 'undersideFabric', identical: true })
|
||||
} else {
|
||||
store.cutlist.addCut({ cut: 8, from: 'undersideFabric', identical: true })
|
||||
}
|
||||
|
||||
for (var i = 0; i < 4; i++) {
|
||||
snippets[`armLeft${i}`] = new Snippet(
|
||||
'notch',
|
||||
points.armTopLeft.shiftFractionTowards(points.armBottomLeft, i / 4)
|
||||
)
|
||||
snippets[`armRight${i}`] = new Snippet(
|
||||
'notch',
|
||||
points.armTopRight.shiftFractionTowards(points.armBottomRight, i / 4)
|
||||
)
|
||||
}
|
||||
if (options.type == 'octopus') {
|
||||
points.skirtArmLeft = utils.curveIntersectsX(
|
||||
points.skirtLeft,
|
||||
points.skirtLeft,
|
||||
points.armMiddleCp1,
|
||||
points.armMiddle,
|
||||
points.armTopLeft.x
|
||||
)
|
||||
points.skirtArmRight = points.skirtArmLeft.flipX(points.sectionTop)
|
||||
for (var i = 0; i < 4; i++) {
|
||||
snippets[`armLeft${i}`] = new Snippet(
|
||||
'notch',
|
||||
points.armTopLeft.shiftFractionTowards(points.armBottomLeft, i / 4)
|
||||
)
|
||||
snippets[`armRight${i}`] = new Snippet(
|
||||
'notch',
|
||||
points.armTopRight.shiftFractionTowards(points.armBottomRight, i / 4)
|
||||
)
|
||||
}
|
||||
if (options.type == 'octopus') {
|
||||
points.skirtArmLeft = utils.curveIntersectsX(
|
||||
points.skirtLeft,
|
||||
points.skirtLeft,
|
||||
points.armMiddleCp1,
|
||||
points.armMiddle,
|
||||
points.armTopLeft.x
|
||||
)
|
||||
points.skirtArmRight = points.skirtArmLeft.flipX(points.sectionTop)
|
||||
if (complete) {
|
||||
paths.armLeftLine = new Path()
|
||||
.move(points.skirtArmLeft)
|
||||
.line(points.armTopLeft)
|
||||
.attr('data-text', 'stitch line')
|
||||
.attr('data-text-class', 'center')
|
||||
.attr('class', 'hint dotted')
|
||||
.addClass('hint dotted')
|
||||
.addText('stitchLine', 'center')
|
||||
paths.armRightLine = new Path()
|
||||
.move(points.armTopRight)
|
||||
.line(points.skirtArmRight)
|
||||
.attr('data-text', 'stitch line')
|
||||
.attr('data-text-class', 'center')
|
||||
.attr('class', 'hint dotted')
|
||||
.addClass('hint dotted')
|
||||
.addText('stitchLine', 'center')
|
||||
}
|
||||
}
|
||||
|
||||
if (sa) {
|
||||
paths.sa = paths.section.offset(sa).attr('class', 'fabric sa')
|
||||
}
|
||||
if (sa) {
|
||||
paths.sa = paths.section.offset(sa).attr('class', 'fabric sa')
|
||||
}
|
||||
|
||||
if (paperless) {
|
||||
macro('hd', {
|
||||
from: points.armTopLeft,
|
||||
to: points.armTopRight,
|
||||
y: points.armMiddle.y - sa,
|
||||
id: 'topWidth',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.armBottomLeft,
|
||||
to: points.armBottomRight,
|
||||
y: points.armBottom.y + sa + 10,
|
||||
id: 'bottomWidth',
|
||||
})
|
||||
|
||||
macro('vd', {
|
||||
from: points.armBottom,
|
||||
to: points.armMiddle,
|
||||
x: points.skirtLeft.x - sa - 20,
|
||||
id: 'height',
|
||||
})
|
||||
|
||||
if (options.type == 'octopus') {
|
||||
macro('hd', {
|
||||
from: points.skirtLeft,
|
||||
to: points.skirtRight,
|
||||
y: points.skirtRight.y,
|
||||
id: 'skirtWidth',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.skirtLeft,
|
||||
to: points.armMiddle,
|
||||
x: points.skirtLeft.x - sa - 10,
|
||||
id: 'skirtHeight',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.armTopLeft,
|
||||
to: points.skirtLeft,
|
||||
x: points.skirtLeft.x - sa - 10,
|
||||
id: 'skirtToArm',
|
||||
})
|
||||
} else {
|
||||
macro('vd', {
|
||||
from: points.armTopLeft,
|
||||
to: points.armMiddle,
|
||||
x: points.skirtLeft.x - sa - 10,
|
||||
id: 'topToArm',
|
||||
})
|
||||
}
|
||||
if (options.type == 'squid') {
|
||||
if (partNumber == 1) {
|
||||
macro('hd', {
|
||||
from: points.armTopLeft,
|
||||
to: points.armTopRight,
|
||||
y: points.armMiddle.y - sa,
|
||||
from: points.tentacleLeft,
|
||||
to: points.tentacleRight,
|
||||
y: points.tentacleRight.y,
|
||||
id: 'tentacleWidth',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.armBottomLeft,
|
||||
to: points.armBottomRight,
|
||||
y: points.armBottom.y + sa + 10,
|
||||
})
|
||||
|
||||
macro('vd', {
|
||||
from: points.armBottom,
|
||||
to: points.armMiddle,
|
||||
x: points.skirtLeft.x - sa - 20,
|
||||
to: points.tentacleLeft,
|
||||
x: points.tentacleLeft.x - sa - 10,
|
||||
id: 'tentacleHeight',
|
||||
})
|
||||
|
||||
if (options.type == 'octopus') {
|
||||
macro('hd', {
|
||||
from: points.skirtLeft,
|
||||
to: points.skirtRight,
|
||||
y: points.skirtRight.y,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.skirtLeft,
|
||||
to: points.armMiddle,
|
||||
x: points.skirtLeft.x - sa - 10,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.armTopLeft,
|
||||
to: points.skirtLeft,
|
||||
x: points.skirtLeft.x - sa - 10,
|
||||
})
|
||||
} else {
|
||||
macro('vd', {
|
||||
from: points.armTopLeft,
|
||||
to: points.armMiddle,
|
||||
x: points.skirtLeft.x - sa - 10,
|
||||
})
|
||||
}
|
||||
if (options.type == 'squid') {
|
||||
if (partNumber == 1) {
|
||||
macro('hd', {
|
||||
from: points.tentacleLeft,
|
||||
to: points.tentacleRight,
|
||||
y: points.tentacleRight.y,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.armBottom,
|
||||
to: points.tentacleLeft,
|
||||
x: points.tentacleLeft.x - sa - 10,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,23 +2,9 @@ import { headSection1 } from './head.mjs'
|
|||
|
||||
function octoplushyEye(
|
||||
partNumber,
|
||||
{
|
||||
options,
|
||||
Point,
|
||||
Path,
|
||||
points,
|
||||
paths,
|
||||
Snippet,
|
||||
snippets,
|
||||
complete,
|
||||
sa,
|
||||
paperless,
|
||||
macro,
|
||||
store,
|
||||
part,
|
||||
}
|
||||
{ options, Point, Path, points, paths, Snippet, snippets, sa, macro, expand, units, store, part }
|
||||
) {
|
||||
if (options.type != 'squid' && options.type != 'octopus') {
|
||||
if (options.type == 'octoplushy') {
|
||||
return part
|
||||
}
|
||||
if (partNumber > (options.type == 'squid' ? 1 : 2)) {
|
||||
|
@ -27,14 +13,39 @@ function octoplushyEye(
|
|||
|
||||
const c = 0.55191502449351
|
||||
|
||||
let sectionWidth = store.get('sectionWidth')
|
||||
let eyeSize = sectionWidth / 1.5
|
||||
let logoScale = 0.25
|
||||
let titleScale = 0.25
|
||||
if (partNumber == 1) {
|
||||
eyeSize *= 0.65
|
||||
logoScale = 0.15
|
||||
titleScale = 0.16
|
||||
const sectionWidth = store.get('sectionWidth')
|
||||
const logoScale = 0.35
|
||||
const titleScale = 0.25
|
||||
const eyeSize = (sectionWidth / 1.5) * (partNumber === 1 ? 0.65 : 1)
|
||||
const eyeBrowWidth = eyeSize * 0.375
|
||||
const eyeCirc = (eyeSize + eyeBrowWidth * 2) * Math.PI
|
||||
|
||||
if (expand) {
|
||||
// Hint about expand
|
||||
store.flag.preset('expandIsOn')
|
||||
} else {
|
||||
// Expand is off, do not draw the part but flag this to the user
|
||||
const message =
|
||||
(options.type == 'squid' ? `squid` : 'octopus') +
|
||||
(partNumber == 2 ? 'Eyebrow' : partNumber == 1 ? 'Pupil' : 'Eye')
|
||||
store.flag.note({
|
||||
msg: message,
|
||||
replace: {
|
||||
width: units(eyeCirc + 2 * sa),
|
||||
length: units(eyeBrowWidth * 2 + 2 * sa),
|
||||
},
|
||||
suggest: {
|
||||
text: 'flag:show',
|
||||
icon: 'expand',
|
||||
update: {
|
||||
settings: ['expand', 1],
|
||||
},
|
||||
},
|
||||
})
|
||||
// Also hint about expand
|
||||
store.flag.preset('expandIsOff')
|
||||
|
||||
return part.hide()
|
||||
}
|
||||
|
||||
if (partNumber < 2) {
|
||||
|
@ -60,16 +71,12 @@ function octoplushyEye(
|
|||
.curve(points.rightCp1, points.topCp2, points.top)
|
||||
.close()
|
||||
.attr('class', 'fabric')
|
||||
.hide()
|
||||
|
||||
points.logo = points.top.shiftFractionTowards(points.bottom, 0.3)
|
||||
points.titleAnchor = points.bottom
|
||||
.shiftFractionTowards(points.top, 0.25)
|
||||
.shift(180, eyeSize / 10)
|
||||
} else {
|
||||
logoScale = 0.35
|
||||
titleScale = 0.25
|
||||
let eyeBrowWidth = eyeSize * 0.375
|
||||
let eyeCirc = (eyeSize + eyeBrowWidth * 2) * Math.PI
|
||||
points.tl = new Point(0, 0)
|
||||
points.tr = points.tl.shift(0, eyeCirc)
|
||||
points.bl = points.tl.shift(270, eyeBrowWidth * 2)
|
||||
|
@ -83,7 +90,6 @@ function octoplushyEye(
|
|||
.line(points.tl)
|
||||
.close()
|
||||
.attr('class', 'fabric')
|
||||
.hide()
|
||||
|
||||
points.logo = points.tl
|
||||
.shiftFractionTowards(points.bl, 0.5)
|
||||
|
@ -92,41 +98,46 @@ function octoplushyEye(
|
|||
.shiftFractionTowards(points.br, 0.5)
|
||||
.shiftFractionTowards(points.bl, 0.3)
|
||||
}
|
||||
if (complete) {
|
||||
snippets.logo = new Snippet('logo', points.logo).attr('data-scale', logoScale)
|
||||
points.gridAnchor = points.logo.clone()
|
||||
|
||||
macro('title', {
|
||||
at: points.titleAnchor,
|
||||
nr: 3 + partNumber * 3,
|
||||
title: partNumber == 2 ? 'eyebrow' : partNumber == 1 ? 'pupil' : 'eye',
|
||||
scale: titleScale,
|
||||
})
|
||||
snippets.logo = new Snippet('logo', points.logo).attr('data-scale', logoScale)
|
||||
|
||||
if (sa) {
|
||||
paths.sa = paths.eye.offset(Math.min(sa, 6)).attr('class', 'fabric sa')
|
||||
}
|
||||
macro('title', {
|
||||
at: points.titleAnchor,
|
||||
nr: 3 + partNumber * 3,
|
||||
title: partNumber == 2 ? 'eyebrow' : partNumber == 1 ? 'pupil' : 'eye',
|
||||
scale: titleScale,
|
||||
})
|
||||
|
||||
store.cutlist.addCut({
|
||||
cut: 2,
|
||||
from: partNumber == 2 ? 'fabric' : partNumber == 1 ? 'pupilFabric' : 'eyeFabric',
|
||||
})
|
||||
|
||||
if (sa) {
|
||||
paths.sa = paths.eye.offset(Math.min(sa, 6)).attr('class', 'fabric sa')
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
if (partNumber < 2) {
|
||||
macro('hd', {
|
||||
from: points.left,
|
||||
to: points.right,
|
||||
y: points.top.y - sa,
|
||||
})
|
||||
} else {
|
||||
macro('hd', {
|
||||
from: points.tl,
|
||||
to: points.tr,
|
||||
y: points.tl.y - sa,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.bl,
|
||||
to: points.tl,
|
||||
x: points.tl.x - sa,
|
||||
})
|
||||
}
|
||||
if (partNumber < 2) {
|
||||
macro('hd', {
|
||||
from: points.left,
|
||||
to: points.right,
|
||||
y: points.top.y - sa,
|
||||
id: 'width',
|
||||
})
|
||||
} else {
|
||||
macro('hd', {
|
||||
from: points.tl,
|
||||
to: points.tr,
|
||||
y: points.tl.y - sa,
|
||||
id: 'width',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.bl,
|
||||
to: points.tl,
|
||||
x: points.tl.x - sa,
|
||||
id: 'height',
|
||||
})
|
||||
}
|
||||
|
||||
return part
|
||||
|
|
|
@ -8,12 +8,11 @@ function octoplushyHeadSection(
|
|||
paths,
|
||||
Snippet,
|
||||
snippets,
|
||||
complete,
|
||||
sa,
|
||||
paperless,
|
||||
macro,
|
||||
utils,
|
||||
store,
|
||||
complete,
|
||||
part,
|
||||
}
|
||||
) {
|
||||
|
@ -26,10 +25,10 @@ function octoplushyHeadSection(
|
|||
const h = options.sizeConstant * options.size * 0.5
|
||||
const sections = options.type == 'squid' ? 10 : 8
|
||||
|
||||
let sectionWidth = (w * 2) / sections
|
||||
let neckWidth = sectionWidth * options.neckWidth
|
||||
let armWidth = (w * options.armWidth * options.bottomTopArmRatio * 3.1415) / 2
|
||||
let armAdjustedWidth = armWidth * options.bottomTopArmRatio
|
||||
const sectionWidth = (w * 2) / sections
|
||||
const neckWidth = sectionWidth * options.neckWidth
|
||||
const armWidth = w * options.armWidth * options.bottomTopArmRatio * 3.1415
|
||||
const armAdjustedWidth = armWidth * options.bottomTopArmRatio
|
||||
let armLength = ((w * 2) / 3.1415) * options.armLength
|
||||
if (options.type == 'octopus') {
|
||||
armLength *= 2
|
||||
|
@ -41,13 +40,6 @@ function octoplushyHeadSection(
|
|||
}
|
||||
}
|
||||
|
||||
// console.log({ w: w })
|
||||
// console.log({ sectionWidth: sectionWidth })
|
||||
// console.log({ neckWidth: neckWidth })
|
||||
// console.log({ armAdjustedWidth: w * options.armWidth * options.bottomTopArmRatio })
|
||||
// console.log({ toparmWidth: armAdjustedWidth })
|
||||
// console.log({ armLength: armLength })
|
||||
|
||||
points.topLeft = new Point(-1 * w, -1 * h)
|
||||
points.topRight = new Point(w, -1 * h)
|
||||
points.bottomLeft = new Point(-1 * w, h)
|
||||
|
@ -58,11 +50,10 @@ function octoplushyHeadSection(
|
|||
points.sectionTop = new Point(0, -1 * h)
|
||||
points.sectionBottom = new Point(0, h)
|
||||
points.sectionLeft = new Point((-1 * sectionWidth) / 2, 0)
|
||||
let sectionMid = points.sectionLeft.shiftFractionTowards(points.sectionTop, 0.5)
|
||||
|
||||
const sectionMid = points.sectionLeft.shiftFractionTowards(points.sectionTop, 0.5)
|
||||
const sectionAngle = sectionMid.angle(points.sectionTop)
|
||||
|
||||
let lineEnd = sectionMid.shift(sectionAngle - 90, 1000)
|
||||
const lineEnd = sectionMid.shift(sectionAngle - 90, 1000)
|
||||
points.circleCenter = utils.beamIntersectsY(sectionMid, lineEnd, 0)
|
||||
|
||||
const circleRadius = points.circleCenter.dist(points.sectionTop)
|
||||
|
@ -95,7 +86,7 @@ function octoplushyHeadSection(
|
|||
points.lowerLeft.y
|
||||
)
|
||||
|
||||
let currentNeckWidth = (points.sectionTop.x - points.sectionBottomLeft.x) * 2
|
||||
const currentNeckWidth = (points.sectionTop.x - points.sectionBottomLeft.x) * 2
|
||||
|
||||
diff = neckWidth - currentNeckWidth
|
||||
div = div * (currentNeckWidth / neckWidth)
|
||||
|
@ -116,7 +107,7 @@ function octoplushyHeadSection(
|
|||
points.lowerLeft.y
|
||||
)
|
||||
|
||||
let sectionLeft = paths.circle.split(points.sectionTop)[1].split(points.sectionBottomLeft)[0]
|
||||
const sectionLeft = paths.circle.split(points.sectionTop)[1].split(points.sectionBottomLeft)[0]
|
||||
|
||||
points.sectionTop = sectionLeft.ops[0].to.clone()
|
||||
points.sectionTopCp1 = sectionLeft.ops[1].cp1.clone()
|
||||
|
@ -178,8 +169,8 @@ function octoplushyHeadSection(
|
|||
)
|
||||
|
||||
if (options.type == 'octopus') {
|
||||
let octopusHeadFactor = 0.7
|
||||
let sectionHeight = points.sectionBottom.dist(points.sectionTop)
|
||||
const octopusHeadFactor = 0.7
|
||||
const sectionHeight = points.sectionBottom.dist(points.sectionTop)
|
||||
points.sectionTop = points.sectionTop.shift(90, sectionHeight * octopusHeadFactor)
|
||||
points.sectionTopCp1 = points.sectionTopCp1.shift(90, sectionHeight * octopusHeadFactor)
|
||||
points.sectionLeft = points.sectionLeft.shift(90, (sectionHeight * octopusHeadFactor) / 1.1)
|
||||
|
@ -192,7 +183,7 @@ function octoplushyHeadSection(
|
|||
(sectionHeight * octopusHeadFactor) / 1.1
|
||||
)
|
||||
|
||||
let pSkirtLeft = new Path()
|
||||
const pSkirtLeft = new Path()
|
||||
.move(points.skirtBottomLeft)
|
||||
.curve(points.skirtBottomLeft, points.sectionBottomLeftCp1, points.sectionBottomLeft)
|
||||
|
||||
|
@ -233,19 +224,19 @@ function octoplushyHeadSection(
|
|||
points.armBottom = points.armBottom.flipY(points.tentacleLeft)
|
||||
points.armBottomCp2 = points.armBottomCp2.flipY(points.tentacleLeft)
|
||||
|
||||
let pLeftSection = new Path()
|
||||
const pLeftSection = new Path()
|
||||
.move(points.sectionLeft)
|
||||
.curve(points.sectionLeftCp2, points.sectionTopCp1, points.sectionTop)
|
||||
points.finSection = pLeftSection.shiftFractionAlong(0.45)
|
||||
let pLeftCurves = pLeftSection.split(points.finSection)
|
||||
const pLeftCurves = pLeftSection.split(points.finSection)
|
||||
|
||||
points.sectionLeftCp2 = pLeftCurves[0].ops[1].cp1.clone()
|
||||
points.finSectionCp1 = pLeftCurves[0].ops[1].cp2.clone()
|
||||
points.finFold = points.finSection.rotate(-20, points.sectionTop)
|
||||
points.finSeam = points.finSection.rotate(-40, points.sectionTop)
|
||||
let foldAngle = points.sectionTop.angle(points.finFold)
|
||||
let aCp1 = points.sectionTop.angle(pLeftCurves[1].ops[1].cp1) - foldAngle
|
||||
let aCp2 = points.sectionTop.angle(pLeftCurves[1].ops[1].cp2) - foldAngle
|
||||
const foldAngle = points.sectionTop.angle(points.finFold)
|
||||
const aCp1 = points.sectionTop.angle(pLeftCurves[1].ops[1].cp1) - foldAngle
|
||||
const aCp2 = points.sectionTop.angle(pLeftCurves[1].ops[1].cp2) - foldAngle
|
||||
points.finSeamCp2 = points.sectionTop.shift(
|
||||
foldAngle - aCp1,
|
||||
points.sectionTop.dist(pLeftCurves[1].ops[1].cp1)
|
||||
|
@ -385,212 +376,230 @@ function octoplushyHeadSection(
|
|||
.close()
|
||||
.attr('class', 'fabric')
|
||||
|
||||
// Complete?
|
||||
if (complete) {
|
||||
points.logo = points.sectionTop.shiftFractionTowards(
|
||||
points.sectionBottom,
|
||||
options.type == 'octoplushy' ? 0.3 : 0.5
|
||||
points.logo = points.sectionTop.shiftFractionTowards(
|
||||
points.sectionBottom,
|
||||
options.type == 'octoplushy' ? 0.3 : 0.5
|
||||
)
|
||||
snippets.logo = new Snippet('logo', points.logo).attr('data-scale', 0.4)
|
||||
points.gridAnchor = points.skirtTopMiddle.clone()
|
||||
|
||||
if (partNumber == 1) {
|
||||
store.cutlist.addCut({ cut: 2, from: 'fabric', identical: true })
|
||||
} else {
|
||||
store.cutlist.addCut({ cut: 8, from: 'fabric', identical: true })
|
||||
}
|
||||
|
||||
points.titleAnchor = points.sectionBottom
|
||||
.shiftFractionTowards(points.sectionTop, options.type == 'octoplushy' ? 0.3 : 0.4)
|
||||
.shift(180, sectionWidth * 0.2)
|
||||
macro('title', {
|
||||
at: points.titleAnchor,
|
||||
nr: 1 + partNumber * 3,
|
||||
title: 'head' + (partNumber == 0 ? '' : ' (a)'),
|
||||
rotation: 90,
|
||||
scale: options.type == 'octoplushy' ? 0.35 : 0.5,
|
||||
})
|
||||
|
||||
if (options.type == 'octoplushy') {
|
||||
points.eyeLeft = paths.sectionLeft.shiftFractionAlong(0.465)
|
||||
points.eyeRight = points.eyeLeft.flipX(points.sectionTop)
|
||||
if (complete) {
|
||||
points.eyeLeft.addText('eye', 'center')
|
||||
points.eyeRight.addText('eye', 'center')
|
||||
}
|
||||
snippets.eyeLeft = new Snippet('button', points.eyeLeft)
|
||||
snippets.eyeRight = new Snippet('button', points.eyeRight)
|
||||
|
||||
points.mouthMiddle = points.sectionBottom.shiftFractionTowards(points.sectionTop, 0.45)
|
||||
points.mouthLeft = points.mouthMiddle.shift(180, sectionWidth / 4)
|
||||
points.mouthRight = points.mouthMiddle.shift(0, sectionWidth / 4)
|
||||
points.mouthBottom = points.mouthMiddle.shift(270, sectionWidth / 4)
|
||||
points.mouthLeftCp1 = points.mouthLeft.shift(270, (sectionWidth / 4) * c)
|
||||
points.mouthRightCp2 = points.mouthRight.shift(270, (sectionWidth / 4) * c)
|
||||
points.mouthBottomCp2 = points.mouthBottom.shift(180, (sectionWidth / 4) * c)
|
||||
points.mouthBottomCp1 = points.mouthBottom.shift(0, (sectionWidth / 4) * c)
|
||||
paths.mouth = new Path()
|
||||
.move(points.mouthLeft)
|
||||
.curve(points.mouthLeftCp1, points.mouthBottomCp2, points.mouthBottom)
|
||||
.curve(points.mouthBottomCp1, points.mouthRightCp2, points.mouthRight)
|
||||
.attr('class', 'stroke-lg')
|
||||
if (complete) paths.mouth.addText('mouth', 'text-xs center')
|
||||
}
|
||||
|
||||
if (options.type == 'squid' && partNumber == 1 && complete) {
|
||||
paths.fold = new Path()
|
||||
.move(points.sectionTop)
|
||||
.line(points.finFold)
|
||||
.addClass('hint dotted')
|
||||
.addText('foldLine', 'center')
|
||||
}
|
||||
if (options.type == 'octopus') {
|
||||
points.skirtArmLeft = utils.curveIntersectsX(
|
||||
points.sectionBottomLeft,
|
||||
points.sectionBottomLeftCp1,
|
||||
points.skirtBottomLeft,
|
||||
points.skirtBottomLeft,
|
||||
points.armTopLeft.x
|
||||
)
|
||||
snippets.logo = new Snippet('logo', points.logo).attr('data-scale', 0.4)
|
||||
|
||||
points.titleAnchor = points.sectionBottom
|
||||
.shiftFractionTowards(points.sectionTop, options.type == 'octoplushy' ? 0.3 : 0.4)
|
||||
.shift(180, sectionWidth * 0.2)
|
||||
macro('title', {
|
||||
at: points.titleAnchor,
|
||||
nr: 1 + partNumber * 3,
|
||||
title: 'Head' + (partNumber == 0 ? '' : ' (a)'),
|
||||
rotation: 90,
|
||||
scale: options.type == 'octoplushy' ? 0.35 : 0.5,
|
||||
})
|
||||
|
||||
if (options.type == 'octoplushy') {
|
||||
points.eyeLeft = paths.sectionLeft
|
||||
.shiftFractionAlong(0.465)
|
||||
.attr('data-text', 'eye')
|
||||
.attr('data-text-class', 'center')
|
||||
points.eyeRight = points.eyeLeft
|
||||
.flipX(points.sectionTop)
|
||||
.attr('data-text', 'eye')
|
||||
.attr('data-text-class', 'center')
|
||||
snippets.eyeLeft = new Snippet('button', points.eyeLeft)
|
||||
snippets.eyeRight = new Snippet('button', points.eyeRight)
|
||||
|
||||
points.mouthMiddle = points.sectionBottom.shiftFractionTowards(points.sectionTop, 0.45)
|
||||
points.mouthLeft = points.mouthMiddle.shift(180, sectionWidth / 4)
|
||||
points.mouthRight = points.mouthMiddle.shift(0, sectionWidth / 4)
|
||||
points.mouthBottom = points.mouthMiddle.shift(270, sectionWidth / 4)
|
||||
points.mouthLeftCp1 = points.mouthLeft.shift(270, (sectionWidth / 4) * c)
|
||||
points.mouthRightCp2 = points.mouthRight.shift(270, (sectionWidth / 4) * c)
|
||||
points.mouthBottomCp2 = points.mouthBottom.shift(180, (sectionWidth / 4) * c)
|
||||
points.mouthBottomCp1 = points.mouthBottom.shift(0, (sectionWidth / 4) * c)
|
||||
paths.mouth = new Path()
|
||||
.move(points.mouthLeft)
|
||||
.curve(points.mouthLeftCp1, points.mouthBottomCp2, points.mouthBottom)
|
||||
.curve(points.mouthBottomCp1, points.mouthRightCp2, points.mouthRight)
|
||||
.attr('data-text', 'mouth')
|
||||
.attr('data-text-class', 'text-xs center')
|
||||
.attr('class', 'stroke-lg')
|
||||
}
|
||||
|
||||
if (options.type == 'squid' && partNumber == 1) {
|
||||
paths.fold = new Path()
|
||||
.move(points.sectionTop)
|
||||
.line(points.finFold)
|
||||
.attr('data-text', 'fold line')
|
||||
.attr('data-text-class', 'center')
|
||||
.attr('class', 'hint dotted')
|
||||
}
|
||||
if (options.type == 'octopus') {
|
||||
points.skirtArmLeft = utils.curveIntersectsX(
|
||||
points.sectionBottomLeft,
|
||||
points.sectionBottomLeftCp1,
|
||||
points.skirtBottomLeft,
|
||||
points.skirtBottomLeft,
|
||||
points.armTopLeft.x
|
||||
)
|
||||
points.skirtArmRight = points.skirtArmLeft.flipX(points.sectionTop)
|
||||
points.skirtArmRight = points.skirtArmLeft.flipX(points.sectionTop)
|
||||
if (complete) {
|
||||
paths.armLeftLine = new Path()
|
||||
.move(points.skirtArmLeft)
|
||||
.line(points.armTopLeft)
|
||||
.attr('data-text', 'stitch line')
|
||||
.attr('data-text-class', 'center')
|
||||
.attr('class', 'hint dotted')
|
||||
.addClass('class', 'hint dotted')
|
||||
.addText('stitchLine', 'center')
|
||||
paths.armRightLine = new Path()
|
||||
.move(points.armTopRight)
|
||||
.line(points.skirtArmRight)
|
||||
.attr('data-text', 'stitch line')
|
||||
.attr('data-text-class', 'center')
|
||||
.attr('class', 'hint dotted')
|
||||
}
|
||||
points.sectionTop.attr('data-text', 'A').attr('data-text-class', 'center')
|
||||
points.armTopLeft.attr('data-text', 'B').attr('data-text-class', 'center')
|
||||
points.armTopRight.attr('data-text', 'B').attr('data-text-class', 'center')
|
||||
|
||||
snippets.left = new Snippet('notch', points.sectionLeft)
|
||||
snippets.right = new Snippet('notch', points.sectionRight)
|
||||
snippets.bottomLeft = new Snippet('notch', points.sectionBottomLeft)
|
||||
snippets.bottomRight = new Snippet('notch', points.sectionBottomRight)
|
||||
for (var i = 0; i < 4; i++) {
|
||||
snippets[`armLeft${i}`] = new Snippet(
|
||||
'notch',
|
||||
points.armTopLeft.shiftFractionTowards(points.armBottomLeft, i / 4)
|
||||
)
|
||||
snippets[`armRight${i}`] = new Snippet(
|
||||
'notch',
|
||||
points.armTopRight.shiftFractionTowards(points.armBottomRight, i / 4)
|
||||
)
|
||||
}
|
||||
|
||||
if (sa) {
|
||||
paths.sa = paths.section.offset(sa).attr('class', 'fabric sa')
|
||||
.addClass('class', 'hint dotted')
|
||||
.addText('stitchLine', 'center')
|
||||
}
|
||||
}
|
||||
if (complete) {
|
||||
points.sectionTop.addText('A', 'center')
|
||||
points.armTopLeft.addText('B', 'center')
|
||||
points.armTopRight.addText('B', 'center')
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
macro('hd', {
|
||||
from: points.sectionLeft,
|
||||
to: points.sectionRight,
|
||||
y: points.sectionTop.y - sa,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.armTopLeft,
|
||||
to: points.armTopRight,
|
||||
y: points.armTopRight.y,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.armBottomLeft,
|
||||
to: points.armBottomRight,
|
||||
y: points.armBottom.y + sa + 10,
|
||||
})
|
||||
snippets.left = new Snippet('notch', points.sectionLeft)
|
||||
snippets.right = new Snippet('notch', points.sectionRight)
|
||||
snippets.bottomLeft = new Snippet('notch', points.sectionBottomLeft)
|
||||
snippets.bottomRight = new Snippet('notch', points.sectionBottomRight)
|
||||
for (var i = 0; i < 4; i++) {
|
||||
snippets[`armLeft${i}`] = new Snippet(
|
||||
'notch',
|
||||
points.armTopLeft.shiftFractionTowards(points.armBottomLeft, i / 4)
|
||||
)
|
||||
snippets[`armRight${i}`] = new Snippet(
|
||||
'notch',
|
||||
points.armTopRight.shiftFractionTowards(points.armBottomRight, i / 4)
|
||||
)
|
||||
}
|
||||
|
||||
macro('vd', {
|
||||
from: points.sectionTop,
|
||||
to: points.sectionRight,
|
||||
x: points.skirtBottomRight.x + sa + 10,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.sectionTop,
|
||||
to: points.sectionBottomRight,
|
||||
x: points.skirtBottomRight.x + sa + 20,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.sectionTop,
|
||||
if (sa) {
|
||||
paths.sa = paths.section.offset(sa).attr('class', 'fabric sa')
|
||||
}
|
||||
|
||||
macro('hd', {
|
||||
from: points.sectionLeft,
|
||||
to: points.sectionRight,
|
||||
y: points.sectionTop.y - sa,
|
||||
id: 'headWidth',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.armTopLeft,
|
||||
to: points.armTopRight,
|
||||
y: points.armTopRight.y,
|
||||
id: 'topArmWidth',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.armBottomLeft,
|
||||
to: points.armBottomRight,
|
||||
y: points.armBottom.y + sa + 10,
|
||||
id: 'bottomArmWidth',
|
||||
})
|
||||
|
||||
macro('vd', {
|
||||
from: points.sectionTop,
|
||||
to: points.sectionRight,
|
||||
x: points.skirtBottomRight.x + sa + 10,
|
||||
id: 'headMidHeight',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.sectionTop,
|
||||
to: points.sectionBottomRight,
|
||||
x: points.skirtBottomRight.x + sa + 20,
|
||||
id: 'topToNeckHeight',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.sectionTop,
|
||||
to: points.skirtBottomRight,
|
||||
x: points.skirtBottomRight.x + sa + 30,
|
||||
id: 'topToArmHeight',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.sectionTop,
|
||||
to: points.armBottom,
|
||||
x: points.skirtBottomRight.x + sa + 40,
|
||||
id: 'totalHeight',
|
||||
})
|
||||
|
||||
if (options.type == 'octopus') {
|
||||
macro('hd', {
|
||||
from: points.skirtBottomLeft,
|
||||
to: points.skirtBottomRight,
|
||||
x: points.skirtBottomRight.x + sa + 30,
|
||||
y: points.skirtBottomRight.y,
|
||||
id: 'skirtWidth',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.sectionTop,
|
||||
to: points.armBottom,
|
||||
x: points.skirtBottomRight.x + sa + 40,
|
||||
from: points.skirtBottomRight,
|
||||
to: points.armTopRight,
|
||||
x: points.skirtBottomRight.x + sa + 30,
|
||||
id: 'skirtHeight',
|
||||
})
|
||||
|
||||
if (options.type == 'octopus') {
|
||||
}
|
||||
if (options.type == 'squid') {
|
||||
macro('vd', {
|
||||
from: points.armTopLeft,
|
||||
to: points.sectionBottomLeft,
|
||||
x: points.armTopLeft.x - sa - 10,
|
||||
id: 'neckToArm',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.sectionBottomLeft,
|
||||
to: points.sectionMidLeft,
|
||||
x: points.armTopLeft.x - sa - 10,
|
||||
id: 'sectionHeight',
|
||||
})
|
||||
if (partNumber == 1) {
|
||||
macro('hd', {
|
||||
from: points.skirtBottomLeft,
|
||||
to: points.skirtBottomRight,
|
||||
y: points.skirtBottomRight.y,
|
||||
from: points.tentacleLeft,
|
||||
to: points.tentacleRight,
|
||||
y: points.tentacleRight.y,
|
||||
id: 'tentacleWidth',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.finSeam,
|
||||
to: points.sectionTop,
|
||||
y: points.sectionTop.y,
|
||||
id: 'finWidth',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.finSeam,
|
||||
to: points.finSection,
|
||||
y: points.finSection.y,
|
||||
id: 'finToHead',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.finFold,
|
||||
to: points.finSection,
|
||||
y: points.finFold.y,
|
||||
id: 'foldToHead',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.skirtBottomRight,
|
||||
to: points.armTopRight,
|
||||
x: points.skirtBottomRight.x + sa + 30,
|
||||
})
|
||||
}
|
||||
if (options.type == 'squid') {
|
||||
macro('vd', {
|
||||
from: points.armTopLeft,
|
||||
to: points.sectionBottomLeft,
|
||||
x: points.armTopLeft.x - sa - 10,
|
||||
from: points.armBottom,
|
||||
to: points.tentacleLeft,
|
||||
x: points.tentacleLeft.x - sa - 10,
|
||||
id: 'tentacleHeight',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.sectionBottomLeft,
|
||||
to: points.sectionMidLeft,
|
||||
x: points.armTopLeft.x - sa - 10,
|
||||
from: points.finSeam,
|
||||
to: points.sectionTop,
|
||||
x: points.finSeam.x - sa,
|
||||
id: 'finHeight',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.finFold,
|
||||
to: points.sectionTop,
|
||||
x: points.finSeam.x - sa - 10,
|
||||
id: 'finFoldHeight',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.finSection,
|
||||
to: points.sectionTop,
|
||||
x: points.finSeam.x - sa - 20,
|
||||
id: 'finToHeadHeight',
|
||||
})
|
||||
if (partNumber == 1) {
|
||||
macro('hd', {
|
||||
from: points.tentacleLeft,
|
||||
to: points.tentacleRight,
|
||||
y: points.tentacleRight.y,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.finSeam,
|
||||
to: points.sectionTop,
|
||||
y: points.sectionTop.y,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.finSeam,
|
||||
to: points.finSection,
|
||||
y: points.finSection.y,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.finFold,
|
||||
to: points.finSection,
|
||||
y: points.finFold.y,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.armBottom,
|
||||
to: points.tentacleLeft,
|
||||
x: points.tentacleLeft.x - sa - 10,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.finSeam,
|
||||
to: points.sectionTop,
|
||||
x: points.finSeam.x - sa,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.finFold,
|
||||
to: points.sectionTop,
|
||||
x: points.finSeam.x - sa - 10,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.finSection,
|
||||
to: points.sectionTop,
|
||||
x: points.finSeam.x - sa - 20,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
return part
|
||||
|
@ -598,13 +607,45 @@ function octoplushyHeadSection(
|
|||
|
||||
const options = {
|
||||
sizeConstant: 200,
|
||||
size: { pct: 100, min: 5, max: 500, menu: 'style' },
|
||||
size: {
|
||||
pct: 100,
|
||||
min: 5,
|
||||
max: 500,
|
||||
menu: 'style',
|
||||
toAbs: (val, { options }, mergedOptions) =>
|
||||
((mergedOptions.sizeConstant * val * 2) / 3.1415) *
|
||||
(options.type === undefined
|
||||
? 1
|
||||
: options.type == 'octopus'
|
||||
? 1.7
|
||||
: options.type == 'squid'
|
||||
? 2
|
||||
: 1),
|
||||
},
|
||||
type: { dflt: 'octoplushy', list: ['octoplushy', 'octopus', 'squid'], menu: 'style' },
|
||||
armWidth: { pct: 15, min: 10, max: 30, menu: 'style' },
|
||||
armLength: { pct: 200, min: 100, max: 500, menu: 'style' },
|
||||
armLength: {
|
||||
pct: 200,
|
||||
min: 100,
|
||||
max: 500,
|
||||
menu: 'style',
|
||||
toAbs: (val, { options }, mergedOptions) =>
|
||||
((mergedOptions.sizeConstant *
|
||||
(options.size === undefined ? mergedOptions.size : options.size) *
|
||||
2) /
|
||||
3.1415) *
|
||||
val *
|
||||
(options.type === undefined
|
||||
? 1
|
||||
: options.type == 'octopus'
|
||||
? 2
|
||||
: options.type == 'squid'
|
||||
? 1.8
|
||||
: 1),
|
||||
},
|
||||
neckWidth: { pct: 25, min: 25, max: 45, menu: 'style' },
|
||||
armTaper: { pct: 25, min: 0, max: 50, menu: 'style' },
|
||||
bottomTopArmRatio: { pct: 87, min: 75, max: 100, menu: 'style' },
|
||||
bottomTopArmRatio: { pct: 57, min: 25, max: 75, menu: 'style' },
|
||||
bottomArmReduction: {
|
||||
pct: 90,
|
||||
min: 75,
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -16,6 +16,14 @@
|
|||
"t": "Back vent",
|
||||
"d": "Add a vent in the back of the skirt."
|
||||
},
|
||||
"backVentNo": {
|
||||
"t": "No vent in the back",
|
||||
"d": "This will be the challenging way to walk."
|
||||
},
|
||||
"backVentYes": {
|
||||
"t": "A vent in the back",
|
||||
"d": "Making it easier to walk."
|
||||
},
|
||||
"backVentLength": {
|
||||
"t": "Back vent length",
|
||||
"d": "Length of the Back Vent as a percentage of the skirt length."
|
||||
|
@ -24,6 +32,14 @@
|
|||
"t": "Curved darts",
|
||||
"d": "Whether or not to used curved darts."
|
||||
},
|
||||
"curvedDartsNo": {
|
||||
"t": "Straight darts",
|
||||
"d": "The darts will be straight, for the standard look."
|
||||
},
|
||||
"curvedDartsYes": {
|
||||
"t": "Curved darts",
|
||||
"d": "The darts will be curved, making the shape in the back and front more round."
|
||||
},
|
||||
"dartToSideSeamFactor": {
|
||||
"t": "Dart to side seam factor",
|
||||
"d": "Percentage of how much of the hip to waist reduction has to be taken in by the darts versus the side seam."
|
||||
|
@ -52,13 +68,25 @@
|
|||
"t": "Seat ease",
|
||||
"d": "Amount of ease at the seat level."
|
||||
},
|
||||
"waistBand": {
|
||||
"t": "Waist band",
|
||||
"waistband": {
|
||||
"t": "Waistband",
|
||||
"d": "Add a waistband to the pattern."
|
||||
},
|
||||
"waistBandWidth": {
|
||||
"t": "Waist band width",
|
||||
"d": "The width of the waist band."
|
||||
"waistbandNo": {
|
||||
"t": "No waistband",
|
||||
"d": "Just the skirt, nothing else."
|
||||
},
|
||||
"waistbandYes": {
|
||||
"t": "Skirt with a waistband",
|
||||
"d": "Add a waistband."
|
||||
},
|
||||
"waistbandOverlap": {
|
||||
"t": "Waistband overlap",
|
||||
"d": "How much the waistband should overlap at the front."
|
||||
},
|
||||
"waistbandWidth": {
|
||||
"t": "Waistband width",
|
||||
"d": "The width of the waistband."
|
||||
},
|
||||
"waistEase": {
|
||||
"t": "Waist ease",
|
||||
|
@ -67,6 +95,14 @@
|
|||
"zipperLocation": {
|
||||
"t": "Zipper location",
|
||||
"d": "The location of the zipper."
|
||||
},
|
||||
"zipperLocation.backSeam": {
|
||||
"t": "Add the zipper to the back seam",
|
||||
"d": "Good option with the back vent."
|
||||
},
|
||||
"zipperLocation.sideSeam": {
|
||||
"t": "Add the zipper to the side seam",
|
||||
"d": "Allows you to cut the back on fold, removing the seam from the back."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -1,59 +1,59 @@
|
|||
import { measurements, optionalMeasurements, options, BuildMainShape } from './shape.mjs'
|
||||
|
||||
function penelopeBack(params) {
|
||||
const {
|
||||
options,
|
||||
measurements,
|
||||
Path,
|
||||
points,
|
||||
paths,
|
||||
Snippet,
|
||||
snippets,
|
||||
store,
|
||||
complete,
|
||||
sa,
|
||||
paperless,
|
||||
macro,
|
||||
part,
|
||||
} = params
|
||||
export const back = {
|
||||
name: 'penelope.back',
|
||||
measurements,
|
||||
optionalMeasurements,
|
||||
options,
|
||||
draft: (params) => {
|
||||
const {
|
||||
options,
|
||||
measurements,
|
||||
Path,
|
||||
points,
|
||||
paths,
|
||||
Snippet,
|
||||
snippets,
|
||||
store,
|
||||
sa,
|
||||
macro,
|
||||
part,
|
||||
} = params
|
||||
|
||||
BuildMainShape(params, false)
|
||||
BuildMainShape(params, false)
|
||||
|
||||
if (options.backVent == true) {
|
||||
// I don't care what you're trying to create, the vent will not go higher than your hips.
|
||||
let backVentLength = Math.min(
|
||||
store.get('skirtLength') - measurements.waistToHips,
|
||||
options.backVentLength * store.get('skirtLength')
|
||||
)
|
||||
if (options.backVent == true) {
|
||||
const backVentLength = Math.min(
|
||||
store.get('skirtLength') - measurements.waistToHips,
|
||||
options.backVentLength * store.get('skirtLength')
|
||||
)
|
||||
|
||||
points.vLeg = points.rLeg.shiftFractionTowards(points.lLeg, 1 + options.backVentWidth)
|
||||
points.vHem = points.rHem.shiftFractionTowards(points.lHem, 1 + options.backVentWidth)
|
||||
points.vTop = points.vLeg.shift(90, backVentLength)
|
||||
points.lVent = points.vTop
|
||||
.shift(0, points.lLeg.dx(points.rLeg) * options.backVentWidth)
|
||||
.shift(90, points.lLeg.dx(points.rLeg) * options.backVentWidth)
|
||||
points.vLeg = points.rLeg.shiftFractionTowards(points.lLeg, 1 + options.backVentWidth)
|
||||
points.vHem = points.rHem.shiftFractionTowards(points.lHem, 1 + options.backVentWidth)
|
||||
points.vTop = points.vLeg.shift(90, backVentLength)
|
||||
points.lVent = points.vTop
|
||||
.shift(0, points.lLeg.dx(points.rLeg) * options.backVentWidth)
|
||||
.shift(90, points.lLeg.dx(points.rLeg) * options.backVentWidth)
|
||||
|
||||
paths.vent = new Path()
|
||||
.move(points.lVent)
|
||||
.line(points.vTop)
|
||||
.line(points.vLeg)
|
||||
.line(points.vHem)
|
||||
.hide()
|
||||
paths.vent = new Path()
|
||||
.move(points.lVent)
|
||||
.line(points.vTop)
|
||||
.line(points.vLeg)
|
||||
.line(points.vHem)
|
||||
.hide()
|
||||
|
||||
paths.leftSide = new Path().move(points.lWaist).line(points.lVent).join(paths.vent).hide()
|
||||
paths.leftSide = new Path().move(points.lWaist).line(points.lVent).join(paths.vent).hide()
|
||||
|
||||
paths.hem = paths.hem.line(points.vLeg)
|
||||
}
|
||||
paths.hem = paths.hem.line(points.vLeg)
|
||||
}
|
||||
|
||||
paths.seam = paths.leftSide
|
||||
.clone()
|
||||
.join(paths.bottom)
|
||||
.join(paths.sideSeam)
|
||||
.join(paths.waist)
|
||||
.attr('class', 'fabric')
|
||||
paths.seam = paths.leftSide
|
||||
.clone()
|
||||
.join(paths.bottom)
|
||||
.join(paths.sideSeam)
|
||||
.join(paths.waist)
|
||||
.attr('class', 'fabric')
|
||||
|
||||
// Complete?
|
||||
if (complete) {
|
||||
macro('grainline', {
|
||||
from: points.grainlineTop,
|
||||
to: points.grainlineBottom,
|
||||
|
@ -61,12 +61,16 @@ function penelopeBack(params) {
|
|||
|
||||
snippets.logo = new Snippet('logo', points.logoAnchor)
|
||||
|
||||
store.cutlist.addCut({
|
||||
cut: options.backVent == false && options.zipperLocation != 'backSeam' ? 1 : 2,
|
||||
from: 'fabric',
|
||||
})
|
||||
|
||||
if (options.backVent == false && options.zipperLocation != 'backSeam') {
|
||||
macro('cutonfold', {
|
||||
from: points.lWaist,
|
||||
to: points.lLeg,
|
||||
margin: 5,
|
||||
offset: 10,
|
||||
id: 'back',
|
||||
})
|
||||
}
|
||||
macro('title', {
|
||||
|
@ -94,47 +98,58 @@ function penelopeBack(params) {
|
|||
.attr('class', 'fabric sa')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (paperless) {
|
||||
if (options.backVent) {
|
||||
macro('hd', {
|
||||
from: points.vHem,
|
||||
to: points.rHem,
|
||||
y: points.rHem.y - options.paperlessOffset - sa,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.vTop,
|
||||
to: points.lVent,
|
||||
y: points.vTop.y,
|
||||
id: 'ventWidth',
|
||||
noStartMarker: true,
|
||||
noEndMarker: true,
|
||||
})
|
||||
|
||||
macro('vd', {
|
||||
from: points.lSeat,
|
||||
to: points.lVent,
|
||||
x: points.lWaist.x - options.paperlessOffset - sa,
|
||||
id: 'seatToVent',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.lVent,
|
||||
to: points.vTop,
|
||||
x: points.lVent.x,
|
||||
id: 'ventDiagonalHeight',
|
||||
noStartMarker: true,
|
||||
noEndMarker: true,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.vLeg,
|
||||
to: points.rLeg,
|
||||
y: points.rHem.y + sa + options.paperlessOffset,
|
||||
id: 'legWidth',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.vHem,
|
||||
to: points.rHem,
|
||||
y: points.rHem.y + sa + options.paperlessOffset * 2,
|
||||
id: 'hemWidth',
|
||||
})
|
||||
} else {
|
||||
macro('hd', {
|
||||
from: points.lLeg,
|
||||
to: points.rLeg,
|
||||
y: points.rHem.y + sa + options.paperlessOffset,
|
||||
id: 'legWidth',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.lHem,
|
||||
to: points.rHem,
|
||||
y: points.rHem.y - options.paperlessOffset - sa,
|
||||
y: points.rHem.y + sa + options.paperlessOffset * 2,
|
||||
id: 'hemWidth',
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
return part
|
||||
}
|
||||
|
||||
export const back = {
|
||||
name: 'penelope.back',
|
||||
measurements,
|
||||
optionalMeasurements,
|
||||
options,
|
||||
draft: penelopeBack,
|
||||
return part
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,25 +1,26 @@
|
|||
import { measurements, optionalMeasurements, options, BuildMainShape } from './shape.mjs'
|
||||
|
||||
function penelopeFront(params) {
|
||||
const { options, Path, points, paths, Snippet, snippets, complete, sa, paperless, macro, part } =
|
||||
params
|
||||
export const front = {
|
||||
name: 'penelope.front',
|
||||
measurements,
|
||||
optionalMeasurements,
|
||||
options,
|
||||
draft: (params) => {
|
||||
const { options, Path, points, paths, Snippet, snippets, sa, macro, store, part } = params
|
||||
|
||||
BuildMainShape(params, true)
|
||||
BuildMainShape(params, true)
|
||||
|
||||
paths.seam = paths.leftSide
|
||||
.clone()
|
||||
.join(paths.bottom)
|
||||
.join(paths.sideSeam)
|
||||
.join(paths.waist)
|
||||
.attr('class', 'fabric')
|
||||
paths.seam = paths.leftSide
|
||||
.clone()
|
||||
.join(paths.bottom)
|
||||
.join(paths.sideSeam)
|
||||
.join(paths.waist)
|
||||
.attr('class', 'fabric')
|
||||
|
||||
// Complete?
|
||||
if (complete) {
|
||||
macro('cutonfold', {
|
||||
from: points.lWaist,
|
||||
to: points.lLeg,
|
||||
margin: 5,
|
||||
offset: 10,
|
||||
id: 'front',
|
||||
})
|
||||
macro('title', {
|
||||
nr: 1,
|
||||
|
@ -36,6 +37,8 @@ function penelopeFront(params) {
|
|||
|
||||
snippets.logo = new Snippet('logo', points.logoAnchor)
|
||||
|
||||
store.cutlist.addCut({ cut: 1, from: 'fabric' })
|
||||
|
||||
if (sa) {
|
||||
paths.sa = new Path()
|
||||
.move(points.lHem)
|
||||
|
@ -44,22 +47,19 @@ function penelopeFront(params) {
|
|||
.attr('class', 'fabric sa')
|
||||
}
|
||||
|
||||
if (paperless) {
|
||||
macro('hd', {
|
||||
from: points.lHem,
|
||||
to: points.rHem,
|
||||
y: points.rHem.y - options.paperlessOffset,
|
||||
})
|
||||
}
|
||||
}
|
||||
macro('hd', {
|
||||
from: points.lLeg,
|
||||
to: points.rLeg,
|
||||
y: points.rHem.y + sa + options.paperlessOffset,
|
||||
id: 'legWidth',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.lHem,
|
||||
to: points.rHem,
|
||||
y: points.rHem.y + sa + options.paperlessOffset * 2,
|
||||
id: 'hemWidth',
|
||||
})
|
||||
|
||||
return part
|
||||
}
|
||||
|
||||
export const front = {
|
||||
name: 'penelope.front',
|
||||
measurements,
|
||||
optionalMeasurements,
|
||||
options,
|
||||
draft: penelopeFront,
|
||||
return part
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { pctBasedOn } from '@freesewing/core'
|
||||
import { addDartToCurve, dartCalc } from './utils.mjs'
|
||||
|
||||
export const measurements = ['waist', 'seat', 'waistToHips', 'waistToSeat', 'waistToKnee']
|
||||
|
@ -23,32 +24,53 @@ export const options = {
|
|||
curvedDartTopControlOffset: 0.2,
|
||||
curvedDartBottomControlOffset: 0.4,
|
||||
curvedDarts: { bool: true, menu: 'style' },
|
||||
lengthBonus: { pct: 0, min: -50, max: 50, menu: 'style' },
|
||||
hemBonus: { pct: 0, min: -35, max: 0, menu: 'style' },
|
||||
hem: { pct: 2, min: 0, max: 5, menu: 'style' },
|
||||
lengthBonus: { pct: 0, min: -50, max: 50, ...pctBasedOn('waistToKnee'), menu: 'style' },
|
||||
hemBonus: { pct: 0, min: -35, max: 0, ...pctBasedOn('seat'), menu: 'style' },
|
||||
hem: { pct: 2, min: 0, max: 5, ...pctBasedOn('waistToKnee'), menu: 'style' },
|
||||
backVent: { bool: true, menu: 'style' },
|
||||
backVentLength: { pct: 40, min: 5, max: 70, menu: 'style' },
|
||||
backVentLength: {
|
||||
pct: 40,
|
||||
min: 5,
|
||||
max: 70,
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
toAbs: (value, { measurements, options }, mergedOptions) =>
|
||||
value * (measurements.waistToKnee * (1 + options.lengthBonus)),
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
menu: (settings, mergedOptions) => (settings?.options?.backVent === false ? false : 'style'),
|
||||
},
|
||||
zipperLocation: { dflt: 'backSeam', list: ['backSeam', 'sideSeam'], menu: 'style' },
|
||||
nrOfDarts: { count: 2, min: 1, max: 2, menu: 'style' },
|
||||
seatEase: { pct: 1, min: 0, max: 8, menu: 'fit' },
|
||||
waistEase,
|
||||
backDartDepthFactor: { pct: 50, min: 35, max: 70, menu: 'advanced' },
|
||||
frontDartDepthFactor: { pct: 45, min: 30, max: 65, menu: 'advanced' },
|
||||
seatEase: { pct: 1, min: 0, max: 8, ...pctBasedOn('seat'), menu: 'fit' },
|
||||
waistEase: { pct: 1, min: 0, max: 8, ...pctBasedOn('waist'), menu: 'fit' },
|
||||
backDartDepthFactor: {
|
||||
pct: 50,
|
||||
min: 35,
|
||||
max: 70,
|
||||
...pctBasedOn('waistToSeat'),
|
||||
menu: 'advanced',
|
||||
},
|
||||
frontDartDepthFactor: {
|
||||
pct: 45,
|
||||
min: 30,
|
||||
max: 65,
|
||||
...pctBasedOn('waistToSeat'),
|
||||
menu: 'advanced',
|
||||
},
|
||||
dartToSideSeamFactor: { pct: 50, min: 30, max: 70, menu: 'advanced' },
|
||||
}
|
||||
|
||||
export function BuildMainShape(
|
||||
{ sa, options, measurements, Point, Path, points, paths, store, paperless, macro, part, log },
|
||||
{ sa, options, measurements, Point, Path, points, paths, store, macro, part, log },
|
||||
frontPart
|
||||
) {
|
||||
let skirtLength = measurements.waistToKnee * (1 + options.lengthBonus) // + options.hem;
|
||||
const skirtLength = measurements.waistToKnee * (1 + options.lengthBonus) // + options.hem;
|
||||
|
||||
store.set('skirtLength', skirtLength)
|
||||
store.set('waistEase', measurements.waist * options.waistEase)
|
||||
store.set('seatEase', measurements.seat * options.seatEase)
|
||||
store.set('hem', measurements.waistToKnee * options.hem)
|
||||
|
||||
let dartDepthFactor = frontPart ? options.frontDartDepthFactor : options.backDartDepthFactor
|
||||
const dartDepthFactor = frontPart ? options.frontDartDepthFactor : options.backDartDepthFactor
|
||||
|
||||
let waist = measurements.waist
|
||||
let seat = measurements.seat > waist ? measurements.seat : waist
|
||||
|
@ -85,7 +107,7 @@ export function BuildMainShape(
|
|||
seat += store.get('seatEase')
|
||||
waist += store.get('waistEase')
|
||||
|
||||
let sideSeam = seat / 4 //+ sideSeamShift
|
||||
const sideSeam = seat / 4 //+ sideSeamShift
|
||||
|
||||
points.lWaist = new Point(0, 0)
|
||||
points.lLeg = new Point(0, skirtLength)
|
||||
|
@ -246,12 +268,14 @@ export function BuildMainShape(
|
|||
// Create the inverse of the curve from the leg to the waist
|
||||
// Then split it at the hem level
|
||||
points.lHem = points.lLeg.shift(270, store.get('hem'))
|
||||
let rInverseSeat = points.rSeat.shift(270, (points.rLeg.y - points.rSeat.y) * 2)
|
||||
let rInverseSeatCP = rInverseSeat.shift(90, points.rSeatCPdown.y - points.rSeat.y)
|
||||
let rInversePath = new Path().move(rInverseSeat).curve(rInverseSeatCP, points.rLeg, points.rLeg)
|
||||
const rInverseSeat = points.rSeat.shift(270, (points.rLeg.y - points.rSeat.y) * 2)
|
||||
const rInverseSeatCP = rInverseSeat.shift(90, points.rSeatCPdown.y - points.rSeat.y)
|
||||
const rInversePath = new Path()
|
||||
.move(rInverseSeat)
|
||||
.curve(rInverseSeatCP, points.rLeg, points.rLeg)
|
||||
points.rHem = rInversePath.intersectsY(points.lHem.y)[0]
|
||||
|
||||
let sideSeamHemPath = rInversePath.split(points.rHem)[1]
|
||||
const sideSeamHemPath = rInversePath.split(points.rHem)[1]
|
||||
|
||||
sideSeamPath = sideSeamHemPath.join(sideSeamPath)
|
||||
|
||||
|
@ -270,114 +294,144 @@ export function BuildMainShape(
|
|||
|
||||
points.titleAnchor = new Point(measurements.waist / 6, measurements.waistToSeat)
|
||||
points.logoAnchor = points.titleAnchor.shift(270, 75)
|
||||
points.gridAnchor = points.logoAnchor.clone()
|
||||
|
||||
points.grainlineTop = points.lWaist.shift(0, 50).shift(270, 50)
|
||||
points.grainlineBottom = points.lLeg.shift(0, 50).shift(90, 50)
|
||||
|
||||
if (paperless) {
|
||||
macro('hd', {
|
||||
from: points.lSeat,
|
||||
to: points.rSeat,
|
||||
y: points.rSeat.y,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.lSeat,
|
||||
to: points.rSeat,
|
||||
y: points.rSeat.y,
|
||||
id: 'seatWidth',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.lWaist,
|
||||
to: points.rWaist,
|
||||
x: points.rWaist.x + options.paperlessOffset + sa,
|
||||
id: 'sideWaistHeight',
|
||||
noStartMarker: true,
|
||||
noEndMarker: true,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.lWaist,
|
||||
to: points.lLeg,
|
||||
x: points.lLeg.x + options.paperlessOffset + sa,
|
||||
id: 'heightToHem',
|
||||
})
|
||||
if (store.get('hem') > 0) {
|
||||
macro('vd', {
|
||||
from: points.lWaist,
|
||||
to: points.rWaist,
|
||||
x: points.rWaist.x + options.paperlessOffset + sa,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.lWaist,
|
||||
to: points.lLeg,
|
||||
from: points.lLeg,
|
||||
to: points.lHem,
|
||||
x: points.lLeg.x + options.paperlessOffset + sa,
|
||||
id: 'heightHem',
|
||||
noStartMarker: true,
|
||||
noEndMarker: true,
|
||||
})
|
||||
if (store.get('hem') > 0) {
|
||||
macro('vd', {
|
||||
from: points.lLeg,
|
||||
to: points.lHem,
|
||||
x: points.lLeg.x + options.paperlessOffset + sa,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
if (store.get('nrOfDarts') > 0) {
|
||||
if (store.get('nrOfDarts') > 0) {
|
||||
macro('hd', {
|
||||
from: points.lWaist,
|
||||
to: points.dart1Middle,
|
||||
y: points.dart1Middle.y,
|
||||
id: 'dart1Middle',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.lWaist,
|
||||
to: points.dart1Start,
|
||||
y: points.dart1Start.y - options.paperlessOffset - sa,
|
||||
id: 'middleToDart1',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.dart1Start,
|
||||
to: points.dart1End,
|
||||
y: points.dart1End.y - options.paperlessOffset - sa,
|
||||
id: 'widthDart1',
|
||||
noStartMarker: true,
|
||||
noEndMarker: true,
|
||||
})
|
||||
if (store.get('nrOfDarts') > 1) {
|
||||
macro('hd', {
|
||||
from: points.lWaist,
|
||||
to: points.dart1Middle,
|
||||
y: points.dart1Middle.y,
|
||||
to: points.dart2Middle,
|
||||
y: points.dart2Middle.y,
|
||||
id: 'middleToDart2',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.lWaist,
|
||||
to: points.dart1Start,
|
||||
y: points.dart1Start.y - options.paperlessOffset - sa,
|
||||
from: points.dart1End,
|
||||
to: points.dart2Start,
|
||||
y: points.dart2Start.y - options.paperlessOffset - sa,
|
||||
id: 'dart1toDart2',
|
||||
noStartMarker: true,
|
||||
noEndMarker: true,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.dart1Start,
|
||||
to: points.dart1End,
|
||||
y: points.dart1End.y - options.paperlessOffset - sa,
|
||||
from: points.dart2Start,
|
||||
to: points.dart2End,
|
||||
y: points.dart2End.y - options.paperlessOffset - sa,
|
||||
id: 'widthDart2',
|
||||
noStartMarker: true,
|
||||
noEndMarker: true,
|
||||
})
|
||||
if (store.get('nrOfDarts') > 1) {
|
||||
macro('hd', {
|
||||
from: points.lWaist,
|
||||
to: points.dart2Middle,
|
||||
y: points.dart2Middle.y,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.dart1End,
|
||||
to: points.dart2Start,
|
||||
y: points.dart2Start.y - options.paperlessOffset - sa,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.dart2Start,
|
||||
to: points.dart2End,
|
||||
y: points.dart2End.y - options.paperlessOffset - sa,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.dart2End,
|
||||
to: points.rWaist,
|
||||
y: points.rWaist.y - options.paperlessOffset - sa,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.lWaist,
|
||||
to: points.dart2Middle,
|
||||
x: points.lWaist.x - options.paperlessOffset - sa,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.dart2Middle,
|
||||
to: points.dart1Middle,
|
||||
x: points.lWaist.x - options.paperlessOffset - sa,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.dart1Middle,
|
||||
to: points.lSeat,
|
||||
x: points.lWaist.x - options.paperlessOffset - sa,
|
||||
})
|
||||
} else {
|
||||
macro('vd', {
|
||||
from: points.lWaist,
|
||||
to: points.dart1Middle,
|
||||
x: points.lWaist.x - options.paperlessOffset - sa,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.dart1End,
|
||||
to: points.rWaist,
|
||||
y: points.rWaist.y - options.paperlessOffset - sa,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.dart1Middle,
|
||||
to: points.lSeat,
|
||||
x: points.lWaist.x - options.paperlessOffset - sa,
|
||||
})
|
||||
}
|
||||
} else {
|
||||
macro('hd', {
|
||||
from: points.lWaist,
|
||||
from: points.dart2End,
|
||||
to: points.rWaist,
|
||||
y: points.rWaist.y - options.paperlessOffset - sa,
|
||||
id: 'dart2toSide',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.lWaist,
|
||||
to: points.dart2Middle,
|
||||
x: points.lWaist.x - options.paperlessOffset - sa,
|
||||
id: 'heightDart2',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.dart2Middle,
|
||||
to: points.dart1Middle,
|
||||
x: points.lWaist.x - options.paperlessOffset - sa,
|
||||
id: 'heightDart1toDart2',
|
||||
noStartMarker: true,
|
||||
noEndMarker: true,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.dart1Middle,
|
||||
to: points.lSeat,
|
||||
x: points.lWaist.x - options.paperlessOffset - sa,
|
||||
id: 'dart1ToSeat',
|
||||
})
|
||||
} else {
|
||||
macro('vd', {
|
||||
from: points.lWaist,
|
||||
to: points.dart1Middle,
|
||||
x: points.lWaist.x - options.paperlessOffset - sa,
|
||||
id: 'heightDart1',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.dart1End,
|
||||
to: points.rWaist,
|
||||
y: points.rWaist.y - options.paperlessOffset - sa,
|
||||
id: 'dart1toSide',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.dart1Middle,
|
||||
to: points.lSeat,
|
||||
x: points.lWaist.x - options.paperlessOffset - sa,
|
||||
id: 'dart1toSeat',
|
||||
})
|
||||
}
|
||||
} else {
|
||||
macro('hd', {
|
||||
from: points.lWaist,
|
||||
to: points.rWaist,
|
||||
y: points.rWaist.y - options.paperlessOffset - sa,
|
||||
id: 'waistWidth',
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.lWaist,
|
||||
to: points.lSeat,
|
||||
x: points.lWaist.x - options.paperlessOffset - sa,
|
||||
id: 'waistToSeat',
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ function dartCalcBack(options, seatWaistDiff, waist, nrOfDarts) {
|
|||
function dartCalc(store, options, seat, seatEase, waist, waistEase) {
|
||||
seat += seatEase
|
||||
waist += waistEase
|
||||
let seatWaistDiff = Math.max(seat - waist, 0)
|
||||
const seatWaistDiff = Math.max(seat - waist, 0)
|
||||
|
||||
let nrOfDarts = options.nrOfDarts
|
||||
|
||||
|
@ -81,41 +81,41 @@ function addDartToCurve(part, curvePath, distance, dartSize, dartDepth) {
|
|||
if (curvePath.length() - distance < dartSize) {
|
||||
distance = curvePath.length() - dartSize / 1.95
|
||||
}
|
||||
let dartMiddle = curvePath.shiftAlong(distance)
|
||||
let curvePaths = curvePath.split(dartMiddle)
|
||||
const dartMiddle = curvePath.shiftAlong(distance)
|
||||
const curvePaths = curvePath.split(dartMiddle)
|
||||
|
||||
if (curvePaths[0].length() < dartSize / 2 || curvePaths[1].length() < dartSize / 2) {
|
||||
// Curve too small to fit dart!
|
||||
return null
|
||||
}
|
||||
let dartLeft = curvePaths[0].reverse().shiftAlong(dartSize / 2)
|
||||
let dartRight = curvePaths[1].shiftAlong(dartSize / 2)
|
||||
const dartLeft = curvePaths[0].reverse().shiftAlong(dartSize / 2)
|
||||
const dartRight = curvePaths[1].shiftAlong(dartSize / 2)
|
||||
|
||||
let distanceFactor = 0.0015
|
||||
let leftCPdistance = Math.min(
|
||||
const distanceFactor = 0.0015
|
||||
const leftCPdistance = Math.min(
|
||||
curvePaths[0].length() * distanceFactor,
|
||||
curvePaths[0].ops[1].to.dist(curvePaths[0].ops[1].cp2)
|
||||
)
|
||||
let rightCPdistance = Math.min(
|
||||
const rightCPdistance = Math.min(
|
||||
curvePaths[1].length() * distanceFactor,
|
||||
curvePaths[1].ops[0].to.dist(curvePaths[1].ops[1].cp1)
|
||||
)
|
||||
|
||||
let dartBottom = dartMiddle.shift(dartLeft.angle(dartRight) - 90, dartDepth)
|
||||
const dartBottom = dartMiddle.shift(dartLeft.angle(dartRight) - 90, dartDepth)
|
||||
|
||||
let leftDartCP = dartLeft.shift(dartLeft.angle(dartBottom) - 90, leftCPdistance)
|
||||
let rightDartCP = dartRight.shift(dartRight.angle(dartBottom) + 90, rightCPdistance)
|
||||
const leftDartCP = dartLeft.shift(dartLeft.angle(dartBottom) - 90, leftCPdistance)
|
||||
const rightDartCP = dartRight.shift(dartRight.angle(dartBottom) + 90, rightCPdistance)
|
||||
|
||||
let curveLeftOfDart = new part.Path()
|
||||
const curveLeftOfDart = new part.Path()
|
||||
.move(curvePaths[0].ops[0].to)
|
||||
.curve(curvePaths[0].ops[1].cp1, leftDartCP, dartLeft)
|
||||
.hide()
|
||||
let curveRightOfDart = new part.Path()
|
||||
const curveRightOfDart = new part.Path()
|
||||
.move(dartRight)
|
||||
.curve(rightDartCP, curvePaths[1].ops[1].cp2, curvePaths[1].ops[1].to)
|
||||
.hide()
|
||||
|
||||
let dart
|
||||
let dart = null
|
||||
if (options.curvedDarts) {
|
||||
if (
|
||||
dartBottom.angle(dartLeft) - dartBottom.angle(dartRight) <
|
||||
|
@ -123,17 +123,17 @@ function addDartToCurve(part, curvePath, distance, dartSize, dartDepth) {
|
|||
) {
|
||||
dart = new part.Path().move(dartLeft).line(dartBottom).line(dartRight).hide()
|
||||
} else {
|
||||
let dartBottomCp2 = dartBottom
|
||||
const dartBottomCp2 = dartBottom
|
||||
.shiftFractionTowards(dartMiddle, options.curvedDartBottomControlOffset)
|
||||
.rotate(options.curvedDartControlAngle, dartBottom)
|
||||
let dartBottomCp1 = dartBottom
|
||||
const dartBottomCp1 = dartBottom
|
||||
.shiftFractionTowards(dartMiddle, options.curvedDartBottomControlOffset)
|
||||
.rotate(360 - options.curvedDartControlAngle, dartBottom)
|
||||
let dartLeftCp1 = dartLeft.shiftFractionTowards(
|
||||
const dartLeftCp1 = dartLeft.shiftFractionTowards(
|
||||
dartBottom,
|
||||
options.curvedDartTopControlOffset
|
||||
)
|
||||
let dartRightCp2 = dartRight.shiftFractionTowards(
|
||||
const dartRightCp2 = dartRight.shiftFractionTowards(
|
||||
dartBottom,
|
||||
options.curvedDartTopControlOffset
|
||||
)
|
||||
|
@ -148,7 +148,7 @@ function addDartToCurve(part, curvePath, distance, dartSize, dartDepth) {
|
|||
dart = new part.Path().move(dartLeft).line(dartBottom).line(dartRight).hide()
|
||||
}
|
||||
|
||||
let curveWithDart = {
|
||||
const curveWithDart = {
|
||||
left: curveLeftOfDart,
|
||||
dart: dart,
|
||||
right: curveRightOfDart,
|
||||
|
|
|
@ -1,56 +1,106 @@
|
|||
import { waistEase } from './shape.mjs'
|
||||
import { pctBasedOn } from '@freesewing/core'
|
||||
import { options } from './shape.mjs'
|
||||
|
||||
function penelopeWaistband({
|
||||
options,
|
||||
measurements,
|
||||
Point,
|
||||
Path,
|
||||
points,
|
||||
paths,
|
||||
Snippet,
|
||||
snippets,
|
||||
complete,
|
||||
sa,
|
||||
paperless,
|
||||
macro,
|
||||
store,
|
||||
part,
|
||||
}) {
|
||||
if (!options.waistBand) return part.hide()
|
||||
const { waistEase } = options
|
||||
|
||||
let waist = measurements.waist
|
||||
waist += measurements.waist * options.waistEase
|
||||
store.set('waistBandWidth', options.waistBandWidth * measurements.waistToKnee)
|
||||
export const waistband = {
|
||||
name: 'penelope.waistband',
|
||||
measurements: ['waist', 'waistToKnee'],
|
||||
options: {
|
||||
waistEase,
|
||||
waistband: { bool: true, menu: 'style' },
|
||||
waistbandWidth: {
|
||||
pct: 10,
|
||||
min: 5,
|
||||
max: 20,
|
||||
...pctBasedOn('waistToKnee'),
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
menu: (settings, mergedOptions) => (settings?.options?.waistband === false ? false : 'style'),
|
||||
},
|
||||
waistbandOverlap: {
|
||||
pct: 3.5,
|
||||
min: 0,
|
||||
max: 10,
|
||||
...pctBasedOn('waist'),
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
menu: (settings, mergedOptions) => (settings?.options?.waistband === false ? false : 'style'),
|
||||
},
|
||||
},
|
||||
draft: ({
|
||||
options,
|
||||
measurements,
|
||||
Point,
|
||||
Path,
|
||||
points,
|
||||
paths,
|
||||
Snippet,
|
||||
snippets,
|
||||
sa,
|
||||
macro,
|
||||
store,
|
||||
expand,
|
||||
units,
|
||||
part,
|
||||
}) => {
|
||||
if (!options.waistband) return part.hide()
|
||||
|
||||
points.TL = new Point(0, 0)
|
||||
points.BL = new Point(0, waist / 2 + options.waistBandOverlap)
|
||||
points.TR = new Point(store.get('waistBandWidth'), 0)
|
||||
points.BR = new Point(store.get('waistBandWidth'), waist / 2 + options.waistBandOverlap)
|
||||
let waist = measurements.waist
|
||||
waist += measurements.waist * options.waistEase
|
||||
const waistbandWidth = options.waistbandWidth * measurements.waistToKnee
|
||||
const waistbandLength = waist / 2 + measurements.waist * options.waistbandOverlap
|
||||
store.set('waistbandWidth', waistbandWidth)
|
||||
|
||||
points.titleAnchor = new Point(store.get('waistBandWidth') / 2, waist / 6)
|
||||
points.logoAnchor = new Point(store.get('waistBandWidth') / 2, waist / 3)
|
||||
if (!expand) {
|
||||
// Expand is on, do not draw the part but flag this to the user
|
||||
store.flag.note({
|
||||
msg: `penelope:cutWaistband`,
|
||||
replace: {
|
||||
width: units(waistbandLength),
|
||||
length: units(waistbandWidth),
|
||||
},
|
||||
suggest: {
|
||||
text: 'flag:show',
|
||||
icon: 'expand',
|
||||
update: {
|
||||
settings: ['expand', 1],
|
||||
},
|
||||
},
|
||||
})
|
||||
// Also hint about expand
|
||||
store.flag.preset('expand')
|
||||
|
||||
paths.outline = new Path()
|
||||
.move(points.TL)
|
||||
.line(points.BL)
|
||||
.line(points.BR)
|
||||
.line(points.TR)
|
||||
.line(points.TL)
|
||||
.close()
|
||||
.attr('class', 'fabric')
|
||||
return part.hide()
|
||||
}
|
||||
|
||||
points.TL = new Point(0, 0)
|
||||
points.BL = new Point(0, waist / 2 + options.waistbandOverlap)
|
||||
points.TR = new Point(waistbandWidth, 0)
|
||||
points.BR = new Point(waistbandWidth, waist / 2 + options.waistbandOverlap)
|
||||
|
||||
points.titleAnchor = new Point(waistbandWidth / 2, waist / 6)
|
||||
points.logoAnchor = new Point(waistbandWidth / 2, waist / 3)
|
||||
points.gridAnchor = points.logoAnchor.clone()
|
||||
|
||||
paths.outline = new Path()
|
||||
.move(points.TL)
|
||||
.line(points.BL)
|
||||
.line(points.BR)
|
||||
.line(points.TR)
|
||||
.line(points.TL)
|
||||
.close()
|
||||
.attr('class', 'fabric')
|
||||
|
||||
// Complete?
|
||||
if (complete) {
|
||||
macro('cutonfold', {
|
||||
from: points.TR,
|
||||
to: points.TL,
|
||||
margin: 15,
|
||||
offset: 15,
|
||||
grainline: true,
|
||||
reverse: true,
|
||||
})
|
||||
|
||||
snippets.logo = new Snippet('logo', points.logoAnchor)
|
||||
|
||||
store.cutlist.addCut({ cut: 1, from: 'fabric' })
|
||||
|
||||
macro('title', {
|
||||
nr: 3,
|
||||
at: points.titleAnchor,
|
||||
|
@ -66,32 +116,20 @@ function penelopeWaistband({
|
|||
.line(points.TR)
|
||||
.attr('class', 'fabric sa')
|
||||
}
|
||||
}
|
||||
|
||||
if (paperless) {
|
||||
macro('vd', {
|
||||
from: points.TL,
|
||||
to: points.BL,
|
||||
x: points.TL.x + options.paperlessOffset,
|
||||
id: 'height',
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.BL,
|
||||
to: points.BR,
|
||||
y: points.BR.y - options.paperlessOffset,
|
||||
id: 'width',
|
||||
})
|
||||
}
|
||||
|
||||
return part
|
||||
}
|
||||
|
||||
export const waistband = {
|
||||
name: 'penelope.waistband',
|
||||
measurements: ['waist', 'waistToKnee'],
|
||||
options: {
|
||||
waistEase,
|
||||
waistBandOverlap: 25,
|
||||
waistBand: { bool: true, menu: 'style' },
|
||||
waistBandWidth: { pct: 10, min: 5, max: 20, menu: 'style' },
|
||||
return part
|
||||
},
|
||||
draft: penelopeWaistband,
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/models": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-timing": "3.0.0-alpha.10"
|
||||
},
|
||||
|
|
11
markdown/org/docs/designs/penelope/options/curveddarts/en.md
Normal file
11
markdown/org/docs/designs/penelope/options/curveddarts/en.md
Normal file
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
title: "Curved darts"
|
||||
---
|
||||
|
||||
The darts can be straight, or curved. Straight darts is what you see in most
|
||||
pencil skirt patterns. Curved darts shape the top of the skirt slightly, hopefully
|
||||
giving a better fit.
|
||||
|
||||
## Effect of this option on the pattern
|
||||
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
title: "Waist band overlap"
|
||||
---
|
||||
|
||||
The width of the overlap by the zipper. This is normally used to hide snaps, buttons, or hooks that
|
||||
reinforce the zipper at the waistband.
|
||||
|
||||
## Effect of this option on the pattern
|
||||
|
||||
|
|
@ -63,11 +63,11 @@
|
|||
"lodash.clonedeep": "^4.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "8.48.0",
|
||||
"eslint": "8.50.0",
|
||||
"nyc": "15.1.0",
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"sinon": "^15.0.1"
|
||||
"chai": "4.3.9",
|
||||
"sinon": "^16.0.0"
|
||||
},
|
||||
"files": [
|
||||
"dist/*",
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"@freesewing/plugin-annotations": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-mirror": "3.0.0-alpha.10",
|
||||
"@freesewing/plugin-round": "3.0.0-alpha.10",
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7"
|
||||
"chai": "4.3.9"
|
||||
},
|
||||
"files": [
|
||||
"dist/*",
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7"
|
||||
"chai": "4.3.9"
|
||||
},
|
||||
"files": [
|
||||
"dist/*",
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7"
|
||||
"chai": "4.3.9"
|
||||
},
|
||||
"files": [
|
||||
"dist/*",
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7"
|
||||
"chai": "4.3.9"
|
||||
},
|
||||
"files": [
|
||||
"dist/*",
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7"
|
||||
"chai": "4.3.9"
|
||||
},
|
||||
"files": [
|
||||
"dist/*",
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7"
|
||||
"chai": "4.3.9"
|
||||
},
|
||||
"files": [
|
||||
"dist/*",
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7"
|
||||
"chai": "4.3.9"
|
||||
},
|
||||
"files": [
|
||||
"dist/*",
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7"
|
||||
"chai": "4.3.9"
|
||||
},
|
||||
"files": [
|
||||
"dist/*",
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7"
|
||||
"chai": "4.3.9"
|
||||
},
|
||||
"files": [
|
||||
"dist/*",
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7"
|
||||
"chai": "4.3.9"
|
||||
},
|
||||
"files": [
|
||||
"dist/*",
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7"
|
||||
"chai": "4.3.9"
|
||||
},
|
||||
"files": [
|
||||
"dist/*",
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7"
|
||||
"chai": "4.3.9"
|
||||
},
|
||||
"files": [
|
||||
"dist/*",
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "10.2.0",
|
||||
"chai": "4.3.7"
|
||||
"chai": "4.3.9"
|
||||
},
|
||||
"files": [
|
||||
"dist/*",
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
"swagger-ui-express": "5.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"chai": "4.3.7",
|
||||
"chai": "4.3.9",
|
||||
"chai-http": "4.4.0",
|
||||
"esbuild": "0.19.2",
|
||||
"mocha": "10.2.0",
|
||||
|
|
|
@ -80,10 +80,10 @@ export const DesignInfo = ({ design, docs = false }) => {
|
|||
|
||||
// Translate measurements
|
||||
const measies = { required: {}, optional: {} }
|
||||
if (config.measurements) {
|
||||
if (config?.measurements) {
|
||||
for (const m of config.measurements) measies.required[m] = t(`measurements:${m}`)
|
||||
}
|
||||
if (config.optionalMeasurements) {
|
||||
if (config?.optionalMeasurements) {
|
||||
for (const m of config.optionalMeasurements) measies.optional[m] = t(`measurements:${m}`)
|
||||
}
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue