From e367f31836329618fee6ae902461203ec7034516 Mon Sep 17 00:00:00 2001 From: Wouter van Wageningen Date: Fri, 7 Apr 2023 23:54:05 +0000 Subject: [PATCH 01/27] Add code files --- config/software/designs.json | 7 + designs/skully/CHANGELOG.md | 9 + designs/skully/README.md | 297 +++++++++++++++++++++++++++ designs/skully/build.mjs | 35 ++++ designs/skully/data.mjs | 4 + designs/skully/package.json | 69 +++++++ designs/skully/src/box.mjs | 70 +++++++ designs/skully/src/cheek.mjs | 203 ++++++++++++++++++ designs/skully/src/cheekbone.mjs | 90 ++++++++ designs/skully/src/eye.mjs | 239 +++++++++++++++++++++ designs/skully/src/forehead.mjs | 169 +++++++++++++++ designs/skully/src/head1.mjs | 117 +++++++++++ designs/skully/src/head2.mjs | 166 +++++++++++++++ designs/skully/src/head3.mjs | 154 ++++++++++++++ designs/skully/src/index.mjs | 53 +++++ designs/skully/src/jawfloor.mjs | 147 +++++++++++++ designs/skully/src/lowerjaw.mjs | 164 +++++++++++++++ designs/skully/src/lowermouth.mjs | 0 designs/skully/src/nose.mjs | 143 +++++++++++++ designs/skully/src/part12.mjs | 165 +++++++++++++++ designs/skully/src/pointsUtil.mjs | 52 +++++ designs/skully/src/uppermouth.mjs | 112 ++++++++++ designs/skully/tests/shared.test.mjs | 16 ++ 23 files changed, 2481 insertions(+) create mode 100644 designs/skully/CHANGELOG.md create mode 100644 designs/skully/README.md create mode 100644 designs/skully/build.mjs create mode 100644 designs/skully/data.mjs create mode 100644 designs/skully/package.json create mode 100644 designs/skully/src/box.mjs create mode 100644 designs/skully/src/cheek.mjs create mode 100644 designs/skully/src/cheekbone.mjs create mode 100644 designs/skully/src/eye.mjs create mode 100644 designs/skully/src/forehead.mjs create mode 100644 designs/skully/src/head1.mjs create mode 100644 designs/skully/src/head2.mjs create mode 100644 designs/skully/src/head3.mjs create mode 100644 designs/skully/src/index.mjs create mode 100644 designs/skully/src/jawfloor.mjs create mode 100644 designs/skully/src/lowerjaw.mjs create mode 100644 designs/skully/src/lowermouth.mjs create mode 100644 designs/skully/src/nose.mjs create mode 100644 designs/skully/src/part12.mjs create mode 100644 designs/skully/src/pointsUtil.mjs create mode 100644 designs/skully/src/uppermouth.mjs create mode 100644 designs/skully/tests/shared.test.mjs diff --git a/config/software/designs.json b/config/software/designs.json index 1188fd8936a..84f6690c4be 100644 --- a/config/software/designs.json +++ b/config/software/designs.json @@ -77,6 +77,13 @@ "difficulty": 4, "tags": ["accessories", "toys"] }, + "skully": { + "description": "A FreeSewing pattern that needs a description", + "code": "Coder name", + "design": "Designer name", + "difficulty": 1, + "tags": ["tagname"] + }, "trayvon": { "description": "A FreeSewing pattern for a tie", "code": "Joost De Cock", diff --git a/designs/skully/CHANGELOG.md b/designs/skully/CHANGELOG.md new file mode 100644 index 00000000000..4dfcc7b22f6 --- /dev/null +++ b/designs/skully/CHANGELOG.md @@ -0,0 +1,9 @@ +# Change log for: @freesewing/skully + + + +This is the **initial release**, and the start of this change log. + +> Prior to version 2, FreeSewing was not a JavaScript project. +> As such, that history is out of scope for this change log. + diff --git a/designs/skully/README.md b/designs/skully/README.md new file mode 100644 index 00000000000..cd3ab3f7a37 --- /dev/null +++ b/designs/skully/README.md @@ -0,0 +1,297 @@ +![FreeSewing](https://static.freesewing.org/banner.png) +

@freesewing/skully on NPM + License: MIT + Code quality on DeepScan + Open issues tagged pkg:skully + All Contributors +

Follow @freesewing_org on Twitter + Chat with us on Discord + Become a FreeSewing Patron + Follow @freesewing_org on Twitter +

+ +# @freesewing/skully + +A FreeSewing pattern that needs a description + + + + +> #### Note: Version 3 is a work in progress +> +> We are working on a new major version (v3) but it is not ready for prime-time. +> For production use, please refer to our v2 packages (the `latest` on NPM) +> or [the `v2` branch in our monorepo](https://github.com/freesewing/freesewing/tree/v2). +> +> We the `main` branch and `next` packages on NPM holds v3 code. But it's alpha for now. + +## What am I looking at? πŸ€” + +This repository is our *monorepo* holding all our NPM designs, plugins, other NPM packages, and (web)sites. + +This folder holds: @freesewing/skully + +If you're not entirely sure what to do or how to start, type this command: + +``` +npm run tips +``` + +> If you don't want to set up a dev environment, you can run it in your browser: +> +> [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/freesewing/freesewing) +> +> We recommend that you fork our repository and then +> put `gitpod.io/# to start up a browser-based dev environment of your own. + +## About FreeSewing πŸ’€ + +Where the world of makers and developers collide, that's where you'll find FreeSewing. + +If you're a maker, checkout [freesewing.org](https://freesewing.org/) where you can generate +our sewing patterns adapted to your measurements. + +If you're a developer, our documentation is on [freesewing.dev](https://freesewing.dev/). +Our [core library](https://freesewing.dev/reference/api/) is a *batteries-included* toolbox +for parametric design of sewing patterns. But we also provide a range +of [plugins](https://freesewing.dev/reference/plugins/) that further extend the +functionality of the platform. + +If you have NodeJS installed, you can try it right now by running: + +```bash +npx create-freesewing-pattern +``` + +Or, consult our getting started guides +for [Linux](https://freesewing.dev/tutorials/getting-started-linux/), +[MacOS](https://freesewing.dev/tutorials/getting-started-mac/), +or [Windows](https://freesewing.dev/tutorials/getting-started-windows/). + +We also have a [pattern design tutorial](https://freesewing.dev/tutorials/pattern-design/) that +walks you through your first parametric design, +and [a friendly community](https://freesewing.org/community/where/) with +people who can help you when you get stuck. + +## Support FreeSewing: Become a patron πŸ₯° + +FreeSewing is an open source project run by a community, +and financially supported by our patrons. + +If you feel what we do is worthwhile, and you can spend a few coind without +hardship, then you should [join us and become a patron](https://freesewing.org/community/join). + +## Links πŸ‘©β€πŸ’» + + - πŸ’» Makers website: [freesewing.org](https://freesewing.org) + - πŸ’» Developers website: [freesewing.dev](https://freesewing.dev) + - πŸ’¬ Chat: On Discord via [discord.freesewing.org](https://discord.freesewing.org/) + - βœ… Todo list/Kanban board: On Github via [todo.freesewing.org](https://todo.freesewing.org/) + - 🐦 Twitter: [@freesewing_org](https://twitter.com/freesewing_org) + - πŸ“· Instagram: [@freesewing_org](https://instagram.com/freesewing_org) + +## License: MIT πŸ€“ + +Β© [Joost De Cock](https://github.com/joostdecock). +See [the license file](https://github.com/freesewing/freesewing/blob/develop/LICENSE) for details. + +## Where to get help 🀯 + +Our [chatrooms on Discord](https://chat.freesewing.org/) are the best place to ask questions, +share your feedback, or just hang out. + +If you want to report a problem, please [create an issue](https://github.com/freesewing/freesewing/issues/new). + + + +## Contributors ✨ + +Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Adam Tomkins
Adam Tomkins

πŸ“–
Alexandre Ignjatovic
Alexandre Ignjatovic

πŸ’»
AlfaLyr
AlfaLyr

πŸ’» πŸ”Œ 🎨
Andrew James
Andrew James

πŸ“–
Anneke
Anneke

πŸ“– 🌍
Annie Kao
Annie Kao

πŸ“–
Anternative
Anternative

πŸ“–
Anthony
Anthony

πŸ’¬
Ari Grayzel-student
Ari Grayzel-student

πŸ’»
Bart
Bart

πŸ“–
BenJamesBen
BenJamesBen

πŸ’» πŸ“– πŸ›
Cameron Dubas
Cameron Dubas

πŸ“–
Carsten Biebricher
Carsten Biebricher

πŸ“–
Cathy Zoller
Cathy Zoller

πŸ“–
Chantal Lapointe
Chantal Lapointe

🌍
Damien PIQUET
Damien PIQUET

πŸ’»
Darigov Research
Darigov Research

πŸ“– πŸ€”
David Clegg
David Clegg

🎨 πŸ’»
Elena FdR
Elena FdR

πŸ“– πŸ“
Emmanuel Nyachoke
Emmanuel Nyachoke

πŸ’» πŸ“–
Enoch Riese
Enoch Riese

πŸ’»
EvEkSwed
EvEkSwed

🌍
Fantastik-Maman
Fantastik-Maman

🌍
Forrest O.
Forrest O.

πŸ“–
FrΓ©dΓ©ric
FrΓ©dΓ©ric

🌍
Glenn Matthews
Glenn Matthews

πŸ“–
Greg Sadetsky
Greg Sadetsky

πŸ“–
Igor Couto
Igor Couto

πŸ›
Ikko Ashimine
Ikko Ashimine

πŸ“–
Irapeke
Irapeke

🌍
Jacek Sawoszczuk
Jacek Sawoszczuk

πŸ“–
Jason Williams
Jason Williams

πŸ“–
Jeremy Jackson
Jeremy Jackson

πŸ’»
Jeroen Hoek
Jeroen Hoek

πŸ“–
Joe Schofield
Joe Schofield

πŸ“–
Joebidido
Joebidido

🌍
Joost De Cock
Joost De Cock

🚧
Josh Essman
Josh Essman

πŸ“–
Kake
Kake

πŸ“–
Kapunahele Wong
Kapunahele Wong

πŸ“–
Karen
Karen

πŸ“– πŸ“‹
Katie McGinley
Katie McGinley

πŸ“–
Kieran Klaassen
Kieran Klaassen

πŸ’»
Kittycatou
Kittycatou

🌍
Kris
Kris

πŸ“–
Kristin Ruben
Kristin Ruben

πŸ’»
Loudepeuter
Loudepeuter

🌍
Lucian
Lucian

πŸ“‹
MA-TATAS
MA-TATAS

πŸ“–
Marcus
Marcus

🌍
Martin Tribo
Martin Tribo

πŸ“–
Nadege Michel
Nadege Michel

⚠️ πŸ“–
Natalia
Natalia

πŸ’» 🎨 πŸ“
Nathan Yergler
Nathan Yergler

πŸ“–
Nick Dower
Nick Dower

πŸ“– πŸ’» πŸ›
Nikhil Chelliah
Nikhil Chelliah

πŸ“–
OysteinHoiby
OysteinHoiby

πŸ’»
Patrick Forringer
Patrick Forringer

πŸ”Œ
Paul
Paul

πŸ“– πŸ“ 🌍
Phillip Thelen
Phillip Thelen

πŸ’»
Pixieish
Pixieish

πŸ“–
Prof. dr. Sorcha NΓ­ Dhubhghaill
Prof. dr. Sorcha NΓ­ Dhubhghaill

πŸ“–
Quentin FELIX
Quentin FELIX

πŸ’» 🎨
Rik Hekker
Rik Hekker

πŸ›
Sam Livingston-Gray
Sam Livingston-Gray

πŸ“–
Sanne
Sanne

πŸ’» πŸ“–
Sara Latorre
Sara Latorre

🌍
SeaZeeZee
SeaZeeZee

πŸ“– πŸ’»
SimonbJohnson
SimonbJohnson

πŸ›
SirCharlotte
SirCharlotte

🌍
Slylele
Slylele

πŸ“– 🌍
Soazillon
Soazillon

🌍
SoneaTheBest
SoneaTheBest

🌍
Stefan Sydow
Stefan Sydow

🌍 πŸ“– πŸ’»
TrΓ­ona
TrΓ­ona

πŸ“–
Unmutual
Unmutual

πŸ“–
Wouter van Wageningen
Wouter van Wageningen

πŸ’» 🎨 πŸ”§
amysews
amysews

πŸ“–
anna-puk
anna-puk

πŸ’»
beautifulsummermoon
beautifulsummermoon

🌍
berce
berce

πŸ“–
biou
biou

πŸ’»
bobgeorgethe3rd
bobgeorgethe3rd

πŸ’» πŸ“– 🎨
brmlyklr
brmlyklr

πŸ“–
chri5b
chri5b

πŸ’» ⚠️
dingcycle
dingcycle

🌍
drowned-in-books
drowned-in-books

πŸ’¬
econo202
econo202

πŸ“–
ericamattos
ericamattos

🌍
fightingrabbit
fightingrabbit

πŸ’»
gaylyndie
gaylyndie

πŸ“–
grimlokason
grimlokason

πŸ’»
hellgy
hellgy

🎨
jackseye
jackseye

πŸ“–
marckiesel
marckiesel

🌍
mergerg
mergerg

πŸ“–
mesil
mesil

πŸ›
starfetch
starfetch

πŸ’» πŸ“– 🌍 🎨
timorl
timorl

πŸ’»
ttimearl
ttimearl

πŸ–‹
tuesgloomsday
tuesgloomsday

πŸ“–
valadaptive
valadaptive

πŸ’»
viocky
viocky

🌍
woolishboy
woolishboy

πŸ’»
yc
yc

🌍
+ + + + + + +This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! + diff --git a/designs/skully/build.mjs b/designs/skully/build.mjs new file mode 100644 index 00000000000..99ace216bc8 --- /dev/null +++ b/designs/skully/build.mjs @@ -0,0 +1,35 @@ +/* This script will build the package with esbuild */ +import esbuild from 'esbuild' +import pkg from './package.json' assert { type: 'json' } + +// Create banner based on package info +const banner = `/** + * ${pkg.name} | v${pkg.version} + * ${pkg.description} + * (c) ${new Date().getFullYear()} ${pkg.author} + * @license ${pkg.license} + */` + +// Shared esbuild options +const options = { + banner: { js: banner }, + bundle: true, + entryPoints: ['src/index.mjs'], + format: 'esm', + outfile: 'dist/index.mjs', + external: ['@freesewing'], + metafile: process.env.VERBOSE ? true : false, + minify: process.env.NO_MINIFY ? false : true, + sourcemap: true, +} + +// Let esbuild generate the build +const build = async () => { + const result = await esbuild.build(options).catch(() => process.exit(1)) + + if (process.env.VERBOSE) { + const info = await esbuild.analyzeMetafile(result.metafile) + console.log(info) + } +} +build() diff --git a/designs/skully/data.mjs b/designs/skully/data.mjs new file mode 100644 index 00000000000..97c1c76603a --- /dev/null +++ b/designs/skully/data.mjs @@ -0,0 +1,4 @@ +// This file is auto-generated | All changes you make will be overwritten. +export const name = '@freesewing/skully' +export const version = '3.0.0-alpha.8' +export const data = { name, version } diff --git a/designs/skully/package.json b/designs/skully/package.json new file mode 100644 index 00000000000..e5e3ac2b456 --- /dev/null +++ b/designs/skully/package.json @@ -0,0 +1,69 @@ +{ + "name": "@freesewing/skully", + "version": "3.0.0-alpha.8", + "description": "A FreeSewing pattern that needs a description", + "author": "Joost De Cock (https://github.com/joostdecock)", + "homepage": "https://freesewing.org/", + "repository": "github:freesewing/freesewing", + "license": "MIT", + "bugs": { + "url": "https://github.com/freesewing/freesewing/issues" + }, + "funding": { + "type": "individual", + "url": "https://freesewing.org/patrons/join" + }, + "keywords": [ + "freesewing", + "design", + "diy", + "fashion", + "made to measure", + "parametric design", + "pattern", + "sewing", + "sewing pattern" + ], + "type": "module", + "module": "dist/index.mjs", + "exports": { + ".": "./dist/index.mjs" + }, + "scripts": { + "build": "node build.mjs", + "clean": "rimraf dist", + "mbuild": "NO_MINIFY=1 node build.mjs", + "symlink": "mkdir -p ./node_modules/@freesewing && cd ./node_modules/@freesewing && ln -s -f ../../../* . && cd -", + "test": "npx mocha tests/*.test.mjs", + "vbuild": "VERBOSE=1 node build.mjs", + "lab": "cd ../../sites/lab && yarn start", + "tips": "node ../../scripts/help.mjs", + "lint": "npx eslint 'src/**' 'tests/*.mjs'", + "prettier": "npx prettier --write 'src/*.mjs' 'tests/*.mjs'", + "testci": "npx mocha tests/*.test.mjs --reporter ../../tests/reporters/terse.js", + "cibuild_step5": "node build.mjs", + "wbuild": "node build.mjs", + "wcibuild_step5": "node build.mjs" + }, + "peerDependencies": { + "@freesewing/core": "3.0.0-alpha.8", + "@freesewing/plugin-bundle": "3.0.0-alpha.8" + }, + "dependencies": {}, + "devDependencies": { + "mocha": "10.0.0", + "chai": "4.2.0" + }, + "files": [ + "dist/*", + "README.md" + ], + "publishConfig": { + "access": "public", + "tag": "next" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=8" + } +} diff --git a/designs/skully/src/box.mjs b/designs/skully/src/box.mjs new file mode 100644 index 00000000000..b06ac5a6c20 --- /dev/null +++ b/designs/skully/src/box.mjs @@ -0,0 +1,70 @@ +import { pluginBundle } from '@freesewing/plugin-bundle' + +function draftBox({ + options, + Point, + Path, + points, + paths, + Snippet, + snippets, + complete, + sa, + paperless, + macro, + part, +}) { + const w = 500 * options.size + points.topLeft = new Point(0, 0) + points.topRight = new Point(w, 0) + points.bottomLeft = new Point(0, w / 2) + points.bottomRight = new Point(w, w / 2) + + paths.seam = new Path() + .move(points.topLeft) + .line(points.bottomLeft) + .line(points.bottomRight) + .line(points.topRight) + .line(points.topLeft) + .close() + .attr('class', 'fabric') + + // Complete? + if (complete) { + points.logo = points.topLeft.shiftFractionTowards(points.bottomRight, 0.5) + snippets.logo = new Snippet('logo', points.logo) + points.text = points.logo + .shift(-90, w / 8) + .attr('data-text', 'hello') + .attr('data-text-class', 'center') + + if (sa) { + paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') + } + } + + // Paperless? + if (paperless) { + macro('hd', { + from: points.bottomLeft, + to: points.bottomRight, + y: points.bottomLeft.y + sa + 15, + }) + macro('vd', { + from: points.bottomRight, + to: points.topRight, + x: points.topRight.x + sa + 15, + }) + } + + return part +} + +export const box = { + name: 'box', + options: { + size: { pct: 50, min: 10, max: 100, menu: 'fit' }, + }, + plugins: [pluginBundle], + draft: draftBox, +} diff --git a/designs/skully/src/cheek.mjs b/designs/skully/src/cheek.mjs new file mode 100644 index 00000000000..ba10b0c1128 --- /dev/null +++ b/designs/skully/src/cheek.mjs @@ -0,0 +1,203 @@ +import { pluginBundle } from '@freesewing/plugin-bundle' +import { convertPoints } from './pointsUtil.mjs' + +function draftCheek({ + options, + Point, + Path, + points, + paths, + Snippet, + snippets, + complete, + measurements, + sa, + store, + paperless, + macro, + part, +}) { + console.log('cheek') + const textAttribute = 'text-xs center' + + let sizeFactor = ((measurements?.head || 596) / 929.5) * options.size * 2 + store.set('sizeFactor', sizeFactor) + + points.point0 = new Point(0, 0) + points.point1 = points.point0.shift(254.78244159705943, 22.5254232590644 * sizeFactor) + points.point1Cp1 = points.point1.shift(321.2022157426192, 7.140882368447221 * sizeFactor) + points.point2 = points.point0.shift(260.1018837009255, 44.64105174612264 * sizeFactor) + points.point2Cp1 = points.point2.shift(243.25309471936828, 16.615062563830442 * sizeFactor) + points.point2Cp2 = points.point2.shift(322.6411575424251, 21.283352555459906 * sizeFactor) + points.point3 = points.point0.shift(261.38174456728586, 76.35866165668438 * sizeFactor) + points.point3Cp1 = points.point3.shift(333.3176703576494, 12.168666812761435 * sizeFactor) + points.point3Cp2 = points.point3.shift(85.91520774712568, 11.731692674119953 * sizeFactor) + points.point4 = points.point0.shift(299.45265842618784, 86.78060596475459 * sizeFactor) + points.point4Cp1 = points.point4.shift(84.35380802294482, 49.11521286943584 * sizeFactor) + points.point4Cp2 = points.point4.shift(184.39630340760462, 19.40463369919666 * sizeFactor) + points.point5 = points.point0.shift(342.8506386745285, 121.04758752176764 * sizeFactor) + points.point5Cp1 = points.point5.shift(137.52316754335672, 29.889370057597382 * sizeFactor) + points.point5Cp2 = points.point5.shift(196.75764739545923, 56.96390931984925 * sizeFactor) + points.point6 = points.point0.shift(1.1205493505415198, 54.26948752485138 * sizeFactor) + points.point6Cp2 = points.point6.shift(316.18924774003017, 44.726876316259826 * sizeFactor) + points.point7 = points.point0.shift(357.37806779049225, 43.287782602138435 * sizeFactor) + points.point7Cp1 = points.point7.shift(299.1399624138707, 19.59910745416729 * sizeFactor) + points.point8 = points.point0.shift(317.5381963475652, 36.1375990486363 * sizeFactor) + points.point8Cp1 = points.point8.shift(173.12090742697325, 12.479807891149623 * sizeFactor) + points.point8Cp2 = points.point8.shift(353.1201304168364, 15.075322060904695 * sizeFactor) + points.point9 = points.point0.shift(336.14503661026947, 8.388980629373263 * sizeFactor) + points.point9Cp2 = points.point9.shift(255.27121271777986, 18.645853640957277 * sizeFactor) + + points.point5a = new Path() + .move(points.point6) + .curve(points.point6Cp2, points.point5Cp1, points.point5) + .shiftAlong(65 * sizeFactor) + + var sp = new Path() + .move(points.point5) + .curve(points.point5Cp1, points.point6Cp2, points.point6) + .split(points.point5a) + + points.point5aCp1 = sp[1].ops[1].cp1.clone() + points.point6Cp2 = sp[1].ops[1].cp2.clone() + + points.point5 = points.point5.rotate(357, points.point0) + points.point5Cp2 = points.point5.shift(196.75764739545923, 56.96390931984925 * sizeFactor) + + paths.eyeBottom = new Path() + .move(points.point7) + .curve(points.point7Cp1, points.point8Cp2, points.point8) + .curve(points.point8Cp1, points.point9Cp2, points.point9) + .setText('eyeBottom' + ' (4)', textAttribute) + .addClass('hidden') + + paths.mouthTop = new Path() + .move(points.point3) + .curve(points.point3Cp1, points.point4Cp2, points.point4) + .setText('mouthTop' + ' (16)', textAttribute) + .addClass('hidden') + + paths.upperJaw = new Path() + .move(points.point4) + .curve(points.point4Cp1, points.point5Cp2, points.point5) + .setText('upperJaw' + ' (16)', textAttribute) + .addClass('hidden') + + paths.nose = new Path() + .move(points.point1) + .curve(points.point1Cp1, points.point2Cp2, points.point2) + .setText('nose (10)', textAttribute) + .addClass('hidden') + + store.set('templeToJaw', points.point5.dist(points.point5a)) + store.set('upperJaw', paths.upperJaw.length()) + + console.log({ sp: sp }) + console.log({ points: JSON.parse(JSON.stringify(points)) }) + + paths.seam1 = new Path() + .move(points.point9) + .line(points.point0) + .setText('1', textAttribute) + .addClass('hidden') + paths.seam2 = new Path() + .move(points.point6) + .line(points.point7) + .setText('2', textAttribute) + .addClass('hidden') + paths.seam5 = new Path() + .move(points.point5a) + .curve(points.point5aCp1, points.point6Cp2, points.point6) + .setText('5', textAttribute) + .addClass('hidden') + paths.seam7 = new Path() + .move(points.point0) + .line(points.point1) + .setText('7', textAttribute) + .addClass('hidden') + paths.seam8 = new Path() + .move(points.point2) + .curve(points.point2Cp1, points.point3Cp2, points.point3) + .setText('8', textAttribute) + .addClass('hidden') + + paths.seam = new Path() + .move(points.point0) + .join(paths.seam7) + .join(paths.nose) + .join(paths.seam8) + .join(paths.mouthTop) + .join(paths.upperJaw) + .line(points.point5a) + .join(paths.seam5) + .join(paths.seam2) + .join(paths.eyeBottom) + .join(paths.seam1) + .close() + // .attr('class', 'fabric') + + store.set('templeWidth', points.point6.dist(points.point7)) + store.set('noseBridgeWidth', points.point0.dist(points.point9)) + store.set('templeWidth', points.point6.dist(points.point7)) + store.set('mouthTop', paths.mouthTop.length()) + store.set('eyeBottom', paths.eyeBottom.length()) + store.set('noseSide', paths.nose.length()) + store.set('noseHeight', points.point1.dist(points.point2)) + + // console.log({ points: JSON.parse(JSON.stringify(points)) }) + // console.log({ paths: JSON.parse(JSON.stringify(paths)) }) + // convertPoints(points) + + // Complete? + if (complete) { + points.title = points.point4Cp2.shiftFractionTowards(points.point0, 0.3) + macro('title', { + nr: 1, + at: points.title, + scale: 0.5, + title: 'cheek', + }) + + snippets.n1 = new Snippet('notch', points.point9) + snippets.n2 = new Snippet('notch', points.point5) + snippets.n3 = new Snippet('notch', points.point5a) + snippets.n4 = new Snippet('notch', points.point1) + snippets.n5 = new Snippet('bnotch', points.point7) + snippets.n6 = new Snippet('bnotch', points.point2) + + points.logo = points.point7 + .shiftFractionTowards(points.point5, 0.5) + .shiftFractionTowards(points.point4, 0.25) + snippets.logo = new Snippet('logo', points.logo).attr('data-scale', 0.3) + + if (sa) { + paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') + } + } + + // Paperless? + if (paperless) { + // macro('hd', { + // from: points.bottomLeft, + // to: points.bottomRight, + // y: points.bottomLeft.y + sa + 15, + // }) + // macro('vd', { + // from: points.bottomRight, + // to: points.topRight, + // x: points.topRight.x + sa + 15, + // }) + } + + return part +} + +export const cheek = { + name: 'cheek', + options: { + size: { pct: 75, min: 10, max: 300, menu: 'fit' }, + }, + optionalMeasurements: ['head'], + plugins: [pluginBundle], + draft: draftCheek, +} diff --git a/designs/skully/src/cheekbone.mjs b/designs/skully/src/cheekbone.mjs new file mode 100644 index 00000000000..8b7a6ab01ba --- /dev/null +++ b/designs/skully/src/cheekbone.mjs @@ -0,0 +1,90 @@ +import { pluginBundle } from '@freesewing/plugin-bundle' +import { cheek } from './cheek.mjs' +import { convertPoints } from './pointsUtil.mjs' + +function draftCheekbone({ + options, + Point, + Path, + points, + paths, + Snippet, + snippets, + complete, + sa, + store, + paperless, + macro, + part, +}) { + console.log('cheekbone') + const textAttribute = 'text-xs center text-decoration="line-through"' + const sizeFactor = store.get('sizeFactor') + + points.point0 = new Point(0, 0) + points.point0Cp1 = points.point0.shift(26.9653561519379, 19.25431213546719 * sizeFactor) + points.point1 = points.point0.shift(23.857094414377794, 57.23972922717229 * sizeFactor) + points.point1Cp1 = points.point1.shift(135.7075072577942, 32.47486987518195 * sizeFactor) + points.point1Cp2 = points.point1.shift(180.82587279494425, 29.902106313769938 * sizeFactor) + + paths.seam5 = new Path() + .move(points.point1) + .curve_(points.point1Cp1, points.point0) + .setText('5', textAttribute) + .addClass('hidden') + paths.seam6 = new Path() + .move(points.point0) + .curve(points.point0Cp1, points.point1Cp2, points.point1) + .setText('6', textAttribute) + .attr('data-text-text-decoration', 'underline') + .addClass('hidden') + + paths.seam = new Path().move(points.point0).join(paths.seam6).join(paths.seam5).close() + + // Complete? + if (complete) { + points.title = points.point0 + .shiftFractionTowards(points.point1, 0.65) + .shiftFractionTowards(points.point1Cp2, 0.4) + macro('title', { + nr: 6, + at: points.title, + scale: 0.15, + rotation: 325, + title: 'cheekbone', + }) + // points.logo = points.topLeft.shiftFractionTowards(points.bottomRight, 0.5) + // snippets.logo = new Snippet('logo', points.logo) + // points.text = points.logo + // .shift(-90, w / 8) + // .attr('data-text', 'hello') + // .attr('data-text-class', 'center') + + if (sa) { + paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') + } + } + + // Paperless? + if (paperless) { + macro('hd', { + from: points.bottomLeft, + to: points.bottomRight, + y: points.bottomLeft.y + sa + 15, + }) + macro('vd', { + from: points.bottomRight, + to: points.topRight, + x: points.topRight.x + sa + 15, + }) + } + + return part +} + +export const cheekbone = { + name: 'cheekbone', + after: cheek, + plugins: [pluginBundle], + draft: draftCheekbone, +} diff --git a/designs/skully/src/eye.mjs b/designs/skully/src/eye.mjs new file mode 100644 index 00000000000..8f655db778c --- /dev/null +++ b/designs/skully/src/eye.mjs @@ -0,0 +1,239 @@ +import { pluginBundle } from '@freesewing/plugin-bundle' +import { cheek } from './cheek.mjs' +import { forehead } from './forehead.mjs' +import { convertPoints } from './pointsUtil.mjs' + +// const markers = ` +// +// +// +// +// +// +// +// +// +// ` + +// export const sewTogetherPlugin = { +// name: 'sewTogetherplugin', +// version: '0.01.01', +// hooks: { +// preRender: (svg) => { +// console.log({ preRender: svg }) +// if (svg.defs.indexOf(markers) === -1) svg.defs += markers +// }, +// }, +// macros: { +// sewTogether: function (so, { points, paths, Path, complete, scale, sa }) { +// if (so === false) { +// delete points.sewTogetherFrom +// delete points.sewTogetherTo +// delete points.cutonfoldVia1 +// delete points.cutonfoldVia2 +// delete paths.cutonfold +// // setCutOnFold relies on plugin-cutlist +// return true +// } +// so = { +// prefix: 'sewTogether', +// ...so, +// } +// if (complete) { +// if (null == so.middle) { +// so.middle = so.from.shiftFractionTowards(so.to, 0.5) +// } +// points[so.prefix + 'From'] = so.from +// points[so.prefix + 'Middle'] = so.middle +// points[so.prefix + 'To'] = so.to + +// points[so.prefix + 'FromCp'] = points[so.prefix + 'From'].shift( +// points[so.prefix + 'From'].angle(points[so.prefix + 'Middle']) + 90, +// points[so.prefix + 'From'].dist(points[so.prefix + 'Middle']) / 1.5 +// ) +// points[so.prefix + 'ToCp'] = points[so.prefix + 'To'].shift( +// points[so.prefix + 'To'].angle(points[so.prefix + 'Middle']) - 90, +// points[so.prefix + 'To'].dist(points[so.prefix + 'Middle']) / 1.5 +// ) + +// if (so.hinge) { +// points[so.prefix + 'Hinge'] = points[so.prefix + 'Middle'].shift( +// points[so.prefix + 'Middle'].angle(points[so.prefix + 'To']) + +// Math.abs( +// points[so.prefix + 'Middle'].angle(points[so.prefix + 'From']) - +// points[so.prefix + 'Middle'].angle(points[so.prefix + 'To']) +// ) / +// 2 + +// (sa ? 180 : 0), +// sa +// ? sa +// : Math.min( +// points[so.prefix + 'From'].dist(points[so.prefix + 'Middle']), +// points[so.prefix + 'From'].dist(points[so.prefix + 'Middle']) +// ) / 4 +// ) +// paths[so.prefix + 'SewTogetherHinge'] = new Path() +// .move(points[so.prefix + 'Middle']) +// .line(points[so.prefix + 'Hinge']) +// .attr('marker-start', 'url(#sewTogetherCross)') +// .attr('class', 'dotted note stroke-sm') +// } +// paths[so.prefix + 'SewTogether'] = new Path() +// .move(points[so.prefix + 'From']) +// .curve(points[so.prefix + 'FromCp'], points[so.prefix + 'ToCp'], points[so.prefix + 'To']) +// .attr('class', 'dotted note stroke-sm') +// .attr('marker-start', 'url(#sewTogetherStart)') +// .attr('marker-end', 'url(#sewTogetherEnd)') +// .attr('data-text', 'sewTogether') +// .attr('data-text-class', 'center fill-note text-xs') +// } +// }, +// }, +// } + +function draftEye({ + options, + Point, + Path, + points, + paths, + Snippet, + snippets, + complete, + sa, + store, + paperless, + macro, + part, + svg, +}) { + console.log('eye') + const textAttribute = 'text-xs center' + const sizeFactor = store.get('sizeFactor') + + var eyeCircumference = store.get('eyeBottom') + store.get('eyeTop') + var eyeDiameter = (eyeCircumference / Math.PI) * 2 + + const c = 0.55191502449351 + points.point0 = new Point(0, 0) + points.point2 = points.point0.shift(0, eyeDiameter / 2).shift(90, eyeDiameter / 2) + points.point0Cp1 = points.point0.shift(0, (eyeDiameter / 2) * c) + points.point2Cp2 = points.point2.shift(270, (eyeDiameter / 2) * c) + + let p = new Path().move(points.point0).curve(points.point0Cp1, points.point2Cp2, points.point2) + + points.point1 = p.shiftAlong(p.length() / 2) + + let sp = p.split(points.point1) + + points.p0 = sp[0].ops[0].to.clone() + points.p0Cp1 = sp[0].ops[1].cp1.clone() + points.p1Cp2 = sp[0].ops[1].cp2.clone() + points.p1 = sp[1].ops[0].to.clone() + points.p1Cp1 = sp[1].ops[1].cp1.clone() + points.p2Cp2 = sp[1].ops[1].cp2.clone() + points.p2 = sp[1].ops[1].to.clone() + + points.p0Cp1 = points.p0.shift(0, (eyeDiameter / 2) * c * 0.4) + points.p2Cp2 = points.p2.shift(270, (eyeDiameter / 2) * c * 0.4) + points.p1Cp1 = points.p1.shift(45, (eyeDiameter / 2) * c * 0.7) + points.p1Cp2 = points.p1.shift(225, (eyeDiameter / 2) * c * 0.7) + + points.p0Cp2 = points.p0Cp1.flipX() + points.p4 = points.p2.flipX() + points.p4Cp1 = points.p2Cp2.flipX() + points.p3 = points.p1.flipX() + points.p3Cp2 = points.p1Cp1.flipX() + points.p3Cp1 = points.p1Cp2.flipX() + + paths.eye = new Path() + .move(points.p4) + .curve(points.p4Cp1, points.p3Cp2, points.p3) + .curve(points.p3Cp1, points.p0Cp2, points.p0) + .curve(points.p0Cp1, points.p1Cp2, points.p1) + .curve(points.p1Cp1, points.p2Cp2, points.p2) + + points.pointNotch = paths.eye.shiftAlong(store.get('eyeTop')) + + let ps = paths.eye.split(points.pointNotch) + paths.eyeTop = ps[0].clone().setText('eyeTop' + ' (4)', textAttribute) + paths.eyeBottom = ps[1].clone().setText('eyeBottom' + ' (4)', textAttribute) + + paths.seam = new Path() + .move(points.p4) + .join(paths.eyeTop) + .join(paths.eyeBottom) + .line(points.p4) + .close() + + // Complete? + if (complete) { + points.title = points.p4 + .shiftFractionTowards(points.p1, 0.45) + .shiftFractionTowards(points.p0, 0.6) + + macro('title', { + nr: 9, + at: points.title, + scale: 0.3, + title: 'eye', + }) + + points.ps3a = points.p2.shiftFractionTowards(points.p4, 0.25) + points.ps3aCp1 = points.ps3a.shift(270, points.p4.dist(points.p2) / 6) + points.ps3 = points.p2.shiftFractionTowards(points.p4, 0.5) + points.ps3cross1 = points.ps3.shiftFractionTowards(points.p0, 0.1) + points.ps3cross2 = points.ps3.shiftFractionTowards(points.p0, -0.1) + points.ps3b = points.p2.shiftFractionTowards(points.p4, 0.75) + points.ps3bCp1 = points.ps3b.shift(270, points.p4.dist(points.p2) / 6) + + macro('sewtogether', { + from: points.ps3a, + to: points.ps3b, + hinge: true, + }) + + snippets.n1 = new Snippet('notch', points.p2) + snippets.n2 = new Snippet('notch', points.p4) + snippets.n3 = new Snippet('bnotch', points.pointNotch) + + // points.logo = points.topLeft.shiftFractionTowards(points.bottomRight, 0.5) + // snippets.logo = new Snippet('logo', points.logo) + // points.text = points.logo + // .shift(-90, w / 8) + // .attr('data-text', 'hello') + // .attr('data-text-class', 'center') + + if (sa) { + paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') + } + } + console.log({ points: JSON.parse(JSON.stringify(points)) }) + + console.log({ paths: JSON.parse(JSON.stringify(paths)) }) + + // Paperless? + if (paperless) { + macro('hd', { + from: points.bottomLeft, + to: points.bottomRight, + y: points.bottomLeft.y + sa + 15, + }) + macro('vd', { + from: points.bottomRight, + to: points.topRight, + x: points.topRight.x + sa + 15, + }) + } + + console.log({ pluginBundle: pluginBundle }) + return part +} + +export const eye = { + name: 'eye', + after: [cheek, forehead], + // plugins: [pluginBundle, sewTogetherPlugin], + plugins: [pluginBundle], + draft: draftEye, +} diff --git a/designs/skully/src/forehead.mjs b/designs/skully/src/forehead.mjs new file mode 100644 index 00000000000..fd1e0ed30dd --- /dev/null +++ b/designs/skully/src/forehead.mjs @@ -0,0 +1,169 @@ +import { pluginBundle } from '@freesewing/plugin-bundle' +import { cheek } from './cheek.mjs' +import { convertPoints } from './pointsUtil.mjs' + +function draftForehead({ + options, + Point, + Path, + points, + paths, + Snippet, + snippets, + complete, + sa, + store, + paperless, + macro, + part, +}) { + const textAttribute = 'text-xs center' + const sizeFactor = store.get('sizeFactor') + + points.point0 = new Point(0, 0) + points.point0Cp1 = points.point0.shift(241.92955090220636, 37.666339998598225 * sizeFactor) + points.point0Cp2 = points.point0.shift(333.9339465987448, 38.41308527689494 * sizeFactor) + points.point1 = points.point0.shift(255.81688050452775, 105.61426225557886 * sizeFactor) + points.point1Cp2 = points.point1.shift(122.25481630103288, 16.221492810466046 * sizeFactor) + points.point2 = points.point0.shift(260.36453213741225, 104.78002255825727 * sizeFactor) + points.point2Cp1 = points.point2.shift(104.52547665837686, 6.962227517109787 * sizeFactor) + points.point3 = points.point0.shift(266.83135324063875, 91.72676538115797 * sizeFactor) + points.point3Cp1 = points.point3.shift(10.824271939403667, 7.255955140434657 * sizeFactor) + points.point3Cp2 = points.point3.shift(190.82219510192064, 8.8744083082141 * sizeFactor) + points.point4 = points.point0.shift(279.23029819067256, 99.89481626481647 * sizeFactor) + points.point4Cp2 = points.point4.shift(109.3914373863736, 10.114793621226355 * sizeFactor) + points.point5 = points.point0.shift(285.6356187763194, 96.73748550220853 * sizeFactor) + points.point5Cp1 = points.point5.shift(322.25160644653687, 21.112881376069897 * sizeFactor) + points.point6 = points.point0.shift(299.0865415436474, 123.293691591622 * sizeFactor) + points.point6Cp1 = points.point6.shift(102.44153405115529, 30.07799330075059 * sizeFactor) + points.point6Cp2 = points.point6.shift(171.33241486296131, 9.49614011059247 * sizeFactor) + points.point7 = points.point0.shift(301.8945694309706, 53.41879968784397 * sizeFactor) + points.point7Cp1 = points.point7.shift(330.8064552671208, 26.14383661592154 * sizeFactor) + points.point7Cp2 = points.point7.shift(306.82890730505164, 20.883100248765764 * sizeFactor) + points.point8 = points.point0.shift(315.99934749521526, 121.10503287183268 * sizeFactor) + points.point8Cp2 = points.point8.shift(138.225501502238, 23.326308173390803 * sizeFactor) + points.point9 = points.point0.shift(325.07215199461336, 129.7747702101221 * sizeFactor) + points.point9Cp1 = points.point9.shift(126.07355572621562, 42.01723333347864 * sizeFactor) + + paths.firstSeam = new Path() + .move(points.point9) + .curve(points.point9Cp1, points.point0Cp2, points.point0) + .setText('20', textAttribute) + .addClass('hidden') + + store.set('firstSeam', paths.firstSeam.length()) + store.set( + 'templeTop', + new Path().move(points.point8).line(points.point9).length() + + new Path() + .move(points.point5) + .curve(points.point5Cp1, points.point6Cp2, points.point6) + .length() + ) + + paths.eyeTop = new Path() + .move(points.point2) + .curve(points.point2Cp1, points.point3Cp2, points.point3) + .curve(points.point3Cp1, points.point4Cp2, points.point4) + .setText('eyeTop' + ' (4)', textAttribute) + .addClass('hidden') + + paths.seam1 = new Path() + .move(points.point1) + .line(points.point2) + .setText('1', textAttribute) + .addClass('hidden') + + paths.seam2 = new Path() + .move(points.point4) + .line(points.point5) + .setText('2', textAttribute) + .addClass('hidden') + + paths.seam6a = new Path() + .move(points.point5) + .curve(points.point5Cp1, points.point6Cp2, points.point6) + .setText('6', textAttribute) + .attr('data-text-text-decoration', 'underline') + .addClass('hidden') + + paths.seam6b = new Path() + .move(points.point8) + .line(points.point9) + .setText('6', textAttribute) + .attr('data-text-text-decoration', 'underline') + .addClass('hidden') + + paths.seam7 = new Path() + .move(points.point0) + .curve(points.point0Cp1, points.point1Cp2, points.point1) + .setText('7', textAttribute) + .addClass('hidden') + + paths.seam = new Path() + .move(points.point0) + .join(paths.seam7) + .join(paths.seam1) + .join(paths.eyeTop) + .join(paths.seam2) + .join(paths.seam6a) + .line(points.point8) + .join(paths.seam6b) + .curve(points.point9Cp1, points.point0Cp2, points.point0) + .close() + + paths.dart = new Path() + .move(points.point6) + .curve(points.point6Cp1, points.point7Cp2, points.point7) + .curve(points.point7Cp1, points.point8Cp2, points.point8) + + store.set('eyeTop', paths.eyeTop.length()) + + // Complete? + if (complete) { + points.title = points.point3Cp1.shiftFractionTowards(points.point0, 0.3) + macro('title', { + nr: 2, + at: points.title, + scale: 0.5, + title: 'forehead', + }) + + snippets.n1 = new Snippet('notch', points.point2) + snippets.n2 = new Snippet('bnotch', points.point4) + + // points.logo = points.topLeft.shiftFractionTowards(points.bottomRight, 0.5) + // snippets.logo = new Snippet('logo', points.logo) + // points.text = points.logo + // .shift(-90, w / 8) + // .attr('data-text', 'hello') + // .attr('data-text-class', 'center') + + if (sa) { + paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') + } + } + + // Paperless? + if (paperless) { + // macro('hd', { + // from: points.bottomLeft, + // to: points.bottomRight, + // y: points.bottomLeft.y + sa + 15, + // }) + // macro('vd', { + // from: points.bottomRight, + // to: points.topRight, + // x: points.topRight.x + sa + 15, + // }) + } + + return part +} + +export const forehead = { + name: 'forehead', + after: cheek, + plugins: [pluginBundle], + draft: draftForehead, +} diff --git a/designs/skully/src/head1.mjs b/designs/skully/src/head1.mjs new file mode 100644 index 00000000000..2f7d502bb96 --- /dev/null +++ b/designs/skully/src/head1.mjs @@ -0,0 +1,117 @@ +import { pluginBundle } from '@freesewing/plugin-bundle' +import { convertPoints } from './pointsUtil.mjs' +import { cheek } from './cheek.mjs' +import { forehead } from './forehead.mjs' + +function draftHead1({ + options, + Point, + Path, + points, + paths, + Snippet, + snippets, + complete, + sa, + store, + paperless, + macro, + part, + utils, +}) { + console.log('head1') + const textAttribute = 'text-xs center' + const sizeFactor = store.get('sizeFactor') + + points.point0 = new Point(0, 0) + points.point0Cp2 = points.point0.shift(270.9766531413822, 42.41716221059584 * sizeFactor) + points.point2 = points.point0.shift(254.08224234639044, 161.93553876093907 * sizeFactor) + points.point2Cp2 = points.point2.shift(105.78717948197567, 54.27380801428633 * sizeFactor) + points.point2Cp1 = points.point2.shift(75.48077210575057, 107.97156739510459 * sizeFactor) + points.point1 = points.point0.shift(180, 72.005 * sizeFactor) + points.point1Cp1 = points.point1.shift(268.60871199245156, 55.97160080799901 * sizeFactor) + + points.point0 = points.point0.shift(270, 5) + points.point0Cp2 = points.point0.shift(270.9766531413822, 42.41716221059584 * sizeFactor) + + paths.firstSeam = new Path() + .move(points.point1) + .curve(points.point1Cp1, points.point2Cp2, points.point2) + .setText('20', textAttribute) + .addClass('hidden') + + points.fs1 = paths.firstSeam.shiftAlong(store.get('firstSeam')) + points.fs2 = paths.firstSeam.shiftAlong(store.get('firstSeam') + store.get('templeToJaw')) + + store.set( + 'upperJawToLowerJaw', + paths.firstSeam.length() - store.get('firstSeam') - store.get('templeToJaw') + ) + + paths.secondSeam = new Path() + .move(points.point2) + .curve(points.point2Cp1, points.point0Cp2, points.point0) + .setText('17', textAttribute) + .addClass('hidden') + + paths.top = new Path() + .move(points.point0) + .line(points.point1) + .setText('19', textAttribute) + .addClass('hidden') + + store.set('secondSeam', paths.secondSeam.length()) + + paths.seam = new Path() + .move(points.point0) + .join(paths.top) + .join(paths.firstSeam) + .join(paths.secondSeam) + .close() + + // Complete? + if (complete) { + points.title = points.point2.shiftFractionTowards(points.point1, 0.65).shift(0, 10 * sizeFactor) + macro('title', { + nr: 3, + at: points.title, + scale: 0.5, + title: 'head' + '1', + }) + // points.logo = points.topLeft.shiftFractionTowards(points.bottomRight, 0.5) + // snippets.logo = new Snippet('logo', points.logo) + // points.text = points.logo + // .shift(-90, w / 8) + // .attr('data-text', 'hello') + // .attr('data-text-class', 'center') + snippets.n1 = new Snippet('notch', points.fs1) + snippets.n2 = new Snippet('notch', points.fs2) + + if (sa) { + paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') + } + } + + // Paperless? + if (paperless) { + // macro('hd', { + // from: points.bottomLeft, + // to: points.bottomRight, + // y: points.bottomLeft.y + sa + 15, + // }) + macro('vd', { + from: points.point0, + to: points.point2, + x: points.point0.x + sa + 15, + }) + } + + return part +} + +export const head1 = { + name: 'head1', + after: [cheek, forehead], + plugins: [pluginBundle], + draft: draftHead1, +} diff --git a/designs/skully/src/head2.mjs b/designs/skully/src/head2.mjs new file mode 100644 index 00000000000..8131a747727 --- /dev/null +++ b/designs/skully/src/head2.mjs @@ -0,0 +1,166 @@ +import { pluginBundle } from '@freesewing/plugin-bundle' +import { convertPoints } from './pointsUtil.mjs' +import { cheek } from './cheek.mjs' +import { head1 } from './head1.mjs' + +function draftHead2({ + options, + Point, + Path, + points, + paths, + Snippet, + snippets, + complete, + sa, + store, + utils, + paperless, + macro, + part, +}) { + console.log('head2') + const textAttribute = 'text-xs center' + const sizeFactor = store.get('sizeFactor') + + points.point0 = new Point(0, 0) + points.point0Cp1 = points.point0.shift(269.3443191225503, 29.448928299685203 * sizeFactor) + points.point1 = points.point0.shift(257.7901473243395, 66.12988849226953 * sizeFactor) + points.point1Cp1 = points.point1.shift(268.2738211037443, 30.242724116719366 * sizeFactor) + points.point1Cp2 = points.point1.shift(88.2745252696326, 18.83053830882166 * sizeFactor) + points.point2 = points.point0.shift(272.3327760921532, 153.20596573567235 * sizeFactor) + points.point3 = points.point0.shift(282.5001868336755, 164.15422647315543 * sizeFactor) + points.point3Cp1 = points.point3.shift(81.44269285511335, 54.758598457228615 * sizeFactor) + points.point4 = points.point0.shift(340.927384878832, 52.16879559660159 * sizeFactor) + points.point4Cp2 = points.point4.shift(274.04106104609286, 50.57373626695976 * sizeFactor) + + let secondSeam = store.get('secondSeam') + + let iterations = 0 + var p + do { + iterations++ + + p = new Path() + .move(points.point0) + .curve(points.point0Cp1, points.point1Cp2, points.point1) + .curve_(points.point1Cp1, points.point2) + + if (secondSeam - p.length() > 0.1 || secondSeam - p.length() < -0.1) { + points.point0 = points.point0.shift(90, secondSeam - p.length()) + points.point1 = points.point1.shift(90, secondSeam - p.length()) + points.point0Cp1 = points.point0.shift(269.3443191225503, 29.448928299685203 * sizeFactor) + points.point1Cp1 = points.point1.shift(268.2738211037443, 30.242724116719366 * sizeFactor) + points.point1Cp2 = points.point1.shift(88.2745252696326, 18.83053830882166 * sizeFactor) + points.point0Cp2 = points.point0.shift(0, 15 * sizeFactor) + } + } while (iterations < 100 && (secondSeam - p.length() > 1 || secondSeam - p.length() < -1)) + + if (iterations >= 100) { + log.error('Something is not quite right here!') + } + console.log({ iterations: iterations }) + + points.dartPoint0 = new Path() + .move(points.point3) + .curve(points.point3Cp1, points.point4Cp2, points.point4) + .shiftAlong(99.23273836900117 * sizeFactor) + // points.dartPoint0Cp1 = points.dartPoint0.clone() + points.dartPoint1 = points.point0.shift(285.96197961706986, 65.4910471438654 * sizeFactor) + points.dartPoint1Cp1 = points.dartPoint1.shift( + 354.74216521134053, + 13.662486193954589 * sizeFactor + ) + points.dartPoint1Cp2 = points.dartPoint1.shift( + 356.55115250146685, + 13.680777207454268 * sizeFactor + ) + points.dartPoint2 = new Path() + .move(points.point3) + .curve(points.point3Cp1, points.point4Cp2, points.point4) + .shiftAlong(92.81578231343269 * sizeFactor) + + paths.secondSeam = new Path() + .move(points.point0) + ._curve(points.point1Cp2, points.point1) + .curve_(points.point1Cp1, points.point2) + .setText('17', textAttribute) + .addClass('hidden') + + paths.thirdSeam = new Path() + .move(points.point3) + .curve(points.point3Cp1, points.point4Cp2, points.point4) + .setText('18', textAttribute) + .addClass('hidden') + + paths.top = new Path() + .move(points.point4) + .curve(points.point4, points.point0Cp2, points.point0) + .setText('19', textAttribute) + .addClass('hidden') + + paths.bottom = new Path() + .move(points.point2) + .line(points.point3) + .setText('21', textAttribute) + .addClass('hidden') + + store.set('thirdSeam', paths.thirdSeam.length() - points.dartPoint0.dist(points.dartPoint2)) + store.set('head2width', points.point2.dist(points.point3)) + paths.dart = new Path() + .move(points.dartPoint0) + ._curve(points.dartPoint1Cp2, points.dartPoint1) + .curve_(points.dartPoint1Cp1, points.dartPoint2) + + paths.seam = new Path() + .move(points.point0) + .join(paths.secondSeam) + .join(paths.bottom) + .join(paths.thirdSeam) + .join(paths.top) + .close() + + // Complete? + if (complete) { + points.title = points.point0.shiftFractionTowards(points.point3, 0.25) + macro('title', { + nr: 4, + at: points.title, + scale: 0.5, + title: 'head' + '2', + }) + // points.logo = points.topLeft.shiftFractionTowards(points.bottomRight, 0.5) + // snippets.logo = new Snippet('logo', points.logo) + // points.text = points.logo + // .shift(-90, w / 8) + // .attr('data-text', 'hello') + // .attr('data-text-class', 'center') + + if (sa) { + paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') + } + } + + // Paperless? + if (paperless) { + macro('hd', { + from: points.bottomLeft, + to: points.bottomRight, + y: points.bottomLeft.y + sa + 15, + }) + macro('vd', { + from: points.bottomRight, + to: points.topRight, + x: points.topRight.x + sa + 15, + }) + } + + return part +} + +export const head2 = { + name: 'head2', + after: [cheek, head1], + plugins: [pluginBundle], + draft: draftHead2, +} diff --git a/designs/skully/src/head3.mjs b/designs/skully/src/head3.mjs new file mode 100644 index 00000000000..34b593a9b72 --- /dev/null +++ b/designs/skully/src/head3.mjs @@ -0,0 +1,154 @@ +import { pluginBundle } from '@freesewing/plugin-bundle' +import { convertPoints } from './pointsUtil.mjs' +import { cheek } from './cheek.mjs' +import { head2 } from './head2.mjs' +import { jawfloor } from './jawfloor.mjs' + +function draftHead3({ + options, + Point, + Path, + points, + paths, + Snippet, + snippets, + complete, + sa, + log, + store, + paperless, + macro, + utils, + part, +}) { + console.log('head3') + const textAttribute = 'text-xs center' + const sizeFactor = store.get('sizeFactor') + + points.point0 = new Point(0, 0) + + points.point0Cp2 = points.point0.shift(176.85941213458383, 24.45873430903567 * sizeFactor) + points.point0Cp1 = points.point0.shift(80.97143471134606, 19.435805231582247 * sizeFactor) + points.point5 = points.point0.shift(174.83014371859687, 57.4195861357429 * sizeFactor) + points.point5Cp1 = points.point5.shift(359.48476820979687, 24.91000716579583 * sizeFactor) + points.point4 = points.point0.shift(128.37, 82.29999999999998 * sizeFactor) + points.point4Cp1 = points.point4.shift(280, 20 * sizeFactor) + points.point3 = points.point0.shift(122.10525602099625, 99.24923435875874 * sizeFactor) + points.point3Cp2 = points.point3.shift(75, 20 * sizeFactor) + points.point2 = points.point0.shift(92.0479806305003, 131.18279286933938 * sizeFactor) + points.point2Cp2 = points.point2.shift(286.4630945432234, 43.38779202725112 * sizeFactor) + points.point2Cp1 = points.point2.shift(208.11590506019132, 16.689416556608613 * sizeFactor) + points.point1 = points.point0.shift(80.96712201455671, 37.967861804426136 * sizeFactor) + points.point1Cp2 = points.point1.shift(266.0887375411011, 17.372462375840676 * sizeFactor) + points.point1Cp1 = points.point1.shift(86.08762325510818, 17.602020395397776 * sizeFactor) + + points.dartPoint0 = points.point4.clone() + points.dartPoint0Cp1 = points.dartPoint0.shift(10, 15.674240045373793 * sizeFactor) + points.dartPoint1 = points.point0.shift(93.69495535762911, 79.06034303618978 * sizeFactor) + points.dartPoint1Cp1 = points.dartPoint1.shift(190.57289744169927, 19.19488590744941 * sizeFactor) + points.dartPoint1Cp2 = points.dartPoint1.shift( + 206.69161019830457, + 18.019174148667343 * sizeFactor + ) + points.dartPoint2 = points.point3.clone() + points.dartPoint2Cp2 = points.dartPoint2.shift(345, 15.211717490145492 * sizeFactor) + + let lowerWidth = store.get('halfOfBack') - store.get('head2width') + let tsAdjustment = + store.get('thirdSeam') - + new Path().move(points.point2).curve(points.point2Cp1, points.point3Cp2, points.point3).length() + + let x = utils.circlesIntersect(points.dartPoint0, tsAdjustment, points.point0, lowerWidth) + if (x) { + points.point5 = x[0].clone() + } else { + log.error('Something is not quite right here!') + } + + points.point5Cp1 = points.point5.shift(359.48476820979687, 24.91000716579583 * sizeFactor) + + paths.thirdSeam1 = new Path() + .move(points.point2) + .curve(points.point2Cp1, points.point3Cp2, points.point3) + .setText('18', textAttribute) + .addClass('hidden') + + paths.thirdSeam2 = new Path() + .move(points.point4) + .line(points.point5) + .setText('18', textAttribute) + .addClass('hidden') + + paths.back = new Path() + .move(points.point0) + .curve(points.point0Cp1, points.point1Cp2, points.point1) + .curve(points.point1Cp1, points.point2Cp2, points.point2) + .setText('19', textAttribute) + .addClass('hidden') + + paths.bottom = new Path() + .move(points.point5) + .line(points.point0) + .setText('21', textAttribute) + .addClass('hidden') + + paths.dart = new Path() + .move(points.dartPoint0) + .curve(points.dartPoint0Cp1, points.dartPoint1Cp2, points.dartPoint1) + .curve(points.dartPoint1Cp1, points.dartPoint2Cp2, points.dartPoint2) + + paths.seam = new Path() + .move(points.point0) + .join(paths.back) + .join(paths.thirdSeam1) + .line(points.point4) + .join(paths.thirdSeam2) + .join(paths.bottom) + .close() + + // Complete? + if (complete) { + points.title = points.point4 + .shiftFractionTowards(points.point1, 0.25) + .shiftFractionTowards(points.point0, 0.25) + macro('title', { + nr: 5, + at: points.title, + scale: 0.5, + title: 'head' + '3', + }) + // points.logo = points.topLeft.shiftFractionTowards(points.bottomRight, 0.5) + // snippets.logo = new Snippet('logo', points.logo) + // points.text = points.logo + // .shift(-90, w / 8) + // .attr('data-text', 'hello') + // .attr('data-text-class', 'center') + + if (sa) { + paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') + } + } + + // Paperless? + if (paperless) { + macro('hd', { + from: points.bottomLeft, + to: points.bottomRight, + y: points.bottomLeft.y + sa + 15, + }) + macro('vd', { + from: points.bottomRight, + to: points.topRight, + x: points.topRight.x + sa + 15, + }) + } + + return part +} + +export const head3 = { + name: 'head3', + after: [cheek, head2, jawfloor], + plugins: [pluginBundle], + draft: draftHead3, +} diff --git a/designs/skully/src/index.mjs b/designs/skully/src/index.mjs new file mode 100644 index 00000000000..89d1cf21141 --- /dev/null +++ b/designs/skully/src/index.mjs @@ -0,0 +1,53 @@ +// + +import { Design } from '@freesewing/core' +import { data } from '../data.mjs' +// Parts +import { cheek } from './cheek.mjs' +import { cheekbone } from './cheekbone.mjs' +import { eye } from './eye.mjs' +import { forehead } from './forehead.mjs' +import { head1 } from './head1.mjs' +import { head2 } from './head2.mjs' +import { head3 } from './head3.mjs' +import { jawfloor } from './jawfloor.mjs' +import { lowerjaw } from './lowerjaw.mjs' +import { lowermouth } from './lowermouth.mjs' +import { nose } from './nose.mjs' +import { uppermouth } from './uppermouth.mjs' + +// Create new design +const Skully = new Design({ + data, + parts: [ + cheek, + cheekbone, + eye, + forehead, + head1, + head2, + head3, + jawfloor, + lowerjaw, + lowermouth, + nose, + uppermouth, + ], +}) + +// Named exports +export { + cheek, + cheekbone, + eye, + forehead, + head1, + head2, + head3, + jawfloor, + lowerjaw, + lowermouth, + nose, + uppermouth, + Skully, +} diff --git a/designs/skully/src/jawfloor.mjs b/designs/skully/src/jawfloor.mjs new file mode 100644 index 00000000000..8005c719db9 --- /dev/null +++ b/designs/skully/src/jawfloor.mjs @@ -0,0 +1,147 @@ +import { pluginBundle } from '@freesewing/plugin-bundle' +import { cheek } from './cheek.mjs' +import { lowerjaw } from './lowerjaw.mjs' +import { convertPoints } from './pointsUtil.mjs' + +function draftJawfloor({ + options, + Point, + Path, + points, + paths, + Snippet, + snippets, + complete, + sa, + store, + paperless, + macro, + part, +}) { + console.log('jawfloor') + const textAttribute = 'text-xs center' + const sizeFactor = store.get('sizeFactor') + + points.point0 = new Point(0, 0) + points.point0Cp1 = points.point0.shift(271.5282081165893, 13.423774618191423 * sizeFactor) + points.point1 = points.point0.shift(329.79784303240206, 56.7574974166409 * sizeFactor) + points.point1Cp1 = points.point1.shift(0.11113474162861184, 14.951028125182583 * sizeFactor) + points.point1Cp2 = points.point1.shift(180.11102743493262, 10.32101937794903 * sizeFactor) + points.point2 = points.point0.shift(341.7834753138606, 84.52734739124374 * sizeFactor) + points.point2Cp1 = points.point2.shift(0.270382570357072, 8.900099100571891 * sizeFactor) + points.point2Cp2 = points.point2.shift(180.28237864410448, 8.319101033164598 * sizeFactor) + points.point3 = points.point0.shift(343.81344080631544, 113.99173416524552 * sizeFactor) + points.point3Cp1 = points.point3.shift(339.59546305762336, 4.204834955143868 * sizeFactor) + points.point3Cp2 = points.point3.shift(159.590412018152, 8.47076366096944 * sizeFactor) + points.point4 = points.point0.shift(340.4669995939806, 139.17462884448446 * sizeFactor) + points.point4Cp2 = points.point4.shift(166.50426671920425, 8.612823288562234 * sizeFactor) + points.point5 = points.point0.shift(3.560698409188234, 135.3172211952344 * sizeFactor) + + points.point6 = points.point0.shift(90.34672828513591, 8.097148263432018 * sizeFactor) + points.point0Cp2 = points.point0.shift(89.35665584015415, 4.809303171978241 * sizeFactor) + + points.point5 = points.point5.shift(0, points.point4.dist(points.point5) / 3) + points.point5Cp2 = points.point5.shift(270, points.point4.dist(points.point5) / 3) + + macro('mirror', { + mirror: [points.point5, points.point6], + points: [ + points.point0, + points.point0Cp1, + points.point0Cp2, + points.point1Cp2, + points.point1, + points.point1Cp1, + points.point2Cp2, + points.point2, + points.point2Cp1, + points.point3Cp2, + points.point3, + points.point3Cp1, + points.point4Cp2, + points.point4, + points.point4, + points.point5Cp2, + points.point5, + points.point6, + ], + prefix: 'm', + }) + + paths.bottomJaw1 = new Path() + .move(points.point6) + ._curve(points.point0Cp2, points.point0) + .curve(points.point0Cp1, points.point1Cp2, points.point1) + .curve(points.point1Cp1, points.point2Cp2, points.point2) + .curve(points.point2Cp1, points.point3Cp2, points.point3) + .curve(points.point3Cp1, points.point4Cp2, points.point4) + .setText('jawBottom' + ' (15)', textAttribute) + .addClass('hidden') + + paths.bottomJaw2 = new Path() + .move(points.mPoint4) + .curve(points.mPoint4Cp2, points.mPoint3Cp1, points.mPoint3) + .curve(points.mPoint3Cp2, points.mPoint2Cp1, points.mPoint2) + .curve(points.mPoint2Cp2, points.mPoint1Cp1, points.mPoint1) + .curve(points.mPoint1Cp2, points.mPoint0Cp1, points.mPoint0) + .curve_(points.mPoint0Cp2, points.point6) + .setText('jawBottom' + ' (15)', textAttribute) + .addClass('hidden') + + paths.seam = new Path() + .move(points.point6) + .join(paths.bottomJaw1) + .curve(points.point4, points.point5Cp2, points.point5) + .curve(points.mPoint5Cp2, points.mPoint4, points.mPoint4) + .join(paths.bottomJaw2) + .close() + + store.set( + 'backOfLowerJaw', + new Path().move(points.point4).curve(points.point4, points.point5Cp2, points.point5).length() + ) + + // Complete? + if (complete) { + points.title = points.point6.shiftFractionTowards(points.point5, 0.5) + macro('title', { + nr: 8, + at: points.title, + scale: 0.5, + title: 'jawfloor', + }) + // points.logo = points.topLeft.shiftFractionTowards(points.bottomRight, 0.5) + // snippets.logo = new Snippet('logo', points.logo) + // points.text = points.logo + // .shift(-90, w / 8) + // .attr('data-text', 'hello') + // .attr('data-text-class', 'center') + + if (sa) { + paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') + } + } + + // Paperless? + if (paperless) { + macro('hd', { + from: points.bottomLeft, + to: points.bottomRight, + y: points.bottomLeft.y + sa + 15, + }) + macro('vd', { + from: points.bottomRight, + to: points.topRight, + x: points.topRight.x + sa + 15, + }) + } + + return part +} + +export const jawfloor = { + name: 'jawfloor', + after: [cheek, lowerjaw], + plugins: [pluginBundle], + draft: draftJawfloor, +} diff --git a/designs/skully/src/lowerjaw.mjs b/designs/skully/src/lowerjaw.mjs new file mode 100644 index 00000000000..a4533fd5520 --- /dev/null +++ b/designs/skully/src/lowerjaw.mjs @@ -0,0 +1,164 @@ +import { pluginBundle } from '@freesewing/plugin-bundle' +import { cheek } from './cheek.mjs' +import { lowermouth } from './lowermouth.mjs' +import { convertPoints } from './pointsUtil.mjs' + +function draftLowerjaw({ + options, + Point, + Path, + points, + paths, + Snippet, + snippets, + complete, + sa, + store, + paperless, + macro, + part, +}) { + console.log('lowerjaw') + const textAttribute = 'text-xs center' + const sizeFactor = store.get('sizeFactor') + + points.point0 = new Point(0, 0) + points.point1 = points.point0.shift(174.91311161963839, 43.0264648094635 * sizeFactor) + points.point2 = points.point0.shift(240.9901082422603, 82.64382533498798 * sizeFactor) + points.point3 = points.point0.shift(251.1601763775522, 106.01579184725264 * sizeFactor) + points.point4 = points.point0.shift(276.6440430845334, 116.75813357963548 * sizeFactor) + points.point5 = points.point0.shift(264.48800048134507, 50.78381912578058 * sizeFactor) + + points.point0Cp2 = points.point0.shift(264.9481781658739, 16.659715303689914 * sizeFactor) + points.point1Cp1 = points.point1.shift(268.7020740231185, 53.02160375733648 * sizeFactor) + + let mouthTop = store.get('mouthTop') + + points.point0 = new Point(0, 0) + points.point0Cp2 = points.point0.shift(354.9481781658739, 16.659715303689914 * sizeFactor) + points.point1 = points.point0.shift(264.91311161963836, 43.0264648094635 * sizeFactor) + points.point1Cp1 = points.point1.shift(358.7020740231185, 53.02160375733651 * sizeFactor) + points.point2 = points.point0.shift(331.14662128979205, 83.05325951149062 * sizeFactor) + points.point2Cp1 = points.point2.shift(23.491413537740165, 11.818521142681087 * sizeFactor) + points.point2Cp2 = points.point2.shift(203.48599545649284, 6.360957553702122 * sizeFactor) + points.point3 = points.point0.shift(341.2414817357221, 106.45865437980989 * sizeFactor) + points.point3Cp1 = points.point3.shift(83.22770461819215, 15.755934754878917 * sizeFactor) + points.point3Cp2 = points.point3.shift(263.2247839478168, 8.959567958333654 * sizeFactor) + points.point4 = points.point0.shift(6.617587088273078, 117.22282297600707 * sizeFactor) + points.point4Cp1 = points.point4.shift(171.59670910061834, 40.160161877163844 * sizeFactor) + points.point4Cp2 = points.point4.shift(255.77964223723035, 21.208879767682262 * sizeFactor) + points.point5 = points.point0.shift(354.81977589032454, 54.026610044075944 * sizeFactor) + points.point5Cp1 = points.point5.shift(166.25960112580196, 20.659041530160696 * sizeFactor) + points.point5Cp2 = points.point5.shift(76.26126036953632, 34.11095664483535 * sizeFactor) + points.point0 = new Point(0, 0) + + let iterations = 0 + var p + do { + iterations++ + + points.point5Cp1 = points.point5.shift(166.25960112580196, 20.659041530160696 * sizeFactor) + points.point5Cp2 = points.point5.shift(76.26126036953632, 34.11095664483535 * sizeFactor) + p = new Path().move(points.point5).curve(points.point5Cp1, points.point0Cp2, points.point0) + + points.point5 = points.point5.shift(270, (mouthTop - p.length()) * 0.5) + + console.log({ mouthTop: mouthTop, seriously: p.length() }) + } while (iterations < 100 && (mouthTop - p.length() > 1 || mouthTop - p.length() < -1)) + if (iterations >= 100) { + log.error('Something is not quite right here!') + } + + // let mouthTop = store.get('mouthTop') + let mt = new Path() + .move(points.point5) + .curve(points.point5Cp1, points.point0Cp2, points.point0) + .length() + + points.point4 = points.point4.shift( + 355, + store.get('lowerJaw') - + new Path() + .move(points.point4) + .curve(points.point4Cp1, points.point5Cp2, points.point5) + .length() + ) + points.point4Cp1 = points.point4.shift(171.59670910061834, 40.160161877163844 * sizeFactor) + points.point4Cp2 = points.point4.shift(255.77964223723035, 21.208879767682262 * sizeFactor) + + paths.mouthBottom = new Path() + .move(points.point5) + .curve(points.point5Cp1, points.point0Cp2, points.point0) + .setText('mouthBottom' + ' (13)', textAttribute) + .addClass('hidden') + + paths.lowerJaw = new Path() + .move(points.point4) + .curve(points.point4Cp1, points.point5Cp2, points.point5) + .setText('lowerJaw' + ' (14)', textAttribute) + .addClass('hidden') + + paths.front = new Path().move(points.point0).line(points.point1).setText('12', textAttribute) + + paths.bottomJaw = new Path() + .move(points.point1) + .curve(points.point1Cp1, points.point2Cp2, points.point2) + .curve(points.point2Cp1, points.point3Cp2, points.point3) + .curve(points.point3Cp1, points.point4Cp2, points.point4) + .setText('jawBottom' + '(15)', textAttribute) + .addClass('hidden') + + paths.seam = new Path() + .move(points.point0) + .join(paths.front) + .join(paths.bottomJaw) + .join(paths.lowerJaw) + .join(paths.mouthBottom) + .close() + + store.set('bottomJaw', paths.bottomJaw.length()) + + // Complete? + if (complete) { + points.title = points.point1.shiftFractionTowards(points.point4, 0.25) + macro('title', { + nr: 11, + at: points.title, + scale: 0.4, + title: 'lowerJaw', + }) + // points.logo = points.topLeft.shiftFractionTowards(points.bottomRight, 0.5) + // snippets.logo = new Snippet('logo', points.logo) + // points.text = points.logo + // .shift(-90, w / 8) + // .attr('data-text', 'hello') + // .attr('data-text-class', 'center') + + if (sa) { + paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') + } + } + + // Paperless? + if (paperless) { + macro('hd', { + from: points.bottomLeft, + to: points.bottomRight, + y: points.bottomLeft.y + sa + 15, + }) + macro('vd', { + from: points.bottomRight, + to: points.topRight, + x: points.topRight.x + sa + 15, + }) + } + + return part +} + +export const lowerjaw = { + name: 'lowerjaw', + after: [cheek, lowermouth], + plugins: [pluginBundle], + draft: draftLowerjaw, +} diff --git a/designs/skully/src/lowermouth.mjs b/designs/skully/src/lowermouth.mjs new file mode 100644 index 00000000000..e69de29bb2d diff --git a/designs/skully/src/nose.mjs b/designs/skully/src/nose.mjs new file mode 100644 index 00000000000..cd23e0933c6 --- /dev/null +++ b/designs/skully/src/nose.mjs @@ -0,0 +1,143 @@ +import { pluginBundle } from '@freesewing/plugin-bundle' +import { cheek } from './cheek.mjs' +import { eye } from './eye.mjs' +import { forehead } from './forehead.mjs' +import { convertPoints } from './pointsUtil.mjs' + +function draftNose({ + options, + Point, + Path, + points, + paths, + Snippet, + snippets, + complete, + sa, + store, + paperless, + utils, + macro, + part, +}) { + console.log('nose') + const textAttribute = 'text-xs center' + const sizeFactor = store.get('sizeFactor') + + var noseSide = store.get('noseSide') + var noseHeight = store.get('noseHeight') + var noseCircumference = noseSide * 2 + var noseDiameter = (noseCircumference / Math.PI) * 2 + + const c = 0.55191502449351 + + points.point0 = new Point(0, 0) + points.point2 = points.point0.shift(90, noseHeight) + points.point0Cp1 = points.point0.shift(315, noseHeight) + points.point2Cp2 = points.point2.shift(325, noseHeight / 3) + + paths.p1 = new Path() + .move(points.point0) + .curve(points.point0Cp1, points.point2Cp2, points.point2) + .hide() + + points.pRotate = points.point0.shift(30, noseHeight) + + paths.p0p1 = new Path().move(points.point0).line(points.point2).setClass('dashed mark') + + points.point1 = points.pRotate.shiftTowards(points.point2, noseHeight * -1) + + points.point1Cp2 = points.point1.shift(points.point1.angle(points.point2) + 55, noseHeight / 3) + + var iteration = 0 + var pl + do { + iteration++ + + points.point1 = points.point1.rotate(-0.5, points.point2) + points.point1Cp2 = points.point1Cp2.rotate(-0.5, points.point2) + points.point0Cp1 = points.point0Cp1.rotate(-0.5, points.point2) + paths.p1 = new Path() + .move(points.point0) + .curve(points.point0Cp1, points.point1Cp2, points.point1) + .setText('nose' + ' (10)', textAttribute) + + pl = paths.p1.length() + console.log({ i: iteration, pl: pl, noseSide: noseSide }) + } while (iteration < 100 && pl - noseSide > 1) + + points.pMiddle1 = points.point2.shiftFractionTowards(points.point1, 0.5) + + points.point3 = points.point1.flipX() + points.point3Cp1 = points.point1Cp2.flipX() + points.point0Cp2 = points.point0Cp1.flipX() + points.pMiddle2 = points.pMiddle1.flipX() + + paths.p2 = new Path() + .move(points.point3) + .curve(points.point3Cp1, points.point0Cp2, points.point0) + .setText('nose' + ' (10)', textAttribute) + + paths.seam = new Path() + .move(points.point0) + .join(paths.p1) + .line(points.point2) + .line(points.point3) + .join(paths.p2) + .close() + + // Complete? + if (complete) { + snippets.n1 = new Snippet('bnotch', points.point0) + snippets.n2 = new Snippet('notch', points.point1) + snippets.n3 = new Snippet('notch', points.point2) + snippets.n4 = new Snippet('notch', points.point3) + + macro('sewtogether', { + from: points.point1.shiftFractionTowards(points.point2, 0.25), + to: points.point1.shiftFractionTowards(points.point2, 0.75), + hinge: true, + prefix: 'st1', + }) + macro('sewtogether', { + from: points.point2.shiftFractionTowards(points.point3, 0.25), + to: points.point2.shiftFractionTowards(points.point3, 0.75), + hinge: true, + prefix: 'st2', + }) + + // points.logo = points.topLeft.shiftFractionTowards(points.bottomRight, 0.5) + // snippets.logo = new Snippet('logo', points.logo) + // points.text = points.logo + // .shift(-90, w / 8) + // .attr('data-text', 'hello') + // .attr('data-text-class', 'center') + + if (sa) { + paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') + } + } + + // Paperless? + if (paperless) { + macro('hd', { + from: points.bottomLeft, + to: points.bottomRight, + y: points.bottomLeft.y + sa + 15, + }) + macro('vd', { + from: points.bottomRight, + to: points.topRight, + x: points.topRight.x + sa + 15, + }) + } + + return part +} + +export const nose = { + name: 'nose', + after: [cheek, forehead, eye], + plugins: [pluginBundle], + draft: draftNose, +} diff --git a/designs/skully/src/part12.mjs b/designs/skully/src/part12.mjs new file mode 100644 index 00000000000..415c87579d1 --- /dev/null +++ b/designs/skully/src/part12.mjs @@ -0,0 +1,165 @@ +import { pluginBundle } from '@freesewing/plugin-bundle' +import { cheek } from './cheek.mjs' +import { forehead } from './forehead.mjs' +import { convertPoints } from './pointsUtil.mjs' + +function draftPart12({ + options, + Point, + Path, + points, + paths, + Snippet, + snippets, + complete, + sa, + store, + paperless, + macro, + part, +}) { + console.log('part12') + const textAttribute = 'text-xs center' + const sizeFactor = store.get('sizeFactor') + + var eyeCircumference = store.get('eyeBottom') + store.get('eyeTop') + var eyeDiameter = (eyeCircumference / Math.PI) * 2 + + const c = 0.55191502449351 + // const c = 0.75 + + // points.b0 = new Point(0,0).shift(0,eyeDiameter*1.5).shift(90,eyeDiameter*1.5) + // points.b1 = new Point(0,0).shift(180,eyeDiameter*1.5).shift(90,eyeDiameter*1.5) + // points.b2 = new Point(0,0).shift(180,eyeDiameter*1.5).shift(270,eyeDiameter*1.5) + // points.b3 = new Point(0,0).shift(0,eyeDiameter*1.5).shift(270,eyeDiameter*1.5) + + // paths.box = new Path() + // .move(points.b0) + // .line(points.b1) + // .line(points.b2) + // .line(points.b3) + // .close() + + points.point0 = new Point(0, 0) + points.point2 = points.point0.shift(0, eyeDiameter / 2).shift(90, eyeDiameter / 2) + points.point0Cp1 = points.point0.shift(0, (eyeDiameter / 2) * c) + points.point2Cp2 = points.point2.shift(270, (eyeDiameter / 2) * c) + + let p = new Path().move(points.point0).curve(points.point0Cp1, points.point2Cp2, points.point2) + + points.point1 = p.shiftAlong(p.length() / 2) + + let sp = p.split(points.point1) + + // paths.p1 = sp[0].clone() + // paths.p2 = sp[1].clone() + + points.p0 = sp[0].ops[0].to.clone() + points.p0Cp1 = sp[0].ops[1].cp1.clone() + points.p1Cp2 = sp[0].ops[1].cp2.clone() + points.p1 = sp[1].ops[0].to.clone() + points.p1Cp1 = sp[1].ops[1].cp1.clone() + points.p2Cp2 = sp[1].ops[1].cp2.clone() + points.p2 = sp[1].ops[1].to.clone() + + points.p0Cp1 = points.p0.shift(0, (eyeDiameter / 2) * c * 0.4) + points.p2Cp2 = points.p2.shift(270, (eyeDiameter / 2) * c * 0.4) + points.p1Cp1 = points.p1.shift(45, (eyeDiameter / 2) * c * 0.7) + points.p1Cp2 = points.p1.shift(225, (eyeDiameter / 2) * c * 0.7) + + points.p0Cp2 = points.p0Cp1.flipX() + points.p4 = points.p2.flipX() + points.p4Cp1 = points.p2Cp2.flipX() + points.p3 = points.p1.flipX() + points.p3Cp2 = points.p1Cp1.flipX() + points.p3Cp1 = points.p1Cp2.flipX() + + paths.eyeTop = new Path() + .move(points.p4) + .curve(points.p4Cp1, points.p3Cp2, points.p3) + .curve(points.p3Cp1, points.point9Cp2, points.point9) + .setText('Eye bottom (4)', textAttribute) + .addClass('hidden') + + paths.eye = new Path() + .move(points.p4) + .curve(points.p4Cp1, points.p3Cp2, points.p3) + .curve(points.p3Cp1, points.p0Cp2, points.p0) + .curve(points.p0Cp1, points.p1Cp2, points.p1) + .curve(points.p1Cp1, points.p2Cp2, points.p2) + + points.pointNotch = paths.eye.shiftAlong(store.get('eyeTop')) + + let ps = paths.eye.split(points.pointNotch) + paths.eyeTop = ps[0].clone().setText('Eye top (4)', textAttribute) + paths.eyeBottom = ps[1].clone().setText('Eye bottom (4)', textAttribute) + + paths.seam = new Path() + .move(points.p4) + .join(paths.eyeTop) + .join(paths.eyeBottom) + .line(points.p4) + .close() + + console.log({ sLength: p.length() }) + console.log({ + nLength: new Path() + .move(points.p4) + .curve(points.p4Cp1, points.p3Cp2, points.p3) + .curve(points.p3Cp1, points.p0Cp2, points.p0) + .length(), + }) + + // Complete? + if (complete) { + points.title = points.p4 + .shiftFractionTowards(points.p1, 0.5) + .shiftFractionTowards(points.p0, 0.3) + macro('title', { + nr: 12, + at: points.title, + scale: 0.3, + title: 'eye', + }) + snippets.n1 = new Snippet('notch', points.p2) + snippets.n2 = new Snippet('notch', points.p4) + snippets.n3 = new Snippet('bnotch', points.pointNotch) + + // points.logo = points.topLeft.shiftFractionTowards(points.bottomRight, 0.5) + // snippets.logo = new Snippet('logo', points.logo) + // points.text = points.logo + // .shift(-90, w / 8) + // .attr('data-text', 'hello') + // .attr('data-text-class', 'center') + + if (sa) { + paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') + } + } + console.log({ points: JSON.parse(JSON.stringify(points)) }) + + console.log({ paths: JSON.parse(JSON.stringify(paths)) }) + + // Paperless? + if (paperless) { + macro('hd', { + from: points.bottomLeft, + to: points.bottomRight, + y: points.bottomLeft.y + sa + 15, + }) + macro('vd', { + from: points.bottomRight, + to: points.topRight, + x: points.topRight.x + sa + 15, + }) + } + + return part +} + +export const part12 = { + name: 'part12', + after: [cheek, forehead], + plugins: [pluginBundle], + draft: draftPart12, +} diff --git a/designs/skully/src/pointsUtil.mjs b/designs/skully/src/pointsUtil.mjs new file mode 100644 index 00000000000..b53d19bea33 --- /dev/null +++ b/designs/skully/src/pointsUtil.mjs @@ -0,0 +1,52 @@ +function convertPoints(points, rotate = 0, flip = false) { + var p = [] + Object.keys(points).forEach(function (key, index) { + var point = points[key].clone() + if (key != 'point0') { + if (flip) { + point = points[key].flipX() + } + if (rotate != 0) { + point = points[key].rotate(rotate, points['point0']) + } + } + + if (key == 'point0') { + p.push('points.point0 = new Point( 0, 0 );') + } else if (key.match('.+[0-9]Cp[12]')) { + let masterPointKey = key.replace(/Cp[12]/, '') + let masterPoint = points[masterPointKey] + if (flip) { + masterPoint = masterPoint.flipX() + } + if (rotate != 0) { + masterPoint = masterPoint.rotate(rotate, points['point0']) + } + p.push( + 'points.' + + key + + ' = points.' + + masterPointKey + + '.shift( ' + + masterPoint.angle(point) + + ', ' + + masterPoint.dist(point) + + ' *sizeFactor );' + ) + } else { + p.push( + 'points.' + + key + + ' = points.point0.shift( ' + + points.point0.angle(point) + + ', ' + + points.point0.dist(point) + + ' *sizeFactor );' + ) + } + }) + + console.log(p.sort().join('\n')) +} + +export { convertPoints } diff --git a/designs/skully/src/uppermouth.mjs b/designs/skully/src/uppermouth.mjs new file mode 100644 index 00000000000..5cdaf401e7b --- /dev/null +++ b/designs/skully/src/uppermouth.mjs @@ -0,0 +1,112 @@ +import { pluginBundle } from '@freesewing/plugin-bundle' +import { cheek } from './cheek.mjs' +import { convertPoints } from './pointsUtil.mjs' + +function draftUppermouth({ + options, + Point, + Path, + points, + paths, + Snippet, + snippets, + complete, + sa, + store, + paperless, + macro, + part, +}) { + console.log('uppermouth') + const textAttribute = 'text-xs center' + const sizeFactor = store.get('sizeFactor') + + points.point0 = new Point(0, 0) + points.point1 = points.point0.shift(270, 66.14600000000002 * sizeFactor) + points.point1Cp1 = points.point1.shift(0, 0 * sizeFactor) + points.point0Cp2 = points.point0.shift(0, 0 * sizeFactor) + + points.point2 = points.point0.shift(219.80599709691597, 51.66121657491237 * sizeFactor) + + points.point0 = new Point(0, 0) + points.point0Cp1 = points.point0.shift(0, 0 * sizeFactor) + points.point1 = points.point0.shift(222.41579397130369, 49.03292752740774 * sizeFactor) + points.point2 = points.point0.shift(270, 66.14600000000002 * sizeFactor) + points.point2Cp2 = points.point2.shift(0, 0 * sizeFactor) + points.point1.x = points.point0.x - points.point0.dist(points.point2) / 2 + points.point1Cp1 = points.point1.shift(270, 33.0746752291626 * sizeFactor) + points.point1Cp2 = points.point1.shift(90, 33.0746752291626 * sizeFactor) + + paths.mouth1 = new Path() + .move(points.point0) + .curve(points.point0Cp1, points.point1Cp2, points.point1) + .setText('mouthBottom' + ' (13)', textAttribute) + .addClass('hidden') + paths.mouth2 = new Path() + .move(points.point1) + .curve(points.point1Cp1, points.point2Cp2, points.point2) + .setText('mouthBottom' + ' (13)', textAttribute) + .addClass('hidden') + + paths.backOfMouth = new Path() + .move(points.point2) + .line(points.point0) + .setText('backOfMouth' + ' (11)', textAttribute) + .addClass('hidden') + + store.set('mouthWidth', points.point0.dist(points.point2)) + + paths.seam = new Path() + .move(points.point0) + .curve(points.point0Cp1, points.point1Cp2, points.point1) + .curve(points.point1Cp1, points.point2Cp2, points.point2) + .line(points.point0) + .close() + + // Complete? + if (complete) { + points.title = points.point0 + .shiftFractionTowards(points.point2, 0.25) + .shiftFractionTowards(points.point1, 0.6) + macro('title', { + nr: 10, + at: points.title, + scale: 0.25, + rotation: 90, + title: 'uppermouth', + }) + // points.logo = points.topLeft.shiftFractionTowards(points.bottomRight, 0.5) + // snippets.logo = new Snippet('logo', points.logo) + // points.text = points.logo + // .shift(-90, w / 8) + // .attr('data-text', 'hello') + // .attr('data-text-class', 'center') + + if (sa) { + paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') + } + } + + // Paperless? + if (paperless) { + macro('hd', { + from: points.bottomLeft, + to: points.bottomRight, + y: points.bottomLeft.y + sa + 15, + }) + macro('vd', { + from: points.bottomRight, + to: points.topRight, + x: points.topRight.x + sa + 15, + }) + } + + return part +} + +export const uppermouth = { + name: 'uppermouth', + after: cheek, + plugins: [pluginBundle], + draft: draftUppermouth, +} diff --git a/designs/skully/tests/shared.test.mjs b/designs/skully/tests/shared.test.mjs new file mode 100644 index 00000000000..2b25b6104ed --- /dev/null +++ b/designs/skully/tests/shared.test.mjs @@ -0,0 +1,16 @@ +// This file is auto-generated | Any changes you make will be overwritten. +import { Skully } from '../src/index.mjs' + +// Shared tests +import { testPatternConfig } from '../../../tests/designs/config.mjs' +import { testPatternDrafting } from '../../../tests/designs/drafting.mjs' +import { testPatternSampling } from '../../../tests/designs/sampling.mjs' + +// Test config +testPatternConfig(Skully) + +// Test drafting - Change the second parameter to `true` to log errors +testPatternDrafting(Skully, false) + +// Test sampling - Change the second parameter to `true` to log errors +testPatternSampling(Skully, false) From 52c29a04cc9accc018e5cac313f2a2c6794a8302 Mon Sep 17 00:00:00 2001 From: Wouter van Wageningen Date: Sun, 9 Apr 2023 17:33:05 +0000 Subject: [PATCH 02/27] Some paperless --- config/software/designs.json | 9 +- designs/skully/src/box.mjs | 70 -------- designs/skully/src/cheek.mjs | 2 +- designs/skully/src/cheekbone.mjs | 20 +-- designs/skully/src/eye.mjs | 24 +-- designs/skully/src/forehead.mjs | 2 +- designs/skully/src/head1.mjs | 38 +++- designs/skully/src/head2.mjs | 20 +-- designs/skully/src/head3.mjs | 20 +-- designs/skully/src/jawfloor.mjs | 57 +++++- designs/skully/src/lowerjaw.mjs | 22 +-- designs/skully/src/lowermouth.mjs | 290 ++++++++++++++++++++++++++++++ designs/skully/src/nose.mjs | 20 +-- designs/skully/src/part12.mjs | 165 ----------------- designs/skully/src/uppermouth.mjs | 12 +- 15 files changed, 448 insertions(+), 323 deletions(-) delete mode 100644 designs/skully/src/box.mjs delete mode 100644 designs/skully/src/part12.mjs diff --git a/config/software/designs.json b/config/software/designs.json index 84f6690c4be..6296f723527 100644 --- a/config/software/designs.json +++ b/config/software/designs.json @@ -78,11 +78,12 @@ "tags": ["accessories", "toys"] }, "skully": { - "description": "A FreeSewing pattern that needs a description", + "description": "A FreeSewing pattern for skully, our logo, a plushy toy", "code": "Coder name", - "design": "Designer name", - "difficulty": 1, - "tags": ["tagname"] + "code": "Wouter Van Wageningen", + "design": "Wouter Van Wageningen", + "difficulty": 9, + "tags": ["accessories", "toys"] }, "trayvon": { "description": "A FreeSewing pattern for a tie", diff --git a/designs/skully/src/box.mjs b/designs/skully/src/box.mjs deleted file mode 100644 index b06ac5a6c20..00000000000 --- a/designs/skully/src/box.mjs +++ /dev/null @@ -1,70 +0,0 @@ -import { pluginBundle } from '@freesewing/plugin-bundle' - -function draftBox({ - options, - Point, - Path, - points, - paths, - Snippet, - snippets, - complete, - sa, - paperless, - macro, - part, -}) { - const w = 500 * options.size - points.topLeft = new Point(0, 0) - points.topRight = new Point(w, 0) - points.bottomLeft = new Point(0, w / 2) - points.bottomRight = new Point(w, w / 2) - - paths.seam = new Path() - .move(points.topLeft) - .line(points.bottomLeft) - .line(points.bottomRight) - .line(points.topRight) - .line(points.topLeft) - .close() - .attr('class', 'fabric') - - // Complete? - if (complete) { - points.logo = points.topLeft.shiftFractionTowards(points.bottomRight, 0.5) - snippets.logo = new Snippet('logo', points.logo) - points.text = points.logo - .shift(-90, w / 8) - .attr('data-text', 'hello') - .attr('data-text-class', 'center') - - if (sa) { - paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') - } - } - - // Paperless? - if (paperless) { - macro('hd', { - from: points.bottomLeft, - to: points.bottomRight, - y: points.bottomLeft.y + sa + 15, - }) - macro('vd', { - from: points.bottomRight, - to: points.topRight, - x: points.topRight.x + sa + 15, - }) - } - - return part -} - -export const box = { - name: 'box', - options: { - size: { pct: 50, min: 10, max: 100, menu: 'fit' }, - }, - plugins: [pluginBundle], - draft: draftBox, -} diff --git a/designs/skully/src/cheek.mjs b/designs/skully/src/cheek.mjs index ba10b0c1128..56d9264accb 100644 --- a/designs/skully/src/cheek.mjs +++ b/designs/skully/src/cheek.mjs @@ -171,7 +171,7 @@ function draftCheek({ snippets.logo = new Snippet('logo', points.logo).attr('data-scale', 0.3) if (sa) { - paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') + paths.sa = paths.seam.offset(sa).trim().attr('class', 'fabric sa') } } diff --git a/designs/skully/src/cheekbone.mjs b/designs/skully/src/cheekbone.mjs index 8b7a6ab01ba..ec0de41aeeb 100644 --- a/designs/skully/src/cheekbone.mjs +++ b/designs/skully/src/cheekbone.mjs @@ -67,16 +67,16 @@ function draftCheekbone({ // Paperless? if (paperless) { - macro('hd', { - from: points.bottomLeft, - to: points.bottomRight, - y: points.bottomLeft.y + sa + 15, - }) - macro('vd', { - from: points.bottomRight, - to: points.topRight, - x: points.topRight.x + sa + 15, - }) + // macro('hd', { + // from: points.bottomLeft, + // to: points.bottomRight, + // y: points.bottomLeft.y + sa + 15, + // }) + // macro('vd', { + // from: points.bottomRight, + // to: points.topRight, + // x: points.topRight.x + sa + 15, + // }) } return part diff --git a/designs/skully/src/eye.mjs b/designs/skully/src/eye.mjs index 8f655db778c..d9c70ccb0f4 100644 --- a/designs/skully/src/eye.mjs +++ b/designs/skully/src/eye.mjs @@ -170,7 +170,7 @@ function draftEye({ if (complete) { points.title = points.p4 .shiftFractionTowards(points.p1, 0.45) - .shiftFractionTowards(points.p0, 0.6) + .shiftFractionTowards(points.p0, 0.5) macro('title', { nr: 9, @@ -201,28 +201,28 @@ function draftEye({ // snippets.logo = new Snippet('logo', points.logo) // points.text = points.logo // .shift(-90, w / 8) - // .attr('data-text', 'hello') - // .attr('data-text-class', 'center') if (sa) { paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') } } - console.log({ points: JSON.parse(JSON.stringify(points)) }) - - console.log({ paths: JSON.parse(JSON.stringify(paths)) }) // Paperless? if (paperless) { macro('hd', { - from: points.bottomLeft, - to: points.bottomRight, - y: points.bottomLeft.y + sa + 15, + from: points.p4, + to: points.pointNotch, + y: points.p0.y + sa + 15, + }) + macro('hd', { + from: points.p4, + to: points.p2, + y: points.p2.y - sa - 15, }) macro('vd', { - from: points.bottomRight, - to: points.topRight, - x: points.topRight.x + sa + 15, + from: points.p2, + to: points.p0, + x: points.p2.x + sa + 15, }) } diff --git a/designs/skully/src/forehead.mjs b/designs/skully/src/forehead.mjs index fd1e0ed30dd..b4ce59ae6f0 100644 --- a/designs/skully/src/forehead.mjs +++ b/designs/skully/src/forehead.mjs @@ -140,7 +140,7 @@ function draftForehead({ // .attr('data-text-class', 'center') if (sa) { - paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') + paths.sa = paths.seam.offset(sa).trim().attr('class', 'fabric sa') } } diff --git a/designs/skully/src/head1.mjs b/designs/skully/src/head1.mjs index 2f7d502bb96..bb377944668 100644 --- a/designs/skully/src/head1.mjs +++ b/designs/skully/src/head1.mjs @@ -82,8 +82,7 @@ function draftHead1({ // snippets.logo = new Snippet('logo', points.logo) // points.text = points.logo // .shift(-90, w / 8) - // .attr('data-text', 'hello') - // .attr('data-text-class', 'center') + snippets.n1 = new Snippet('notch', points.fs1) snippets.n2 = new Snippet('notch', points.fs2) @@ -94,16 +93,41 @@ function draftHead1({ // Paperless? if (paperless) { - // macro('hd', { - // from: points.bottomLeft, - // to: points.bottomRight, - // y: points.bottomLeft.y + sa + 15, - // }) + macro('hd', { + from: points.point1, + to: points.point2, + y: points.point2.y + sa + 10, + }) + macro('hd', { + from: points.point2, + to: points.point0, + y: points.point2.y + sa + 10, + }) macro('vd', { from: points.point0, to: points.point2, x: points.point0.x + sa + 15, }) + macro('vd', { + from: points.point2, + to: points.point1, + x: points.point1.x - sa - 15, + }) + macro('ld', { + from: points.point0, + to: points.point1, + d: 5, + }) + macro('ld', { + from: points.point2, + to: points.fs2, + d: 5, + }) + macro('ld', { + from: points.point2, + to: points.fs1, + d: 15, + }) } return part diff --git a/designs/skully/src/head2.mjs b/designs/skully/src/head2.mjs index 8131a747727..405ff7dd702 100644 --- a/designs/skully/src/head2.mjs +++ b/designs/skully/src/head2.mjs @@ -143,16 +143,16 @@ function draftHead2({ // Paperless? if (paperless) { - macro('hd', { - from: points.bottomLeft, - to: points.bottomRight, - y: points.bottomLeft.y + sa + 15, - }) - macro('vd', { - from: points.bottomRight, - to: points.topRight, - x: points.topRight.x + sa + 15, - }) + // macro('hd', { + // from: points.bottomLeft, + // to: points.bottomRight, + // y: points.bottomLeft.y + sa + 15, + // }) + // macro('vd', { + // from: points.bottomRight, + // to: points.topRight, + // x: points.topRight.x + sa + 15, + // }) } return part diff --git a/designs/skully/src/head3.mjs b/designs/skully/src/head3.mjs index 34b593a9b72..26849e72543 100644 --- a/designs/skully/src/head3.mjs +++ b/designs/skully/src/head3.mjs @@ -131,16 +131,16 @@ function draftHead3({ // Paperless? if (paperless) { - macro('hd', { - from: points.bottomLeft, - to: points.bottomRight, - y: points.bottomLeft.y + sa + 15, - }) - macro('vd', { - from: points.bottomRight, - to: points.topRight, - x: points.topRight.x + sa + 15, - }) + // macro('hd', { + // from: points.bottomLeft, + // to: points.bottomRight, + // y: points.bottomLeft.y + sa + 15, + // }) + // macro('vd', { + // from: points.bottomRight, + // to: points.topRight, + // x: points.topRight.x + sa + 15, + // }) } return part diff --git a/designs/skully/src/jawfloor.mjs b/designs/skully/src/jawfloor.mjs index 8005c719db9..3e4a5359a9c 100644 --- a/designs/skully/src/jawfloor.mjs +++ b/designs/skully/src/jawfloor.mjs @@ -125,14 +125,59 @@ function draftJawfloor({ // Paperless? if (paperless) { macro('hd', { - from: points.bottomLeft, - to: points.bottomRight, - y: points.bottomLeft.y + sa + 15, + from: points.mPoint0, + to: points.mPoint5, + y: points.mPoint4.y - sa - 15, + }) + macro('hd', { + from: points.point4, + to: points.point5, + y: points.point4.y + sa + 15, + }) + macro('hd', { + from: points.point2, + to: points.point4, + y: points.point4.y + sa + 15, + }) + macro('hd', { + from: points.point1, + to: points.point2, + y: points.point4.y + sa + 15, + }) + macro('hd', { + from: points.point0, + to: points.point1, + y: points.point4.y + sa + 15, }) macro('vd', { - from: points.bottomRight, - to: points.topRight, - x: points.topRight.x + sa + 15, + from: points.point1, + to: points.mPoint1, + x: points.mPoint1.x, + }) + macro('vd', { + from: points.point2, + to: points.mPoint2, + x: points.mPoint2.x, + }) + macro('vd', { + from: points.point3, + to: points.mPoint3, + x: points.mPoint3.x, + }) + macro('vd', { + from: points.point4, + to: points.mPoint4, + x: points.mPoint4.x, + }) + macro('vd', { + from: points.mPoint4, + to: points.point5, + x: points.point5.x + sa + 15, + }) + macro('vd', { + from: points.mPoint5, + to: points.point4, + x: points.mPoint5.x + sa + 15, }) } diff --git a/designs/skully/src/lowerjaw.mjs b/designs/skully/src/lowerjaw.mjs index a4533fd5520..ef4873660cc 100644 --- a/designs/skully/src/lowerjaw.mjs +++ b/designs/skully/src/lowerjaw.mjs @@ -135,22 +135,22 @@ function draftLowerjaw({ // .attr('data-text-class', 'center') if (sa) { - paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') + paths.sa = paths.seam.offset(sa).trim().attr('class', 'fabric sa') } } // Paperless? if (paperless) { - macro('hd', { - from: points.bottomLeft, - to: points.bottomRight, - y: points.bottomLeft.y + sa + 15, - }) - macro('vd', { - from: points.bottomRight, - to: points.topRight, - x: points.topRight.x + sa + 15, - }) + // macro('hd', { + // from: points.bottomLeft, + // to: points.bottomRight, + // y: points.bottomLeft.y + sa + 15, + // }) + // macro('vd', { + // from: points.bottomRight, + // to: points.topRight, + // x: points.topRight.x + sa + 15, + // }) } return part diff --git a/designs/skully/src/lowermouth.mjs b/designs/skully/src/lowermouth.mjs index e69de29bb2d..43622fdb8c8 100644 --- a/designs/skully/src/lowermouth.mjs +++ b/designs/skully/src/lowermouth.mjs @@ -0,0 +1,290 @@ +import { pluginBundle } from '@freesewing/plugin-bundle' +import { cheek } from './cheek.mjs' +import { head1 } from './head1.mjs' +import { uppermouth } from './uppermouth.mjs' +import { convertPoints } from './pointsUtil.mjs' + +function draftLowermouth({ + options, + Point, + Path, + points, + paths, + Snippet, + snippets, + complete, + sa, + store, + paperless, + macro, + part, +}) { + console.log('lowermouth') + const textAttribute = 'text-xs center' + const sizeFactor = store.get('sizeFactor') + + points.point0 = new Point(0, 0) + points.point6 = points.point0.shift(0.11139916029446559, 128.58224303534288 * sizeFactor) + points.point6Cp2 = points.point6.shift(269.8182450112891, 5.359026963917993 * sizeFactor) + points.point5 = points.point0.shift(328.14341716244707, 120.52788940738986 * sizeFactor) + points.point5Cp1 = points.point5.shift(29.114015378370315, 25.571930803128662 * sizeFactor) + points.point4 = points.point0.shift(317.9233666855834, 95.68080416154534 * sizeFactor) + points.point4Cp2 = points.point4.shift(178.12857030706965, 15.433231709528583 * sizeFactor) + points.point3 = points.point0.shift(312.29520434983914, 55.53156468171955 * sizeFactor) + points.point3Cp2 = points.point3.shift(90, 6.745097849549684 * sizeFactor) + points.point3Cp1 = points.point3.shift(270, 23.140963009347697 * sizeFactor) + points.point2 = points.point0.shift(312.62624217423604, 44.01273783803957 * sizeFactor) + points.point2Cp1 = points.point2.shift(358.24231642721344, 5.05337768230318 * sizeFactor) + points.point1 = points.point0.shift(270, 32.77328218228992 * sizeFactor) + + points.point1 = points.point1.shift( + 90, + points.point0.dist(points.point1) - store.get('mouthWidth') / 2 + ) + points.point2 = points.point2.shift( + 90, + points.point0.dist(points.point1) - store.get('mouthWidth') / 2 + ) + points.point2Cp1 = points.point2.shift(358.24231642721344, 5.05337768230318 * sizeFactor) + points.point3 = points.point3.shift( + 90, + points.point0.dist(points.point1) - store.get('mouthWidth') / 2 + ) + points.point3Cp1 = points.point3.shift(270, 23.140963009347697 * sizeFactor) + points.point3Cp2 = points.point3.shift(90, 6.745097849549684 * sizeFactor) + points.point4 = points.point4.shift( + 90, + points.point0.dist(points.point1) - store.get('mouthWidth') / 2 + ) + points.point4Cp2 = points.point4.shift(178.12857030706965, 15.433231709528583 * sizeFactor) + + points.point5 = points.point4.shift( + 0, + store.get('upperJaw') - + new Path() + .move(points.point1) + .line(points.point2) + .curve(points.point2Cp1, points.point3Cp2, points.point3) + .curve(points.point3Cp1, points.point4Cp2, points.point4) + .length() + ) + points.point5Cp1 = points.point5.shift(0, 9 * sizeFactor) + + points.point6 = new Point(points.point5.x, points.point0.y).shift(0, points.point5.x * 0.2) + points.point6Cp2 = points.point6.shift(270, 5 * sizeFactor) + + points.pointM1 = points.point0.shift(180, store.get('mouthWidth') / 2) + points.pointM1Cp1 = points.pointM1.shift(270, 33.0746752291626 * sizeFactor) + + paths.backOfUpperJaw = new Path() + .move(points.point5) + .curve(points.point5Cp1, points.point6Cp2, points.point6) + .setText('21', textAttribute) + .addClass('hidden') + + points.lowerJaw = paths.backOfUpperJaw.shiftAlong(store.get('upperJawToLowerJaw')) + var ljAngle = points.lowerJaw.angle( + paths.backOfUpperJaw.shiftAlong(store.get('upperJawToLowerJaw') + 1) + ) + + store.set('halfOfBack', paths.backOfUpperJaw.length() - store.get('upperJawToLowerJaw')) + + points.point2ToLowerJaw = points.point2.shift(0, points.point2.dist(points.lowerJaw) / 2) + points.lowerJawToPoint2 = points.lowerJaw.shift( + ljAngle + 90, + points.point2.dist(points.lowerJaw) / 3 + ) + + macro('mirror', { + mirror: [points.pointM1, points.point6], + points: [ + points.point0, + points.lowerJaw, + points.lowerJawToPoint2, + points.point2ToLowerJaw, + points.pointM1Cp1, + points.point1, + points.point2, + points.point2Cp1, + points.point3, + points.point3Cp1, + points.point3Cp2, + points.point4, + points.point4Cp2, + points.point5, + points.point5Cp1, + points.point6Cp2, + ], + prefix: 'm', + }) + console.log({ points: JSON.parse(JSON.stringify(points)) }) + + paths.upperJaw1 = new Path() + .move(points.point1) + .line(points.point2) + .curve(points.point2Cp1, points.point3Cp2, points.point3) + .curve(points.point3Cp1, points.point4Cp2, points.point4) + .line(points.point5) + .setText('upperJaw' + ' (16)', textAttribute) + .addClass('hidden') + + paths.upperJaw2 = new Path() + .move(points.mPoint5) + .line(points.mPoint4) + .curve(points.mPoint4Cp2, points.mPoint3Cp1, points.mPoint3) + .curve(points.mPoint3Cp2, points.mPoint2Cp1, points.mPoint2) + .line(points.mPoint1) + .setText('upperJaw' + ' (16)', textAttribute) + .addClass('hidden') + + paths.front1 = new Path() + .move(points.mPoint1) + .curve_(points.mPointM1Cp1, points.pointM1) + .setText('(16)', textAttribute) + .addClass('hidden') + + paths.front2 = new Path() + .move(points.pointM1) + .curve_(points.pointM1Cp1, points.point1) + .setText('(16)', textAttribute) + .addClass('hidden') + + paths.backOfUpperJaw.curve(points.mPoint6Cp2, points.mPoint5Cp1, points.mPoint5) + + paths.seam = new Path() + .move(points.point1) + .join(paths.upperJaw1) + .join(paths.backOfUpperJaw) + .join(paths.upperJaw2) + .join(paths.front1) + .join(paths.front2) + .close() + + paths.backOfMouth = new Path() + .move(points.mPoint1) + .line(points.point1) + .setText('backOfMouth' + ' (11)', textAttribute) + .setClass('dashed') + + paths.lowerJaw1 = new Path() + .move(points.point2) + .curve(points.point2ToLowerJaw, points.lowerJawToPoint2, points.lowerJaw) + .setText('lowerJaw' + ' (14)', textAttribute) + .setClass('dashed') + paths.lowerJaw2 = new Path() + .move(points.mPoint2) + .curve(points.mPoint2ToLowerJaw, points.mLowerJawToPoint2, points.mLowerJaw) + .setText('lowerJaw' + ' (14)', textAttribute) + .setClass('dashed') + + store.set('lowerJaw', paths.lowerJaw1.length() + points.point1.dist(points.point2)) + + // Complete? + if (complete) { + points.title = points.pointM1.shiftFractionTowards(points.point6, 0.5) + macro('title', { + nr: 7, + at: points.title, + scale: 0.5, + title: 'lowerMouth', + }) + // points.logo = points.topLeft.shiftFractionTowards(points.bottomRight, 0.5) + // snippets.logo = new Snippet('logo', points.logo) + // points.text = points.logo + // .shift(-90, w / 8) + // .attr('data-text', 'hello') + // .attr('data-text-class', 'center') + + if (sa) { + paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') + } + } + + // Paperless? + if (paperless) { + macro('hd', { + from: points.pointM1, + to: points.point1, + y: points.point5.y + sa + 15, + }) + macro('hd', { + from: points.point1, + to: points.point3, + y: points.point5.y + sa + 15, + }) + macro('hd', { + from: points.point3, + to: points.point5, + y: points.point5.y + sa + 15, + }) + macro('hd', { + from: points.point5, + to: points.point6, + y: points.point5.y + sa + 15, + }) + macro('hd', { + from: points.pointM1, + to: points.point6, + y: points.mPoint5.y - sa - 15, + }) + macro('vd', { + from: points.point6, + to: points.point5, + x: points.point6.x + sa + 15, + }) + macro('vd', { + from: points.mPoint5, + to: points.point6, + x: points.point6.x + sa + 15, + }) + macro('vd', { + from: points.mPoint1, + to: points.mPoint5, + x: points.pointM1.x - sa - 15, + }) + macro('vd', { + from: points.point1, + to: points.mPoint1, + x: points.pointM1.x - sa - 15, + }) + macro('vd', { + from: points.point5, + to: points.point1, + x: points.pointM1.x - sa - 15, + }) + macro('vd', { + from: points.point2, + to: points.mPoint2, + x: points.point2.x, + }) + macro('ld', { + from: points.point5, + to: points.lowerJaw, + d: 5, + }) + macro('ld', { + from: points.lowerJaw, + to: points.point6, + d: 5, + }) + macro('ld', { + from: points.point6, + to: points.mLowerJaw, + d: 5, + }) + macro('ld', { + from: points.mLowerJaw, + to: points.mPoint5, + d: 5, + }) + } + + return part +} + +export const lowermouth = { + name: 'lowermouth', + after: [cheek, head1, uppermouth], + plugins: [pluginBundle], + draft: draftLowermouth, +} diff --git a/designs/skully/src/nose.mjs b/designs/skully/src/nose.mjs index cd23e0933c6..e184d547120 100644 --- a/designs/skully/src/nose.mjs +++ b/designs/skully/src/nose.mjs @@ -120,16 +120,16 @@ function draftNose({ // Paperless? if (paperless) { - macro('hd', { - from: points.bottomLeft, - to: points.bottomRight, - y: points.bottomLeft.y + sa + 15, - }) - macro('vd', { - from: points.bottomRight, - to: points.topRight, - x: points.topRight.x + sa + 15, - }) + // macro('hd', { + // from: points.bottomLeft, + // to: points.bottomRight, + // y: points.bottomLeft.y + sa + 15, + // }) + // macro('vd', { + // from: points.bottomRight, + // to: points.topRight, + // x: points.topRight.x + sa + 15, + // }) } return part diff --git a/designs/skully/src/part12.mjs b/designs/skully/src/part12.mjs deleted file mode 100644 index 415c87579d1..00000000000 --- a/designs/skully/src/part12.mjs +++ /dev/null @@ -1,165 +0,0 @@ -import { pluginBundle } from '@freesewing/plugin-bundle' -import { cheek } from './cheek.mjs' -import { forehead } from './forehead.mjs' -import { convertPoints } from './pointsUtil.mjs' - -function draftPart12({ - options, - Point, - Path, - points, - paths, - Snippet, - snippets, - complete, - sa, - store, - paperless, - macro, - part, -}) { - console.log('part12') - const textAttribute = 'text-xs center' - const sizeFactor = store.get('sizeFactor') - - var eyeCircumference = store.get('eyeBottom') + store.get('eyeTop') - var eyeDiameter = (eyeCircumference / Math.PI) * 2 - - const c = 0.55191502449351 - // const c = 0.75 - - // points.b0 = new Point(0,0).shift(0,eyeDiameter*1.5).shift(90,eyeDiameter*1.5) - // points.b1 = new Point(0,0).shift(180,eyeDiameter*1.5).shift(90,eyeDiameter*1.5) - // points.b2 = new Point(0,0).shift(180,eyeDiameter*1.5).shift(270,eyeDiameter*1.5) - // points.b3 = new Point(0,0).shift(0,eyeDiameter*1.5).shift(270,eyeDiameter*1.5) - - // paths.box = new Path() - // .move(points.b0) - // .line(points.b1) - // .line(points.b2) - // .line(points.b3) - // .close() - - points.point0 = new Point(0, 0) - points.point2 = points.point0.shift(0, eyeDiameter / 2).shift(90, eyeDiameter / 2) - points.point0Cp1 = points.point0.shift(0, (eyeDiameter / 2) * c) - points.point2Cp2 = points.point2.shift(270, (eyeDiameter / 2) * c) - - let p = new Path().move(points.point0).curve(points.point0Cp1, points.point2Cp2, points.point2) - - points.point1 = p.shiftAlong(p.length() / 2) - - let sp = p.split(points.point1) - - // paths.p1 = sp[0].clone() - // paths.p2 = sp[1].clone() - - points.p0 = sp[0].ops[0].to.clone() - points.p0Cp1 = sp[0].ops[1].cp1.clone() - points.p1Cp2 = sp[0].ops[1].cp2.clone() - points.p1 = sp[1].ops[0].to.clone() - points.p1Cp1 = sp[1].ops[1].cp1.clone() - points.p2Cp2 = sp[1].ops[1].cp2.clone() - points.p2 = sp[1].ops[1].to.clone() - - points.p0Cp1 = points.p0.shift(0, (eyeDiameter / 2) * c * 0.4) - points.p2Cp2 = points.p2.shift(270, (eyeDiameter / 2) * c * 0.4) - points.p1Cp1 = points.p1.shift(45, (eyeDiameter / 2) * c * 0.7) - points.p1Cp2 = points.p1.shift(225, (eyeDiameter / 2) * c * 0.7) - - points.p0Cp2 = points.p0Cp1.flipX() - points.p4 = points.p2.flipX() - points.p4Cp1 = points.p2Cp2.flipX() - points.p3 = points.p1.flipX() - points.p3Cp2 = points.p1Cp1.flipX() - points.p3Cp1 = points.p1Cp2.flipX() - - paths.eyeTop = new Path() - .move(points.p4) - .curve(points.p4Cp1, points.p3Cp2, points.p3) - .curve(points.p3Cp1, points.point9Cp2, points.point9) - .setText('Eye bottom (4)', textAttribute) - .addClass('hidden') - - paths.eye = new Path() - .move(points.p4) - .curve(points.p4Cp1, points.p3Cp2, points.p3) - .curve(points.p3Cp1, points.p0Cp2, points.p0) - .curve(points.p0Cp1, points.p1Cp2, points.p1) - .curve(points.p1Cp1, points.p2Cp2, points.p2) - - points.pointNotch = paths.eye.shiftAlong(store.get('eyeTop')) - - let ps = paths.eye.split(points.pointNotch) - paths.eyeTop = ps[0].clone().setText('Eye top (4)', textAttribute) - paths.eyeBottom = ps[1].clone().setText('Eye bottom (4)', textAttribute) - - paths.seam = new Path() - .move(points.p4) - .join(paths.eyeTop) - .join(paths.eyeBottom) - .line(points.p4) - .close() - - console.log({ sLength: p.length() }) - console.log({ - nLength: new Path() - .move(points.p4) - .curve(points.p4Cp1, points.p3Cp2, points.p3) - .curve(points.p3Cp1, points.p0Cp2, points.p0) - .length(), - }) - - // Complete? - if (complete) { - points.title = points.p4 - .shiftFractionTowards(points.p1, 0.5) - .shiftFractionTowards(points.p0, 0.3) - macro('title', { - nr: 12, - at: points.title, - scale: 0.3, - title: 'eye', - }) - snippets.n1 = new Snippet('notch', points.p2) - snippets.n2 = new Snippet('notch', points.p4) - snippets.n3 = new Snippet('bnotch', points.pointNotch) - - // points.logo = points.topLeft.shiftFractionTowards(points.bottomRight, 0.5) - // snippets.logo = new Snippet('logo', points.logo) - // points.text = points.logo - // .shift(-90, w / 8) - // .attr('data-text', 'hello') - // .attr('data-text-class', 'center') - - if (sa) { - paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') - } - } - console.log({ points: JSON.parse(JSON.stringify(points)) }) - - console.log({ paths: JSON.parse(JSON.stringify(paths)) }) - - // Paperless? - if (paperless) { - macro('hd', { - from: points.bottomLeft, - to: points.bottomRight, - y: points.bottomLeft.y + sa + 15, - }) - macro('vd', { - from: points.bottomRight, - to: points.topRight, - x: points.topRight.x + sa + 15, - }) - } - - return part -} - -export const part12 = { - name: 'part12', - after: [cheek, forehead], - plugins: [pluginBundle], - draft: draftPart12, -} diff --git a/designs/skully/src/uppermouth.mjs b/designs/skully/src/uppermouth.mjs index 5cdaf401e7b..fc36a14e910 100644 --- a/designs/skully/src/uppermouth.mjs +++ b/designs/skully/src/uppermouth.mjs @@ -90,14 +90,14 @@ function draftUppermouth({ // Paperless? if (paperless) { macro('hd', { - from: points.bottomLeft, - to: points.bottomRight, - y: points.bottomLeft.y + sa + 15, + from: points.point1, + to: points.point0, + y: points.point0.y - sa - 15, }) macro('vd', { - from: points.bottomRight, - to: points.topRight, - x: points.topRight.x + sa + 15, + from: points.point0, + to: points.point2, + x: points.point0.x + sa + 15, }) } From 28b535bedac8df68d55369e6a3699fca67f62f41 Mon Sep 17 00:00:00 2001 From: Wouter van Wageningen Date: Sun, 9 Apr 2023 19:18:41 +0000 Subject: [PATCH 03/27] More paperless --- designs/skully/src/head2.mjs | 115 ++++++++++++++++++++++++++------ designs/skully/src/head3.mjs | 82 ++++++++++++++++++++--- designs/skully/src/lowerjaw.mjs | 93 ++++++++++++++++++++------ 3 files changed, 239 insertions(+), 51 deletions(-) diff --git a/designs/skully/src/head2.mjs b/designs/skully/src/head2.mjs index 405ff7dd702..b4293740b5b 100644 --- a/designs/skully/src/head2.mjs +++ b/designs/skully/src/head2.mjs @@ -24,10 +24,11 @@ function draftHead2({ const sizeFactor = store.get('sizeFactor') points.point0 = new Point(0, 0) - points.point0Cp1 = points.point0.shift(269.3443191225503, 29.448928299685203 * sizeFactor) + points.point0Cp2 = points.point0.shift(0, 15 * sizeFactor) + // points.point0Cp1 = points.point0.shift(269.3443191225503, 29.448928299685203 * sizeFactor) points.point1 = points.point0.shift(257.7901473243395, 66.12988849226953 * sizeFactor) - points.point1Cp1 = points.point1.shift(268.2738211037443, 30.242724116719366 * sizeFactor) - points.point1Cp2 = points.point1.shift(88.2745252696326, 18.83053830882166 * sizeFactor) + points.point1Cp1 = points.point1.shift(270, 30.242724116719366 * sizeFactor) + points.point1Cp2 = points.point1.shift(90, 18.83053830882166 * sizeFactor) points.point2 = points.point0.shift(272.3327760921532, 153.20596573567235 * sizeFactor) points.point3 = points.point0.shift(282.5001868336755, 164.15422647315543 * sizeFactor) points.point3Cp1 = points.point3.shift(81.44269285511335, 54.758598457228615 * sizeFactor) @@ -43,15 +44,16 @@ function draftHead2({ p = new Path() .move(points.point0) - .curve(points.point0Cp1, points.point1Cp2, points.point1) + // .curve(points.point0Cp1, points.point1Cp2, points.point1) + ._curve(points.point1Cp2, points.point1) .curve_(points.point1Cp1, points.point2) if (secondSeam - p.length() > 0.1 || secondSeam - p.length() < -0.1) { points.point0 = points.point0.shift(90, secondSeam - p.length()) points.point1 = points.point1.shift(90, secondSeam - p.length()) - points.point0Cp1 = points.point0.shift(269.3443191225503, 29.448928299685203 * sizeFactor) - points.point1Cp1 = points.point1.shift(268.2738211037443, 30.242724116719366 * sizeFactor) - points.point1Cp2 = points.point1.shift(88.2745252696326, 18.83053830882166 * sizeFactor) + // points.point0Cp1 = points.point0.shift(269.3443191225503, 29.448928299685203 * sizeFactor) + points.point1Cp1 = points.point1.shift(270, 30.242724116719366 * sizeFactor) + points.point1Cp2 = points.point1.shift(90, 18.83053830882166 * sizeFactor) points.point0Cp2 = points.point0.shift(0, 15 * sizeFactor) } } while (iterations < 100 && (secondSeam - p.length() > 1 || secondSeam - p.length() < -1)) @@ -133,8 +135,6 @@ function draftHead2({ // snippets.logo = new Snippet('logo', points.logo) // points.text = points.logo // .shift(-90, w / 8) - // .attr('data-text', 'hello') - // .attr('data-text-class', 'center') if (sa) { paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') @@ -143,16 +143,93 @@ function draftHead2({ // Paperless? if (paperless) { - // macro('hd', { - // from: points.bottomLeft, - // to: points.bottomRight, - // y: points.bottomLeft.y + sa + 15, - // }) - // macro('vd', { - // from: points.bottomRight, - // to: points.topRight, - // x: points.topRight.x + sa + 15, - // }) + const bb = paths.seam.bbox() + const minX = bb.bottomRight.x + + points.pointX = utils.curveIntersectsX( + points.point3, + points.point3Cp1, + points.point4Cp2, + points.point4, + minX - 0.00001 + )[0] + + macro('hd', { + from: points.point0, + to: points.point4, + y: points.point0.y - sa - 15, + }) + macro('hd', { + from: points.point0, + to: points.pointX, + y: points.point0.y - sa - 25, + }) + macro('hd', { + from: points.point1, + to: points.pointX, + y: points.point0.y - sa - 35, + }) + macro('hd', { + from: points.point3, + to: points.pointX, + y: points.point3.y + sa + 15, + }) + macro('hd', { + from: points.point2, + to: points.point3, + y: points.point3.y + sa + 15, + }) + macro('hd', { + from: points.point1, + to: points.point2, + y: points.point3.y + sa + 15, + }) + macro('hd', { + from: points.point0, + to: points.dartPoint1, + y: points.dartPoint1.y, + }) + + macro('vd', { + from: points.point1, + to: points.point0, + x: points.point1.x - sa - 15, + }) + macro('vd', { + from: points.point2, + to: points.point1, + x: points.point1.x - sa - 15, + }) + macro('vd', { + from: points.point3, + to: points.point1, + x: points.point1.x - sa - 25, + }) + macro('vd', { + from: points.point0, + to: points.point4, + x: points.point4.x + sa + 15, + }) + macro('vd', { + from: points.point4, + to: points.dartPoint0, + x: points.point4.x + sa + 15, + }) + macro('vd', { + from: points.point4, + to: points.dartPoint2, + x: points.point4.x + sa + 25, + }) + macro('vd', { + from: points.dartPoint2, + to: points.point3, + x: points.point4.x + sa + 25, + }) + macro('vd', { + from: points.point0, + to: points.dartPoint1, + x: points.dartPoint1.x, + }) } return part diff --git a/designs/skully/src/head3.mjs b/designs/skully/src/head3.mjs index 26849e72543..6c14ac4b5af 100644 --- a/designs/skully/src/head3.mjs +++ b/designs/skully/src/head3.mjs @@ -131,16 +131,78 @@ function draftHead3({ // Paperless? if (paperless) { - // macro('hd', { - // from: points.bottomLeft, - // to: points.bottomRight, - // y: points.bottomLeft.y + sa + 15, - // }) - // macro('vd', { - // from: points.bottomRight, - // to: points.topRight, - // x: points.topRight.x + sa + 15, - // }) + const bb = paths.seam.bbox() + const minX = bb.bottomRight.x + + points.pointX = utils.curveIntersectsX( + points.point1, + points.point1Cp1, + points.point2Cp2, + points.point2, + minX - 0.0000001 + )[0] + + macro('hd', { + from: points.dartPoint2, + to: points.point2, + y: points.point2.y - sa - 15, + }) + macro('hd', { + from: points.dartPoint2, + to: points.pointX, + y: points.point2.y - sa - 25, + }) + macro('hd', { + from: points.dartPoint2, + to: points.point5, + y: points.point0.y + sa + 15, + }) + macro('hd', { + from: points.dartPoint0, + to: points.point5, + y: points.point0.y + sa + 5, + }) + macro('hd', { + from: points.dartPoint2, + to: points.point0, + y: points.point0.y + sa + 25, + }) + macro('hd', { + from: points.dartPoint2, + to: points.dartPoint1, + y: points.dartPoint2.y, + }) + + macro('vd', { + from: points.point2, + to: points.dartPoint1, + x: points.pointX.x + sa + 15, + }) + macro('vd', { + from: points.dartPoint1, + to: points.point0, + x: points.pointX.x + sa + 15, + }) + macro('vd', { + from: points.point2, + to: points.pointX, + x: points.pointX.x + sa + 25, + }) + macro('vd', { + from: points.dartPoint2, + to: points.point2, + x: points.dartPoint2.x - sa - 15, + }) + macro('vd', { + from: points.dartPoint0, + to: points.dartPoint2, + x: points.dartPoint2.x - sa - 15, + }) + macro('vd', { + from: points.point5, + to: points.dartPoint0, + x: points.dartPoint2.x - sa - 15, + }) } return part diff --git a/designs/skully/src/lowerjaw.mjs b/designs/skully/src/lowerjaw.mjs index ef4873660cc..882dfbef25b 100644 --- a/designs/skully/src/lowerjaw.mjs +++ b/designs/skully/src/lowerjaw.mjs @@ -16,6 +16,7 @@ function draftLowerjaw({ store, paperless, macro, + utils, part, }) { console.log('lowerjaw') @@ -29,15 +30,12 @@ function draftLowerjaw({ points.point4 = points.point0.shift(276.6440430845334, 116.75813357963548 * sizeFactor) points.point5 = points.point0.shift(264.48800048134507, 50.78381912578058 * sizeFactor) - points.point0Cp2 = points.point0.shift(264.9481781658739, 16.659715303689914 * sizeFactor) - points.point1Cp1 = points.point1.shift(268.7020740231185, 53.02160375733648 * sizeFactor) - let mouthTop = store.get('mouthTop') points.point0 = new Point(0, 0) points.point0Cp2 = points.point0.shift(354.9481781658739, 16.659715303689914 * sizeFactor) points.point1 = points.point0.shift(264.91311161963836, 43.0264648094635 * sizeFactor) - points.point1Cp1 = points.point1.shift(358.7020740231185, 53.02160375733651 * sizeFactor) + points.point1Cp1 = points.point1.shift(0, 53.02160375733651 * sizeFactor) points.point2 = points.point0.shift(331.14662128979205, 83.05325951149062 * sizeFactor) points.point2Cp1 = points.point2.shift(23.491413537740165, 11.818521142681087 * sizeFactor) points.point2Cp2 = points.point2.shift(203.48599545649284, 6.360957553702122 * sizeFactor) @@ -69,12 +67,6 @@ function draftLowerjaw({ log.error('Something is not quite right here!') } - // let mouthTop = store.get('mouthTop') - let mt = new Path() - .move(points.point5) - .curve(points.point5Cp1, points.point0Cp2, points.point0) - .length() - points.point4 = points.point4.shift( 355, store.get('lowerJaw') - @@ -131,8 +123,6 @@ function draftLowerjaw({ // snippets.logo = new Snippet('logo', points.logo) // points.text = points.logo // .shift(-90, w / 8) - // .attr('data-text', 'hello') - // .attr('data-text-class', 'center') if (sa) { paths.sa = paths.seam.offset(sa).trim().attr('class', 'fabric sa') @@ -141,16 +131,75 @@ function draftLowerjaw({ // Paperless? if (paperless) { - // macro('hd', { - // from: points.bottomLeft, - // to: points.bottomRight, - // y: points.bottomLeft.y + sa + 15, - // }) - // macro('vd', { - // from: points.bottomRight, - // to: points.topRight, - // x: points.topRight.x + sa + 15, - // }) + const bb = paths.seam.bbox() + const maxY = bb.topLeft.y + + points.pointY = utils.curveIntersectsY( + points.point4, + points.point4Cp1, + points.point5Cp2, + points.point5, + maxY + 0.0000001 + )[0] + + console.log({ bb: bb, maxY: maxY, pointY: points.pointY }) + + macro('hd', { + from: points.point0, + to: points.point5, + y: points.pointY.y - sa - 15, + }) + macro('hd', { + from: points.pointY, + to: points.point4, + y: points.pointY.y - sa - 15, + }) + macro('hd', { + from: points.point1, + to: points.point5, + y: points.pointY.y - sa - 25, + }) + macro('hd', { + from: points.point5, + to: points.point4, + y: points.pointY.y - sa - 25, + }) + macro('hd', { + from: points.point1, + to: points.point3, + y: points.point1.y + sa + 15, + }) + macro('hd', { + from: points.point3, + to: points.point4, + y: points.point1.y + sa + 15, + }) + + macro('vd', { + from: points.point1, + to: points.point5, + x: points.point1.x - sa - 15, + }) + macro('vd', { + from: points.point1, + to: points.point0, + x: points.point1.x - sa - 25, + }) + macro('vd', { + from: points.point1, + to: points.pointY, + x: points.point1.x - sa - 35, + }) + macro('vd', { + from: points.pointY, + to: points.point3, + x: points.point4.x + sa + 25, + }) + macro('vd', { + from: points.point4, + to: points.point3, + x: points.point4.x + sa + 15, + }) } return part From c45b79ff57024de65861d8ad48e01af6bd805f6f Mon Sep 17 00:00:00 2001 From: Wouter van Wageningen Date: Mon, 10 Apr 2023 02:07:02 +0000 Subject: [PATCH 04/27] Even more paperless --- designs/skully/src/cheekbone.mjs | 55 +++++++++++++----- designs/skully/src/nose.mjs | 96 ++++++++++++++++++++++++++------ 2 files changed, 120 insertions(+), 31 deletions(-) diff --git a/designs/skully/src/cheekbone.mjs b/designs/skully/src/cheekbone.mjs index ec0de41aeeb..869456c0957 100644 --- a/designs/skully/src/cheekbone.mjs +++ b/designs/skully/src/cheekbone.mjs @@ -1,20 +1,17 @@ import { pluginBundle } from '@freesewing/plugin-bundle' import { cheek } from './cheek.mjs' -import { convertPoints } from './pointsUtil.mjs' function draftCheekbone({ - options, Point, Path, points, paths, - Snippet, - snippets, complete, sa, store, paperless, macro, + utils, part, }) { console.log('cheekbone') @@ -57,8 +54,6 @@ function draftCheekbone({ // snippets.logo = new Snippet('logo', points.logo) // points.text = points.logo // .shift(-90, w / 8) - // .attr('data-text', 'hello') - // .attr('data-text-class', 'center') if (sa) { paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') @@ -67,16 +62,48 @@ function draftCheekbone({ // Paperless? if (paperless) { - // macro('hd', { - // from: points.bottomLeft, - // to: points.bottomRight, - // y: points.bottomLeft.y + sa + 15, - // }) + const bb = paths.seam.bbox() + const minY = bb.topLeft.y + + points.pointY = utils.curveIntersectsY( + points.point1, + points.point1Cp1, + points.point0, + points.point0, + minY + 0.00001 + )[0] + + macro('hd', { + from: points.point0, + to: points.point1, + y: points.point0.y + sa + 15, + }) + macro('hd', { + from: points.point0, + to: points.pointY, + y: points.pointY.y - sa - 15, + }) + macro('hd', { + from: points.pointY, + to: points.point1, + y: points.pointY.y - sa - 15, + }) + // macro('vd', { - // from: points.bottomRight, - // to: points.topRight, - // x: points.topRight.x + sa + 15, + // from: points.pointY, + // to: points.point1, + // x: points.point1.x + sa + 15, // }) + macro('vd', { + from: points.point1, + to: points.point0, + x: points.point1.x + sa + 15, + }) + macro('vd', { + from: points.pointY, + to: points.point0, + x: points.point0.x - sa - 15, + }) } return part diff --git a/designs/skully/src/nose.mjs b/designs/skully/src/nose.mjs index e184d547120..42539f6d1b7 100644 --- a/designs/skully/src/nose.mjs +++ b/designs/skully/src/nose.mjs @@ -5,7 +5,6 @@ import { forehead } from './forehead.mjs' import { convertPoints } from './pointsUtil.mjs' function draftNose({ - options, Point, Path, points, @@ -22,12 +21,9 @@ function draftNose({ }) { console.log('nose') const textAttribute = 'text-xs center' - const sizeFactor = store.get('sizeFactor') var noseSide = store.get('noseSide') var noseHeight = store.get('noseHeight') - var noseCircumference = noseSide * 2 - var noseDiameter = (noseCircumference / Math.PI) * 2 const c = 0.55191502449351 @@ -110,26 +106,92 @@ function draftNose({ // snippets.logo = new Snippet('logo', points.logo) // points.text = points.logo // .shift(-90, w / 8) - // .attr('data-text', 'hello') - // .attr('data-text-class', 'center') if (sa) { - paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') + // paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') + const pathSA1 = new Path() + .move(points.point0) + .join(paths.p1) + .line(points.point2) + .offset(sa) + .hide() + const pathSA2 = new Path() + .move(points.point2) + .line(points.point3) + .curve(points.point3Cp1, points.point0Cp2, points.point0) + .offset(sa) + .hide() + const pSa1 = pathSA1.intersectsX(0)[0] + paths.sa1 = pathSA1.split(pSa1)[1].hide() + const pSa2 = pathSA2.intersectsX(0)[0] + paths.sa2 = pathSA2.split(pSa2)[0].hide() + paths.sa = new Path() + .move(pSa1) + .join(paths.sa1) + .join(paths.sa2) + .close() + .attr('class', 'fabric sa') } } // Paperless? if (paperless) { - // macro('hd', { - // from: points.bottomLeft, - // to: points.bottomRight, - // y: points.bottomLeft.y + sa + 15, - // }) - // macro('vd', { - // from: points.bottomRight, - // to: points.topRight, - // x: points.topRight.x + sa + 15, - // }) + const bb = paths.seam.bbox() + const maxY = bb.bottomRight.y + + console.log({ bb: bb, maxY: maxY }) + + points.pointY1 = utils.curveIntersectsY( + points.point0, + points.point0Cp1, + points.point1Cp2, + points.point1, + maxY - 0.0000001 + )[0] + points.pointY2 = utils.curveIntersectsY( + points.point0, + points.point0Cp2, + points.point3Cp1, + points.point3, + maxY - 0.0000001 + )[0] + + macro('vd', { + from: points.point2, + to: points.point1, + x: points.point1.x + sa + 5, + }) + macro('vd', { + from: points.pointY2, + to: points.point2, + x: points.point3.x - sa - 5, + }) + + macro('hd', { + from: points.point0, + to: points.point1, + y: points.point2.y - sa - 5, + }) + macro('hd', { + from: points.point3, + to: points.point0, + y: points.point2.y - sa - 5, + }) + macro('hd', { + from: points.pointY1, + to: points.point1, + y: maxY + sa + 5, + }) + macro('hd', { + from: points.pointY2, + to: points.pointY1, + y: maxY + sa + 5, + }) + macro('hd', { + from: points.point3, + to: points.pointY2, + y: maxY + sa + 5, + }) } return part From aff3cbad9a63b8ac01d5e6f1e3801d106830aa27 Mon Sep 17 00:00:00 2001 From: Wouter van Wageningen Date: Mon, 10 Apr 2023 16:55:54 +0000 Subject: [PATCH 05/27] Change bbox to edge --- designs/skully/src/cheekbone.mjs | 8 +------- designs/skully/src/head2.mjs | 11 +--------- designs/skully/src/head3.mjs | 14 ++++--------- designs/skully/src/lowerjaw.mjs | 16 ++++----------- designs/skully/src/nose.mjs | 35 +++++++++++--------------------- 5 files changed, 22 insertions(+), 62 deletions(-) diff --git a/designs/skully/src/cheekbone.mjs b/designs/skully/src/cheekbone.mjs index 869456c0957..c83a7b5cdd6 100644 --- a/designs/skully/src/cheekbone.mjs +++ b/designs/skully/src/cheekbone.mjs @@ -65,13 +65,7 @@ function draftCheekbone({ const bb = paths.seam.bbox() const minY = bb.topLeft.y - points.pointY = utils.curveIntersectsY( - points.point1, - points.point1Cp1, - points.point0, - points.point0, - minY + 0.00001 - )[0] + points.pointY = paths.seam.edge('top') macro('hd', { from: points.point0, diff --git a/designs/skully/src/head2.mjs b/designs/skully/src/head2.mjs index b4293740b5b..2b09b6a5f37 100644 --- a/designs/skully/src/head2.mjs +++ b/designs/skully/src/head2.mjs @@ -143,16 +143,7 @@ function draftHead2({ // Paperless? if (paperless) { - const bb = paths.seam.bbox() - const minX = bb.bottomRight.x - - points.pointX = utils.curveIntersectsX( - points.point3, - points.point3Cp1, - points.point4Cp2, - points.point4, - minX - 0.00001 - )[0] + points.pointX = paths.seam.edge('right') macro('hd', { from: points.point0, diff --git a/designs/skully/src/head3.mjs b/designs/skully/src/head3.mjs index 6c14ac4b5af..333ac6faea2 100644 --- a/designs/skully/src/head3.mjs +++ b/designs/skully/src/head3.mjs @@ -131,16 +131,10 @@ function draftHead3({ // Paperless? if (paperless) { - const bb = paths.seam.bbox() - const minX = bb.bottomRight.x - - points.pointX = utils.curveIntersectsX( - points.point1, - points.point1Cp1, - points.point2Cp2, - points.point2, - minX - 0.0000001 - )[0] + points.pointX = new Path() + .move(points.point1) + .curve(points.point1Cp1, points.point2Cp2, points.point2) + .edge('right') macro('hd', { from: points.dartPoint2, diff --git a/designs/skully/src/lowerjaw.mjs b/designs/skully/src/lowerjaw.mjs index 882dfbef25b..5677b7931ba 100644 --- a/designs/skully/src/lowerjaw.mjs +++ b/designs/skully/src/lowerjaw.mjs @@ -131,18 +131,10 @@ function draftLowerjaw({ // Paperless? if (paperless) { - const bb = paths.seam.bbox() - const maxY = bb.topLeft.y - - points.pointY = utils.curveIntersectsY( - points.point4, - points.point4Cp1, - points.point5Cp2, - points.point5, - maxY + 0.0000001 - )[0] - - console.log({ bb: bb, maxY: maxY, pointY: points.pointY }) + points.pointY = new Path() + .move(points.point4) + .curve(points.point4Cp1, points.point5Cp2, points.point5) + .edge('top') macro('hd', { from: points.point0, diff --git a/designs/skully/src/nose.mjs b/designs/skully/src/nose.mjs index 42539f6d1b7..3473a43aab9 100644 --- a/designs/skully/src/nose.mjs +++ b/designs/skully/src/nose.mjs @@ -136,25 +136,14 @@ function draftNose({ // Paperless? if (paperless) { - const bb = paths.seam.bbox() - const maxY = bb.bottomRight.y - - console.log({ bb: bb, maxY: maxY }) - - points.pointY1 = utils.curveIntersectsY( - points.point0, - points.point0Cp1, - points.point1Cp2, - points.point1, - maxY - 0.0000001 - )[0] - points.pointY2 = utils.curveIntersectsY( - points.point0, - points.point0Cp2, - points.point3Cp1, - points.point3, - maxY - 0.0000001 - )[0] + points.pointY1 = new Path() + .move(points.point0) + .curve(points.point0Cp1, points.point1Cp2, points.point1) + .edge('bottom') + points.pointY2 = new Path() + .move(points.point0) + .curve(points.point0Cp2, points.point3Cp1, points.point3) + .edge('bottom') macro('vd', { from: points.point2, @@ -162,7 +151,7 @@ function draftNose({ x: points.point1.x + sa + 5, }) macro('vd', { - from: points.pointY2, + from: points.pointY1, to: points.point2, x: points.point3.x - sa - 5, }) @@ -180,17 +169,17 @@ function draftNose({ macro('hd', { from: points.pointY1, to: points.point1, - y: maxY + sa + 5, + y: points.pointY2.y + sa + 5, }) macro('hd', { from: points.pointY2, to: points.pointY1, - y: maxY + sa + 5, + y: points.pointY2.y + sa + 5, }) macro('hd', { from: points.point3, to: points.pointY2, - y: maxY + sa + 5, + y: points.pointY2.y + sa + 5, }) } From 509d1f09bf71004ea8b460a6c49b9acf8b7c818b Mon Sep 17 00:00:00 2001 From: Wouter van Wageningen Date: Tue, 11 Apr 2023 04:08:25 +0000 Subject: [PATCH 06/27] Last of the paperless and some cleanup --- config/software/designs.json | 2 +- designs/skully/README.md | 2 +- designs/skully/package.json | 2 +- designs/skully/src/cheek.mjs | 124 +++++++++++++++++++++++++----- designs/skully/src/cheekbone.mjs | 9 --- designs/skully/src/eye.mjs | 104 ++----------------------- designs/skully/src/forehead.mjs | 107 ++++++++++++++++++++++---- designs/skully/src/head1.mjs | 4 - designs/skully/src/head2.mjs | 27 +------ designs/skully/src/head3.mjs | 5 -- designs/skully/src/index.mjs | 2 +- designs/skully/src/jawfloor.mjs | 7 -- designs/skully/src/lowerjaw.mjs | 8 +- designs/skully/src/lowermouth.mjs | 20 ++--- designs/skully/src/nose.mjs | 20 +++-- designs/skully/src/pointsUtil.mjs | 52 ------------- designs/skully/src/uppermouth.mjs | 6 -- 17 files changed, 230 insertions(+), 271 deletions(-) delete mode 100644 designs/skully/src/pointsUtil.mjs diff --git a/config/software/designs.json b/config/software/designs.json index 6296f723527..98e934d0dd0 100644 --- a/config/software/designs.json +++ b/config/software/designs.json @@ -82,7 +82,7 @@ "code": "Coder name", "code": "Wouter Van Wageningen", "design": "Wouter Van Wageningen", - "difficulty": 9, + "difficulty": 5, "tags": ["accessories", "toys"] }, "trayvon": { diff --git a/designs/skully/README.md b/designs/skully/README.md index cd3ab3f7a37..dfb5b197513 100644 --- a/designs/skully/README.md +++ b/designs/skully/README.md @@ -48,7 +48,7 @@ # @freesewing/skully -A FreeSewing pattern that needs a description +A FreeSewing pattern for skully, our logo, a plushy toy diff --git a/designs/skully/package.json b/designs/skully/package.json index e5e3ac2b456..ff01ff6489e 100644 --- a/designs/skully/package.json +++ b/designs/skully/package.json @@ -1,7 +1,7 @@ { "name": "@freesewing/skully", "version": "3.0.0-alpha.8", - "description": "A FreeSewing pattern that needs a description", + "description": "A FreeSewing pattern for skully, our logo, a plushy toy", "author": "Joost De Cock (https://github.com/joostdecock)", "homepage": "https://freesewing.org/", "repository": "github:freesewing/freesewing", diff --git a/designs/skully/src/cheek.mjs b/designs/skully/src/cheek.mjs index 56d9264accb..1b6a2e2178d 100644 --- a/designs/skully/src/cheek.mjs +++ b/designs/skully/src/cheek.mjs @@ -1,5 +1,4 @@ import { pluginBundle } from '@freesewing/plugin-bundle' -import { convertPoints } from './pointsUtil.mjs' function draftCheek({ options, @@ -20,7 +19,7 @@ function draftCheek({ console.log('cheek') const textAttribute = 'text-xs center' - let sizeFactor = ((measurements?.head || 596) / 929.5) * options.size * 2 + const sizeFactor = ((measurements?.head || 596) / 929.5) * options.size * 2 store.set('sizeFactor', sizeFactor) points.point0 = new Point(0, 0) @@ -53,7 +52,7 @@ function draftCheek({ .curve(points.point6Cp2, points.point5Cp1, points.point5) .shiftAlong(65 * sizeFactor) - var sp = new Path() + const sp = new Path() .move(points.point5) .curve(points.point5Cp1, points.point6Cp2, points.point6) .split(points.point5a) @@ -92,9 +91,6 @@ function draftCheek({ store.set('templeToJaw', points.point5.dist(points.point5a)) store.set('upperJaw', paths.upperJaw.length()) - console.log({ sp: sp }) - console.log({ points: JSON.parse(JSON.stringify(points)) }) - paths.seam1 = new Path() .move(points.point9) .line(points.point0) @@ -134,7 +130,6 @@ function draftCheek({ .join(paths.eyeBottom) .join(paths.seam1) .close() - // .attr('class', 'fabric') store.set('templeWidth', points.point6.dist(points.point7)) store.set('noseBridgeWidth', points.point0.dist(points.point9)) @@ -144,10 +139,6 @@ function draftCheek({ store.set('noseSide', paths.nose.length()) store.set('noseHeight', points.point1.dist(points.point2)) - // console.log({ points: JSON.parse(JSON.stringify(points)) }) - // console.log({ paths: JSON.parse(JSON.stringify(paths)) }) - // convertPoints(points) - // Complete? if (complete) { points.title = points.point4Cp2.shiftFractionTowards(points.point0, 0.3) @@ -177,16 +168,107 @@ function draftCheek({ // Paperless? if (paperless) { - // macro('hd', { - // from: points.bottomLeft, - // to: points.bottomRight, - // y: points.bottomLeft.y + sa + 15, - // }) - // macro('vd', { - // from: points.bottomRight, - // to: points.topRight, - // x: points.topRight.x + sa + 15, - // }) + points.noseX = paths.nose.edge('right') + points.eyeBottomY = paths.eyeBottom.edge('bottom') + points.upperJaw = paths.upperJaw.shiftFractionAlong(0.42) + console.log({ uj: points.upperJaw, p6: points.point6 }) + + macro('hd', { + from: points.noseX, + to: points.point4, + y: points.noseX.y + 5, + }) + macro('hd', { + from: points.point6, + to: points.point5, + y: points.point6.y - sa - 15, + }) + macro('hd', { + from: points.point6, + to: points.point5a, + y: points.point6.y - sa - 5, + }) + macro('hd', { + from: points.point7, + to: points.point5, + y: points.point6.y - sa - 25, + }) + macro('hd', { + from: points.point3, + to: points.point7, + y: points.point6.y - sa - 35, + }) + macro('hd', { + from: points.point2, + to: points.point7, + y: points.point6.y - sa - 25, + }) + macro('hd', { + from: points.point1, + to: points.point7, + y: points.point6.y - sa - 15, + }) + macro('hd', { + from: points.point0, + to: points.point7, + y: points.point6.y - sa - 5, + }) + macro('hd', { + from: points.point9, + to: points.point7, + y: points.point6.y - sa + 5, + }) + macro('hd', { + from: points.point3, + to: points.point4, + y: points.point4.y + sa + 15, + }) + macro('hd', { + from: points.point4, + to: points.point5, + y: points.point4.y + sa + 15, + }) + + macro('vd', { + from: points.eyeBottomY, + to: points.point4, + x: points.point4.x, + }) + macro('vd', { + from: points.point6, + to: points.point5a, + x: points.point5.x + sa + 10, + }) + macro('vd', { + from: points.point6, + to: points.point5, + x: points.point5.x + sa + 20, + }) + macro('vd', { + from: points.point5, + to: points.point4, + x: points.point5.x + sa + 20, + }) + macro('vd', { + from: points.point3, + to: points.point2, + x: points.point2.x - sa - 10, + }) + macro('vd', { + from: points.point3, + to: points.point1, + x: points.point2.x - sa - 20, + }) + macro('vd', { + from: points.point1, + to: points.point0, + x: points.point2.x - sa - 20, + }) + macro('vd', { + from: points.point6, + to: points.upperJaw, + x: points.point6.x, + }) } return part diff --git a/designs/skully/src/cheekbone.mjs b/designs/skully/src/cheekbone.mjs index c83a7b5cdd6..1a85986fdb2 100644 --- a/designs/skully/src/cheekbone.mjs +++ b/designs/skully/src/cheekbone.mjs @@ -11,7 +11,6 @@ function draftCheekbone({ store, paperless, macro, - utils, part, }) { console.log('cheekbone') @@ -62,9 +61,6 @@ function draftCheekbone({ // Paperless? if (paperless) { - const bb = paths.seam.bbox() - const minY = bb.topLeft.y - points.pointY = paths.seam.edge('top') macro('hd', { @@ -83,11 +79,6 @@ function draftCheekbone({ y: points.pointY.y - sa - 15, }) - // macro('vd', { - // from: points.pointY, - // to: points.point1, - // x: points.point1.x + sa + 15, - // }) macro('vd', { from: points.point1, to: points.point0, diff --git a/designs/skully/src/eye.mjs b/designs/skully/src/eye.mjs index d9c70ccb0f4..87efcd62e20 100644 --- a/designs/skully/src/eye.mjs +++ b/designs/skully/src/eye.mjs @@ -1,98 +1,8 @@ import { pluginBundle } from '@freesewing/plugin-bundle' import { cheek } from './cheek.mjs' import { forehead } from './forehead.mjs' -import { convertPoints } from './pointsUtil.mjs' - -// const markers = ` -// -// -// -// -// -// -// -// -// -// ` - -// export const sewTogetherPlugin = { -// name: 'sewTogetherplugin', -// version: '0.01.01', -// hooks: { -// preRender: (svg) => { -// console.log({ preRender: svg }) -// if (svg.defs.indexOf(markers) === -1) svg.defs += markers -// }, -// }, -// macros: { -// sewTogether: function (so, { points, paths, Path, complete, scale, sa }) { -// if (so === false) { -// delete points.sewTogetherFrom -// delete points.sewTogetherTo -// delete points.cutonfoldVia1 -// delete points.cutonfoldVia2 -// delete paths.cutonfold -// // setCutOnFold relies on plugin-cutlist -// return true -// } -// so = { -// prefix: 'sewTogether', -// ...so, -// } -// if (complete) { -// if (null == so.middle) { -// so.middle = so.from.shiftFractionTowards(so.to, 0.5) -// } -// points[so.prefix + 'From'] = so.from -// points[so.prefix + 'Middle'] = so.middle -// points[so.prefix + 'To'] = so.to - -// points[so.prefix + 'FromCp'] = points[so.prefix + 'From'].shift( -// points[so.prefix + 'From'].angle(points[so.prefix + 'Middle']) + 90, -// points[so.prefix + 'From'].dist(points[so.prefix + 'Middle']) / 1.5 -// ) -// points[so.prefix + 'ToCp'] = points[so.prefix + 'To'].shift( -// points[so.prefix + 'To'].angle(points[so.prefix + 'Middle']) - 90, -// points[so.prefix + 'To'].dist(points[so.prefix + 'Middle']) / 1.5 -// ) - -// if (so.hinge) { -// points[so.prefix + 'Hinge'] = points[so.prefix + 'Middle'].shift( -// points[so.prefix + 'Middle'].angle(points[so.prefix + 'To']) + -// Math.abs( -// points[so.prefix + 'Middle'].angle(points[so.prefix + 'From']) - -// points[so.prefix + 'Middle'].angle(points[so.prefix + 'To']) -// ) / -// 2 + -// (sa ? 180 : 0), -// sa -// ? sa -// : Math.min( -// points[so.prefix + 'From'].dist(points[so.prefix + 'Middle']), -// points[so.prefix + 'From'].dist(points[so.prefix + 'Middle']) -// ) / 4 -// ) -// paths[so.prefix + 'SewTogetherHinge'] = new Path() -// .move(points[so.prefix + 'Middle']) -// .line(points[so.prefix + 'Hinge']) -// .attr('marker-start', 'url(#sewTogetherCross)') -// .attr('class', 'dotted note stroke-sm') -// } -// paths[so.prefix + 'SewTogether'] = new Path() -// .move(points[so.prefix + 'From']) -// .curve(points[so.prefix + 'FromCp'], points[so.prefix + 'ToCp'], points[so.prefix + 'To']) -// .attr('class', 'dotted note stroke-sm') -// .attr('marker-start', 'url(#sewTogetherStart)') -// .attr('marker-end', 'url(#sewTogetherEnd)') -// .attr('data-text', 'sewTogether') -// .attr('data-text-class', 'center fill-note text-xs') -// } -// }, -// }, -// } function draftEye({ - options, Point, Path, points, @@ -105,14 +15,12 @@ function draftEye({ paperless, macro, part, - svg, }) { console.log('eye') const textAttribute = 'text-xs center' - const sizeFactor = store.get('sizeFactor') - var eyeCircumference = store.get('eyeBottom') + store.get('eyeTop') - var eyeDiameter = (eyeCircumference / Math.PI) * 2 + const eyeCircumference = store.get('eyeBottom') + store.get('eyeTop') + const eyeDiameter = (eyeCircumference / Math.PI) * 2 const c = 0.55191502449351 points.point0 = new Point(0, 0) @@ -120,11 +28,11 @@ function draftEye({ points.point0Cp1 = points.point0.shift(0, (eyeDiameter / 2) * c) points.point2Cp2 = points.point2.shift(270, (eyeDiameter / 2) * c) - let p = new Path().move(points.point0).curve(points.point0Cp1, points.point2Cp2, points.point2) + const p = new Path().move(points.point0).curve(points.point0Cp1, points.point2Cp2, points.point2) points.point1 = p.shiftAlong(p.length() / 2) - let sp = p.split(points.point1) + const sp = p.split(points.point1) points.p0 = sp[0].ops[0].to.clone() points.p0Cp1 = sp[0].ops[1].cp1.clone() @@ -155,7 +63,7 @@ function draftEye({ points.pointNotch = paths.eye.shiftAlong(store.get('eyeTop')) - let ps = paths.eye.split(points.pointNotch) + const ps = paths.eye.split(points.pointNotch) paths.eyeTop = ps[0].clone().setText('eyeTop' + ' (4)', textAttribute) paths.eyeBottom = ps[1].clone().setText('eyeBottom' + ' (4)', textAttribute) @@ -226,14 +134,12 @@ function draftEye({ }) } - console.log({ pluginBundle: pluginBundle }) return part } export const eye = { name: 'eye', after: [cheek, forehead], - // plugins: [pluginBundle, sewTogetherPlugin], plugins: [pluginBundle], draft: draftEye, } diff --git a/designs/skully/src/forehead.mjs b/designs/skully/src/forehead.mjs index b4ce59ae6f0..d6a9e722a68 100644 --- a/designs/skully/src/forehead.mjs +++ b/designs/skully/src/forehead.mjs @@ -1,9 +1,7 @@ import { pluginBundle } from '@freesewing/plugin-bundle' import { cheek } from './cheek.mjs' -import { convertPoints } from './pointsUtil.mjs' function draftForehead({ - options, Point, Path, points, @@ -136,8 +134,6 @@ function draftForehead({ // snippets.logo = new Snippet('logo', points.logo) // points.text = points.logo // .shift(-90, w / 8) - // .attr('data-text', 'hello') - // .attr('data-text-class', 'center') if (sa) { paths.sa = paths.seam.offset(sa).trim().attr('class', 'fabric sa') @@ -146,16 +142,99 @@ function draftForehead({ // Paperless? if (paperless) { - // macro('hd', { - // from: points.bottomLeft, - // to: points.bottomRight, - // y: points.bottomLeft.y + sa + 15, - // }) - // macro('vd', { - // from: points.bottomRight, - // to: points.topRight, - // x: points.topRight.x + sa + 15, - // }) + points.pointX = paths.seam.edge('left') + + macro('hd', { + from: points.point0, + to: points.point9, + y: points.point0.y - sa - 15, + }) + macro('hd', { + from: points.pointX, + to: points.point0, + y: points.point0.y - sa - 15, + }) + macro('hd', { + from: points.point6, + to: points.point8, + y: points.point6.y + sa + 5, + }) + macro('hd', { + from: points.point6, + to: points.point9, + y: points.point6.y + sa + 15, + }) + macro('hd', { + from: points.point5, + to: points.point6, + y: points.point6.y + sa + 5, + }) + macro('hd', { + from: points.point4, + to: points.point6, + y: points.point6.y + sa + 15, + }) + macro('hd', { + from: points.point2, + to: points.point6, + y: points.point6.y + sa + 25, + }) + macro('hd', { + from: points.point1, + to: points.point6, + y: points.point6.y + sa + 35, + }) + macro('hd', { + from: points.pointX, + to: points.point6, + y: points.point6.y + sa + 45, + }) + macro('hd', { + from: points.point0, + to: points.point7, + y: points.point7.y, + }) + + macro('vd', { + from: points.point5, + to: points.point0, + x: points.pointX.x - sa - 10, + }) + macro('vd', { + from: points.point4, + to: points.point0, + x: points.pointX.x - sa - 20, + }) + macro('vd', { + from: points.point1, + to: points.point0, + x: points.pointX.x - sa - 30, + }) + macro('vd', { + from: points.point2, + to: points.point0, + x: points.pointX.x - sa - 40, + }) + macro('vd', { + from: points.point0, + to: points.point9, + x: points.point9.x + sa + 10, + }) + macro('vd', { + from: points.point0, + to: points.point8, + x: points.point9.x + sa + 20, + }) + macro('vd', { + from: points.point0, + to: points.point6, + x: points.point9.x + sa + 30, + }) + macro('vd', { + from: points.point0, + to: points.point7, + x: points.point0.x, + }) } return part diff --git a/designs/skully/src/head1.mjs b/designs/skully/src/head1.mjs index bb377944668..ff91e9ddc4d 100644 --- a/designs/skully/src/head1.mjs +++ b/designs/skully/src/head1.mjs @@ -1,10 +1,8 @@ import { pluginBundle } from '@freesewing/plugin-bundle' -import { convertPoints } from './pointsUtil.mjs' import { cheek } from './cheek.mjs' import { forehead } from './forehead.mjs' function draftHead1({ - options, Point, Path, points, @@ -17,9 +15,7 @@ function draftHead1({ paperless, macro, part, - utils, }) { - console.log('head1') const textAttribute = 'text-xs center' const sizeFactor = store.get('sizeFactor') diff --git a/designs/skully/src/head2.mjs b/designs/skully/src/head2.mjs index 2b09b6a5f37..f59c59ca7b4 100644 --- a/designs/skully/src/head2.mjs +++ b/designs/skully/src/head2.mjs @@ -1,31 +1,14 @@ import { pluginBundle } from '@freesewing/plugin-bundle' -import { convertPoints } from './pointsUtil.mjs' import { cheek } from './cheek.mjs' import { head1 } from './head1.mjs' -function draftHead2({ - options, - Point, - Path, - points, - paths, - Snippet, - snippets, - complete, - sa, - store, - utils, - paperless, - macro, - part, -}) { +function draftHead2({ Point, Path, points, paths, complete, sa, store, paperless, macro, part }) { console.log('head2') const textAttribute = 'text-xs center' const sizeFactor = store.get('sizeFactor') points.point0 = new Point(0, 0) points.point0Cp2 = points.point0.shift(0, 15 * sizeFactor) - // points.point0Cp1 = points.point0.shift(269.3443191225503, 29.448928299685203 * sizeFactor) points.point1 = points.point0.shift(257.7901473243395, 66.12988849226953 * sizeFactor) points.point1Cp1 = points.point1.shift(270, 30.242724116719366 * sizeFactor) points.point1Cp2 = points.point1.shift(90, 18.83053830882166 * sizeFactor) @@ -35,7 +18,7 @@ function draftHead2({ points.point4 = points.point0.shift(340.927384878832, 52.16879559660159 * sizeFactor) points.point4Cp2 = points.point4.shift(274.04106104609286, 50.57373626695976 * sizeFactor) - let secondSeam = store.get('secondSeam') + const secondSeam = store.get('secondSeam') let iterations = 0 var p @@ -44,14 +27,12 @@ function draftHead2({ p = new Path() .move(points.point0) - // .curve(points.point0Cp1, points.point1Cp2, points.point1) ._curve(points.point1Cp2, points.point1) .curve_(points.point1Cp1, points.point2) if (secondSeam - p.length() > 0.1 || secondSeam - p.length() < -0.1) { points.point0 = points.point0.shift(90, secondSeam - p.length()) points.point1 = points.point1.shift(90, secondSeam - p.length()) - // points.point0Cp1 = points.point0.shift(269.3443191225503, 29.448928299685203 * sizeFactor) points.point1Cp1 = points.point1.shift(270, 30.242724116719366 * sizeFactor) points.point1Cp2 = points.point1.shift(90, 18.83053830882166 * sizeFactor) points.point0Cp2 = points.point0.shift(0, 15 * sizeFactor) @@ -61,13 +42,11 @@ function draftHead2({ if (iterations >= 100) { log.error('Something is not quite right here!') } - console.log({ iterations: iterations }) points.dartPoint0 = new Path() .move(points.point3) .curve(points.point3Cp1, points.point4Cp2, points.point4) .shiftAlong(99.23273836900117 * sizeFactor) - // points.dartPoint0Cp1 = points.dartPoint0.clone() points.dartPoint1 = points.point0.shift(285.96197961706986, 65.4910471438654 * sizeFactor) points.dartPoint1Cp1 = points.dartPoint1.shift( 354.74216521134053, @@ -124,7 +103,7 @@ function draftHead2({ // Complete? if (complete) { - points.title = points.point0.shiftFractionTowards(points.point3, 0.25) + points.title = points.dartPoint1.shiftFractionTowards(points.point2, 0.35) macro('title', { nr: 4, at: points.title, diff --git a/designs/skully/src/head3.mjs b/designs/skully/src/head3.mjs index 333ac6faea2..1b7d553a3fa 100644 --- a/designs/skully/src/head3.mjs +++ b/designs/skully/src/head3.mjs @@ -1,17 +1,13 @@ import { pluginBundle } from '@freesewing/plugin-bundle' -import { convertPoints } from './pointsUtil.mjs' import { cheek } from './cheek.mjs' import { head2 } from './head2.mjs' import { jawfloor } from './jawfloor.mjs' function draftHead3({ - options, Point, Path, points, paths, - Snippet, - snippets, complete, sa, log, @@ -21,7 +17,6 @@ function draftHead3({ utils, part, }) { - console.log('head3') const textAttribute = 'text-xs center' const sizeFactor = store.get('sizeFactor') diff --git a/designs/skully/src/index.mjs b/designs/skully/src/index.mjs index 89d1cf21141..0a31fa45090 100644 --- a/designs/skully/src/index.mjs +++ b/designs/skully/src/index.mjs @@ -1,4 +1,4 @@ -// +// Skully import { Design } from '@freesewing/core' import { data } from '../data.mjs' diff --git a/designs/skully/src/jawfloor.mjs b/designs/skully/src/jawfloor.mjs index 3e4a5359a9c..4faf8300a0d 100644 --- a/designs/skully/src/jawfloor.mjs +++ b/designs/skully/src/jawfloor.mjs @@ -1,16 +1,12 @@ import { pluginBundle } from '@freesewing/plugin-bundle' import { cheek } from './cheek.mjs' import { lowerjaw } from './lowerjaw.mjs' -import { convertPoints } from './pointsUtil.mjs' function draftJawfloor({ - options, Point, Path, points, paths, - Snippet, - snippets, complete, sa, store, @@ -18,7 +14,6 @@ function draftJawfloor({ macro, part, }) { - console.log('jawfloor') const textAttribute = 'text-xs center' const sizeFactor = store.get('sizeFactor') @@ -114,8 +109,6 @@ function draftJawfloor({ // snippets.logo = new Snippet('logo', points.logo) // points.text = points.logo // .shift(-90, w / 8) - // .attr('data-text', 'hello') - // .attr('data-text-class', 'center') if (sa) { paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') diff --git a/designs/skully/src/lowerjaw.mjs b/designs/skully/src/lowerjaw.mjs index 5677b7931ba..1e69b91bc28 100644 --- a/designs/skully/src/lowerjaw.mjs +++ b/designs/skully/src/lowerjaw.mjs @@ -1,25 +1,19 @@ import { pluginBundle } from '@freesewing/plugin-bundle' import { cheek } from './cheek.mjs' import { lowermouth } from './lowermouth.mjs' -import { convertPoints } from './pointsUtil.mjs' function draftLowerjaw({ - options, Point, Path, points, paths, - Snippet, - snippets, complete, sa, store, paperless, macro, - utils, part, }) { - console.log('lowerjaw') const textAttribute = 'text-xs center' const sizeFactor = store.get('sizeFactor') @@ -30,7 +24,7 @@ function draftLowerjaw({ points.point4 = points.point0.shift(276.6440430845334, 116.75813357963548 * sizeFactor) points.point5 = points.point0.shift(264.48800048134507, 50.78381912578058 * sizeFactor) - let mouthTop = store.get('mouthTop') + const mouthTop = store.get('mouthTop') points.point0 = new Point(0, 0) points.point0Cp2 = points.point0.shift(354.9481781658739, 16.659715303689914 * sizeFactor) diff --git a/designs/skully/src/lowermouth.mjs b/designs/skully/src/lowermouth.mjs index 43622fdb8c8..912fa21658c 100644 --- a/designs/skully/src/lowermouth.mjs +++ b/designs/skully/src/lowermouth.mjs @@ -2,16 +2,12 @@ import { pluginBundle } from '@freesewing/plugin-bundle' import { cheek } from './cheek.mjs' import { head1 } from './head1.mjs' import { uppermouth } from './uppermouth.mjs' -import { convertPoints } from './pointsUtil.mjs' function draftLowermouth({ - options, Point, Path, points, paths, - Snippet, - snippets, complete, sa, store, @@ -19,7 +15,6 @@ function draftLowermouth({ macro, part, }) { - console.log('lowermouth') const textAttribute = 'text-xs center' const sizeFactor = store.get('sizeFactor') @@ -138,14 +133,14 @@ function draftLowermouth({ .addClass('hidden') paths.front1 = new Path() - .move(points.mPoint1) - .curve_(points.mPointM1Cp1, points.pointM1) + .move(points.pointM1) + .curve_(points.pointM1Cp1, points.point1) .setText('(16)', textAttribute) .addClass('hidden') paths.front2 = new Path() - .move(points.pointM1) - .curve_(points.pointM1Cp1, points.point1) + .move(points.mPoint1) + .curve_(points.mPointM1Cp1, points.pointM1) .setText('(16)', textAttribute) .addClass('hidden') @@ -156,8 +151,8 @@ function draftLowermouth({ .join(paths.upperJaw1) .join(paths.backOfUpperJaw) .join(paths.upperJaw2) - .join(paths.front1) .join(paths.front2) + .join(paths.front1) .close() paths.backOfMouth = new Path() @@ -192,10 +187,11 @@ function draftLowermouth({ // snippets.logo = new Snippet('logo', points.logo) // points.text = points.logo // .shift(-90, w / 8) - // .attr('data-text', 'hello') - // .attr('data-text-class', 'center') if (sa) { + // Doing a trim() here has a weird issue. Part of the SA, related to + // the point1->point2 line, will disappear. + // paths.sa = paths.seam.offset(sa).trim().attr('class', 'fabric sa') paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') } } diff --git a/designs/skully/src/nose.mjs b/designs/skully/src/nose.mjs index 3473a43aab9..c913d34b70b 100644 --- a/designs/skully/src/nose.mjs +++ b/designs/skully/src/nose.mjs @@ -2,7 +2,6 @@ import { pluginBundle } from '@freesewing/plugin-bundle' import { cheek } from './cheek.mjs' import { eye } from './eye.mjs' import { forehead } from './forehead.mjs' -import { convertPoints } from './pointsUtil.mjs' function draftNose({ Point, @@ -15,17 +14,14 @@ function draftNose({ sa, store, paperless, - utils, macro, part, }) { console.log('nose') const textAttribute = 'text-xs center' - var noseSide = store.get('noseSide') - var noseHeight = store.get('noseHeight') - - const c = 0.55191502449351 + const noseSide = store.get('noseSide') + const noseHeight = store.get('noseHeight') points.point0 = new Point(0, 0) points.point2 = points.point0.shift(90, noseHeight) @@ -84,6 +80,15 @@ function draftNose({ // Complete? if (complete) { + points.title = points.point0.shiftFractionTowards(points.point3, 0.5) + macro('title', { + nr: 12, + at: points.title, + scale: 0.15, + rotation: 325, + title: 'nose', + }) + snippets.n1 = new Snippet('bnotch', points.point0) snippets.n2 = new Snippet('notch', points.point1) snippets.n3 = new Snippet('notch', points.point2) @@ -108,7 +113,8 @@ function draftNose({ // .shift(-90, w / 8) if (sa) { - // paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') + // Doing a trim() on the SA will remove the wrong part of the SA ;-) + // paths.sa = paths.seam.offset(sa).trim().attr('class', 'fabric sa') const pathSA1 = new Path() .move(points.point0) .join(paths.p1) diff --git a/designs/skully/src/pointsUtil.mjs b/designs/skully/src/pointsUtil.mjs deleted file mode 100644 index b53d19bea33..00000000000 --- a/designs/skully/src/pointsUtil.mjs +++ /dev/null @@ -1,52 +0,0 @@ -function convertPoints(points, rotate = 0, flip = false) { - var p = [] - Object.keys(points).forEach(function (key, index) { - var point = points[key].clone() - if (key != 'point0') { - if (flip) { - point = points[key].flipX() - } - if (rotate != 0) { - point = points[key].rotate(rotate, points['point0']) - } - } - - if (key == 'point0') { - p.push('points.point0 = new Point( 0, 0 );') - } else if (key.match('.+[0-9]Cp[12]')) { - let masterPointKey = key.replace(/Cp[12]/, '') - let masterPoint = points[masterPointKey] - if (flip) { - masterPoint = masterPoint.flipX() - } - if (rotate != 0) { - masterPoint = masterPoint.rotate(rotate, points['point0']) - } - p.push( - 'points.' + - key + - ' = points.' + - masterPointKey + - '.shift( ' + - masterPoint.angle(point) + - ', ' + - masterPoint.dist(point) + - ' *sizeFactor );' - ) - } else { - p.push( - 'points.' + - key + - ' = points.point0.shift( ' + - points.point0.angle(point) + - ', ' + - points.point0.dist(point) + - ' *sizeFactor );' - ) - } - }) - - console.log(p.sort().join('\n')) -} - -export { convertPoints } diff --git a/designs/skully/src/uppermouth.mjs b/designs/skully/src/uppermouth.mjs index fc36a14e910..4470650e5c7 100644 --- a/designs/skully/src/uppermouth.mjs +++ b/designs/skully/src/uppermouth.mjs @@ -1,15 +1,11 @@ import { pluginBundle } from '@freesewing/plugin-bundle' import { cheek } from './cheek.mjs' -import { convertPoints } from './pointsUtil.mjs' function draftUppermouth({ - options, Point, Path, points, paths, - Snippet, - snippets, complete, sa, store, @@ -79,8 +75,6 @@ function draftUppermouth({ // snippets.logo = new Snippet('logo', points.logo) // points.text = points.logo // .shift(-90, w / 8) - // .attr('data-text', 'hello') - // .attr('data-text-class', 'center') if (sa) { paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') From 0123558425f4f99829dcff7ebe730b5c3de943c7 Mon Sep 17 00:00:00 2001 From: Wouter van Wageningen Date: Tue, 11 Apr 2023 05:16:39 +0000 Subject: [PATCH 07/27] Instructions, and a tweak. --- designs/skully/src/jawfloor.mjs | 10 +- designs/skully/src/lowerjaw.mjs | 4 +- designs/skully/src/lowermouth.mjs | 265 +++-------------- designs/skully/src/uppermouth.mjs | 275 +++++++++++++++--- .../org/docs/patterns/skully/cutting/en.md | 17 ++ markdown/org/docs/patterns/skully/en.md | 5 + .../org/docs/patterns/skully/fabric/en.md | 22 ++ .../docs/patterns/skully/instructions/en.md | 70 +++++ .../docs/patterns/skully/measurements/en.md | 8 + markdown/org/docs/patterns/skully/needs/en.md | 19 ++ .../org/docs/patterns/skully/options/en.md | 5 + .../docs/patterns/skully/options/size/en.md | 10 + 12 files changed, 441 insertions(+), 269 deletions(-) create mode 100644 markdown/org/docs/patterns/skully/cutting/en.md create mode 100644 markdown/org/docs/patterns/skully/en.md create mode 100644 markdown/org/docs/patterns/skully/fabric/en.md create mode 100644 markdown/org/docs/patterns/skully/instructions/en.md create mode 100644 markdown/org/docs/patterns/skully/measurements/en.md create mode 100644 markdown/org/docs/patterns/skully/needs/en.md create mode 100644 markdown/org/docs/patterns/skully/options/en.md create mode 100644 markdown/org/docs/patterns/skully/options/size/en.md diff --git a/designs/skully/src/jawfloor.mjs b/designs/skully/src/jawfloor.mjs index 4faf8300a0d..d7d74ef8f62 100644 --- a/designs/skully/src/jawfloor.mjs +++ b/designs/skully/src/jawfloor.mjs @@ -83,11 +83,17 @@ function draftJawfloor({ .setText('jawBottom' + ' (15)', textAttribute) .addClass('hidden') + paths.back = new Path() + .move(points.point4) + .curve(points.point4, points.point5Cp2, points.point5) + .curve(points.mPoint5Cp2, points.mPoint4, points.mPoint4) + .setText('21', textAttribute) + .addClass('hidden') + paths.seam = new Path() .move(points.point6) .join(paths.bottomJaw1) - .curve(points.point4, points.point5Cp2, points.point5) - .curve(points.mPoint5Cp2, points.mPoint4, points.mPoint4) + .join(paths.back) .join(paths.bottomJaw2) .close() diff --git a/designs/skully/src/lowerjaw.mjs b/designs/skully/src/lowerjaw.mjs index 1e69b91bc28..f1cb2b52114 100644 --- a/designs/skully/src/lowerjaw.mjs +++ b/designs/skully/src/lowerjaw.mjs @@ -1,6 +1,6 @@ import { pluginBundle } from '@freesewing/plugin-bundle' import { cheek } from './cheek.mjs' -import { lowermouth } from './lowermouth.mjs' +import { uppermouth } from './uppermouth.mjs' function draftLowerjaw({ Point, @@ -193,7 +193,7 @@ function draftLowerjaw({ export const lowerjaw = { name: 'lowerjaw', - after: [cheek, lowermouth], + after: [cheek, uppermouth], plugins: [pluginBundle], draft: draftLowerjaw, } diff --git a/designs/skully/src/lowermouth.mjs b/designs/skully/src/lowermouth.mjs index 912fa21658c..6cd2a7bffd9 100644 --- a/designs/skully/src/lowermouth.mjs +++ b/designs/skully/src/lowermouth.mjs @@ -1,7 +1,5 @@ import { pluginBundle } from '@freesewing/plugin-bundle' import { cheek } from './cheek.mjs' -import { head1 } from './head1.mjs' -import { uppermouth } from './uppermouth.mjs' function draftLowermouth({ Point, @@ -19,168 +17,57 @@ function draftLowermouth({ const sizeFactor = store.get('sizeFactor') points.point0 = new Point(0, 0) - points.point6 = points.point0.shift(0.11139916029446559, 128.58224303534288 * sizeFactor) - points.point6Cp2 = points.point6.shift(269.8182450112891, 5.359026963917993 * sizeFactor) - points.point5 = points.point0.shift(328.14341716244707, 120.52788940738986 * sizeFactor) - points.point5Cp1 = points.point5.shift(29.114015378370315, 25.571930803128662 * sizeFactor) - points.point4 = points.point0.shift(317.9233666855834, 95.68080416154534 * sizeFactor) - points.point4Cp2 = points.point4.shift(178.12857030706965, 15.433231709528583 * sizeFactor) - points.point3 = points.point0.shift(312.29520434983914, 55.53156468171955 * sizeFactor) - points.point3Cp2 = points.point3.shift(90, 6.745097849549684 * sizeFactor) - points.point3Cp1 = points.point3.shift(270, 23.140963009347697 * sizeFactor) - points.point2 = points.point0.shift(312.62624217423604, 44.01273783803957 * sizeFactor) - points.point2Cp1 = points.point2.shift(358.24231642721344, 5.05337768230318 * sizeFactor) - points.point1 = points.point0.shift(270, 32.77328218228992 * sizeFactor) + points.point1 = points.point0.shift(270, 66.14600000000002 * sizeFactor) + points.point1Cp1 = points.point1.shift(0, 0 * sizeFactor) + points.point0Cp2 = points.point0.shift(0, 0 * sizeFactor) - points.point1 = points.point1.shift( - 90, - points.point0.dist(points.point1) - store.get('mouthWidth') / 2 - ) - points.point2 = points.point2.shift( - 90, - points.point0.dist(points.point1) - store.get('mouthWidth') / 2 - ) - points.point2Cp1 = points.point2.shift(358.24231642721344, 5.05337768230318 * sizeFactor) - points.point3 = points.point3.shift( - 90, - points.point0.dist(points.point1) - store.get('mouthWidth') / 2 - ) - points.point3Cp1 = points.point3.shift(270, 23.140963009347697 * sizeFactor) - points.point3Cp2 = points.point3.shift(90, 6.745097849549684 * sizeFactor) - points.point4 = points.point4.shift( - 90, - points.point0.dist(points.point1) - store.get('mouthWidth') / 2 - ) - points.point4Cp2 = points.point4.shift(178.12857030706965, 15.433231709528583 * sizeFactor) + points.point2 = points.point0.shift(219.80599709691597, 51.66121657491237 * sizeFactor) - points.point5 = points.point4.shift( - 0, - store.get('upperJaw') - - new Path() - .move(points.point1) - .line(points.point2) - .curve(points.point2Cp1, points.point3Cp2, points.point3) - .curve(points.point3Cp1, points.point4Cp2, points.point4) - .length() - ) - points.point5Cp1 = points.point5.shift(0, 9 * sizeFactor) + points.point0 = new Point(0, 0) + points.point0Cp1 = points.point0.shift(0, 0 * sizeFactor) + points.point1 = points.point0.shift(222.41579397130369, 49.03292752740774 * sizeFactor) + points.point2 = points.point0.shift(270, 66.14600000000002 * sizeFactor) + points.point2Cp2 = points.point2.shift(0, 0 * sizeFactor) + points.point1.x = points.point0.x - points.point0.dist(points.point2) / 2 + points.point1Cp1 = points.point1.shift(270, 33.0746752291626 * sizeFactor) + points.point1Cp2 = points.point1.shift(90, 33.0746752291626 * sizeFactor) - points.point6 = new Point(points.point5.x, points.point0.y).shift(0, points.point5.x * 0.2) - points.point6Cp2 = points.point6.shift(270, 5 * sizeFactor) - - points.pointM1 = points.point0.shift(180, store.get('mouthWidth') / 2) - points.pointM1Cp1 = points.pointM1.shift(270, 33.0746752291626 * sizeFactor) - - paths.backOfUpperJaw = new Path() - .move(points.point5) - .curve(points.point5Cp1, points.point6Cp2, points.point6) - .setText('21', textAttribute) + paths.mouth1 = new Path() + .move(points.point0) + .curve(points.point0Cp1, points.point1Cp2, points.point1) + .setText('mouthBottom' + ' (13)', textAttribute) .addClass('hidden') - - points.lowerJaw = paths.backOfUpperJaw.shiftAlong(store.get('upperJawToLowerJaw')) - var ljAngle = points.lowerJaw.angle( - paths.backOfUpperJaw.shiftAlong(store.get('upperJawToLowerJaw') + 1) - ) - - store.set('halfOfBack', paths.backOfUpperJaw.length() - store.get('upperJawToLowerJaw')) - - points.point2ToLowerJaw = points.point2.shift(0, points.point2.dist(points.lowerJaw) / 2) - points.lowerJawToPoint2 = points.lowerJaw.shift( - ljAngle + 90, - points.point2.dist(points.lowerJaw) / 3 - ) - - macro('mirror', { - mirror: [points.pointM1, points.point6], - points: [ - points.point0, - points.lowerJaw, - points.lowerJawToPoint2, - points.point2ToLowerJaw, - points.pointM1Cp1, - points.point1, - points.point2, - points.point2Cp1, - points.point3, - points.point3Cp1, - points.point3Cp2, - points.point4, - points.point4Cp2, - points.point5, - points.point5Cp1, - points.point6Cp2, - ], - prefix: 'm', - }) - console.log({ points: JSON.parse(JSON.stringify(points)) }) - - paths.upperJaw1 = new Path() + paths.mouth2 = new Path() .move(points.point1) - .line(points.point2) - .curve(points.point2Cp1, points.point3Cp2, points.point3) - .curve(points.point3Cp1, points.point4Cp2, points.point4) - .line(points.point5) - .setText('upperJaw' + ' (16)', textAttribute) + .curve(points.point1Cp1, points.point2Cp2, points.point2) + .setText('mouthBottom' + ' (13)', textAttribute) .addClass('hidden') - paths.upperJaw2 = new Path() - .move(points.mPoint5) - .line(points.mPoint4) - .curve(points.mPoint4Cp2, points.mPoint3Cp1, points.mPoint3) - .curve(points.mPoint3Cp2, points.mPoint2Cp1, points.mPoint2) - .line(points.mPoint1) - .setText('upperJaw' + ' (16)', textAttribute) - .addClass('hidden') - - paths.front1 = new Path() - .move(points.pointM1) - .curve_(points.pointM1Cp1, points.point1) - .setText('(16)', textAttribute) - .addClass('hidden') - - paths.front2 = new Path() - .move(points.mPoint1) - .curve_(points.mPointM1Cp1, points.pointM1) - .setText('(16)', textAttribute) - .addClass('hidden') - - paths.backOfUpperJaw.curve(points.mPoint6Cp2, points.mPoint5Cp1, points.mPoint5) - - paths.seam = new Path() - .move(points.point1) - .join(paths.upperJaw1) - .join(paths.backOfUpperJaw) - .join(paths.upperJaw2) - .join(paths.front2) - .join(paths.front1) - .close() - paths.backOfMouth = new Path() - .move(points.mPoint1) - .line(points.point1) - .setText('backOfMouth' + ' (11)', textAttribute) - .setClass('dashed') - - paths.lowerJaw1 = new Path() .move(points.point2) - .curve(points.point2ToLowerJaw, points.lowerJawToPoint2, points.lowerJaw) - .setText('lowerJaw' + ' (14)', textAttribute) - .setClass('dashed') - paths.lowerJaw2 = new Path() - .move(points.mPoint2) - .curve(points.mPoint2ToLowerJaw, points.mLowerJawToPoint2, points.mLowerJaw) - .setText('lowerJaw' + ' (14)', textAttribute) - .setClass('dashed') + .line(points.point0) + .setText('backOfMouth' + ' (11)', textAttribute) + .addClass('hidden') - store.set('lowerJaw', paths.lowerJaw1.length() + points.point1.dist(points.point2)) + store.set('mouthWidth', points.point0.dist(points.point2)) + + paths.seam = new Path() + .move(points.point0) + .curve(points.point0Cp1, points.point1Cp2, points.point1) + .curve(points.point1Cp1, points.point2Cp2, points.point2) + .line(points.point0) + .close() // Complete? if (complete) { - points.title = points.pointM1.shiftFractionTowards(points.point6, 0.5) + points.title = points.point0 + .shiftFractionTowards(points.point2, 0.25) + .shiftFractionTowards(points.point1, 0.6) macro('title', { - nr: 7, + nr: 10, at: points.title, - scale: 0.5, + scale: 0.25, + rotation: 90, title: 'lowerMouth', }) // points.logo = points.topLeft.shiftFractionTowards(points.bottomRight, 0.5) @@ -189,89 +76,21 @@ function draftLowermouth({ // .shift(-90, w / 8) if (sa) { - // Doing a trim() here has a weird issue. Part of the SA, related to - // the point1->point2 line, will disappear. - // paths.sa = paths.seam.offset(sa).trim().attr('class', 'fabric sa') paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') } } // Paperless? if (paperless) { - macro('hd', { - from: points.pointM1, - to: points.point1, - y: points.point5.y + sa + 15, - }) macro('hd', { from: points.point1, - to: points.point3, - y: points.point5.y + sa + 15, - }) - macro('hd', { - from: points.point3, - to: points.point5, - y: points.point5.y + sa + 15, - }) - macro('hd', { - from: points.point5, - to: points.point6, - y: points.point5.y + sa + 15, - }) - macro('hd', { - from: points.pointM1, - to: points.point6, - y: points.mPoint5.y - sa - 15, + to: points.point0, + y: points.point0.y - sa - 15, }) macro('vd', { - from: points.point6, - to: points.point5, - x: points.point6.x + sa + 15, - }) - macro('vd', { - from: points.mPoint5, - to: points.point6, - x: points.point6.x + sa + 15, - }) - macro('vd', { - from: points.mPoint1, - to: points.mPoint5, - x: points.pointM1.x - sa - 15, - }) - macro('vd', { - from: points.point1, - to: points.mPoint1, - x: points.pointM1.x - sa - 15, - }) - macro('vd', { - from: points.point5, - to: points.point1, - x: points.pointM1.x - sa - 15, - }) - macro('vd', { - from: points.point2, - to: points.mPoint2, - x: points.point2.x, - }) - macro('ld', { - from: points.point5, - to: points.lowerJaw, - d: 5, - }) - macro('ld', { - from: points.lowerJaw, - to: points.point6, - d: 5, - }) - macro('ld', { - from: points.point6, - to: points.mLowerJaw, - d: 5, - }) - macro('ld', { - from: points.mLowerJaw, - to: points.mPoint5, - d: 5, + from: points.point0, + to: points.point2, + x: points.point0.x + sa + 15, }) } @@ -280,7 +99,7 @@ function draftLowermouth({ export const lowermouth = { name: 'lowermouth', - after: [cheek, head1, uppermouth], + after: cheek, plugins: [pluginBundle], draft: draftLowermouth, } diff --git a/designs/skully/src/uppermouth.mjs b/designs/skully/src/uppermouth.mjs index 4470650e5c7..18ecb99408c 100644 --- a/designs/skully/src/uppermouth.mjs +++ b/designs/skully/src/uppermouth.mjs @@ -1,5 +1,7 @@ import { pluginBundle } from '@freesewing/plugin-bundle' import { cheek } from './cheek.mjs' +import { head1 } from './head1.mjs' +import { lowermouth } from './lowermouth.mjs' function draftUppermouth({ Point, @@ -13,63 +15,184 @@ function draftUppermouth({ macro, part, }) { - console.log('uppermouth') const textAttribute = 'text-xs center' const sizeFactor = store.get('sizeFactor') points.point0 = new Point(0, 0) - points.point1 = points.point0.shift(270, 66.14600000000002 * sizeFactor) - points.point1Cp1 = points.point1.shift(0, 0 * sizeFactor) - points.point0Cp2 = points.point0.shift(0, 0 * sizeFactor) + points.point6 = points.point0.shift(0.11139916029446559, 128.58224303534288 * sizeFactor) + points.point6Cp2 = points.point6.shift(269.8182450112891, 5.359026963917993 * sizeFactor) + points.point5 = points.point0.shift(328.14341716244707, 120.52788940738986 * sizeFactor) + points.point5Cp1 = points.point5.shift(29.114015378370315, 25.571930803128662 * sizeFactor) + points.point4 = points.point0.shift(317.9233666855834, 95.68080416154534 * sizeFactor) + points.point4Cp2 = points.point4.shift(178.12857030706965, 15.433231709528583 * sizeFactor) + points.point3 = points.point0.shift(312.29520434983914, 55.53156468171955 * sizeFactor) + points.point3Cp2 = points.point3.shift(90, 6.745097849549684 * sizeFactor) + points.point3Cp1 = points.point3.shift(270, 23.140963009347697 * sizeFactor) + points.point2 = points.point0.shift(312.62624217423604, 44.01273783803957 * sizeFactor) + points.point2Cp1 = points.point2.shift(358.24231642721344, 5.05337768230318 * sizeFactor) + points.point1 = points.point0.shift(270, 32.77328218228992 * sizeFactor) - points.point2 = points.point0.shift(219.80599709691597, 51.66121657491237 * sizeFactor) + points.point1 = points.point1.shift( + 90, + points.point0.dist(points.point1) - store.get('mouthWidth') / 2 + ) + points.point2 = points.point2.shift( + 90, + points.point0.dist(points.point1) - store.get('mouthWidth') / 2 + ) + points.point2Cp1 = points.point2.shift(358.24231642721344, 5.05337768230318 * sizeFactor) + points.point3 = points.point3.shift( + 90, + points.point0.dist(points.point1) - store.get('mouthWidth') / 2 + ) + points.point3Cp1 = points.point3.shift(270, 23.140963009347697 * sizeFactor) + points.point3Cp2 = points.point3.shift(90, 6.745097849549684 * sizeFactor) + points.point4 = points.point4.shift( + 90, + points.point0.dist(points.point1) - store.get('mouthWidth') / 2 + ) + points.point4Cp2 = points.point4.shift(178.12857030706965, 15.433231709528583 * sizeFactor) - points.point0 = new Point(0, 0) - points.point0Cp1 = points.point0.shift(0, 0 * sizeFactor) - points.point1 = points.point0.shift(222.41579397130369, 49.03292752740774 * sizeFactor) - points.point2 = points.point0.shift(270, 66.14600000000002 * sizeFactor) - points.point2Cp2 = points.point2.shift(0, 0 * sizeFactor) - points.point1.x = points.point0.x - points.point0.dist(points.point2) / 2 - points.point1Cp1 = points.point1.shift(270, 33.0746752291626 * sizeFactor) - points.point1Cp2 = points.point1.shift(90, 33.0746752291626 * sizeFactor) + points.point5 = points.point4.shift( + 0, + store.get('upperJaw') - + new Path() + .move(points.point1) + .line(points.point2) + .curve(points.point2Cp1, points.point3Cp2, points.point3) + .curve(points.point3Cp1, points.point4Cp2, points.point4) + .length() + ) + points.point5Cp1 = points.point5.shift(0, 9 * sizeFactor) - paths.mouth1 = new Path() - .move(points.point0) - .curve(points.point0Cp1, points.point1Cp2, points.point1) - .setText('mouthBottom' + ' (13)', textAttribute) + points.point6 = new Point(points.point5.x, points.point0.y).shift(0, points.point5.x * 0.2) + points.point6Cp2 = points.point6.shift(270, 5 * sizeFactor) + + points.pointM1 = points.point0.shift(180, store.get('mouthWidth') / 2) + points.pointM1Cp1 = points.pointM1.shift(270, 33.0746752291626 * sizeFactor) + + paths.backOfUpperJaw = new Path() + .move(points.point5) + .curve(points.point5Cp1, points.point6Cp2, points.point6) + .setText('not sewn', textAttribute) .addClass('hidden') - paths.mouth2 = new Path() + + points.lowerJaw = paths.backOfUpperJaw.shiftAlong(store.get('upperJawToLowerJaw')) + var ljAngle = points.lowerJaw.angle( + paths.backOfUpperJaw.shiftAlong(store.get('upperJawToLowerJaw') + 1) + ) + + store.set('halfOfBack', paths.backOfUpperJaw.length() - store.get('upperJawToLowerJaw')) + + points.point2ToLowerJaw = points.point2.shift(0, points.point2.dist(points.lowerJaw) / 2) + points.lowerJawToPoint2 = points.lowerJaw.shift( + ljAngle + 90, + points.point2.dist(points.lowerJaw) / 3 + ) + + macro('mirror', { + mirror: [points.pointM1, points.point6], + points: [ + points.point0, + points.lowerJaw, + points.lowerJawToPoint2, + points.point2ToLowerJaw, + points.pointM1Cp1, + points.point1, + points.point2, + points.point2Cp1, + points.point3, + points.point3Cp1, + points.point3Cp2, + points.point4, + points.point4Cp2, + points.point5, + points.point5Cp1, + points.point6Cp2, + ], + prefix: 'm', + }) + console.log({ points: JSON.parse(JSON.stringify(points)) }) + + paths.upperJaw1 = new Path() .move(points.point1) - .curve(points.point1Cp1, points.point2Cp2, points.point2) - .setText('mouthBottom' + ' (13)', textAttribute) + .line(points.point2) + .curve(points.point2Cp1, points.point3Cp2, points.point3) + .curve(points.point3Cp1, points.point4Cp2, points.point4) + .line(points.point5) + .setText('upperJaw' + ' (16)', textAttribute) .addClass('hidden') - paths.backOfMouth = new Path() - .move(points.point2) - .line(points.point0) - .setText('backOfMouth' + ' (11)', textAttribute) + paths.upperJaw2 = new Path() + .move(points.mPoint5) + .line(points.mPoint4) + .curve(points.mPoint4Cp2, points.mPoint3Cp1, points.mPoint3) + .curve(points.mPoint3Cp2, points.mPoint2Cp1, points.mPoint2) + .line(points.mPoint1) + .setText('upperJaw' + ' (16)', textAttribute) .addClass('hidden') - store.set('mouthWidth', points.point0.dist(points.point2)) + paths.front1 = new Path() + .move(points.pointM1) + .curve_(points.pointM1Cp1, points.point1) + .setText('(16)', textAttribute) + .addClass('hidden') + + paths.front2 = new Path() + .move(points.mPoint1) + .curve_(points.mPointM1Cp1, points.pointM1) + .setText('(16)', textAttribute) + .addClass('hidden') + + paths.backOfUpperJaw.curve(points.mPoint6Cp2, points.mPoint5Cp1, points.mPoint5) paths.seam = new Path() - .move(points.point0) - .curve(points.point0Cp1, points.point1Cp2, points.point1) - .curve(points.point1Cp1, points.point2Cp2, points.point2) - .line(points.point0) + .move(points.point1) + .join(paths.upperJaw1) + .join(paths.backOfUpperJaw) + .join(paths.upperJaw2) + .join(paths.front2) + .join(paths.front1) .close() + paths.backOfMouth = new Path() + .move(points.mPoint1) + .line(points.point1) + .setText('backOfMouth' + ' (11)', textAttribute) + .setClass('dashed') + + paths.lowerJaw1 = new Path() + .move(points.point2) + .curve(points.point2ToLowerJaw, points.lowerJawToPoint2, points.lowerJaw) + .setText('lowerJaw' + ' (14)', textAttribute) + .setClass('dashed') + paths.lowerJaw2 = new Path() + .move(points.mPoint2) + .curve(points.mPoint2ToLowerJaw, points.mLowerJawToPoint2, points.mLowerJaw) + .setText('lowerJaw' + ' (14)', textAttribute) + .setClass('dashed') + + paths.backOfUpperJaw1 = new Path() + .move(points.point5) + .line(points.lowerJaw) + .setText('21', textAttribute) + .addClass('hidden') + paths.backOfUpperJaw2 = new Path() + .move(points.mLowerJaw) + .line(points.mPoint5) + .setText('21', textAttribute) + .addClass('hidden') + + store.set('lowerJaw', paths.lowerJaw1.length() + points.point1.dist(points.point2)) + // Complete? if (complete) { - points.title = points.point0 - .shiftFractionTowards(points.point2, 0.25) - .shiftFractionTowards(points.point1, 0.6) + points.title = points.pointM1.shiftFractionTowards(points.point6, 0.5) macro('title', { - nr: 10, + nr: 7, at: points.title, - scale: 0.25, - rotation: 90, - title: 'uppermouth', + scale: 0.5, + title: 'upperMouth', }) // points.logo = points.topLeft.shiftFractionTowards(points.bottomRight, 0.5) // snippets.logo = new Snippet('logo', points.logo) @@ -77,21 +200,89 @@ function draftUppermouth({ // .shift(-90, w / 8) if (sa) { + // Doing a trim() here has a weird issue. Part of the SA, related to + // the point1->point2 line, will disappear. + // paths.sa = paths.seam.offset(sa).trim().attr('class', 'fabric sa') paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') } } // Paperless? if (paperless) { + macro('hd', { + from: points.pointM1, + to: points.point1, + y: points.point5.y + sa + 15, + }) macro('hd', { from: points.point1, - to: points.point0, - y: points.point0.y - sa - 15, + to: points.point3, + y: points.point5.y + sa + 15, + }) + macro('hd', { + from: points.point3, + to: points.point5, + y: points.point5.y + sa + 15, + }) + macro('hd', { + from: points.point5, + to: points.point6, + y: points.point5.y + sa + 15, + }) + macro('hd', { + from: points.pointM1, + to: points.point6, + y: points.mPoint5.y - sa - 15, }) macro('vd', { - from: points.point0, - to: points.point2, - x: points.point0.x + sa + 15, + from: points.point6, + to: points.point5, + x: points.point6.x + sa + 15, + }) + macro('vd', { + from: points.mPoint5, + to: points.point6, + x: points.point6.x + sa + 15, + }) + macro('vd', { + from: points.mPoint1, + to: points.mPoint5, + x: points.pointM1.x - sa - 15, + }) + macro('vd', { + from: points.point1, + to: points.mPoint1, + x: points.pointM1.x - sa - 15, + }) + macro('vd', { + from: points.point5, + to: points.point1, + x: points.pointM1.x - sa - 15, + }) + macro('vd', { + from: points.point2, + to: points.mPoint2, + x: points.point2.x, + }) + macro('ld', { + from: points.point5, + to: points.lowerJaw, + d: 5, + }) + macro('ld', { + from: points.lowerJaw, + to: points.point6, + d: 5, + }) + macro('ld', { + from: points.point6, + to: points.mLowerJaw, + d: 5, + }) + macro('ld', { + from: points.mLowerJaw, + to: points.mPoint5, + d: 5, }) } @@ -100,7 +291,7 @@ function draftUppermouth({ export const uppermouth = { name: 'uppermouth', - after: cheek, + after: [cheek, head1, lowermouth], plugins: [pluginBundle], draft: draftUppermouth, } diff --git a/markdown/org/docs/patterns/skully/cutting/en.md b/markdown/org/docs/patterns/skully/cutting/en.md new file mode 100644 index 00000000000..3c97b10ca49 --- /dev/null +++ b/markdown/org/docs/patterns/skully/cutting/en.md @@ -0,0 +1,17 @@ +--- +title: "Skully (the logo): Cutting Instructions" +--- + +- **Main fabric** + - Cut **2 cheek** + - Cut **2 forehead** + - Cut **2 head1** + - Cut **2 head2** + - Cut **2 head3** + - Cut **2 cheekbone** + - Cut **1 lowermouth** + - Cut **1 jawFloor** + - Cut **2 eye** + - Cut **1 uppermouth** + - Cut **2 lowerJaw** + - Cut **1 nose** diff --git a/markdown/org/docs/patterns/skully/en.md b/markdown/org/docs/patterns/skully/en.md new file mode 100644 index 00000000000..d6a21c48edd --- /dev/null +++ b/markdown/org/docs/patterns/skully/en.md @@ -0,0 +1,5 @@ +--- +title: Skully (the logo) +--- + + diff --git a/markdown/org/docs/patterns/skully/fabric/en.md b/markdown/org/docs/patterns/skully/fabric/en.md new file mode 100644 index 00000000000..4fc759050ad --- /dev/null +++ b/markdown/org/docs/patterns/skully/fabric/en.md @@ -0,0 +1,22 @@ +--- +title: "Skully (the logo): Fabric Options" +--- + +## Main Fabric + +This plush toy is best made from a felt type of fabric. This will provide extra rigidity to keep the shape +correct, while still allowing it to be a plush toy. Thin and stretchy fabrics are not well suited, because +the shape will change considerably due to tensions from the stuffing. + +## Stuffing + +Since this is a plush toy, it will need to be stuffed with material. Most of the time you'll want to use polyester fiberfill (polyfill), but if you have a lot of fabric scraps, you can use shredded scrap fabric. However this may be heavier and less soft than fiberfill. It's also worth thinking about whether your Hi may be at risk of getting dirty, or want to go for a swim, as not all stuffing options are washable. + +## Hair + +Skully needs hair. Embrodery floss works very well, and can be had in all colors. + +## Needle + +Skully has traded his sword for a needle. A needle this size is mostly sold as upholstery needles. This will come +in handy when doing some of the touch-ups at the end of the construction. diff --git a/markdown/org/docs/patterns/skully/instructions/en.md b/markdown/org/docs/patterns/skully/instructions/en.md new file mode 100644 index 00000000000..681c438d244 --- /dev/null +++ b/markdown/org/docs/patterns/skully/instructions/en.md @@ -0,0 +1,70 @@ +--- +title: "Skully (the logo): Sewing Instructions" +--- + + + +A lot of the smaller seams (eyes, nose) are best sewn by hand. + +Most of the seams will benefit from being basted before being sewn. + + + +## Step 1: The darts + +There are three darts that need to be closed first. Pin and sew them, then remove the bulk and +give them a good press. Repeat for the other three darts. + +## Step 2: The eyes + +Sew together the sides of the eye, so you will make a cone. Cut away any bulk. Repeat for the other eye + +## Step 3: The nose + +Like the eyes, the nose too has parts that need to be sewn together. There are two of these sides that need to be sew together. This creates two connected cones. This is very finicky, so take your time. + +## Step 4: The head + + + +The Skully pattern is set up to be sewn-by-numbers. Every seam is numbered. Please start at '1', and +keep going until you reach '21'. This is the seam through which you will fill Skully, so only close +it partly. + + + +When you are sewing together the individual parts, you will be making two halves of the skull. + +Sewing the eyes and nose to the cheek and forehead parts is best done by hand. You will have to aling +the different notches to their corresponding ones on the other part. + +Sewing the lowerJaw to the lowerMouth and upperMouth is challenging. You will be making a normal seam +between the lowerJaw parts and the lowerMouth part. You will then have to continue this seam along +the dashed line (14) on the upperMouth part. Baste or lots of pins are your friend. And make sure you +first visualize how this will get together before doing the final sewing. + +The back of the upperMouth is not sewn to anything. It is just there to provide stability. + +## Step 5: Hair + +Now is the time to add hair to skully. When putting the embroidery floss in, make sure you add knots +on the inside, or else it is very easy to pull Skully's hair out later. + +## Step 6: Stuffing + +- Fill the plush toy with stuffing through the opening you left, making sure to fill all the parts +well. The areas in the front are the hardest to get to. +- _Slipsticth_ or _whipstitch_ the opening closed. + +## Step 6: Tweaks + +You can use the long upholstery needle to add some tweaks to Skully. Adding some stitches, attaching +the back of the eyes to corner of seams 14 and 21 right through the skull helps with keeping the +eyes from popping out, and can help with giving the head more form. The same applies to the nose. + +It is also a good isea to add stitches between seams 5 and 14, along the length of both seams. This +will make the cheek bones more pronounced and adds to the overall shape of the skull. + +## Step 7: Enjoy! + +That's it, you are all done. Start planning what pirate sewing ship you'll be joining! diff --git a/markdown/org/docs/patterns/skully/measurements/en.md b/markdown/org/docs/patterns/skully/measurements/en.md new file mode 100644 index 00000000000..9c1cb68a114 --- /dev/null +++ b/markdown/org/docs/patterns/skully/measurements/en.md @@ -0,0 +1,8 @@ +--- +title: "Skully (the logo): Required Measurements" +--- + + +Skully does not require any measurements, but it can use the head circumference +measurement. If used, Skully will be approximately the same size as your head. + diff --git a/markdown/org/docs/patterns/skully/needs/en.md b/markdown/org/docs/patterns/skully/needs/en.md new file mode 100644 index 00000000000..323d7d699ba --- /dev/null +++ b/markdown/org/docs/patterns/skully/needs/en.md @@ -0,0 +1,19 @@ +--- +title: "Skully (the logo): What You Need" +--- + +To make Skully, you will need the following: + +- [Basic sewing supplies](/docs/sewing/basic-sewing-supplies) +- About 0.5 meter (0.6 yards) of a suitable fabric ([see Skully Fabric options](/docs/patterns/skully/fabric/)) +- Stuffing +- Embroidery floss for the hair +- Appropriately sized upholstery needle + + + +This list is based on a default Skully and you may need less or more fabric dependant on the [size you are making Skully](/docs/patterns/skully/options/size/). + +For instance a 300% Skully will need 1.5 meters (0.5 meter x 300% = 1.5 meters) and a 50% skully will need 0.25 meters (0.5 meter x 50% = 0.25 meters). + + diff --git a/markdown/org/docs/patterns/skully/options/en.md b/markdown/org/docs/patterns/skully/options/en.md new file mode 100644 index 00000000000..e46afcd03e3 --- /dev/null +++ b/markdown/org/docs/patterns/skully/options/en.md @@ -0,0 +1,5 @@ +--- +title: "Skully (the logo): Design Options" +--- + + diff --git a/markdown/org/docs/patterns/skully/options/size/en.md b/markdown/org/docs/patterns/skully/options/size/en.md new file mode 100644 index 00000000000..5b29d3c9da4 --- /dev/null +++ b/markdown/org/docs/patterns/skully/options/size/en.md @@ -0,0 +1,10 @@ +--- +title: "Size" +--- + +Skully can be made in different sizes. The default is about 75% of a normal human head. +This is a percentage of the head circumference. + +If you set the percentage to 100%, and you enter your own head measurwement, Skully will +be approximately the size of your head. + From 218fb6de71af00c15ec3d9fe92c2cd73c885dbf6 Mon Sep 17 00:00:00 2001 From: Wouter van Wageningen Date: Tue, 11 Apr 2023 07:32:08 -0700 Subject: [PATCH 08/27] Update markdown/org/docs/patterns/skully/cutting/en.md Co-authored-by: bobgeorgethe3rd --- .../org/docs/patterns/skully/cutting/en.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/markdown/org/docs/patterns/skully/cutting/en.md b/markdown/org/docs/patterns/skully/cutting/en.md index 3c97b10ca49..01e220f4f78 100644 --- a/markdown/org/docs/patterns/skully/cutting/en.md +++ b/markdown/org/docs/patterns/skully/cutting/en.md @@ -3,15 +3,15 @@ title: "Skully (the logo): Cutting Instructions" --- - **Main fabric** - - Cut **2 cheek** - - Cut **2 forehead** - - Cut **2 head1** - - Cut **2 head2** - - Cut **2 head3** - - Cut **2 cheekbone** - - Cut **1 lowermouth** - - Cut **1 jawFloor** - - Cut **2 eye** - - Cut **1 uppermouth** - - Cut **2 lowerJaw** - - Cut **1 nose** + - Cut **2 cheek** parts + - Cut **2 forehead** parts + - Cut **2 head1** parts + - Cut **2 head2** parts + - Cut **2 head3** parts + - Cut **2 cheekbone** parts + - Cut **1 lowermouth** part + - Cut **1 jawFloor** part + - Cut **2 eye** parts + - Cut **1 uppermouth** part + - Cut **2 lowerJaw** parts + - Cut **1 nose** part From 504a370ae824d35a713e63d81ce47f4dc58b9ac8 Mon Sep 17 00:00:00 2001 From: Wouter van Wageningen Date: Tue, 11 Apr 2023 07:32:52 -0700 Subject: [PATCH 09/27] Update markdown/org/docs/patterns/skully/fabric/en.md Co-authored-by: bobgeorgethe3rd --- markdown/org/docs/patterns/skully/fabric/en.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/markdown/org/docs/patterns/skully/fabric/en.md b/markdown/org/docs/patterns/skully/fabric/en.md index 4fc759050ad..fafe3dfa38d 100644 --- a/markdown/org/docs/patterns/skully/fabric/en.md +++ b/markdown/org/docs/patterns/skully/fabric/en.md @@ -4,9 +4,7 @@ title: "Skully (the logo): Fabric Options" ## Main Fabric -This plush toy is best made from a felt type of fabric. This will provide extra rigidity to keep the shape -correct, while still allowing it to be a plush toy. Thin and stretchy fabrics are not well suited, because -the shape will change considerably due to tensions from the stuffing. +This plush toy is best made from a felt type fabrics. This will provide extra rigidity to keep the shape correct, while still allowing it to be a plush toy. Thin and stretchy fabrics are not well suited, because the shape will change considerably due to tensions from the stuffing. ## Stuffing From c4eb624c989c971ad04c707b949b29120cdd5a9a Mon Sep 17 00:00:00 2001 From: Wouter van Wageningen Date: Tue, 11 Apr 2023 07:33:07 -0700 Subject: [PATCH 10/27] Update markdown/org/docs/patterns/skully/fabric/en.md Co-authored-by: bobgeorgethe3rd --- markdown/org/docs/patterns/skully/fabric/en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/markdown/org/docs/patterns/skully/fabric/en.md b/markdown/org/docs/patterns/skully/fabric/en.md index fafe3dfa38d..48bb2451040 100644 --- a/markdown/org/docs/patterns/skully/fabric/en.md +++ b/markdown/org/docs/patterns/skully/fabric/en.md @@ -8,7 +8,7 @@ This plush toy is best made from a felt type fabrics. This will provide extra ri ## Stuffing -Since this is a plush toy, it will need to be stuffed with material. Most of the time you'll want to use polyester fiberfill (polyfill), but if you have a lot of fabric scraps, you can use shredded scrap fabric. However this may be heavier and less soft than fiberfill. It's also worth thinking about whether your Hi may be at risk of getting dirty, or want to go for a swim, as not all stuffing options are washable. +Since this is a plush toy, it will need to be stuffed with material. Most of the time you'll want to use polyester fiberfill (polyfill), but if you have a lot of fabric scraps, you can use shredded scrap fabric. However this may be heavier and less soft than fiberfill. It's also worth thinking about whether your Skully may be at risk of getting dirty as not all stuffing options are washable. ## Hair From 52649df95b70ac627e7743b4320d2b41bc8f3139 Mon Sep 17 00:00:00 2001 From: Wouter van Wageningen Date: Tue, 11 Apr 2023 07:33:18 -0700 Subject: [PATCH 11/27] Update markdown/org/docs/patterns/skully/fabric/en.md Co-authored-by: bobgeorgethe3rd --- markdown/org/docs/patterns/skully/fabric/en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/markdown/org/docs/patterns/skully/fabric/en.md b/markdown/org/docs/patterns/skully/fabric/en.md index 48bb2451040..95045649efb 100644 --- a/markdown/org/docs/patterns/skully/fabric/en.md +++ b/markdown/org/docs/patterns/skully/fabric/en.md @@ -12,7 +12,7 @@ Since this is a plush toy, it will need to be stuffed with material. Most of the ## Hair -Skully needs hair. Embrodery floss works very well, and can be had in all colors. +Skully needs hair. Embroidery floss works very well, and can be had in all colors. ## Needle From 79a110fc99c18ee7931be8d2b7596a80fd9b8296 Mon Sep 17 00:00:00 2001 From: Wouter van Wageningen Date: Tue, 11 Apr 2023 07:33:29 -0700 Subject: [PATCH 12/27] Update markdown/org/docs/patterns/skully/fabric/en.md Co-authored-by: bobgeorgethe3rd --- markdown/org/docs/patterns/skully/fabric/en.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/markdown/org/docs/patterns/skully/fabric/en.md b/markdown/org/docs/patterns/skully/fabric/en.md index 95045649efb..0207ee38b5f 100644 --- a/markdown/org/docs/patterns/skully/fabric/en.md +++ b/markdown/org/docs/patterns/skully/fabric/en.md @@ -16,5 +16,4 @@ Skully needs hair. Embroidery floss works very well, and can be had in all color ## Needle -Skully has traded his sword for a needle. A needle this size is mostly sold as upholstery needles. This will come -in handy when doing some of the touch-ups at the end of the construction. +Skully has traded his sword for a needle. A needle this size is mostly sold as upholstery needles. This will come in handy when doing some of the touch-ups at the end of the construction. From 8e232901e4f6f713f05f285607220ffad721c049 Mon Sep 17 00:00:00 2001 From: Wouter van Wageningen Date: Tue, 11 Apr 2023 07:33:41 -0700 Subject: [PATCH 13/27] Update markdown/org/docs/patterns/skully/needs/en.md Co-authored-by: bobgeorgethe3rd --- markdown/org/docs/patterns/skully/needs/en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/markdown/org/docs/patterns/skully/needs/en.md b/markdown/org/docs/patterns/skully/needs/en.md index 323d7d699ba..3076ce09f7e 100644 --- a/markdown/org/docs/patterns/skully/needs/en.md +++ b/markdown/org/docs/patterns/skully/needs/en.md @@ -5,7 +5,7 @@ title: "Skully (the logo): What You Need" To make Skully, you will need the following: - [Basic sewing supplies](/docs/sewing/basic-sewing-supplies) -- About 0.5 meter (0.6 yards) of a suitable fabric ([see Skully Fabric options](/docs/patterns/skully/fabric/)) +- About 0.5 meters (0.6 yards) of a suitable fabric ([see Skully Fabric options](/docs/patterns/skully/fabric/)) - Stuffing - Embroidery floss for the hair - Appropriately sized upholstery needle From 03aed97c5845aa276b4d4e12ce51ce60b5637e05 Mon Sep 17 00:00:00 2001 From: Wouter van Wageningen Date: Tue, 11 Apr 2023 07:34:50 -0700 Subject: [PATCH 14/27] Update markdown/org/docs/patterns/skully/measurements/en.md Co-authored-by: bobgeorgethe3rd --- markdown/org/docs/patterns/skully/measurements/en.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/markdown/org/docs/patterns/skully/measurements/en.md b/markdown/org/docs/patterns/skully/measurements/en.md index 9c1cb68a114..ef3293aa814 100644 --- a/markdown/org/docs/patterns/skully/measurements/en.md +++ b/markdown/org/docs/patterns/skully/measurements/en.md @@ -3,6 +3,5 @@ title: "Skully (the logo): Required Measurements" --- -Skully does not require any measurements, but it can use the head circumference -measurement. If used, Skully will be approximately the same size as your head. +Skully does not require any measurements, but it can use the head circumference measurement. If used, Skully will be approximately the same size as your head. From 981ddd2a9e86b0e0b183fde9f933225f55712d38 Mon Sep 17 00:00:00 2001 From: Wouter van Wageningen Date: Tue, 11 Apr 2023 07:35:34 -0700 Subject: [PATCH 15/27] Update markdown/org/docs/patterns/skully/options/size/en.md Co-authored-by: bobgeorgethe3rd --- markdown/org/docs/patterns/skully/options/size/en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/markdown/org/docs/patterns/skully/options/size/en.md b/markdown/org/docs/patterns/skully/options/size/en.md index 5b29d3c9da4..a6058160f59 100644 --- a/markdown/org/docs/patterns/skully/options/size/en.md +++ b/markdown/org/docs/patterns/skully/options/size/en.md @@ -3,7 +3,7 @@ title: "Size" --- Skully can be made in different sizes. The default is about 75% of a normal human head. -This is a percentage of the head circumference. +This is a percentage of the default head circumference. If you set the percentage to 100%, and you enter your own head measurwement, Skully will be approximately the size of your head. From ea78e48e31ed79bd149181a19b88152e2e1ec193 Mon Sep 17 00:00:00 2001 From: Wouter van Wageningen Date: Tue, 11 Apr 2023 17:56:58 +0000 Subject: [PATCH 16/27] Linter issues fix --- designs/skully/src/head2.mjs | 16 +++++++++++++--- designs/skully/src/lowerjaw.mjs | 1 + designs/skully/src/nose.mjs | 11 +++++++---- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/designs/skully/src/head2.mjs b/designs/skully/src/head2.mjs index f59c59ca7b4..6c55d6b8fb8 100644 --- a/designs/skully/src/head2.mjs +++ b/designs/skully/src/head2.mjs @@ -2,8 +2,19 @@ import { pluginBundle } from '@freesewing/plugin-bundle' import { cheek } from './cheek.mjs' import { head1 } from './head1.mjs' -function draftHead2({ Point, Path, points, paths, complete, sa, store, paperless, macro, part }) { - console.log('head2') +function draftHead2({ + Point, + Path, + points, + paths, + complete, + sa, + log, + store, + paperless, + macro, + part +}) { const textAttribute = 'text-xs center' const sizeFactor = store.get('sizeFactor') @@ -38,7 +49,6 @@ function draftHead2({ Point, Path, points, paths, complete, sa, store, paperless points.point0Cp2 = points.point0.shift(0, 15 * sizeFactor) } } while (iterations < 100 && (secondSeam - p.length() > 1 || secondSeam - p.length() < -1)) - if (iterations >= 100) { log.error('Something is not quite right here!') } diff --git a/designs/skully/src/lowerjaw.mjs b/designs/skully/src/lowerjaw.mjs index f1cb2b52114..a12285a2ae1 100644 --- a/designs/skully/src/lowerjaw.mjs +++ b/designs/skully/src/lowerjaw.mjs @@ -9,6 +9,7 @@ function draftLowerjaw({ paths, complete, sa, + log, store, paperless, macro, diff --git a/designs/skully/src/nose.mjs b/designs/skully/src/nose.mjs index c913d34b70b..e9532db55d7 100644 --- a/designs/skully/src/nose.mjs +++ b/designs/skully/src/nose.mjs @@ -12,6 +12,7 @@ function draftNose({ snippets, complete, sa, + log, store, paperless, macro, @@ -41,10 +42,10 @@ function draftNose({ points.point1Cp2 = points.point1.shift(points.point1.angle(points.point2) + 55, noseHeight / 3) - var iteration = 0 + var iterations = 0 var pl do { - iteration++ + iterations++ points.point1 = points.point1.rotate(-0.5, points.point2) points.point1Cp2 = points.point1Cp2.rotate(-0.5, points.point2) @@ -55,8 +56,10 @@ function draftNose({ .setText('nose' + ' (10)', textAttribute) pl = paths.p1.length() - console.log({ i: iteration, pl: pl, noseSide: noseSide }) - } while (iteration < 100 && pl - noseSide > 1) + } while (iterations < 100 && pl - noseSide > 1) + if (iterations >= 100) { + log.error('Something is not quite right here!') + } points.pMiddle1 = points.point2.shiftFractionTowards(points.point1, 0.5) From 3bc23edcffd0b457a0a98e2669f85faeb004fe9f Mon Sep 17 00:00:00 2001 From: Wouter van Wageningen Date: Tue, 11 Apr 2023 11:05:34 -0700 Subject: [PATCH 17/27] Update designs.json --- config/software/designs.json | 1 - 1 file changed, 1 deletion(-) diff --git a/config/software/designs.json b/config/software/designs.json index 98e934d0dd0..5327cf7369f 100644 --- a/config/software/designs.json +++ b/config/software/designs.json @@ -79,7 +79,6 @@ }, "skully": { "description": "A FreeSewing pattern for skully, our logo, a plushy toy", - "code": "Coder name", "code": "Wouter Van Wageningen", "design": "Wouter Van Wageningen", "difficulty": 5, From 9e53c68b1f195911b0d05a1237e5d413d055d6dd Mon Sep 17 00:00:00 2001 From: Wouter van Wageningen Date: Tue, 11 Apr 2023 14:37:13 -0700 Subject: [PATCH 18/27] Update markdown/org/docs/patterns/skully/instructions/en.md Co-authored-by: bobgeorgethe3rd --- markdown/org/docs/patterns/skully/instructions/en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/markdown/org/docs/patterns/skully/instructions/en.md b/markdown/org/docs/patterns/skully/instructions/en.md index 681c438d244..0a7f7532b7a 100644 --- a/markdown/org/docs/patterns/skully/instructions/en.md +++ b/markdown/org/docs/patterns/skully/instructions/en.md @@ -21,7 +21,7 @@ Sew together the sides of the eye, so you will make a cone. Cut away any bulk. R ## Step 3: The nose -Like the eyes, the nose too has parts that need to be sewn together. There are two of these sides that need to be sew together. This creates two connected cones. This is very finicky, so take your time. +Like the eyes, the nose has seams that need to be sewn together. Sew the two straight seams together creating two connected cones. This is very finicky, so take your time. ## Step 4: The head From 4c8746cdfd4e9430578c71a508dcecd996aa4995 Mon Sep 17 00:00:00 2001 From: Wouter van Wageningen Date: Fri, 21 Apr 2023 05:46:41 +0000 Subject: [PATCH 19/27] Recommended fixes --- designs/skully/src/cheek.mjs | 22 ++++++------- designs/skully/src/cheekbone.mjs | 4 +-- designs/skully/src/eye.mjs | 4 +-- designs/skully/src/forehead.mjs | 14 ++++---- designs/skully/src/head1.mjs | 6 ++-- designs/skully/src/head2.mjs | 32 +++++++++---------- designs/skully/src/head3.mjs | 10 +++--- designs/skully/src/jawfloor.mjs | 6 ++-- designs/skully/src/lowerjaw.mjs | 11 ++++--- designs/skully/src/lowermouth.mjs | 6 ++-- designs/skully/src/nose.mjs | 6 ++-- designs/skully/src/uppermouth.mjs | 20 ++++++------ .../docs/patterns/skully/instructions/en.md | 10 +++--- .../docs/patterns/skully/measurements/en.md | 2 +- .../docs/patterns/skully/options/size/en.md | 2 +- 15 files changed, 79 insertions(+), 76 deletions(-) diff --git a/designs/skully/src/cheek.mjs b/designs/skully/src/cheek.mjs index 1b6a2e2178d..be71632776f 100644 --- a/designs/skully/src/cheek.mjs +++ b/designs/skully/src/cheek.mjs @@ -16,10 +16,8 @@ function draftCheek({ macro, part, }) { - console.log('cheek') const textAttribute = 'text-xs center' - - const sizeFactor = ((measurements?.head || 596) / 929.5) * options.size * 2 + const sizeFactor = (('head' in measurements ? measurements.head : 596) / 929.5) * options.size * 2 store.set('sizeFactor', sizeFactor) points.point0 = new Point(0, 0) @@ -67,25 +65,25 @@ function draftCheek({ .move(points.point7) .curve(points.point7Cp1, points.point8Cp2, points.point8) .curve(points.point8Cp1, points.point9Cp2, points.point9) - .setText('eyeBottom' + ' (4)', textAttribute) + .setText(complete ? 'eyeBottom' + ' (4)' : '', textAttribute) .addClass('hidden') paths.mouthTop = new Path() .move(points.point3) .curve(points.point3Cp1, points.point4Cp2, points.point4) - .setText('mouthTop' + ' (16)', textAttribute) + .setText(complete ? 'mouthTop' + ' (16)' : '', textAttribute) .addClass('hidden') paths.upperJaw = new Path() .move(points.point4) .curve(points.point4Cp1, points.point5Cp2, points.point5) - .setText('upperJaw' + ' (16)', textAttribute) + .setText(complete ? 'upperJaw' + ' (16)' : '', textAttribute) .addClass('hidden') paths.nose = new Path() .move(points.point1) .curve(points.point1Cp1, points.point2Cp2, points.point2) - .setText('nose (10)', textAttribute) + .setText(complete ? 'nose (10)' : '', textAttribute) .addClass('hidden') store.set('templeToJaw', points.point5.dist(points.point5a)) @@ -94,27 +92,27 @@ function draftCheek({ paths.seam1 = new Path() .move(points.point9) .line(points.point0) - .setText('1', textAttribute) + .setText(complete ? '1' : '', textAttribute) .addClass('hidden') paths.seam2 = new Path() .move(points.point6) .line(points.point7) - .setText('2', textAttribute) + .setText(complete ? '2' : '', textAttribute) .addClass('hidden') paths.seam5 = new Path() .move(points.point5a) .curve(points.point5aCp1, points.point6Cp2, points.point6) - .setText('5', textAttribute) + .setText(complete ? '5' : '', textAttribute) .addClass('hidden') paths.seam7 = new Path() .move(points.point0) .line(points.point1) - .setText('7', textAttribute) + .setText(complete ? '7' : '', textAttribute) .addClass('hidden') paths.seam8 = new Path() .move(points.point2) .curve(points.point2Cp1, points.point3Cp2, points.point3) - .setText('8', textAttribute) + .setText(complete ? '8' : '', textAttribute) .addClass('hidden') paths.seam = new Path() diff --git a/designs/skully/src/cheekbone.mjs b/designs/skully/src/cheekbone.mjs index 1a85986fdb2..bd6aeae4275 100644 --- a/designs/skully/src/cheekbone.mjs +++ b/designs/skully/src/cheekbone.mjs @@ -26,12 +26,12 @@ function draftCheekbone({ paths.seam5 = new Path() .move(points.point1) .curve_(points.point1Cp1, points.point0) - .setText('5', textAttribute) + .setText(complete ? '5' : '', textAttribute) .addClass('hidden') paths.seam6 = new Path() .move(points.point0) .curve(points.point0Cp1, points.point1Cp2, points.point1) - .setText('6', textAttribute) + .setText(complete ? '6' : '', textAttribute) .attr('data-text-text-decoration', 'underline') .addClass('hidden') diff --git a/designs/skully/src/eye.mjs b/designs/skully/src/eye.mjs index 87efcd62e20..e11404995e8 100644 --- a/designs/skully/src/eye.mjs +++ b/designs/skully/src/eye.mjs @@ -64,8 +64,8 @@ function draftEye({ points.pointNotch = paths.eye.shiftAlong(store.get('eyeTop')) const ps = paths.eye.split(points.pointNotch) - paths.eyeTop = ps[0].clone().setText('eyeTop' + ' (4)', textAttribute) - paths.eyeBottom = ps[1].clone().setText('eyeBottom' + ' (4)', textAttribute) + paths.eyeTop = ps[0].clone().setText(complete ? 'eyeTop' + ' (4)' : '', textAttribute) + paths.eyeBottom = ps[1].clone().setText(complete ? 'eyeBottom' + ' (4)' : '', textAttribute) paths.seam = new Path() .move(points.p4) diff --git a/designs/skully/src/forehead.mjs b/designs/skully/src/forehead.mjs index d6a9e722a68..031aff64a80 100644 --- a/designs/skully/src/forehead.mjs +++ b/designs/skully/src/forehead.mjs @@ -46,7 +46,7 @@ function draftForehead({ paths.firstSeam = new Path() .move(points.point9) .curve(points.point9Cp1, points.point0Cp2, points.point0) - .setText('20', textAttribute) + .setText(complete ? '20' : '', textAttribute) .addClass('hidden') store.set('firstSeam', paths.firstSeam.length()) @@ -63,39 +63,39 @@ function draftForehead({ .move(points.point2) .curve(points.point2Cp1, points.point3Cp2, points.point3) .curve(points.point3Cp1, points.point4Cp2, points.point4) - .setText('eyeTop' + ' (4)', textAttribute) + .setText(complete ? 'eyeTop' + ' (4)' : '', textAttribute) .addClass('hidden') paths.seam1 = new Path() .move(points.point1) .line(points.point2) - .setText('1', textAttribute) + .setText(complete ? '1' : '', textAttribute) .addClass('hidden') paths.seam2 = new Path() .move(points.point4) .line(points.point5) - .setText('2', textAttribute) + .setText(complete ? '2' : '', textAttribute) .addClass('hidden') paths.seam6a = new Path() .move(points.point5) .curve(points.point5Cp1, points.point6Cp2, points.point6) - .setText('6', textAttribute) + .setText(complete ? '6' : '', textAttribute) .attr('data-text-text-decoration', 'underline') .addClass('hidden') paths.seam6b = new Path() .move(points.point8) .line(points.point9) - .setText('6', textAttribute) + .setText(complete ? '6' : '', textAttribute) .attr('data-text-text-decoration', 'underline') .addClass('hidden') paths.seam7 = new Path() .move(points.point0) .curve(points.point0Cp1, points.point1Cp2, points.point1) - .setText('7', textAttribute) + .setText(complete ? '7' : '', textAttribute) .addClass('hidden') paths.seam = new Path() diff --git a/designs/skully/src/head1.mjs b/designs/skully/src/head1.mjs index ff91e9ddc4d..ed7411b40e2 100644 --- a/designs/skully/src/head1.mjs +++ b/designs/skully/src/head1.mjs @@ -33,7 +33,7 @@ function draftHead1({ paths.firstSeam = new Path() .move(points.point1) .curve(points.point1Cp1, points.point2Cp2, points.point2) - .setText('20', textAttribute) + .setText(complete ? '20' : '', textAttribute) .addClass('hidden') points.fs1 = paths.firstSeam.shiftAlong(store.get('firstSeam')) @@ -47,13 +47,13 @@ function draftHead1({ paths.secondSeam = new Path() .move(points.point2) .curve(points.point2Cp1, points.point0Cp2, points.point0) - .setText('17', textAttribute) + .setText(complete ? '17' : '', textAttribute) .addClass('hidden') paths.top = new Path() .move(points.point0) .line(points.point1) - .setText('19', textAttribute) + .setText(complete ? '19' : '', textAttribute) .addClass('hidden') store.set('secondSeam', paths.secondSeam.length()) diff --git a/designs/skully/src/head2.mjs b/designs/skully/src/head2.mjs index 6c55d6b8fb8..40bdcd5df3d 100644 --- a/designs/skully/src/head2.mjs +++ b/designs/skully/src/head2.mjs @@ -2,18 +2,18 @@ import { pluginBundle } from '@freesewing/plugin-bundle' import { cheek } from './cheek.mjs' import { head1 } from './head1.mjs' -function draftHead2({ - Point, - Path, - points, - paths, - complete, - sa, +function draftHead2({ + Point, + Path, + points, + paths, + complete, + sa, log, - store, - paperless, - macro, - part + store, + paperless, + macro, + part, }) { const textAttribute = 'text-xs center' const sizeFactor = store.get('sizeFactor') @@ -50,7 +50,7 @@ function draftHead2({ } } while (iterations < 100 && (secondSeam - p.length() > 1 || secondSeam - p.length() < -1)) if (iterations >= 100) { - log.error('Something is not quite right here!') + log.error('Generating head2 could not be made to fit in 100 iterations!') } points.dartPoint0 = new Path() @@ -75,25 +75,25 @@ function draftHead2({ .move(points.point0) ._curve(points.point1Cp2, points.point1) .curve_(points.point1Cp1, points.point2) - .setText('17', textAttribute) + .setText(complete ? '17' : '', textAttribute) .addClass('hidden') paths.thirdSeam = new Path() .move(points.point3) .curve(points.point3Cp1, points.point4Cp2, points.point4) - .setText('18', textAttribute) + .setText(complete ? '18' : '', textAttribute) .addClass('hidden') paths.top = new Path() .move(points.point4) .curve(points.point4, points.point0Cp2, points.point0) - .setText('19', textAttribute) + .setText(complete ? '19' : '', textAttribute) .addClass('hidden') paths.bottom = new Path() .move(points.point2) .line(points.point3) - .setText('21', textAttribute) + .setText(complete ? '21' : '', textAttribute) .addClass('hidden') store.set('thirdSeam', paths.thirdSeam.length() - points.dartPoint0.dist(points.dartPoint2)) diff --git a/designs/skully/src/head3.mjs b/designs/skully/src/head3.mjs index 1b7d553a3fa..cfe06f6afa0 100644 --- a/designs/skully/src/head3.mjs +++ b/designs/skully/src/head3.mjs @@ -57,7 +57,7 @@ function draftHead3({ if (x) { points.point5 = x[0].clone() } else { - log.error('Something is not quite right here!') + log.error('Could not make the lower part of head3 fit the other parts!') } points.point5Cp1 = points.point5.shift(359.48476820979687, 24.91000716579583 * sizeFactor) @@ -65,26 +65,26 @@ function draftHead3({ paths.thirdSeam1 = new Path() .move(points.point2) .curve(points.point2Cp1, points.point3Cp2, points.point3) - .setText('18', textAttribute) + .setText(complete ? '18' : '', textAttribute) .addClass('hidden') paths.thirdSeam2 = new Path() .move(points.point4) .line(points.point5) - .setText('18', textAttribute) + .setText(complete ? '18' : '', textAttribute) .addClass('hidden') paths.back = new Path() .move(points.point0) .curve(points.point0Cp1, points.point1Cp2, points.point1) .curve(points.point1Cp1, points.point2Cp2, points.point2) - .setText('19', textAttribute) + .setText(complete ? '19' : '', textAttribute) .addClass('hidden') paths.bottom = new Path() .move(points.point5) .line(points.point0) - .setText('21', textAttribute) + .setText(complete ? '21' : '', textAttribute) .addClass('hidden') paths.dart = new Path() diff --git a/designs/skully/src/jawfloor.mjs b/designs/skully/src/jawfloor.mjs index d7d74ef8f62..9b9f4f4089d 100644 --- a/designs/skully/src/jawfloor.mjs +++ b/designs/skully/src/jawfloor.mjs @@ -70,7 +70,7 @@ function draftJawfloor({ .curve(points.point1Cp1, points.point2Cp2, points.point2) .curve(points.point2Cp1, points.point3Cp2, points.point3) .curve(points.point3Cp1, points.point4Cp2, points.point4) - .setText('jawBottom' + ' (15)', textAttribute) + .setText(complete ? 'jawBottom' + ' (15)' : '', textAttribute) .addClass('hidden') paths.bottomJaw2 = new Path() @@ -80,14 +80,14 @@ function draftJawfloor({ .curve(points.mPoint2Cp2, points.mPoint1Cp1, points.mPoint1) .curve(points.mPoint1Cp2, points.mPoint0Cp1, points.mPoint0) .curve_(points.mPoint0Cp2, points.point6) - .setText('jawBottom' + ' (15)', textAttribute) + .setText(complete ? 'jawBottom' + ' (15)' : '', textAttribute) .addClass('hidden') paths.back = new Path() .move(points.point4) .curve(points.point4, points.point5Cp2, points.point5) .curve(points.mPoint5Cp2, points.mPoint4, points.mPoint4) - .setText('21', textAttribute) + .setText(complete ? '21' : '', textAttribute) .addClass('hidden') paths.seam = new Path() diff --git a/designs/skully/src/lowerjaw.mjs b/designs/skully/src/lowerjaw.mjs index a12285a2ae1..033188686d7 100644 --- a/designs/skully/src/lowerjaw.mjs +++ b/designs/skully/src/lowerjaw.mjs @@ -76,23 +76,26 @@ function draftLowerjaw({ paths.mouthBottom = new Path() .move(points.point5) .curve(points.point5Cp1, points.point0Cp2, points.point0) - .setText('mouthBottom' + ' (13)', textAttribute) + .setText(complete ? 'mouthBottom' + ' (13)' : '', textAttribute) .addClass('hidden') paths.lowerJaw = new Path() .move(points.point4) .curve(points.point4Cp1, points.point5Cp2, points.point5) - .setText('lowerJaw' + ' (14)', textAttribute) + .setText(complete ? 'lowerJaw' + ' (14)' : '', textAttribute) .addClass('hidden') - paths.front = new Path().move(points.point0).line(points.point1).setText('12', textAttribute) + paths.front = new Path() + .move(points.point0) + .line(points.point1) + .setText(complete ? '12' : '', textAttribute) paths.bottomJaw = new Path() .move(points.point1) .curve(points.point1Cp1, points.point2Cp2, points.point2) .curve(points.point2Cp1, points.point3Cp2, points.point3) .curve(points.point3Cp1, points.point4Cp2, points.point4) - .setText('jawBottom' + '(15)', textAttribute) + .setText(complete ? 'jawBottom' + '(15)' : '', textAttribute) .addClass('hidden') paths.seam = new Path() diff --git a/designs/skully/src/lowermouth.mjs b/designs/skully/src/lowermouth.mjs index 6cd2a7bffd9..0bce42dc8bc 100644 --- a/designs/skully/src/lowermouth.mjs +++ b/designs/skully/src/lowermouth.mjs @@ -35,18 +35,18 @@ function draftLowermouth({ paths.mouth1 = new Path() .move(points.point0) .curve(points.point0Cp1, points.point1Cp2, points.point1) - .setText('mouthBottom' + ' (13)', textAttribute) + .setText(complete ? 'mouthBottom' + ' (13)' : '', textAttribute) .addClass('hidden') paths.mouth2 = new Path() .move(points.point1) .curve(points.point1Cp1, points.point2Cp2, points.point2) - .setText('mouthBottom' + ' (13)', textAttribute) + .setText(complete ? 'mouthBottom' + ' (13)' : '', textAttribute) .addClass('hidden') paths.backOfMouth = new Path() .move(points.point2) .line(points.point0) - .setText('backOfMouth' + ' (11)', textAttribute) + .setText(complete ? 'backOfMouth' + ' (11)' : '', textAttribute) .addClass('hidden') store.set('mouthWidth', points.point0.dist(points.point2)) diff --git a/designs/skully/src/nose.mjs b/designs/skully/src/nose.mjs index e9532db55d7..023ca1ecf76 100644 --- a/designs/skully/src/nose.mjs +++ b/designs/skully/src/nose.mjs @@ -53,12 +53,12 @@ function draftNose({ paths.p1 = new Path() .move(points.point0) .curve(points.point0Cp1, points.point1Cp2, points.point1) - .setText('nose' + ' (10)', textAttribute) + .setText(complete ? 'nose' + ' (10)' : '', textAttribute) pl = paths.p1.length() } while (iterations < 100 && pl - noseSide > 1) if (iterations >= 100) { - log.error('Something is not quite right here!') + log.error('Generating nose could not be made to fit in 100 iterations!') } points.pMiddle1 = points.point2.shiftFractionTowards(points.point1, 0.5) @@ -71,7 +71,7 @@ function draftNose({ paths.p2 = new Path() .move(points.point3) .curve(points.point3Cp1, points.point0Cp2, points.point0) - .setText('nose' + ' (10)', textAttribute) + .setText(complete ? 'nose' + ' (10)' : '', textAttribute) paths.seam = new Path() .move(points.point0) diff --git a/designs/skully/src/uppermouth.mjs b/designs/skully/src/uppermouth.mjs index 18ecb99408c..ed68720333e 100644 --- a/designs/skully/src/uppermouth.mjs +++ b/designs/skully/src/uppermouth.mjs @@ -74,7 +74,7 @@ function draftUppermouth({ paths.backOfUpperJaw = new Path() .move(points.point5) .curve(points.point5Cp1, points.point6Cp2, points.point6) - .setText('not sewn', textAttribute) + .setText(complete ? 'not sewn' : '', textAttribute) .addClass('hidden') points.lowerJaw = paths.backOfUpperJaw.shiftAlong(store.get('upperJawToLowerJaw')) @@ -120,7 +120,7 @@ function draftUppermouth({ .curve(points.point2Cp1, points.point3Cp2, points.point3) .curve(points.point3Cp1, points.point4Cp2, points.point4) .line(points.point5) - .setText('upperJaw' + ' (16)', textAttribute) + .setText(complete ? 'upperJaw' + ' (16)' : '', textAttribute) .addClass('hidden') paths.upperJaw2 = new Path() @@ -129,19 +129,19 @@ function draftUppermouth({ .curve(points.mPoint4Cp2, points.mPoint3Cp1, points.mPoint3) .curve(points.mPoint3Cp2, points.mPoint2Cp1, points.mPoint2) .line(points.mPoint1) - .setText('upperJaw' + ' (16)', textAttribute) + .setText(complete ? 'upperJaw' + ' (16)' : '', textAttribute) .addClass('hidden') paths.front1 = new Path() .move(points.pointM1) .curve_(points.pointM1Cp1, points.point1) - .setText('(16)', textAttribute) + .setText(complete ? '(16)' : '', textAttribute) .addClass('hidden') paths.front2 = new Path() .move(points.mPoint1) .curve_(points.mPointM1Cp1, points.pointM1) - .setText('(16)', textAttribute) + .setText(complete ? '(16)' : '', textAttribute) .addClass('hidden') paths.backOfUpperJaw.curve(points.mPoint6Cp2, points.mPoint5Cp1, points.mPoint5) @@ -158,29 +158,29 @@ function draftUppermouth({ paths.backOfMouth = new Path() .move(points.mPoint1) .line(points.point1) - .setText('backOfMouth' + ' (11)', textAttribute) + .setText(complete ? 'backOfMouth' + ' (11)' : '', textAttribute) .setClass('dashed') paths.lowerJaw1 = new Path() .move(points.point2) .curve(points.point2ToLowerJaw, points.lowerJawToPoint2, points.lowerJaw) - .setText('lowerJaw' + ' (14)', textAttribute) + .setText(complete ? 'lowerJaw' + ' (14)' : '', textAttribute) .setClass('dashed') paths.lowerJaw2 = new Path() .move(points.mPoint2) .curve(points.mPoint2ToLowerJaw, points.mLowerJawToPoint2, points.mLowerJaw) - .setText('lowerJaw' + ' (14)', textAttribute) + .setText(complete ? 'lowerJaw' + ' (14)' : '', textAttribute) .setClass('dashed') paths.backOfUpperJaw1 = new Path() .move(points.point5) .line(points.lowerJaw) - .setText('21', textAttribute) + .setText(complete ? '21' : '', textAttribute) .addClass('hidden') paths.backOfUpperJaw2 = new Path() .move(points.mLowerJaw) .line(points.mPoint5) - .setText('21', textAttribute) + .setText(complete ? '21' : '', textAttribute) .addClass('hidden') store.set('lowerJaw', paths.lowerJaw1.length() + points.point1.dist(points.point2)) diff --git a/markdown/org/docs/patterns/skully/instructions/en.md b/markdown/org/docs/patterns/skully/instructions/en.md index 0a7f7532b7a..dec7c90c099 100644 --- a/markdown/org/docs/patterns/skully/instructions/en.md +++ b/markdown/org/docs/patterns/skully/instructions/en.md @@ -12,12 +12,12 @@ Most of the seams will benefit from being basted before being sewn. ## Step 1: The darts -There are three darts that need to be closed first. Pin and sew them, then remove the bulk and +There are three darts that need to be closed first. Pin and sew them, then remove the extra fabric and give them a good press. Repeat for the other three darts. ## Step 2: The eyes -Sew together the sides of the eye, so you will make a cone. Cut away any bulk. Repeat for the other eye +Sew together the sides of the eye, so you will make a cone. Cut away any excess seam allowance. Repeat for the other eye ## Step 3: The nose @@ -35,7 +35,7 @@ it partly. When you are sewing together the individual parts, you will be making two halves of the skull. -Sewing the eyes and nose to the cheek and forehead parts is best done by hand. You will have to aling +Sewing the eyes and nose to the cheek and forehead parts is best done by hand. You will have to align the different notches to their corresponding ones on the other part. Sewing the lowerJaw to the lowerMouth and upperMouth is challenging. You will be making a normal seam @@ -48,7 +48,9 @@ The back of the upperMouth is not sewn to anything. It is just there to provide ## Step 5: Hair Now is the time to add hair to skully. When putting the embroidery floss in, make sure you add knots -on the inside, or else it is very easy to pull Skully's hair out later. +on the inside, or else it is very easy to pull Skully's hair out later. I threaded two pieces of floss +through a needle, and stick it from the outside through the head. Then make an overhand knot, and push +the needle back out. You should make shorter hair towards the outside, and longer in the middle. ## Step 6: Stuffing diff --git a/markdown/org/docs/patterns/skully/measurements/en.md b/markdown/org/docs/patterns/skully/measurements/en.md index ef3293aa814..775cb2dd71e 100644 --- a/markdown/org/docs/patterns/skully/measurements/en.md +++ b/markdown/org/docs/patterns/skully/measurements/en.md @@ -3,5 +3,5 @@ title: "Skully (the logo): Required Measurements" --- -Skully does not require any measurements, but it can use the head circumference measurement. If used, Skully will be approximately the same size as your head. +Skully does not require any measurements, but it can use the head circumference measurement. If used, Skully will be approximately 75%, or any other percentage, of the size of your head. diff --git a/markdown/org/docs/patterns/skully/options/size/en.md b/markdown/org/docs/patterns/skully/options/size/en.md index a6058160f59..820dcbea848 100644 --- a/markdown/org/docs/patterns/skully/options/size/en.md +++ b/markdown/org/docs/patterns/skully/options/size/en.md @@ -2,7 +2,7 @@ title: "Size" --- -Skully can be made in different sizes. The default is about 75% of a normal human head. +Skully can be made in different sizes. The default is about 75% of an averge human head. This is a percentage of the default head circumference. If you set the percentage to 100%, and you enter your own head measurwement, Skully will From cbedd8aabf3fa15c9ad730bac70897c51d3f7919 Mon Sep 17 00:00:00 2001 From: Joost De Cock Date: Mon, 2 Oct 2023 18:45:42 +0200 Subject: [PATCH 20/27] fix(skully): Remove plugin-bundle imports --- designs/skully/src/cheek.mjs | 4 ---- designs/skully/src/cheekbone.mjs | 3 --- designs/skully/src/eye.mjs | 3 --- designs/skully/src/forehead.mjs | 2 -- designs/skully/src/head1.mjs | 2 -- designs/skully/src/head2.mjs | 2 -- designs/skully/src/head3.mjs | 2 -- designs/skully/src/jawfloor.mjs | 2 -- designs/skully/src/lowerjaw.mjs | 4 ---- designs/skully/src/lowermouth.mjs | 2 -- designs/skully/src/nose.mjs | 3 --- designs/skully/src/uppermouth.mjs | 3 --- 12 files changed, 32 deletions(-) diff --git a/designs/skully/src/cheek.mjs b/designs/skully/src/cheek.mjs index be71632776f..d7649cfb79b 100644 --- a/designs/skully/src/cheek.mjs +++ b/designs/skully/src/cheek.mjs @@ -1,5 +1,3 @@ -import { pluginBundle } from '@freesewing/plugin-bundle' - function draftCheek({ options, Point, @@ -169,7 +167,6 @@ function draftCheek({ points.noseX = paths.nose.edge('right') points.eyeBottomY = paths.eyeBottom.edge('bottom') points.upperJaw = paths.upperJaw.shiftFractionAlong(0.42) - console.log({ uj: points.upperJaw, p6: points.point6 }) macro('hd', { from: points.noseX, @@ -278,6 +275,5 @@ export const cheek = { size: { pct: 75, min: 10, max: 300, menu: 'fit' }, }, optionalMeasurements: ['head'], - plugins: [pluginBundle], draft: draftCheek, } diff --git a/designs/skully/src/cheekbone.mjs b/designs/skully/src/cheekbone.mjs index bd6aeae4275..565ec62ecf6 100644 --- a/designs/skully/src/cheekbone.mjs +++ b/designs/skully/src/cheekbone.mjs @@ -1,4 +1,3 @@ -import { pluginBundle } from '@freesewing/plugin-bundle' import { cheek } from './cheek.mjs' function draftCheekbone({ @@ -13,7 +12,6 @@ function draftCheekbone({ macro, part, }) { - console.log('cheekbone') const textAttribute = 'text-xs center text-decoration="line-through"' const sizeFactor = store.get('sizeFactor') @@ -97,6 +95,5 @@ function draftCheekbone({ export const cheekbone = { name: 'cheekbone', after: cheek, - plugins: [pluginBundle], draft: draftCheekbone, } diff --git a/designs/skully/src/eye.mjs b/designs/skully/src/eye.mjs index e11404995e8..6f3935daf5c 100644 --- a/designs/skully/src/eye.mjs +++ b/designs/skully/src/eye.mjs @@ -1,4 +1,3 @@ -import { pluginBundle } from '@freesewing/plugin-bundle' import { cheek } from './cheek.mjs' import { forehead } from './forehead.mjs' @@ -16,7 +15,6 @@ function draftEye({ macro, part, }) { - console.log('eye') const textAttribute = 'text-xs center' const eyeCircumference = store.get('eyeBottom') + store.get('eyeTop') @@ -140,6 +138,5 @@ function draftEye({ export const eye = { name: 'eye', after: [cheek, forehead], - plugins: [pluginBundle], draft: draftEye, } diff --git a/designs/skully/src/forehead.mjs b/designs/skully/src/forehead.mjs index 031aff64a80..688fcbecd38 100644 --- a/designs/skully/src/forehead.mjs +++ b/designs/skully/src/forehead.mjs @@ -1,4 +1,3 @@ -import { pluginBundle } from '@freesewing/plugin-bundle' import { cheek } from './cheek.mjs' function draftForehead({ @@ -243,6 +242,5 @@ function draftForehead({ export const forehead = { name: 'forehead', after: cheek, - plugins: [pluginBundle], draft: draftForehead, } diff --git a/designs/skully/src/head1.mjs b/designs/skully/src/head1.mjs index ed7411b40e2..22a837cd6e6 100644 --- a/designs/skully/src/head1.mjs +++ b/designs/skully/src/head1.mjs @@ -1,4 +1,3 @@ -import { pluginBundle } from '@freesewing/plugin-bundle' import { cheek } from './cheek.mjs' import { forehead } from './forehead.mjs' @@ -132,6 +131,5 @@ function draftHead1({ export const head1 = { name: 'head1', after: [cheek, forehead], - plugins: [pluginBundle], draft: draftHead1, } diff --git a/designs/skully/src/head2.mjs b/designs/skully/src/head2.mjs index 40bdcd5df3d..18064299793 100644 --- a/designs/skully/src/head2.mjs +++ b/designs/skully/src/head2.mjs @@ -1,4 +1,3 @@ -import { pluginBundle } from '@freesewing/plugin-bundle' import { cheek } from './cheek.mjs' import { head1 } from './head1.mjs' @@ -218,6 +217,5 @@ function draftHead2({ export const head2 = { name: 'head2', after: [cheek, head1], - plugins: [pluginBundle], draft: draftHead2, } diff --git a/designs/skully/src/head3.mjs b/designs/skully/src/head3.mjs index cfe06f6afa0..e8fd25cc1db 100644 --- a/designs/skully/src/head3.mjs +++ b/designs/skully/src/head3.mjs @@ -1,4 +1,3 @@ -import { pluginBundle } from '@freesewing/plugin-bundle' import { cheek } from './cheek.mjs' import { head2 } from './head2.mjs' import { jawfloor } from './jawfloor.mjs' @@ -200,6 +199,5 @@ function draftHead3({ export const head3 = { name: 'head3', after: [cheek, head2, jawfloor], - plugins: [pluginBundle], draft: draftHead3, } diff --git a/designs/skully/src/jawfloor.mjs b/designs/skully/src/jawfloor.mjs index 9b9f4f4089d..3a98f0d5b2e 100644 --- a/designs/skully/src/jawfloor.mjs +++ b/designs/skully/src/jawfloor.mjs @@ -1,4 +1,3 @@ -import { pluginBundle } from '@freesewing/plugin-bundle' import { cheek } from './cheek.mjs' import { lowerjaw } from './lowerjaw.mjs' @@ -186,6 +185,5 @@ function draftJawfloor({ export const jawfloor = { name: 'jawfloor', after: [cheek, lowerjaw], - plugins: [pluginBundle], draft: draftJawfloor, } diff --git a/designs/skully/src/lowerjaw.mjs b/designs/skully/src/lowerjaw.mjs index 033188686d7..b8ec3725add 100644 --- a/designs/skully/src/lowerjaw.mjs +++ b/designs/skully/src/lowerjaw.mjs @@ -1,4 +1,3 @@ -import { pluginBundle } from '@freesewing/plugin-bundle' import { cheek } from './cheek.mjs' import { uppermouth } from './uppermouth.mjs' @@ -55,8 +54,6 @@ function draftLowerjaw({ p = new Path().move(points.point5).curve(points.point5Cp1, points.point0Cp2, points.point0) points.point5 = points.point5.shift(270, (mouthTop - p.length()) * 0.5) - - console.log({ mouthTop: mouthTop, seriously: p.length() }) } while (iterations < 100 && (mouthTop - p.length() > 1 || mouthTop - p.length() < -1)) if (iterations >= 100) { log.error('Something is not quite right here!') @@ -198,6 +195,5 @@ function draftLowerjaw({ export const lowerjaw = { name: 'lowerjaw', after: [cheek, uppermouth], - plugins: [pluginBundle], draft: draftLowerjaw, } diff --git a/designs/skully/src/lowermouth.mjs b/designs/skully/src/lowermouth.mjs index 0bce42dc8bc..d013c7cb9c6 100644 --- a/designs/skully/src/lowermouth.mjs +++ b/designs/skully/src/lowermouth.mjs @@ -1,4 +1,3 @@ -import { pluginBundle } from '@freesewing/plugin-bundle' import { cheek } from './cheek.mjs' function draftLowermouth({ @@ -100,6 +99,5 @@ function draftLowermouth({ export const lowermouth = { name: 'lowermouth', after: cheek, - plugins: [pluginBundle], draft: draftLowermouth, } diff --git a/designs/skully/src/nose.mjs b/designs/skully/src/nose.mjs index 023ca1ecf76..1a5e23fc969 100644 --- a/designs/skully/src/nose.mjs +++ b/designs/skully/src/nose.mjs @@ -1,4 +1,3 @@ -import { pluginBundle } from '@freesewing/plugin-bundle' import { cheek } from './cheek.mjs' import { eye } from './eye.mjs' import { forehead } from './forehead.mjs' @@ -18,7 +17,6 @@ function draftNose({ macro, part, }) { - console.log('nose') const textAttribute = 'text-xs center' const noseSide = store.get('noseSide') @@ -198,6 +196,5 @@ function draftNose({ export const nose = { name: 'nose', after: [cheek, forehead, eye], - plugins: [pluginBundle], draft: draftNose, } diff --git a/designs/skully/src/uppermouth.mjs b/designs/skully/src/uppermouth.mjs index ed68720333e..80c0c96d67d 100644 --- a/designs/skully/src/uppermouth.mjs +++ b/designs/skully/src/uppermouth.mjs @@ -1,4 +1,3 @@ -import { pluginBundle } from '@freesewing/plugin-bundle' import { cheek } from './cheek.mjs' import { head1 } from './head1.mjs' import { lowermouth } from './lowermouth.mjs' @@ -112,7 +111,6 @@ function draftUppermouth({ ], prefix: 'm', }) - console.log({ points: JSON.parse(JSON.stringify(points)) }) paths.upperJaw1 = new Path() .move(points.point1) @@ -292,6 +290,5 @@ function draftUppermouth({ export const uppermouth = { name: 'uppermouth', after: [cheek, head1, lowermouth], - plugins: [pluginBundle], draft: draftUppermouth, } From bfbc3e7b2308c1e4503f30fee6c2cd479b45eeda Mon Sep 17 00:00:00 2001 From: Joost De Cock Date: Mon, 2 Oct 2023 18:49:05 +0200 Subject: [PATCH 21/27] chore(skully): Added i18n folder --- designs/skully/i18n/de.json | 8 ++++++++ designs/skully/i18n/en.json | 8 ++++++++ designs/skully/i18n/es.json | 8 ++++++++ designs/skully/i18n/fr.json | 8 ++++++++ designs/skully/i18n/index.mjs | 8 ++++++++ designs/skully/i18n/nl.json | 8 ++++++++ designs/skully/i18n/uk.json | 8 ++++++++ 7 files changed, 56 insertions(+) create mode 100644 designs/skully/i18n/de.json create mode 100644 designs/skully/i18n/en.json create mode 100644 designs/skully/i18n/es.json create mode 100644 designs/skully/i18n/fr.json create mode 100644 designs/skully/i18n/index.mjs create mode 100644 designs/skully/i18n/nl.json create mode 100644 designs/skully/i18n/uk.json diff --git a/designs/skully/i18n/de.json b/designs/skully/i18n/de.json new file mode 100644 index 00000000000..7660b990388 --- /dev/null +++ b/designs/skully/i18n/de.json @@ -0,0 +1,8 @@ +{ + "t": "Skully", + "d": "Skylly is the FreeSewing logo, now in plushy toy form", + "p": { }, + "s": { }, + "o": { } + } +} diff --git a/designs/skully/i18n/en.json b/designs/skully/i18n/en.json new file mode 100644 index 00000000000..7660b990388 --- /dev/null +++ b/designs/skully/i18n/en.json @@ -0,0 +1,8 @@ +{ + "t": "Skully", + "d": "Skylly is the FreeSewing logo, now in plushy toy form", + "p": { }, + "s": { }, + "o": { } + } +} diff --git a/designs/skully/i18n/es.json b/designs/skully/i18n/es.json new file mode 100644 index 00000000000..7660b990388 --- /dev/null +++ b/designs/skully/i18n/es.json @@ -0,0 +1,8 @@ +{ + "t": "Skully", + "d": "Skylly is the FreeSewing logo, now in plushy toy form", + "p": { }, + "s": { }, + "o": { } + } +} diff --git a/designs/skully/i18n/fr.json b/designs/skully/i18n/fr.json new file mode 100644 index 00000000000..7660b990388 --- /dev/null +++ b/designs/skully/i18n/fr.json @@ -0,0 +1,8 @@ +{ + "t": "Skully", + "d": "Skylly is the FreeSewing logo, now in plushy toy form", + "p": { }, + "s": { }, + "o": { } + } +} diff --git a/designs/skully/i18n/index.mjs b/designs/skully/i18n/index.mjs new file mode 100644 index 00000000000..36aac928b67 --- /dev/null +++ b/designs/skully/i18n/index.mjs @@ -0,0 +1,8 @@ +import en from './en.json' assert { type: 'json' } +import de from './de.json' assert { type: 'json' } +import es from './es.json' assert { type: 'json' } +import fr from './fr.json' assert { type: 'json' } +import nl from './nl.json' assert { type: 'json' } +import uk from './uk.json' assert { type: 'json' } + +export const i18n = { en, de, es, fr, nl, uk } diff --git a/designs/skully/i18n/nl.json b/designs/skully/i18n/nl.json new file mode 100644 index 00000000000..7660b990388 --- /dev/null +++ b/designs/skully/i18n/nl.json @@ -0,0 +1,8 @@ +{ + "t": "Skully", + "d": "Skylly is the FreeSewing logo, now in plushy toy form", + "p": { }, + "s": { }, + "o": { } + } +} diff --git a/designs/skully/i18n/uk.json b/designs/skully/i18n/uk.json new file mode 100644 index 00000000000..7660b990388 --- /dev/null +++ b/designs/skully/i18n/uk.json @@ -0,0 +1,8 @@ +{ + "t": "Skully", + "d": "Skylly is the FreeSewing logo, now in plushy toy form", + "p": { }, + "s": { }, + "o": { } + } +} From 2e57bcfae37fe47ecc4e8012794fecc0f0c33009 Mon Sep 17 00:00:00 2001 From: Joost De Cock Date: Wed, 4 Oct 2023 08:36:47 +0200 Subject: [PATCH 22/27] fix(lab): Add skully to use-design hook --- sites/lab/hooks/use-design.mjs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sites/lab/hooks/use-design.mjs b/sites/lab/hooks/use-design.mjs index f078cb6007a..582074b48f9 100644 --- a/sites/lab/hooks/use-design.mjs +++ b/sites/lab/hooks/use-design.mjs @@ -36,6 +36,7 @@ import { Sandy } from '@freesewing/sandy' import { Shin } from '@freesewing/shin' import { Simon } from '@freesewing/simon' import { Simone } from '@freesewing/simone' +import { Skully } from '@freesewing/skully' import { Sven } from '@freesewing/sven' import { Tamiko } from '@freesewing/tamiko' import { Teagan } from '@freesewing/teagan' @@ -87,6 +88,7 @@ const designs = { shin: Shin, simon: Simon, simone: Simone, + skully: Skully, sven: Sven, tamiko: Tamiko, teagan: Teagan, From a8b8b5921e3221b23638af96964832579e0c4b37 Mon Sep 17 00:00:00 2001 From: woutervdub Date: Wed, 4 Oct 2023 15:20:27 +0000 Subject: [PATCH 23/27] i18n --- designs/skully/i18n/de.json | 38 +++++++++++++++++++++++++++++++++++ designs/skully/i18n/en.json | 38 +++++++++++++++++++++++++++++++++++ designs/skully/i18n/es.json | 38 +++++++++++++++++++++++++++++++++++ designs/skully/i18n/fr.json | 38 +++++++++++++++++++++++++++++++++++ designs/skully/i18n/index.mjs | 8 ++++++++ designs/skully/i18n/nl.json | 38 +++++++++++++++++++++++++++++++++++ designs/skully/i18n/uk.json | 38 +++++++++++++++++++++++++++++++++++ 7 files changed, 236 insertions(+) create mode 100644 designs/skully/i18n/de.json create mode 100644 designs/skully/i18n/en.json create mode 100644 designs/skully/i18n/es.json create mode 100644 designs/skully/i18n/fr.json create mode 100644 designs/skully/i18n/index.mjs create mode 100644 designs/skully/i18n/nl.json create mode 100644 designs/skully/i18n/uk.json diff --git a/designs/skully/i18n/de.json b/designs/skully/i18n/de.json new file mode 100644 index 00000000000..cf2665157a0 --- /dev/null +++ b/designs/skully/i18n/de.json @@ -0,0 +1,38 @@ +{ + "t": "Skully logo plush toy", + "d": "A FreeSewing pattern for skully, our logo, a plushy toy.", + "p": { + "cheek": "Cheek", + "cheekbone": "Cheekbone", + "eye": "Eye", + "forehead": "Forehead", + "head1": "Head1", + "head2": "Head2", + "head3": "Head3", + "jawfloor": "Jawfloor", + "lowerjaw": "Lowerjaw", + "lowermouth": "Lowermouth", + "nose": "Nose", + "uppermouth": "Uppermouth" + }, + "s": { + "cheek": "Cheek", + "cheekbone": "Cheekbone", + "eye": "Eye", + "forehead": "Forehead", + "head1": "Head1", + "head2": "Head2", + "head3": "Head3", + "jawfloor": "Jawfloor", + "lowerjaw": "Lowerjaw", + "lowermouth": "Lowermouth", + "nose": "Nose", + "uppermouth": "Uppermouth" + }, + "o": { + "size": { + "t": "Size", + "d": "Controls the overall size (value shown is the size of the head)" + } + } +} diff --git a/designs/skully/i18n/en.json b/designs/skully/i18n/en.json new file mode 100644 index 00000000000..4aebd5dc393 --- /dev/null +++ b/designs/skully/i18n/en.json @@ -0,0 +1,38 @@ +{ + "t": "Skully logo plush toy", + "d": "A FreeSewing pattern for skully, our logo, a plushy toy.", + "p": { + "cheek": "Cheek", + "cheekbone": "Cheekbone", + "eye": "Eye", + "forehead": "Forehead", + "head1": "Head part 1", + "head2": "Head part 2", + "head3": "Head part 3", + "jawfloor": "Jaw floor", + "lowerjaw": "Lower Jaw", + "lowermouth": "Lower Mouth", + "nose": "Nose", + "uppermouth": "Upper Mouth" + }, + "s": { + "cheek": "Cheek", + "cheekbone": "Cheekbone", + "eye": "Eye", + "forehead": "Forehead", + "head1": "Head part 1", + "head2": "Head part 2", + "head3": "Head part 3", + "jawfloor": "Jaw floor", + "lowerjaw": "Lower Jaw", + "lowermouth": "Lower Mouth", + "nose": "Nose", + "uppermouth": "Upper Mouth" + }, + "o": { + "size": { + "t": "Size", + "d": "Controls the overall size (value shown is the size of the head)" + } + } +} diff --git a/designs/skully/i18n/es.json b/designs/skully/i18n/es.json new file mode 100644 index 00000000000..cf2665157a0 --- /dev/null +++ b/designs/skully/i18n/es.json @@ -0,0 +1,38 @@ +{ + "t": "Skully logo plush toy", + "d": "A FreeSewing pattern for skully, our logo, a plushy toy.", + "p": { + "cheek": "Cheek", + "cheekbone": "Cheekbone", + "eye": "Eye", + "forehead": "Forehead", + "head1": "Head1", + "head2": "Head2", + "head3": "Head3", + "jawfloor": "Jawfloor", + "lowerjaw": "Lowerjaw", + "lowermouth": "Lowermouth", + "nose": "Nose", + "uppermouth": "Uppermouth" + }, + "s": { + "cheek": "Cheek", + "cheekbone": "Cheekbone", + "eye": "Eye", + "forehead": "Forehead", + "head1": "Head1", + "head2": "Head2", + "head3": "Head3", + "jawfloor": "Jawfloor", + "lowerjaw": "Lowerjaw", + "lowermouth": "Lowermouth", + "nose": "Nose", + "uppermouth": "Uppermouth" + }, + "o": { + "size": { + "t": "Size", + "d": "Controls the overall size (value shown is the size of the head)" + } + } +} diff --git a/designs/skully/i18n/fr.json b/designs/skully/i18n/fr.json new file mode 100644 index 00000000000..cf2665157a0 --- /dev/null +++ b/designs/skully/i18n/fr.json @@ -0,0 +1,38 @@ +{ + "t": "Skully logo plush toy", + "d": "A FreeSewing pattern for skully, our logo, a plushy toy.", + "p": { + "cheek": "Cheek", + "cheekbone": "Cheekbone", + "eye": "Eye", + "forehead": "Forehead", + "head1": "Head1", + "head2": "Head2", + "head3": "Head3", + "jawfloor": "Jawfloor", + "lowerjaw": "Lowerjaw", + "lowermouth": "Lowermouth", + "nose": "Nose", + "uppermouth": "Uppermouth" + }, + "s": { + "cheek": "Cheek", + "cheekbone": "Cheekbone", + "eye": "Eye", + "forehead": "Forehead", + "head1": "Head1", + "head2": "Head2", + "head3": "Head3", + "jawfloor": "Jawfloor", + "lowerjaw": "Lowerjaw", + "lowermouth": "Lowermouth", + "nose": "Nose", + "uppermouth": "Uppermouth" + }, + "o": { + "size": { + "t": "Size", + "d": "Controls the overall size (value shown is the size of the head)" + } + } +} diff --git a/designs/skully/i18n/index.mjs b/designs/skully/i18n/index.mjs new file mode 100644 index 00000000000..36aac928b67 --- /dev/null +++ b/designs/skully/i18n/index.mjs @@ -0,0 +1,8 @@ +import en from './en.json' assert { type: 'json' } +import de from './de.json' assert { type: 'json' } +import es from './es.json' assert { type: 'json' } +import fr from './fr.json' assert { type: 'json' } +import nl from './nl.json' assert { type: 'json' } +import uk from './uk.json' assert { type: 'json' } + +export const i18n = { en, de, es, fr, nl, uk } diff --git a/designs/skully/i18n/nl.json b/designs/skully/i18n/nl.json new file mode 100644 index 00000000000..cf2665157a0 --- /dev/null +++ b/designs/skully/i18n/nl.json @@ -0,0 +1,38 @@ +{ + "t": "Skully logo plush toy", + "d": "A FreeSewing pattern for skully, our logo, a plushy toy.", + "p": { + "cheek": "Cheek", + "cheekbone": "Cheekbone", + "eye": "Eye", + "forehead": "Forehead", + "head1": "Head1", + "head2": "Head2", + "head3": "Head3", + "jawfloor": "Jawfloor", + "lowerjaw": "Lowerjaw", + "lowermouth": "Lowermouth", + "nose": "Nose", + "uppermouth": "Uppermouth" + }, + "s": { + "cheek": "Cheek", + "cheekbone": "Cheekbone", + "eye": "Eye", + "forehead": "Forehead", + "head1": "Head1", + "head2": "Head2", + "head3": "Head3", + "jawfloor": "Jawfloor", + "lowerjaw": "Lowerjaw", + "lowermouth": "Lowermouth", + "nose": "Nose", + "uppermouth": "Uppermouth" + }, + "o": { + "size": { + "t": "Size", + "d": "Controls the overall size (value shown is the size of the head)" + } + } +} diff --git a/designs/skully/i18n/uk.json b/designs/skully/i18n/uk.json new file mode 100644 index 00000000000..cf2665157a0 --- /dev/null +++ b/designs/skully/i18n/uk.json @@ -0,0 +1,38 @@ +{ + "t": "Skully logo plush toy", + "d": "A FreeSewing pattern for skully, our logo, a plushy toy.", + "p": { + "cheek": "Cheek", + "cheekbone": "Cheekbone", + "eye": "Eye", + "forehead": "Forehead", + "head1": "Head1", + "head2": "Head2", + "head3": "Head3", + "jawfloor": "Jawfloor", + "lowerjaw": "Lowerjaw", + "lowermouth": "Lowermouth", + "nose": "Nose", + "uppermouth": "Uppermouth" + }, + "s": { + "cheek": "Cheek", + "cheekbone": "Cheekbone", + "eye": "Eye", + "forehead": "Forehead", + "head1": "Head1", + "head2": "Head2", + "head3": "Head3", + "jawfloor": "Jawfloor", + "lowerjaw": "Lowerjaw", + "lowermouth": "Lowermouth", + "nose": "Nose", + "uppermouth": "Uppermouth" + }, + "o": { + "size": { + "t": "Size", + "d": "Controls the overall size (value shown is the size of the head)" + } + } +} From b7c24927fc0972c53580d304d90c1f71d76b3d24 Mon Sep 17 00:00:00 2001 From: woutervdub Date: Thu, 5 Oct 2023 16:23:32 +0000 Subject: [PATCH 24/27] almosy done --- config/software/designs.json | 4 +- designs/skully/i18n/de.json | 8 - designs/skully/i18n/en.json | 10 +- designs/skully/i18n/es.json | 8 - designs/skully/i18n/fr.json | 8 - designs/skully/i18n/nl.json | 8 - designs/skully/i18n/uk.json | 8 - designs/skully/src/cheek.mjs | 296 ++++++++------- designs/skully/src/cheekbone.mjs | 81 ++-- designs/skully/src/eye.mjs | 130 +++---- designs/skully/src/forehead.mjs | 230 ++++++------ designs/skully/src/head1.mjs | 131 ++++--- designs/skully/src/head2.mjs | 224 +++++------ designs/skully/src/head3.mjs | 201 +++++----- designs/skully/src/jawfloor.mjs | 203 +++++----- designs/skully/src/lowerjaw.mjs | 200 +++++----- designs/skully/src/lowermouth.mjs | 108 +++--- designs/skully/src/nose.mjs | 185 ++++----- designs/skully/src/uppermouth.mjs | 355 +++++++++--------- .../org/docs/designs/skully/cutting/en.md | 16 + markdown/org/docs/designs/skully/en.md | 8 + markdown/org/docs/designs/skully/fabric/en.md | 15 + .../docs/designs/skully/instructions/en.md | 37 ++ .../docs/designs/skully/measurements/en.md | 7 + markdown/org/docs/designs/skully/needs/en.md | 19 + markdown/org/docs/designs/skully/notes/en.md | 6 + .../org/docs/designs/skully/options/en.md | 5 + .../docs/designs/skully/options/size/en.md | 7 + 28 files changed, 1296 insertions(+), 1222 deletions(-) create mode 100644 markdown/org/docs/designs/skully/cutting/en.md create mode 100644 markdown/org/docs/designs/skully/en.md create mode 100644 markdown/org/docs/designs/skully/fabric/en.md create mode 100644 markdown/org/docs/designs/skully/instructions/en.md create mode 100644 markdown/org/docs/designs/skully/measurements/en.md create mode 100644 markdown/org/docs/designs/skully/needs/en.md create mode 100644 markdown/org/docs/designs/skully/notes/en.md create mode 100644 markdown/org/docs/designs/skully/options/en.md create mode 100644 markdown/org/docs/designs/skully/options/size/en.md diff --git a/config/software/designs.json b/config/software/designs.json index 90e9b80609b..97e7879c091 100644 --- a/config/software/designs.json +++ b/config/software/designs.json @@ -270,7 +270,7 @@ "design": "Wouter Van Wageningen", "difficulty": 3, "tags": ["blocks", "tops"], - "techniques": ["curvedSeam", "precision", "princessSeam"] + "techniques": ["block", "curvedSeam", "precision", "princessSeam"] }, "octoplushy": { "description": "A FreeSewing pattern for an octopus plushy toy", @@ -342,7 +342,7 @@ "design": "Wouter Van Wageningen", "difficulty": 5, "tags": ["accessories", "toys"], - "techniques": ["curvedSeam", "flatSleeve"] + "techniques": ["curvedSeam", "precision"] }, "sven": { "description": "A FreeSewing pattern for a straightforward sweater", diff --git a/designs/skully/i18n/de.json b/designs/skully/i18n/de.json index 0408d102352..cf2665157a0 100644 --- a/designs/skully/i18n/de.json +++ b/designs/skully/i18n/de.json @@ -1,5 +1,4 @@ { -<<<<<<< HEAD "t": "Skully logo plush toy", "d": "A FreeSewing pattern for skully, our logo, a plushy toy.", "p": { @@ -35,12 +34,5 @@ "t": "Size", "d": "Controls the overall size (value shown is the size of the head)" } -======= - "t": "Skully", - "d": "Skylly is the FreeSewing logo, now in plushy toy form", - "p": { }, - "s": { }, - "o": { } ->>>>>>> 2e57bcfae37fe47ecc4e8012794fecc0f0c33009 } } diff --git a/designs/skully/i18n/en.json b/designs/skully/i18n/en.json index 2c15f26571e..1ea48d2aec5 100644 --- a/designs/skully/i18n/en.json +++ b/designs/skully/i18n/en.json @@ -1,5 +1,4 @@ { -<<<<<<< HEAD "t": "Skully logo plush toy", "d": "A FreeSewing pattern for skully, our logo, a plushy toy.", "p": { @@ -33,14 +32,7 @@ "o": { "size": { "t": "Size", - "d": "Controls the overall size (value shown is the size of the head)" + "d": "Controls the overall size (value shown is the resulting height of Skully)" } -======= - "t": "Skully", - "d": "Skylly is the FreeSewing logo, now in plushy toy form", - "p": { }, - "s": { }, - "o": { } ->>>>>>> 2e57bcfae37fe47ecc4e8012794fecc0f0c33009 } } diff --git a/designs/skully/i18n/es.json b/designs/skully/i18n/es.json index 0408d102352..cf2665157a0 100644 --- a/designs/skully/i18n/es.json +++ b/designs/skully/i18n/es.json @@ -1,5 +1,4 @@ { -<<<<<<< HEAD "t": "Skully logo plush toy", "d": "A FreeSewing pattern for skully, our logo, a plushy toy.", "p": { @@ -35,12 +34,5 @@ "t": "Size", "d": "Controls the overall size (value shown is the size of the head)" } -======= - "t": "Skully", - "d": "Skylly is the FreeSewing logo, now in plushy toy form", - "p": { }, - "s": { }, - "o": { } ->>>>>>> 2e57bcfae37fe47ecc4e8012794fecc0f0c33009 } } diff --git a/designs/skully/i18n/fr.json b/designs/skully/i18n/fr.json index 0408d102352..cf2665157a0 100644 --- a/designs/skully/i18n/fr.json +++ b/designs/skully/i18n/fr.json @@ -1,5 +1,4 @@ { -<<<<<<< HEAD "t": "Skully logo plush toy", "d": "A FreeSewing pattern for skully, our logo, a plushy toy.", "p": { @@ -35,12 +34,5 @@ "t": "Size", "d": "Controls the overall size (value shown is the size of the head)" } -======= - "t": "Skully", - "d": "Skylly is the FreeSewing logo, now in plushy toy form", - "p": { }, - "s": { }, - "o": { } ->>>>>>> 2e57bcfae37fe47ecc4e8012794fecc0f0c33009 } } diff --git a/designs/skully/i18n/nl.json b/designs/skully/i18n/nl.json index 0408d102352..cf2665157a0 100644 --- a/designs/skully/i18n/nl.json +++ b/designs/skully/i18n/nl.json @@ -1,5 +1,4 @@ { -<<<<<<< HEAD "t": "Skully logo plush toy", "d": "A FreeSewing pattern for skully, our logo, a plushy toy.", "p": { @@ -35,12 +34,5 @@ "t": "Size", "d": "Controls the overall size (value shown is the size of the head)" } -======= - "t": "Skully", - "d": "Skylly is the FreeSewing logo, now in plushy toy form", - "p": { }, - "s": { }, - "o": { } ->>>>>>> 2e57bcfae37fe47ecc4e8012794fecc0f0c33009 } } diff --git a/designs/skully/i18n/uk.json b/designs/skully/i18n/uk.json index 0408d102352..cf2665157a0 100644 --- a/designs/skully/i18n/uk.json +++ b/designs/skully/i18n/uk.json @@ -1,5 +1,4 @@ { -<<<<<<< HEAD "t": "Skully logo plush toy", "d": "A FreeSewing pattern for skully, our logo, a plushy toy.", "p": { @@ -35,12 +34,5 @@ "t": "Size", "d": "Controls the overall size (value shown is the size of the head)" } -======= - "t": "Skully", - "d": "Skylly is the FreeSewing logo, now in plushy toy form", - "p": { }, - "s": { }, - "o": { } ->>>>>>> 2e57bcfae37fe47ecc4e8012794fecc0f0c33009 } } diff --git a/designs/skully/src/cheek.mjs b/designs/skully/src/cheek.mjs index d7649cfb79b..5e8fa8dc73d 100644 --- a/designs/skully/src/cheek.mjs +++ b/designs/skully/src/cheek.mjs @@ -1,142 +1,154 @@ -function draftCheek({ - options, - Point, - Path, - points, - paths, - Snippet, - snippets, - complete, - measurements, - sa, - store, - paperless, - macro, - part, -}) { - const textAttribute = 'text-xs center' - const sizeFactor = (('head' in measurements ? measurements.head : 596) / 929.5) * options.size * 2 - store.set('sizeFactor', sizeFactor) +export const cheek = { + name: 'cheek', + options: { + size: { + pct: 75, + min: 10, + max: 300, + // eslint-disable-next-line no-unused-vars + toAbs: (value, { measurements }, mergedOptions) => + value * ((measurements?.head ? measurements.head : 596) / 929.5) * 2 * 175, + menu: 'fit', + }, + }, + optionalMeasurements: ['head'], + draft: ({ + options, + Point, + Path, + points, + paths, + Snippet, + snippets, + measurements, + sa, + complete, + store, + macro, + part, + }) => { + const textAttribute = 'text-xs center' + const sizeFactor = + (('head' in measurements ? measurements.head : 596) / 929.5) * options.size * 2 + store.set('sizeFactor', sizeFactor) - points.point0 = new Point(0, 0) - points.point1 = points.point0.shift(254.78244159705943, 22.5254232590644 * sizeFactor) - points.point1Cp1 = points.point1.shift(321.2022157426192, 7.140882368447221 * sizeFactor) - points.point2 = points.point0.shift(260.1018837009255, 44.64105174612264 * sizeFactor) - points.point2Cp1 = points.point2.shift(243.25309471936828, 16.615062563830442 * sizeFactor) - points.point2Cp2 = points.point2.shift(322.6411575424251, 21.283352555459906 * sizeFactor) - points.point3 = points.point0.shift(261.38174456728586, 76.35866165668438 * sizeFactor) - points.point3Cp1 = points.point3.shift(333.3176703576494, 12.168666812761435 * sizeFactor) - points.point3Cp2 = points.point3.shift(85.91520774712568, 11.731692674119953 * sizeFactor) - points.point4 = points.point0.shift(299.45265842618784, 86.78060596475459 * sizeFactor) - points.point4Cp1 = points.point4.shift(84.35380802294482, 49.11521286943584 * sizeFactor) - points.point4Cp2 = points.point4.shift(184.39630340760462, 19.40463369919666 * sizeFactor) - points.point5 = points.point0.shift(342.8506386745285, 121.04758752176764 * sizeFactor) - points.point5Cp1 = points.point5.shift(137.52316754335672, 29.889370057597382 * sizeFactor) - points.point5Cp2 = points.point5.shift(196.75764739545923, 56.96390931984925 * sizeFactor) - points.point6 = points.point0.shift(1.1205493505415198, 54.26948752485138 * sizeFactor) - points.point6Cp2 = points.point6.shift(316.18924774003017, 44.726876316259826 * sizeFactor) - points.point7 = points.point0.shift(357.37806779049225, 43.287782602138435 * sizeFactor) - points.point7Cp1 = points.point7.shift(299.1399624138707, 19.59910745416729 * sizeFactor) - points.point8 = points.point0.shift(317.5381963475652, 36.1375990486363 * sizeFactor) - points.point8Cp1 = points.point8.shift(173.12090742697325, 12.479807891149623 * sizeFactor) - points.point8Cp2 = points.point8.shift(353.1201304168364, 15.075322060904695 * sizeFactor) - points.point9 = points.point0.shift(336.14503661026947, 8.388980629373263 * sizeFactor) - points.point9Cp2 = points.point9.shift(255.27121271777986, 18.645853640957277 * sizeFactor) + points.point0 = new Point(0, 0) + points.point1 = points.point0.shift(254.78244159705943, 22.5254232590644 * sizeFactor) + points.point1Cp1 = points.point1.shift(321.2022157426192, 7.140882368447221 * sizeFactor) + points.point2 = points.point0.shift(260.1018837009255, 44.64105174612264 * sizeFactor) + points.point2Cp1 = points.point2.shift(243.25309471936828, 16.615062563830442 * sizeFactor) + points.point2Cp2 = points.point2.shift(322.6411575424251, 21.283352555459906 * sizeFactor) + points.point3 = points.point0.shift(261.38174456728586, 76.35866165668438 * sizeFactor) + points.point3Cp1 = points.point3.shift(333.3176703576494, 12.168666812761435 * sizeFactor) + points.point3Cp2 = points.point3.shift(85.91520774712568, 11.731692674119953 * sizeFactor) + points.point4 = points.point0.shift(299.45265842618784, 86.78060596475459 * sizeFactor) + points.point4Cp1 = points.point4.shift(84.35380802294482, 49.11521286943584 * sizeFactor) + points.point4Cp2 = points.point4.shift(184.39630340760462, 19.40463369919666 * sizeFactor) + points.point5 = points.point0.shift(342.8506386745285, 121.04758752176764 * sizeFactor) + points.point5Cp1 = points.point5.shift(137.52316754335672, 29.889370057597382 * sizeFactor) + points.point5Cp2 = points.point5.shift(196.75764739545923, 56.96390931984925 * sizeFactor) + points.point6 = points.point0.shift(1.1205493505415198, 54.26948752485138 * sizeFactor) + points.point6Cp2 = points.point6.shift(316.18924774003017, 44.726876316259826 * sizeFactor) + points.point7 = points.point0.shift(357.37806779049225, 43.287782602138435 * sizeFactor) + points.point7Cp1 = points.point7.shift(299.1399624138707, 19.59910745416729 * sizeFactor) + points.point8 = points.point0.shift(317.5381963475652, 36.1375990486363 * sizeFactor) + points.point8Cp1 = points.point8.shift(173.12090742697325, 12.479807891149623 * sizeFactor) + points.point8Cp2 = points.point8.shift(353.1201304168364, 15.075322060904695 * sizeFactor) + points.point9 = points.point0.shift(336.14503661026947, 8.388980629373263 * sizeFactor) + points.point9Cp2 = points.point9.shift(255.27121271777986, 18.645853640957277 * sizeFactor) - points.point5a = new Path() - .move(points.point6) - .curve(points.point6Cp2, points.point5Cp1, points.point5) - .shiftAlong(65 * sizeFactor) + points.point5a = new Path() + .move(points.point6) + .curve(points.point6Cp2, points.point5Cp1, points.point5) + .shiftAlong(65 * sizeFactor) - const sp = new Path() - .move(points.point5) - .curve(points.point5Cp1, points.point6Cp2, points.point6) - .split(points.point5a) + const sp = new Path() + .move(points.point5) + .curve(points.point5Cp1, points.point6Cp2, points.point6) + .split(points.point5a) - points.point5aCp1 = sp[1].ops[1].cp1.clone() - points.point6Cp2 = sp[1].ops[1].cp2.clone() + points.point5aCp1 = sp[1].ops[1].cp1.clone() + points.point6Cp2 = sp[1].ops[1].cp2.clone() - points.point5 = points.point5.rotate(357, points.point0) - points.point5Cp2 = points.point5.shift(196.75764739545923, 56.96390931984925 * sizeFactor) + points.point5 = points.point5.rotate(357, points.point0) + points.point5Cp2 = points.point5.shift(196.75764739545923, 56.96390931984925 * sizeFactor) - paths.eyeBottom = new Path() - .move(points.point7) - .curve(points.point7Cp1, points.point8Cp2, points.point8) - .curve(points.point8Cp1, points.point9Cp2, points.point9) - .setText(complete ? 'eyeBottom' + ' (4)' : '', textAttribute) - .addClass('hidden') + paths.eyeBottom = new Path() + .move(points.point7) + .curve(points.point7Cp1, points.point8Cp2, points.point8) + .curve(points.point8Cp1, points.point9Cp2, points.point9) + .setText(complete ? 'eyeBottom' + ' (4)' : '', textAttribute) + .addClass('hidden') - paths.mouthTop = new Path() - .move(points.point3) - .curve(points.point3Cp1, points.point4Cp2, points.point4) - .setText(complete ? 'mouthTop' + ' (16)' : '', textAttribute) - .addClass('hidden') + paths.mouthTop = new Path() + .move(points.point3) + .curve(points.point3Cp1, points.point4Cp2, points.point4) + .setText(complete ? 'mouthTop' + ' (16)' : '', textAttribute) + .addClass('hidden') - paths.upperJaw = new Path() - .move(points.point4) - .curve(points.point4Cp1, points.point5Cp2, points.point5) - .setText(complete ? 'upperJaw' + ' (16)' : '', textAttribute) - .addClass('hidden') + paths.upperJaw = new Path() + .move(points.point4) + .curve(points.point4Cp1, points.point5Cp2, points.point5) + .setText(complete ? 'upperJaw' + ' (16)' : '', textAttribute) + .addClass('hidden') - paths.nose = new Path() - .move(points.point1) - .curve(points.point1Cp1, points.point2Cp2, points.point2) - .setText(complete ? 'nose (10)' : '', textAttribute) - .addClass('hidden') + paths.nose = new Path() + .move(points.point1) + .curve(points.point1Cp1, points.point2Cp2, points.point2) + .setText(complete ? 'nose (10)' : '', textAttribute) + .addClass('hidden') - store.set('templeToJaw', points.point5.dist(points.point5a)) - store.set('upperJaw', paths.upperJaw.length()) + store.set('templeToJaw', points.point5.dist(points.point5a)) + store.set('upperJaw', paths.upperJaw.length()) - paths.seam1 = new Path() - .move(points.point9) - .line(points.point0) - .setText(complete ? '1' : '', textAttribute) - .addClass('hidden') - paths.seam2 = new Path() - .move(points.point6) - .line(points.point7) - .setText(complete ? '2' : '', textAttribute) - .addClass('hidden') - paths.seam5 = new Path() - .move(points.point5a) - .curve(points.point5aCp1, points.point6Cp2, points.point6) - .setText(complete ? '5' : '', textAttribute) - .addClass('hidden') - paths.seam7 = new Path() - .move(points.point0) - .line(points.point1) - .setText(complete ? '7' : '', textAttribute) - .addClass('hidden') - paths.seam8 = new Path() - .move(points.point2) - .curve(points.point2Cp1, points.point3Cp2, points.point3) - .setText(complete ? '8' : '', textAttribute) - .addClass('hidden') + paths.seam1 = new Path() + .move(points.point9) + .line(points.point0) + .setText(complete ? '1' : '', textAttribute) + .addClass('hidden') + paths.seam2 = new Path() + .move(points.point6) + .line(points.point7) + .setText(complete ? '2' : '', textAttribute) + .addClass('hidden') + paths.seam5 = new Path() + .move(points.point5a) + .curve(points.point5aCp1, points.point6Cp2, points.point6) + .setText(complete ? '5' : '', textAttribute) + .addClass('hidden') + paths.seam7 = new Path() + .move(points.point0) + .line(points.point1) + .setText(complete ? '7' : '', textAttribute) + .addClass('hidden') + paths.seam8 = new Path() + .move(points.point2) + .curve(points.point2Cp1, points.point3Cp2, points.point3) + .setText(complete ? '8' : '', textAttribute) + .addClass('hidden') - paths.seam = new Path() - .move(points.point0) - .join(paths.seam7) - .join(paths.nose) - .join(paths.seam8) - .join(paths.mouthTop) - .join(paths.upperJaw) - .line(points.point5a) - .join(paths.seam5) - .join(paths.seam2) - .join(paths.eyeBottom) - .join(paths.seam1) - .close() + paths.seam = new Path() + .move(points.point0) + .join(paths.seam7) + .join(paths.nose) + .join(paths.seam8) + .join(paths.mouthTop) + .join(paths.upperJaw) + .line(points.point5a) + .join(paths.seam5) + .join(paths.seam2) + .join(paths.eyeBottom) + .join(paths.seam1) + .close() - store.set('templeWidth', points.point6.dist(points.point7)) - store.set('noseBridgeWidth', points.point0.dist(points.point9)) - store.set('templeWidth', points.point6.dist(points.point7)) - store.set('mouthTop', paths.mouthTop.length()) - store.set('eyeBottom', paths.eyeBottom.length()) - store.set('noseSide', paths.nose.length()) - store.set('noseHeight', points.point1.dist(points.point2)) + store.set('templeWidth', points.point6.dist(points.point7)) + store.set('noseBridgeWidth', points.point0.dist(points.point9)) + store.set('templeWidth', points.point6.dist(points.point7)) + store.set('mouthTop', paths.mouthTop.length()) + store.set('eyeBottom', paths.eyeBottom.length()) + store.set('noseSide', paths.nose.length()) + store.set('noseHeight', points.point1.dist(points.point2)) - // Complete? - if (complete) { points.title = points.point4Cp2.shiftFractionTowards(points.point0, 0.3) macro('title', { nr: 1, @@ -152,6 +164,7 @@ function draftCheek({ snippets.n5 = new Snippet('bnotch', points.point7) snippets.n6 = new Snippet('bnotch', points.point2) + points.gridAnchor = points.point4.clone() points.logo = points.point7 .shiftFractionTowards(points.point5, 0.5) .shiftFractionTowards(points.point4, 0.25) @@ -160,10 +173,7 @@ function draftCheek({ if (sa) { paths.sa = paths.seam.offset(sa).trim().attr('class', 'fabric sa') } - } - // Paperless? - if (paperless) { points.noseX = paths.nose.edge('right') points.eyeBottomY = paths.eyeBottom.edge('bottom') points.upperJaw = paths.upperJaw.shiftFractionAlong(0.42) @@ -172,108 +182,118 @@ function draftCheek({ from: points.noseX, to: points.point4, y: points.noseX.y + 5, + id: 'noseToBackOfJaw', }) macro('hd', { from: points.point6, to: points.point5, y: points.point6.y - sa - 15, + id: 'cheekBoneToBackOfJaw', }) macro('hd', { from: points.point6, to: points.point5a, y: points.point6.y - sa - 5, + id: 'cheekBoneWidth', }) macro('hd', { from: points.point7, to: points.point5, y: points.point6.y - sa - 25, + id: 'rightEyeToBackOfJaw', }) macro('hd', { from: points.point3, to: points.point7, y: points.point6.y - sa - 35, + id: 'leftToRightEye', }) macro('hd', { from: points.point2, to: points.point7, y: points.point6.y - sa - 25, + id: 'bottomNoseToRigthEye', }) macro('hd', { from: points.point1, to: points.point7, y: points.point6.y - sa - 15, + id: 'topNoseToRigthEye', }) macro('hd', { from: points.point0, to: points.point7, y: points.point6.y - sa - 5, + id: 'foreheadToRightEye', }) macro('hd', { from: points.point9, to: points.point7, y: points.point6.y - sa + 5, + id: 'eyeWidth', }) macro('hd', { from: points.point3, to: points.point4, y: points.point4.y + sa + 15, + id: 'jawWidth', }) macro('hd', { from: points.point4, to: points.point5, y: points.point4.y + sa + 15, + id: 'jawToRight', }) macro('vd', { from: points.eyeBottomY, to: points.point4, x: points.point4.x, + id: 'eyeToJaw', }) macro('vd', { from: points.point6, to: points.point5a, x: points.point5.x + sa + 10, + id: 'cheekBoneHeight', }) macro('vd', { from: points.point6, to: points.point5, x: points.point5.x + sa + 20, + id: 'cheekBoneToJawCorner', }) macro('vd', { from: points.point5, to: points.point4, x: points.point5.x + sa + 20, + id: 'bottomToJaw', }) macro('vd', { from: points.point3, to: points.point2, x: points.point2.x - sa - 10, + id: 'jawToBottomNose', }) macro('vd', { from: points.point3, to: points.point1, x: points.point2.x - sa - 20, + id: 'jawToTopNose', }) macro('vd', { from: points.point1, to: points.point0, x: points.point2.x - sa - 20, + id: 'topNoseToForehead', }) macro('vd', { from: points.point6, to: points.upperJaw, x: points.point6.x, + id: 'cheekBoneToJaw', }) - } - return part -} - -export const cheek = { - name: 'cheek', - options: { - size: { pct: 75, min: 10, max: 300, menu: 'fit' }, + return part }, - optionalMeasurements: ['head'], - draft: draftCheek, } diff --git a/designs/skully/src/cheekbone.mjs b/designs/skully/src/cheekbone.mjs index 565ec62ecf6..dd370898292 100644 --- a/designs/skully/src/cheekbone.mjs +++ b/designs/skully/src/cheekbone.mjs @@ -1,42 +1,33 @@ import { cheek } from './cheek.mjs' -function draftCheekbone({ - Point, - Path, - points, - paths, - complete, - sa, - store, - paperless, - macro, - part, -}) { - const textAttribute = 'text-xs center text-decoration="line-through"' - const sizeFactor = store.get('sizeFactor') +export const cheekbone = { + name: 'cheekbone', + after: cheek, + draft: ({ Point, Path, points, paths, sa, complete, store, macro, part }) => { + const textAttribute = 'text-xs center text-decoration="line-through"' + const sizeFactor = store.get('sizeFactor') - points.point0 = new Point(0, 0) - points.point0Cp1 = points.point0.shift(26.9653561519379, 19.25431213546719 * sizeFactor) - points.point1 = points.point0.shift(23.857094414377794, 57.23972922717229 * sizeFactor) - points.point1Cp1 = points.point1.shift(135.7075072577942, 32.47486987518195 * sizeFactor) - points.point1Cp2 = points.point1.shift(180.82587279494425, 29.902106313769938 * sizeFactor) + points.point0 = new Point(0, 0) + points.point0Cp1 = points.point0.shift(26.9653561519379, 19.25431213546719 * sizeFactor) + points.point1 = points.point0.shift(23.857094414377794, 57.23972922717229 * sizeFactor) + points.point1Cp1 = points.point1.shift(135.7075072577942, 32.47486987518195 * sizeFactor) + points.point1Cp2 = points.point1.shift(180.82587279494425, 29.902106313769938 * sizeFactor) - paths.seam5 = new Path() - .move(points.point1) - .curve_(points.point1Cp1, points.point0) - .setText(complete ? '5' : '', textAttribute) - .addClass('hidden') - paths.seam6 = new Path() - .move(points.point0) - .curve(points.point0Cp1, points.point1Cp2, points.point1) - .setText(complete ? '6' : '', textAttribute) - .attr('data-text-text-decoration', 'underline') - .addClass('hidden') + paths.seam5 = new Path() + .move(points.point1) + .curve_(points.point1Cp1, points.point0) + .setText(complete ? '5' : '', textAttribute) + .addClass('hidden') + paths.seam6 = new Path() + .move(points.point0) + .curve(points.point0Cp1, points.point1Cp2, points.point1) + .setText(complete ? '6' : '', textAttribute) + .attr('data-text-text-decoration', 'underline') + .addClass('hidden') - paths.seam = new Path().move(points.point0).join(paths.seam6).join(paths.seam5).close() + paths.seam = new Path().move(points.point0).join(paths.seam6).join(paths.seam5).close() - // Complete? - if (complete) { + points.gridAnchor = points.point0.clone() points.title = points.point0 .shiftFractionTowards(points.point1, 0.65) .shiftFractionTowards(points.point1Cp2, 0.4) @@ -55,45 +46,47 @@ function draftCheekbone({ if (sa) { paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') } - } - // Paperless? - if (paperless) { points.pointY = paths.seam.edge('top') macro('hd', { from: points.point0, to: points.point1, y: points.point0.y + sa + 15, + id: 'width', }) macro('hd', { from: points.point0, to: points.pointY, y: points.pointY.y - sa - 15, + id: 'leftToTop', }) macro('hd', { from: points.pointY, to: points.point1, y: points.pointY.y - sa - 15, + id: 'topToRight', + noStartMarker: true, + noEndMarker: true, }) macro('vd', { from: points.point1, to: points.point0, x: points.point1.x + sa + 15, + id: 'cornerToCornerHeight', + noStartMarker: true, + noEndMarker: true, }) macro('vd', { from: points.pointY, to: points.point0, x: points.point0.x - sa - 15, + id: 'height', + noStartMarker: true, + noEndMarker: true, }) - } - return part -} - -export const cheekbone = { - name: 'cheekbone', - after: cheek, - draft: draftCheekbone, + return part + }, } diff --git a/designs/skully/src/eye.mjs b/designs/skully/src/eye.mjs index 6f3935daf5c..dabd84560d1 100644 --- a/designs/skully/src/eye.mjs +++ b/designs/skully/src/eye.mjs @@ -1,79 +1,69 @@ import { cheek } from './cheek.mjs' import { forehead } from './forehead.mjs' -function draftEye({ - Point, - Path, - points, - paths, - Snippet, - snippets, - complete, - sa, - store, - paperless, - macro, - part, -}) { - const textAttribute = 'text-xs center' +export const eye = { + name: 'eye', + after: [cheek, forehead], + draft: ({ Point, Path, points, paths, Snippet, snippets, sa, complete, store, macro, part }) => { + const textAttribute = 'text-xs center' - const eyeCircumference = store.get('eyeBottom') + store.get('eyeTop') - const eyeDiameter = (eyeCircumference / Math.PI) * 2 + const eyeCircumference = store.get('eyeBottom') + store.get('eyeTop') + const eyeDiameter = (eyeCircumference / Math.PI) * 2 - const c = 0.55191502449351 - points.point0 = new Point(0, 0) - points.point2 = points.point0.shift(0, eyeDiameter / 2).shift(90, eyeDiameter / 2) - points.point0Cp1 = points.point0.shift(0, (eyeDiameter / 2) * c) - points.point2Cp2 = points.point2.shift(270, (eyeDiameter / 2) * c) + const c = 0.55191502449351 + points.point0 = new Point(0, 0) + points.point2 = points.point0.shift(0, eyeDiameter / 2).shift(90, eyeDiameter / 2) + points.point0Cp1 = points.point0.shift(0, (eyeDiameter / 2) * c) + points.point2Cp2 = points.point2.shift(270, (eyeDiameter / 2) * c) - const p = new Path().move(points.point0).curve(points.point0Cp1, points.point2Cp2, points.point2) + const p = new Path() + .move(points.point0) + .curve(points.point0Cp1, points.point2Cp2, points.point2) - points.point1 = p.shiftAlong(p.length() / 2) + points.point1 = p.shiftAlong(p.length() / 2) - const sp = p.split(points.point1) + const sp = p.split(points.point1) - points.p0 = sp[0].ops[0].to.clone() - points.p0Cp1 = sp[0].ops[1].cp1.clone() - points.p1Cp2 = sp[0].ops[1].cp2.clone() - points.p1 = sp[1].ops[0].to.clone() - points.p1Cp1 = sp[1].ops[1].cp1.clone() - points.p2Cp2 = sp[1].ops[1].cp2.clone() - points.p2 = sp[1].ops[1].to.clone() + points.p0 = sp[0].ops[0].to.clone() + points.p0Cp1 = sp[0].ops[1].cp1.clone() + points.p1Cp2 = sp[0].ops[1].cp2.clone() + points.p1 = sp[1].ops[0].to.clone() + points.p1Cp1 = sp[1].ops[1].cp1.clone() + points.p2Cp2 = sp[1].ops[1].cp2.clone() + points.p2 = sp[1].ops[1].to.clone() - points.p0Cp1 = points.p0.shift(0, (eyeDiameter / 2) * c * 0.4) - points.p2Cp2 = points.p2.shift(270, (eyeDiameter / 2) * c * 0.4) - points.p1Cp1 = points.p1.shift(45, (eyeDiameter / 2) * c * 0.7) - points.p1Cp2 = points.p1.shift(225, (eyeDiameter / 2) * c * 0.7) + points.p0Cp1 = points.p0.shift(0, (eyeDiameter / 2) * c * 0.4) + points.p2Cp2 = points.p2.shift(270, (eyeDiameter / 2) * c * 0.4) + points.p1Cp1 = points.p1.shift(45, (eyeDiameter / 2) * c * 0.7) + points.p1Cp2 = points.p1.shift(225, (eyeDiameter / 2) * c * 0.7) - points.p0Cp2 = points.p0Cp1.flipX() - points.p4 = points.p2.flipX() - points.p4Cp1 = points.p2Cp2.flipX() - points.p3 = points.p1.flipX() - points.p3Cp2 = points.p1Cp1.flipX() - points.p3Cp1 = points.p1Cp2.flipX() + points.p0Cp2 = points.p0Cp1.flipX() + points.p4 = points.p2.flipX() + points.p4Cp1 = points.p2Cp2.flipX() + points.p3 = points.p1.flipX() + points.p3Cp2 = points.p1Cp1.flipX() + points.p3Cp1 = points.p1Cp2.flipX() - paths.eye = new Path() - .move(points.p4) - .curve(points.p4Cp1, points.p3Cp2, points.p3) - .curve(points.p3Cp1, points.p0Cp2, points.p0) - .curve(points.p0Cp1, points.p1Cp2, points.p1) - .curve(points.p1Cp1, points.p2Cp2, points.p2) + paths.eye = new Path() + .move(points.p4) + .curve(points.p4Cp1, points.p3Cp2, points.p3) + .curve(points.p3Cp1, points.p0Cp2, points.p0) + .curve(points.p0Cp1, points.p1Cp2, points.p1) + .curve(points.p1Cp1, points.p2Cp2, points.p2) - points.pointNotch = paths.eye.shiftAlong(store.get('eyeTop')) + points.pointNotch = paths.eye.shiftAlong(store.get('eyeTop')) - const ps = paths.eye.split(points.pointNotch) - paths.eyeTop = ps[0].clone().setText(complete ? 'eyeTop' + ' (4)' : '', textAttribute) - paths.eyeBottom = ps[1].clone().setText(complete ? 'eyeBottom' + ' (4)' : '', textAttribute) + const ps = paths.eye.split(points.pointNotch) + paths.eyeTop = ps[0].clone().setText(complete ? 'eyeTop' + ' (4)' : '', textAttribute) + paths.eyeBottom = ps[1].clone().setText(complete ? 'eyeBottom' + ' (4)' : '', textAttribute) - paths.seam = new Path() - .move(points.p4) - .join(paths.eyeTop) - .join(paths.eyeBottom) - .line(points.p4) - .close() + paths.seam = new Path() + .move(points.p4) + .join(paths.eyeTop) + .join(paths.eyeBottom) + .line(points.p4) + .close() - // Complete? - if (complete) { points.title = points.p4 .shiftFractionTowards(points.p1, 0.45) .shiftFractionTowards(points.p0, 0.5) @@ -93,6 +83,8 @@ function draftEye({ points.ps3b = points.p2.shiftFractionTowards(points.p4, 0.75) points.ps3bCp1 = points.ps3b.shift(270, points.p4.dist(points.p2) / 6) + points.gridAnchor = points.ps3.clone() + macro('sewtogether', { from: points.ps3a, to: points.ps3b, @@ -111,32 +103,28 @@ function draftEye({ if (sa) { paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') } - } - // Paperless? - if (paperless) { macro('hd', { from: points.p4, to: points.pointNotch, y: points.p0.y + sa + 15, + id: 'leftToNotch', + noStartMarker: true, + noEndMarker: true, }) macro('hd', { from: points.p4, to: points.p2, y: points.p2.y - sa - 15, + id: 'width', }) macro('vd', { from: points.p2, to: points.p0, x: points.p2.x + sa + 15, + id: 'height', }) - } - return part -} - -export const eye = { - name: 'eye', - after: [cheek, forehead], - draft: draftEye, + return part + }, } diff --git a/designs/skully/src/forehead.mjs b/designs/skully/src/forehead.mjs index 688fcbecd38..a578d0ee9f4 100644 --- a/designs/skully/src/forehead.mjs +++ b/designs/skully/src/forehead.mjs @@ -1,123 +1,112 @@ import { cheek } from './cheek.mjs' -function draftForehead({ - Point, - Path, - points, - paths, - Snippet, - snippets, - complete, - sa, - store, - paperless, - macro, - part, -}) { - const textAttribute = 'text-xs center' - const sizeFactor = store.get('sizeFactor') +export const forehead = { + name: 'forehead', + after: cheek, + draft: ({ Point, Path, points, paths, Snippet, snippets, sa, complete, store, macro, part }) => { + const textAttribute = 'text-xs center' + const sizeFactor = store.get('sizeFactor') - points.point0 = new Point(0, 0) - points.point0Cp1 = points.point0.shift(241.92955090220636, 37.666339998598225 * sizeFactor) - points.point0Cp2 = points.point0.shift(333.9339465987448, 38.41308527689494 * sizeFactor) - points.point1 = points.point0.shift(255.81688050452775, 105.61426225557886 * sizeFactor) - points.point1Cp2 = points.point1.shift(122.25481630103288, 16.221492810466046 * sizeFactor) - points.point2 = points.point0.shift(260.36453213741225, 104.78002255825727 * sizeFactor) - points.point2Cp1 = points.point2.shift(104.52547665837686, 6.962227517109787 * sizeFactor) - points.point3 = points.point0.shift(266.83135324063875, 91.72676538115797 * sizeFactor) - points.point3Cp1 = points.point3.shift(10.824271939403667, 7.255955140434657 * sizeFactor) - points.point3Cp2 = points.point3.shift(190.82219510192064, 8.8744083082141 * sizeFactor) - points.point4 = points.point0.shift(279.23029819067256, 99.89481626481647 * sizeFactor) - points.point4Cp2 = points.point4.shift(109.3914373863736, 10.114793621226355 * sizeFactor) - points.point5 = points.point0.shift(285.6356187763194, 96.73748550220853 * sizeFactor) - points.point5Cp1 = points.point5.shift(322.25160644653687, 21.112881376069897 * sizeFactor) - points.point6 = points.point0.shift(299.0865415436474, 123.293691591622 * sizeFactor) - points.point6Cp1 = points.point6.shift(102.44153405115529, 30.07799330075059 * sizeFactor) - points.point6Cp2 = points.point6.shift(171.33241486296131, 9.49614011059247 * sizeFactor) - points.point7 = points.point0.shift(301.8945694309706, 53.41879968784397 * sizeFactor) - points.point7Cp1 = points.point7.shift(330.8064552671208, 26.14383661592154 * sizeFactor) - points.point7Cp2 = points.point7.shift(306.82890730505164, 20.883100248765764 * sizeFactor) - points.point8 = points.point0.shift(315.99934749521526, 121.10503287183268 * sizeFactor) - points.point8Cp2 = points.point8.shift(138.225501502238, 23.326308173390803 * sizeFactor) - points.point9 = points.point0.shift(325.07215199461336, 129.7747702101221 * sizeFactor) - points.point9Cp1 = points.point9.shift(126.07355572621562, 42.01723333347864 * sizeFactor) + points.point0 = new Point(0, 0) + points.point0Cp1 = points.point0.shift(241.92955090220636, 37.666339998598225 * sizeFactor) + points.point0Cp2 = points.point0.shift(333.9339465987448, 38.41308527689494 * sizeFactor) + points.point1 = points.point0.shift(255.81688050452775, 105.61426225557886 * sizeFactor) + points.point1Cp2 = points.point1.shift(122.25481630103288, 16.221492810466046 * sizeFactor) + points.point2 = points.point0.shift(260.36453213741225, 104.78002255825727 * sizeFactor) + points.point2Cp1 = points.point2.shift(104.52547665837686, 6.962227517109787 * sizeFactor) + points.point3 = points.point0.shift(266.83135324063875, 91.72676538115797 * sizeFactor) + points.point3Cp1 = points.point3.shift(10.824271939403667, 7.255955140434657 * sizeFactor) + points.point3Cp2 = points.point3.shift(190.82219510192064, 8.8744083082141 * sizeFactor) + points.point4 = points.point0.shift(279.23029819067256, 99.89481626481647 * sizeFactor) + points.point4Cp2 = points.point4.shift(109.3914373863736, 10.114793621226355 * sizeFactor) + points.point5 = points.point0.shift(285.6356187763194, 96.73748550220853 * sizeFactor) + points.point5Cp1 = points.point5.shift(322.25160644653687, 21.112881376069897 * sizeFactor) + points.point6 = points.point0.shift(299.0865415436474, 123.293691591622 * sizeFactor) + points.point6Cp1 = points.point6.shift(102.44153405115529, 30.07799330075059 * sizeFactor) + points.point6Cp2 = points.point6.shift(171.33241486296131, 9.49614011059247 * sizeFactor) + points.point7 = points.point0.shift(301.8945694309706, 53.41879968784397 * sizeFactor) + points.point7Cp1 = points.point7.shift(330.8064552671208, 26.14383661592154 * sizeFactor) + points.point7Cp2 = points.point7.shift(306.82890730505164, 20.883100248765764 * sizeFactor) + points.point8 = points.point0.shift(315.99934749521526, 121.10503287183268 * sizeFactor) + points.point8Cp2 = points.point8.shift(138.225501502238, 23.326308173390803 * sizeFactor) + points.point9 = points.point0.shift(325.07215199461336, 129.7747702101221 * sizeFactor) + points.point9Cp1 = points.point9.shift(126.07355572621562, 42.01723333347864 * sizeFactor) - paths.firstSeam = new Path() - .move(points.point9) - .curve(points.point9Cp1, points.point0Cp2, points.point0) - .setText(complete ? '20' : '', textAttribute) - .addClass('hidden') + paths.firstSeam = new Path() + .move(points.point9) + .curve(points.point9Cp1, points.point0Cp2, points.point0) + .setText(complete ? '20' : '', textAttribute) + .addClass('hidden') - store.set('firstSeam', paths.firstSeam.length()) - store.set( - 'templeTop', - new Path().move(points.point8).line(points.point9).length() + - new Path() - .move(points.point5) - .curve(points.point5Cp1, points.point6Cp2, points.point6) - .length() - ) + store.set('firstSeam', paths.firstSeam.length()) + store.set( + 'templeTop', + new Path().move(points.point8).line(points.point9).length() + + new Path() + .move(points.point5) + .curve(points.point5Cp1, points.point6Cp2, points.point6) + .length() + ) - paths.eyeTop = new Path() - .move(points.point2) - .curve(points.point2Cp1, points.point3Cp2, points.point3) - .curve(points.point3Cp1, points.point4Cp2, points.point4) - .setText(complete ? 'eyeTop' + ' (4)' : '', textAttribute) - .addClass('hidden') + paths.eyeTop = new Path() + .move(points.point2) + .curve(points.point2Cp1, points.point3Cp2, points.point3) + .curve(points.point3Cp1, points.point4Cp2, points.point4) + .setText(complete ? 'eyeTop' + ' (4)' : '', textAttribute) + .addClass('hidden') - paths.seam1 = new Path() - .move(points.point1) - .line(points.point2) - .setText(complete ? '1' : '', textAttribute) - .addClass('hidden') + paths.seam1 = new Path() + .move(points.point1) + .line(points.point2) + .setText(complete ? '1' : '', textAttribute) + .addClass('hidden') - paths.seam2 = new Path() - .move(points.point4) - .line(points.point5) - .setText(complete ? '2' : '', textAttribute) - .addClass('hidden') + paths.seam2 = new Path() + .move(points.point4) + .line(points.point5) + .setText(complete ? '2' : '', textAttribute) + .addClass('hidden') - paths.seam6a = new Path() - .move(points.point5) - .curve(points.point5Cp1, points.point6Cp2, points.point6) - .setText(complete ? '6' : '', textAttribute) - .attr('data-text-text-decoration', 'underline') - .addClass('hidden') + paths.seam6a = new Path() + .move(points.point5) + .curve(points.point5Cp1, points.point6Cp2, points.point6) + .setText(complete ? '6' : '', textAttribute) + .attr('data-text-text-decoration', 'underline') + .addClass('hidden') - paths.seam6b = new Path() - .move(points.point8) - .line(points.point9) - .setText(complete ? '6' : '', textAttribute) - .attr('data-text-text-decoration', 'underline') - .addClass('hidden') + paths.seam6b = new Path() + .move(points.point8) + .line(points.point9) + .setText(complete ? '6' : '', textAttribute) + .attr('data-text-text-decoration', 'underline') + .addClass('hidden') - paths.seam7 = new Path() - .move(points.point0) - .curve(points.point0Cp1, points.point1Cp2, points.point1) - .setText(complete ? '7' : '', textAttribute) - .addClass('hidden') + paths.seam7 = new Path() + .move(points.point0) + .curve(points.point0Cp1, points.point1Cp2, points.point1) + .setText(complete ? '7' : '', textAttribute) + .addClass('hidden') - paths.seam = new Path() - .move(points.point0) - .join(paths.seam7) - .join(paths.seam1) - .join(paths.eyeTop) - .join(paths.seam2) - .join(paths.seam6a) - .line(points.point8) - .join(paths.seam6b) - .curve(points.point9Cp1, points.point0Cp2, points.point0) - .close() + paths.seam = new Path() + .move(points.point0) + .join(paths.seam7) + .join(paths.seam1) + .join(paths.eyeTop) + .join(paths.seam2) + .join(paths.seam6a) + .line(points.point8) + .join(paths.seam6b) + .curve(points.point9Cp1, points.point0Cp2, points.point0) + .close() - paths.dart = new Path() - .move(points.point6) - .curve(points.point6Cp1, points.point7Cp2, points.point7) - .curve(points.point7Cp1, points.point8Cp2, points.point8) + paths.dart = new Path() + .move(points.point6) + .curve(points.point6Cp1, points.point7Cp2, points.point7) + .curve(points.point7Cp1, points.point8Cp2, points.point8) - store.set('eyeTop', paths.eyeTop.length()) + store.set('eyeTop', paths.eyeTop.length()) - // Complete? - if (complete) { + points.gridAnchor = points.point0.clone() points.title = points.point3Cp1.shiftFractionTowards(points.point0, 0.3) macro('title', { nr: 2, @@ -137,110 +126,119 @@ function draftForehead({ if (sa) { paths.sa = paths.seam.offset(sa).trim().attr('class', 'fabric sa') } - } - // Paperless? - if (paperless) { points.pointX = paths.seam.edge('left') macro('hd', { from: points.point0, to: points.point9, y: points.point0.y - sa - 15, + id: 'topToRight', }) macro('hd', { from: points.pointX, to: points.point0, y: points.point0.y - sa - 15, + id: 'leftToTop', }) macro('hd', { from: points.point6, to: points.point8, y: points.point6.y + sa + 5, + id: 'dartWidth', }) macro('hd', { from: points.point6, to: points.point9, y: points.point6.y + sa + 15, + id: 'dartToRight', }) macro('hd', { from: points.point5, to: points.point6, y: points.point6.y + sa + 5, + id: 'cheekBoneToDart', }) macro('hd', { from: points.point4, to: points.point6, y: points.point6.y + sa + 15, + id: 'rightEyeToDart', }) macro('hd', { from: points.point2, to: points.point6, y: points.point6.y + sa + 25, + id: 'leftEyeToDart', }) macro('hd', { from: points.point1, to: points.point6, y: points.point6.y + sa + 35, + id: 'leftCornerToDart', }) macro('hd', { from: points.pointX, to: points.point6, y: points.point6.y + sa + 45, + id: 'leftToDart', }) macro('hd', { from: points.point0, to: points.point7, y: points.point7.y, + id: 'topToDartPoint', }) macro('vd', { from: points.point5, to: points.point0, x: points.pointX.x - sa - 10, + id: 'cheekBoneToTop', }) macro('vd', { from: points.point4, to: points.point0, x: points.pointX.x - sa - 20, + id: 'rightEyeToTop', }) macro('vd', { from: points.point1, to: points.point0, x: points.pointX.x - sa - 30, + id: 'leftCornerToTop', }) macro('vd', { from: points.point2, to: points.point0, x: points.pointX.x - sa - 40, + id: 'leftEyeToTop', }) macro('vd', { from: points.point0, to: points.point9, x: points.point9.x + sa + 10, + id: 'rightToTop', }) macro('vd', { from: points.point0, to: points.point8, x: points.point9.x + sa + 20, + id: 'rightDartToTop', }) macro('vd', { from: points.point0, to: points.point6, x: points.point9.x + sa + 30, + id: 'leftDartToTop', }) macro('vd', { from: points.point0, to: points.point7, x: points.point0.x, + id: 'dartPointToTop', }) - } - return part -} - -export const forehead = { - name: 'forehead', - after: cheek, - draft: draftForehead, + return part + }, } diff --git a/designs/skully/src/head1.mjs b/designs/skully/src/head1.mjs index 22a837cd6e6..0481ab72c77 100644 --- a/designs/skully/src/head1.mjs +++ b/designs/skully/src/head1.mjs @@ -1,71 +1,61 @@ import { cheek } from './cheek.mjs' import { forehead } from './forehead.mjs' -function draftHead1({ - Point, - Path, - points, - paths, - Snippet, - snippets, - complete, - sa, - store, - paperless, - macro, - part, -}) { - const textAttribute = 'text-xs center' - const sizeFactor = store.get('sizeFactor') +export const head1 = { + name: 'head1', + after: [cheek, forehead], + draft: ({ Point, Path, points, paths, Snippet, snippets, sa, complete, store, macro, part }) => { + const textAttribute = 'text-xs center' + const sizeFactor = store.get('sizeFactor') - points.point0 = new Point(0, 0) - points.point0Cp2 = points.point0.shift(270.9766531413822, 42.41716221059584 * sizeFactor) - points.point2 = points.point0.shift(254.08224234639044, 161.93553876093907 * sizeFactor) - points.point2Cp2 = points.point2.shift(105.78717948197567, 54.27380801428633 * sizeFactor) - points.point2Cp1 = points.point2.shift(75.48077210575057, 107.97156739510459 * sizeFactor) - points.point1 = points.point0.shift(180, 72.005 * sizeFactor) - points.point1Cp1 = points.point1.shift(268.60871199245156, 55.97160080799901 * sizeFactor) + points.point0 = new Point(0, 0) + points.point0Cp2 = points.point0.shift(270.9766531413822, 42.41716221059584 * sizeFactor) + points.point2 = points.point0.shift(254.08224234639044, 161.93553876093907 * sizeFactor) + points.point2Cp2 = points.point2.shift(105.78717948197567, 54.27380801428633 * sizeFactor) + points.point2Cp1 = points.point2.shift(75.48077210575057, 107.97156739510459 * sizeFactor) + points.point1 = points.point0.shift(180, 72.005 * sizeFactor) + points.point1Cp1 = points.point1.shift(268.60871199245156, 55.97160080799901 * sizeFactor) - points.point0 = points.point0.shift(270, 5) - points.point0Cp2 = points.point0.shift(270.9766531413822, 42.41716221059584 * sizeFactor) + points.point0 = points.point0.shift(270, 5) + points.point0Cp2 = points.point0.shift(270.9766531413822, 42.41716221059584 * sizeFactor) - paths.firstSeam = new Path() - .move(points.point1) - .curve(points.point1Cp1, points.point2Cp2, points.point2) - .setText(complete ? '20' : '', textAttribute) - .addClass('hidden') + paths.firstSeam = new Path() + .move(points.point1) + .curve(points.point1Cp1, points.point2Cp2, points.point2) + .setText(complete ? '20' : '', textAttribute) + .addClass('hidden') - points.fs1 = paths.firstSeam.shiftAlong(store.get('firstSeam')) - points.fs2 = paths.firstSeam.shiftAlong(store.get('firstSeam') + store.get('templeToJaw')) + points.fs1 = paths.firstSeam.shiftAlong(store.get('firstSeam')) + points.fs2 = paths.firstSeam.shiftAlong(store.get('firstSeam') + store.get('templeToJaw')) - store.set( - 'upperJawToLowerJaw', - paths.firstSeam.length() - store.get('firstSeam') - store.get('templeToJaw') - ) + points.gridAnchor = points.point0.clone() - paths.secondSeam = new Path() - .move(points.point2) - .curve(points.point2Cp1, points.point0Cp2, points.point0) - .setText(complete ? '17' : '', textAttribute) - .addClass('hidden') + store.set( + 'upperJawToLowerJaw', + paths.firstSeam.length() - store.get('firstSeam') - store.get('templeToJaw') + ) - paths.top = new Path() - .move(points.point0) - .line(points.point1) - .setText(complete ? '19' : '', textAttribute) - .addClass('hidden') + paths.secondSeam = new Path() + .move(points.point2) + .curve(points.point2Cp1, points.point0Cp2, points.point0) + .setText(complete ? '17' : '', textAttribute) + .addClass('hidden') - store.set('secondSeam', paths.secondSeam.length()) + paths.top = new Path() + .move(points.point0) + .line(points.point1) + .setText(complete ? '19' : '', textAttribute) + .addClass('hidden') - paths.seam = new Path() - .move(points.point0) - .join(paths.top) - .join(paths.firstSeam) - .join(paths.secondSeam) - .close() + store.set('secondSeam', paths.secondSeam.length()) + + paths.seam = new Path() + .move(points.point0) + .join(paths.top) + .join(paths.firstSeam) + .join(paths.secondSeam) + .close() - // Complete? - if (complete) { points.title = points.point2.shiftFractionTowards(points.point1, 0.65).shift(0, 10 * sizeFactor) macro('title', { nr: 3, @@ -84,52 +74,57 @@ function draftHead1({ if (sa) { paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') } - } - // Paperless? - if (paperless) { macro('hd', { from: points.point1, to: points.point2, y: points.point2.y + sa + 10, + id: 'leftToBottom', + noStartMarker: true, + noEndMarker: true, }) macro('hd', { from: points.point2, to: points.point0, y: points.point2.y + sa + 10, + id: 'bottomToRight', }) + macro('vd', { from: points.point0, to: points.point2, x: points.point0.x + sa + 15, + id: 'bottomToRight', }) macro('vd', { from: points.point2, to: points.point1, x: points.point1.x - sa - 15, + id: 'bottomToLeft', }) + macro('ld', { - from: points.point0, - to: points.point1, + from: points.point1, + to: points.point0, d: 5, + id: 'topWidth', }) macro('ld', { from: points.point2, to: points.fs2, d: 5, + noStartMarker: true, + noEndMarker: true, }) macro('ld', { from: points.point2, to: points.fs1, d: 15, + id: 'bottomToSecondNotch', + noStartMarker: true, + noEndMarker: true, }) - } - return part -} - -export const head1 = { - name: 'head1', - after: [cheek, forehead], - draft: draftHead1, + return part + }, } diff --git a/designs/skully/src/head2.mjs b/designs/skully/src/head2.mjs index 18064299793..fe2d5cbb902 100644 --- a/designs/skully/src/head2.mjs +++ b/designs/skully/src/head2.mjs @@ -1,117 +1,107 @@ import { cheek } from './cheek.mjs' import { head1 } from './head1.mjs' -function draftHead2({ - Point, - Path, - points, - paths, - complete, - sa, - log, - store, - paperless, - macro, - part, -}) { - const textAttribute = 'text-xs center' - const sizeFactor = store.get('sizeFactor') +export const head2 = { + name: 'head2', + after: [cheek, head1], + draft: ({ Point, Path, points, paths, sa, complete, log, store, macro, part }) => { + const textAttribute = 'text-xs center' + const sizeFactor = store.get('sizeFactor') - points.point0 = new Point(0, 0) - points.point0Cp2 = points.point0.shift(0, 15 * sizeFactor) - points.point1 = points.point0.shift(257.7901473243395, 66.12988849226953 * sizeFactor) - points.point1Cp1 = points.point1.shift(270, 30.242724116719366 * sizeFactor) - points.point1Cp2 = points.point1.shift(90, 18.83053830882166 * sizeFactor) - points.point2 = points.point0.shift(272.3327760921532, 153.20596573567235 * sizeFactor) - points.point3 = points.point0.shift(282.5001868336755, 164.15422647315543 * sizeFactor) - points.point3Cp1 = points.point3.shift(81.44269285511335, 54.758598457228615 * sizeFactor) - points.point4 = points.point0.shift(340.927384878832, 52.16879559660159 * sizeFactor) - points.point4Cp2 = points.point4.shift(274.04106104609286, 50.57373626695976 * sizeFactor) + points.point0 = new Point(0, 0) + points.point0Cp2 = points.point0.shift(0, 15 * sizeFactor) + points.point1 = points.point0.shift(257.7901473243395, 66.12988849226953 * sizeFactor) + points.point1Cp1 = points.point1.shift(270, 30.242724116719366 * sizeFactor) + points.point1Cp2 = points.point1.shift(90, 18.83053830882166 * sizeFactor) + points.point2 = points.point0.shift(272.3327760921532, 153.20596573567235 * sizeFactor) + points.point3 = points.point0.shift(282.5001868336755, 164.15422647315543 * sizeFactor) + points.point3Cp1 = points.point3.shift(81.44269285511335, 54.758598457228615 * sizeFactor) + points.point4 = points.point0.shift(340.927384878832, 52.16879559660159 * sizeFactor) + points.point4Cp2 = points.point4.shift(274.04106104609286, 50.57373626695976 * sizeFactor) - const secondSeam = store.get('secondSeam') + const secondSeam = store.get('secondSeam') - let iterations = 0 - var p - do { - iterations++ + let iterations = 0 + var p + do { + iterations++ - p = new Path() + p = new Path() + .move(points.point0) + ._curve(points.point1Cp2, points.point1) + .curve_(points.point1Cp1, points.point2) + + if (secondSeam - p.length() > 0.1 || secondSeam - p.length() < -0.1) { + points.point0 = points.point0.shift(90, secondSeam - p.length()) + points.point1 = points.point1.shift(90, secondSeam - p.length()) + points.point1Cp1 = points.point1.shift(270, 30.242724116719366 * sizeFactor) + points.point1Cp2 = points.point1.shift(90, 18.83053830882166 * sizeFactor) + points.point0Cp2 = points.point0.shift(0, 15 * sizeFactor) + } + } while (iterations < 100 && (secondSeam - p.length() > 1 || secondSeam - p.length() < -1)) + if (iterations >= 100) { + log.error('Generating head2 could not be made to fit in 100 iterations!') + } + + points.dartPoint0 = new Path() + .move(points.point3) + .curve(points.point3Cp1, points.point4Cp2, points.point4) + .shiftAlong(99.23273836900117 * sizeFactor) + points.dartPoint1 = points.point0.shift(285.96197961706986, 65.4910471438654 * sizeFactor) + points.dartPoint1Cp1 = points.dartPoint1.shift( + 354.74216521134053, + 13.662486193954589 * sizeFactor + ) + points.dartPoint1Cp2 = points.dartPoint1.shift( + 356.55115250146685, + 13.680777207454268 * sizeFactor + ) + points.dartPoint2 = new Path() + .move(points.point3) + .curve(points.point3Cp1, points.point4Cp2, points.point4) + .shiftAlong(92.81578231343269 * sizeFactor) + + paths.secondSeam = new Path() .move(points.point0) ._curve(points.point1Cp2, points.point1) .curve_(points.point1Cp1, points.point2) + .setText(complete ? '17' : '', textAttribute) + .addClass('hidden') - if (secondSeam - p.length() > 0.1 || secondSeam - p.length() < -0.1) { - points.point0 = points.point0.shift(90, secondSeam - p.length()) - points.point1 = points.point1.shift(90, secondSeam - p.length()) - points.point1Cp1 = points.point1.shift(270, 30.242724116719366 * sizeFactor) - points.point1Cp2 = points.point1.shift(90, 18.83053830882166 * sizeFactor) - points.point0Cp2 = points.point0.shift(0, 15 * sizeFactor) - } - } while (iterations < 100 && (secondSeam - p.length() > 1 || secondSeam - p.length() < -1)) - if (iterations >= 100) { - log.error('Generating head2 could not be made to fit in 100 iterations!') - } + paths.thirdSeam = new Path() + .move(points.point3) + .curve(points.point3Cp1, points.point4Cp2, points.point4) + .setText(complete ? '18' : '', textAttribute) + .addClass('hidden') - points.dartPoint0 = new Path() - .move(points.point3) - .curve(points.point3Cp1, points.point4Cp2, points.point4) - .shiftAlong(99.23273836900117 * sizeFactor) - points.dartPoint1 = points.point0.shift(285.96197961706986, 65.4910471438654 * sizeFactor) - points.dartPoint1Cp1 = points.dartPoint1.shift( - 354.74216521134053, - 13.662486193954589 * sizeFactor - ) - points.dartPoint1Cp2 = points.dartPoint1.shift( - 356.55115250146685, - 13.680777207454268 * sizeFactor - ) - points.dartPoint2 = new Path() - .move(points.point3) - .curve(points.point3Cp1, points.point4Cp2, points.point4) - .shiftAlong(92.81578231343269 * sizeFactor) + paths.top = new Path() + .move(points.point4) + .curve(points.point4, points.point0Cp2, points.point0) + .setText(complete ? '19' : '', textAttribute) + .addClass('hidden') - paths.secondSeam = new Path() - .move(points.point0) - ._curve(points.point1Cp2, points.point1) - .curve_(points.point1Cp1, points.point2) - .setText(complete ? '17' : '', textAttribute) - .addClass('hidden') + paths.bottom = new Path() + .move(points.point2) + .line(points.point3) + .setText(complete ? '21' : '', textAttribute) + .addClass('hidden') - paths.thirdSeam = new Path() - .move(points.point3) - .curve(points.point3Cp1, points.point4Cp2, points.point4) - .setText(complete ? '18' : '', textAttribute) - .addClass('hidden') + store.set('thirdSeam', paths.thirdSeam.length() - points.dartPoint0.dist(points.dartPoint2)) + store.set('head2width', points.point2.dist(points.point3)) + paths.dart = new Path() + .move(points.dartPoint0) + ._curve(points.dartPoint1Cp2, points.dartPoint1) + .curve_(points.dartPoint1Cp1, points.dartPoint2) - paths.top = new Path() - .move(points.point4) - .curve(points.point4, points.point0Cp2, points.point0) - .setText(complete ? '19' : '', textAttribute) - .addClass('hidden') + paths.seam = new Path() + .move(points.point0) + .join(paths.secondSeam) + .join(paths.bottom) + .join(paths.thirdSeam) + .join(paths.top) + .close() - paths.bottom = new Path() - .move(points.point2) - .line(points.point3) - .setText(complete ? '21' : '', textAttribute) - .addClass('hidden') - - store.set('thirdSeam', paths.thirdSeam.length() - points.dartPoint0.dist(points.dartPoint2)) - store.set('head2width', points.point2.dist(points.point3)) - paths.dart = new Path() - .move(points.dartPoint0) - ._curve(points.dartPoint1Cp2, points.dartPoint1) - .curve_(points.dartPoint1Cp1, points.dartPoint2) - - paths.seam = new Path() - .move(points.point0) - .join(paths.secondSeam) - .join(paths.bottom) - .join(paths.thirdSeam) - .join(paths.top) - .close() - - // Complete? - if (complete) { + points.gridAnchor = points.dartPoint1.clone() points.title = points.dartPoint1.shiftFractionTowards(points.point2, 0.35) macro('title', { nr: 4, @@ -127,95 +117,111 @@ function draftHead2({ if (sa) { paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') } - } - // Paperless? - if (paperless) { points.pointX = paths.seam.edge('right') macro('hd', { from: points.point0, to: points.point4, y: points.point0.y - sa - 15, + id: 'topWidth', }) macro('hd', { from: points.point0, to: points.pointX, y: points.point0.y - sa - 25, + id: 'topToRight', }) macro('hd', { from: points.point1, to: points.pointX, y: points.point0.y - sa - 35, + id: 'totalWidth', }) macro('hd', { from: points.point3, to: points.pointX, y: points.point3.y + sa + 15, + id: 'bottomRightToRight', + noStartMarker: true, + noEndMarker: true, }) macro('hd', { from: points.point2, to: points.point3, y: points.point3.y + sa + 15, + id: 'bottomWidth', + noStartMarker: true, + noEndMarker: true, }) macro('hd', { from: points.point1, to: points.point2, y: points.point3.y + sa + 15, + id: 'leftToBottomLeft', + noStartMarker: true, + noEndMarker: true, }) macro('hd', { from: points.point0, to: points.dartPoint1, y: points.dartPoint1.y, + id: 'leftTopToDartPoint', + noStartMarker: true, + noEndMarker: true, }) macro('vd', { from: points.point1, to: points.point0, x: points.point1.x - sa - 15, + id: 'leftToTop', }) macro('vd', { from: points.point2, to: points.point1, x: points.point1.x - sa - 15, + id: 'leftToBottomLeft', }) macro('vd', { from: points.point3, to: points.point1, x: points.point1.x - sa - 25, + id: 'leftToBottomRight', }) macro('vd', { from: points.point0, to: points.point4, x: points.point4.x + sa + 15, + id: 'topRightToTopLeft', + noStartMarker: true, + noEndMarker: true, }) macro('vd', { from: points.point4, to: points.dartPoint0, x: points.point4.x + sa + 15, + id: 'topDartToTopRight', }) macro('vd', { from: points.point4, to: points.dartPoint2, x: points.point4.x + sa + 25, + id: 'bottomDartToTopRight', }) macro('vd', { from: points.dartPoint2, to: points.point3, x: points.point4.x + sa + 25, + id: 'bottomRightToBottomDart', }) macro('vd', { from: points.point0, to: points.dartPoint1, x: points.dartPoint1.x, + id: 'dartPointToTopLeft', }) - } - return part -} - -export const head2 = { - name: 'head2', - after: [cheek, head1], - draft: draftHead2, + return part + }, } diff --git a/designs/skully/src/head3.mjs b/designs/skully/src/head3.mjs index e8fd25cc1db..5bee65f4ef1 100644 --- a/designs/skully/src/head3.mjs +++ b/designs/skully/src/head3.mjs @@ -2,106 +2,102 @@ import { cheek } from './cheek.mjs' import { head2 } from './head2.mjs' import { jawfloor } from './jawfloor.mjs' -function draftHead3({ - Point, - Path, - points, - paths, - complete, - sa, - log, - store, - paperless, - macro, - utils, - part, -}) { - const textAttribute = 'text-xs center' - const sizeFactor = store.get('sizeFactor') +export const head3 = { + name: 'head3', + after: [cheek, head2, jawfloor], + draft: ({ Point, Path, points, paths, sa, complete, log, store, macro, utils, part }) => { + const textAttribute = 'text-xs center' + const sizeFactor = store.get('sizeFactor') - points.point0 = new Point(0, 0) + points.point0 = new Point(0, 0) - points.point0Cp2 = points.point0.shift(176.85941213458383, 24.45873430903567 * sizeFactor) - points.point0Cp1 = points.point0.shift(80.97143471134606, 19.435805231582247 * sizeFactor) - points.point5 = points.point0.shift(174.83014371859687, 57.4195861357429 * sizeFactor) - points.point5Cp1 = points.point5.shift(359.48476820979687, 24.91000716579583 * sizeFactor) - points.point4 = points.point0.shift(128.37, 82.29999999999998 * sizeFactor) - points.point4Cp1 = points.point4.shift(280, 20 * sizeFactor) - points.point3 = points.point0.shift(122.10525602099625, 99.24923435875874 * sizeFactor) - points.point3Cp2 = points.point3.shift(75, 20 * sizeFactor) - points.point2 = points.point0.shift(92.0479806305003, 131.18279286933938 * sizeFactor) - points.point2Cp2 = points.point2.shift(286.4630945432234, 43.38779202725112 * sizeFactor) - points.point2Cp1 = points.point2.shift(208.11590506019132, 16.689416556608613 * sizeFactor) - points.point1 = points.point0.shift(80.96712201455671, 37.967861804426136 * sizeFactor) - points.point1Cp2 = points.point1.shift(266.0887375411011, 17.372462375840676 * sizeFactor) - points.point1Cp1 = points.point1.shift(86.08762325510818, 17.602020395397776 * sizeFactor) + points.point0Cp2 = points.point0.shift(176.85941213458383, 24.45873430903567 * sizeFactor) + points.point0Cp1 = points.point0.shift(80.97143471134606, 19.435805231582247 * sizeFactor) + points.point5 = points.point0.shift(174.83014371859687, 57.4195861357429 * sizeFactor) + points.point5Cp1 = points.point5.shift(359.48476820979687, 24.91000716579583 * sizeFactor) + points.point4 = points.point0.shift(128.37, 82.29999999999998 * sizeFactor) + points.point4Cp1 = points.point4.shift(280, 20 * sizeFactor) + points.point3 = points.point0.shift(122.10525602099625, 99.24923435875874 * sizeFactor) + points.point3Cp2 = points.point3.shift(75, 20 * sizeFactor) + points.point2 = points.point0.shift(92.0479806305003, 131.18279286933938 * sizeFactor) + points.point2Cp2 = points.point2.shift(286.4630945432234, 43.38779202725112 * sizeFactor) + points.point2Cp1 = points.point2.shift(208.11590506019132, 16.689416556608613 * sizeFactor) + points.point1 = points.point0.shift(80.96712201455671, 37.967861804426136 * sizeFactor) + points.point1Cp2 = points.point1.shift(266.0887375411011, 17.372462375840676 * sizeFactor) + points.point1Cp1 = points.point1.shift(86.08762325510818, 17.602020395397776 * sizeFactor) - points.dartPoint0 = points.point4.clone() - points.dartPoint0Cp1 = points.dartPoint0.shift(10, 15.674240045373793 * sizeFactor) - points.dartPoint1 = points.point0.shift(93.69495535762911, 79.06034303618978 * sizeFactor) - points.dartPoint1Cp1 = points.dartPoint1.shift(190.57289744169927, 19.19488590744941 * sizeFactor) - points.dartPoint1Cp2 = points.dartPoint1.shift( - 206.69161019830457, - 18.019174148667343 * sizeFactor - ) - points.dartPoint2 = points.point3.clone() - points.dartPoint2Cp2 = points.dartPoint2.shift(345, 15.211717490145492 * sizeFactor) + points.dartPoint0 = points.point4.clone() + points.dartPoint0Cp1 = points.dartPoint0.shift(10, 15.674240045373793 * sizeFactor) + points.dartPoint1 = points.point0.shift(93.69495535762911, 79.06034303618978 * sizeFactor) + points.dartPoint1Cp1 = points.dartPoint1.shift( + 190.57289744169927, + 19.19488590744941 * sizeFactor + ) + points.dartPoint1Cp2 = points.dartPoint1.shift( + 206.69161019830457, + 18.019174148667343 * sizeFactor + ) + points.dartPoint2 = points.point3.clone() + points.dartPoint2Cp2 = points.dartPoint2.shift(345, 15.211717490145492 * sizeFactor) - let lowerWidth = store.get('halfOfBack') - store.get('head2width') - let tsAdjustment = - store.get('thirdSeam') - - new Path().move(points.point2).curve(points.point2Cp1, points.point3Cp2, points.point3).length() + let lowerWidth = store.get('halfOfBack') - store.get('head2width') + let tsAdjustment = + store.get('thirdSeam') - + new Path() + .move(points.point2) + .curve(points.point2Cp1, points.point3Cp2, points.point3) + .length() - let x = utils.circlesIntersect(points.dartPoint0, tsAdjustment, points.point0, lowerWidth) - if (x) { - points.point5 = x[0].clone() - } else { - log.error('Could not make the lower part of head3 fit the other parts!') - } + let x = utils.circlesIntersect(points.dartPoint0, tsAdjustment, points.point0, lowerWidth) + if (x) { + points.point5 = x[0].clone() + } else { + log.error('Could not make the lower part of head3 fit the other parts!') + } - points.point5Cp1 = points.point5.shift(359.48476820979687, 24.91000716579583 * sizeFactor) + points.point5Cp1 = points.point5.shift(359.48476820979687, 24.91000716579583 * sizeFactor) - paths.thirdSeam1 = new Path() - .move(points.point2) - .curve(points.point2Cp1, points.point3Cp2, points.point3) - .setText(complete ? '18' : '', textAttribute) - .addClass('hidden') + points.gridAnchor = points.dartPoint1.clone() - paths.thirdSeam2 = new Path() - .move(points.point4) - .line(points.point5) - .setText(complete ? '18' : '', textAttribute) - .addClass('hidden') + paths.thirdSeam1 = new Path() + .move(points.point2) + .curve(points.point2Cp1, points.point3Cp2, points.point3) + .setText(complete ? '18' : '', textAttribute) + .addClass('hidden') - paths.back = new Path() - .move(points.point0) - .curve(points.point0Cp1, points.point1Cp2, points.point1) - .curve(points.point1Cp1, points.point2Cp2, points.point2) - .setText(complete ? '19' : '', textAttribute) - .addClass('hidden') + paths.thirdSeam2 = new Path() + .move(points.point4) + .line(points.point5) + .setText(complete ? '18' : '', textAttribute) + .addClass('hidden') - paths.bottom = new Path() - .move(points.point5) - .line(points.point0) - .setText(complete ? '21' : '', textAttribute) - .addClass('hidden') + paths.back = new Path() + .move(points.point0) + .curve(points.point0Cp1, points.point1Cp2, points.point1) + .curve(points.point1Cp1, points.point2Cp2, points.point2) + .setText(complete ? '19' : '', textAttribute) + .addClass('hidden') - paths.dart = new Path() - .move(points.dartPoint0) - .curve(points.dartPoint0Cp1, points.dartPoint1Cp2, points.dartPoint1) - .curve(points.dartPoint1Cp1, points.dartPoint2Cp2, points.dartPoint2) + paths.bottom = new Path() + .move(points.point5) + .line(points.point0) + .setText(complete ? '21' : '', textAttribute) + .addClass('hidden') - paths.seam = new Path() - .move(points.point0) - .join(paths.back) - .join(paths.thirdSeam1) - .line(points.point4) - .join(paths.thirdSeam2) - .join(paths.bottom) - .close() + paths.dart = new Path() + .move(points.dartPoint0) + .curve(points.dartPoint0Cp1, points.dartPoint1Cp2, points.dartPoint1) + .curve(points.dartPoint1Cp1, points.dartPoint2Cp2, points.dartPoint2) + + paths.seam = new Path() + .move(points.point0) + .join(paths.back) + .join(paths.thirdSeam1) + .line(points.point4) + .join(paths.thirdSeam2) + .join(paths.bottom) + .close() - // Complete? - if (complete) { points.title = points.point4 .shiftFractionTowards(points.point1, 0.25) .shiftFractionTowards(points.point0, 0.25) @@ -121,10 +117,7 @@ function draftHead3({ if (sa) { paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') } - } - // Paperless? - if (paperless) { points.pointX = new Path() .move(points.point1) .curve(points.point1Cp1, points.point2Cp2, points.point2) @@ -134,70 +127,82 @@ function draftHead3({ from: points.dartPoint2, to: points.point2, y: points.point2.y - sa - 15, + id: 'topDartToTop', }) macro('hd', { from: points.dartPoint2, to: points.pointX, y: points.point2.y - sa - 25, + id: 'totalWidth', }) macro('hd', { from: points.dartPoint2, to: points.point5, y: points.point0.y + sa + 15, + id: 'topDartToBottomLeft', + noStartMarker: true, + noEndMarker: true, }) macro('hd', { from: points.dartPoint0, to: points.point5, y: points.point0.y + sa + 5, + id: 'bottomDartToBottomLeft', + noStartMarker: true, + noEndMarker: true, }) macro('hd', { from: points.dartPoint2, to: points.point0, y: points.point0.y + sa + 25, + id: 'topDartToBottomRight', }) macro('hd', { from: points.dartPoint2, to: points.dartPoint1, y: points.dartPoint2.y, + id: 'topDartToDartPoint', }) macro('vd', { from: points.point2, to: points.dartPoint1, x: points.pointX.x + sa + 15, + id: 'dartPointToTop', }) macro('vd', { from: points.dartPoint1, to: points.point0, x: points.pointX.x + sa + 15, + id: 'dartPointToBottom', }) macro('vd', { from: points.point2, to: points.pointX, x: points.pointX.x + sa + 25, + id: 'rightToTop', }) macro('vd', { from: points.dartPoint2, to: points.point2, x: points.dartPoint2.x - sa - 15, + id: 'topDartToTop', }) macro('vd', { from: points.dartPoint0, to: points.dartPoint2, x: points.dartPoint2.x - sa - 15, + id: 'dartHeight', + noStartMarker: true, + noEndMarker: true, }) macro('vd', { from: points.point5, to: points.dartPoint0, x: points.dartPoint2.x - sa - 15, + id: 'bottomDartToTop', }) - } - return part -} - -export const head3 = { - name: 'head3', - after: [cheek, head2, jawfloor], - draft: draftHead3, + return part + }, } diff --git a/designs/skully/src/jawfloor.mjs b/designs/skully/src/jawfloor.mjs index 3a98f0d5b2e..a4a4367c83f 100644 --- a/designs/skully/src/jawfloor.mjs +++ b/designs/skully/src/jawfloor.mjs @@ -1,108 +1,100 @@ import { cheek } from './cheek.mjs' import { lowerjaw } from './lowerjaw.mjs' -function draftJawfloor({ - Point, - Path, - points, - paths, - complete, - sa, - store, - paperless, - macro, - part, -}) { - const textAttribute = 'text-xs center' - const sizeFactor = store.get('sizeFactor') +export const jawfloor = { + name: 'jawfloor', + after: [cheek, lowerjaw], + draft: ({ Point, Path, points, paths, sa, complete, store, macro, part }) => { + const textAttribute = 'text-xs center' + const sizeFactor = store.get('sizeFactor') - points.point0 = new Point(0, 0) - points.point0Cp1 = points.point0.shift(271.5282081165893, 13.423774618191423 * sizeFactor) - points.point1 = points.point0.shift(329.79784303240206, 56.7574974166409 * sizeFactor) - points.point1Cp1 = points.point1.shift(0.11113474162861184, 14.951028125182583 * sizeFactor) - points.point1Cp2 = points.point1.shift(180.11102743493262, 10.32101937794903 * sizeFactor) - points.point2 = points.point0.shift(341.7834753138606, 84.52734739124374 * sizeFactor) - points.point2Cp1 = points.point2.shift(0.270382570357072, 8.900099100571891 * sizeFactor) - points.point2Cp2 = points.point2.shift(180.28237864410448, 8.319101033164598 * sizeFactor) - points.point3 = points.point0.shift(343.81344080631544, 113.99173416524552 * sizeFactor) - points.point3Cp1 = points.point3.shift(339.59546305762336, 4.204834955143868 * sizeFactor) - points.point3Cp2 = points.point3.shift(159.590412018152, 8.47076366096944 * sizeFactor) - points.point4 = points.point0.shift(340.4669995939806, 139.17462884448446 * sizeFactor) - points.point4Cp2 = points.point4.shift(166.50426671920425, 8.612823288562234 * sizeFactor) - points.point5 = points.point0.shift(3.560698409188234, 135.3172211952344 * sizeFactor) + points.point0 = new Point(0, 0) + points.point0Cp1 = points.point0.shift(271.5282081165893, 13.423774618191423 * sizeFactor) + points.point1 = points.point0.shift(329.79784303240206, 56.7574974166409 * sizeFactor) + points.point1Cp1 = points.point1.shift(0.11113474162861184, 14.951028125182583 * sizeFactor) + points.point1Cp2 = points.point1.shift(180.11102743493262, 10.32101937794903 * sizeFactor) + points.point2 = points.point0.shift(341.7834753138606, 84.52734739124374 * sizeFactor) + points.point2Cp1 = points.point2.shift(0.270382570357072, 8.900099100571891 * sizeFactor) + points.point2Cp2 = points.point2.shift(180.28237864410448, 8.319101033164598 * sizeFactor) + points.point3 = points.point0.shift(343.81344080631544, 113.99173416524552 * sizeFactor) + points.point3Cp1 = points.point3.shift(339.59546305762336, 4.204834955143868 * sizeFactor) + points.point3Cp2 = points.point3.shift(159.590412018152, 8.47076366096944 * sizeFactor) + points.point4 = points.point0.shift(340.4669995939806, 139.17462884448446 * sizeFactor) + points.point4Cp2 = points.point4.shift(166.50426671920425, 8.612823288562234 * sizeFactor) + points.point5 = points.point0.shift(3.560698409188234, 135.3172211952344 * sizeFactor) - points.point6 = points.point0.shift(90.34672828513591, 8.097148263432018 * sizeFactor) - points.point0Cp2 = points.point0.shift(89.35665584015415, 4.809303171978241 * sizeFactor) + points.point6 = points.point0.shift(90.34672828513591, 8.097148263432018 * sizeFactor) + points.point0Cp2 = points.point0.shift(89.35665584015415, 4.809303171978241 * sizeFactor) - points.point5 = points.point5.shift(0, points.point4.dist(points.point5) / 3) - points.point5Cp2 = points.point5.shift(270, points.point4.dist(points.point5) / 3) + points.point5 = points.point5.shift(0, points.point4.dist(points.point5) / 3) + points.point5Cp2 = points.point5.shift(270, points.point4.dist(points.point5) / 3) - macro('mirror', { - mirror: [points.point5, points.point6], - points: [ - points.point0, - points.point0Cp1, - points.point0Cp2, - points.point1Cp2, - points.point1, - points.point1Cp1, - points.point2Cp2, - points.point2, - points.point2Cp1, - points.point3Cp2, - points.point3, - points.point3Cp1, - points.point4Cp2, - points.point4, - points.point4, - points.point5Cp2, - points.point5, - points.point6, - ], - prefix: 'm', - }) + points.gridAnchor = points.point5.clone() - paths.bottomJaw1 = new Path() - .move(points.point6) - ._curve(points.point0Cp2, points.point0) - .curve(points.point0Cp1, points.point1Cp2, points.point1) - .curve(points.point1Cp1, points.point2Cp2, points.point2) - .curve(points.point2Cp1, points.point3Cp2, points.point3) - .curve(points.point3Cp1, points.point4Cp2, points.point4) - .setText(complete ? 'jawBottom' + ' (15)' : '', textAttribute) - .addClass('hidden') + macro('mirror', { + mirror: [points.point5, points.point6], + points: [ + 'point0', + 'point0Cp1', + 'point0Cp2', + 'point1Cp2', + 'point1', + 'point1Cp1', + 'point2Cp2', + 'point2', + 'point2Cp1', + 'point3Cp2', + 'point3', + 'point3Cp1', + 'point4Cp2', + 'point4', + 'point4', + 'point5Cp2', + 'point5', + 'point6', + ], + prefix: 'm', + }) - paths.bottomJaw2 = new Path() - .move(points.mPoint4) - .curve(points.mPoint4Cp2, points.mPoint3Cp1, points.mPoint3) - .curve(points.mPoint3Cp2, points.mPoint2Cp1, points.mPoint2) - .curve(points.mPoint2Cp2, points.mPoint1Cp1, points.mPoint1) - .curve(points.mPoint1Cp2, points.mPoint0Cp1, points.mPoint0) - .curve_(points.mPoint0Cp2, points.point6) - .setText(complete ? 'jawBottom' + ' (15)' : '', textAttribute) - .addClass('hidden') + paths.bottomJaw1 = new Path() + .move(points.point6) + ._curve(points.point0Cp2, points.point0) + .curve(points.point0Cp1, points.point1Cp2, points.point1) + .curve(points.point1Cp1, points.point2Cp2, points.point2) + .curve(points.point2Cp1, points.point3Cp2, points.point3) + .curve(points.point3Cp1, points.point4Cp2, points.point4) + .setText(complete ? 'jawBottom' + ' (15)' : '', textAttribute) + .addClass('hidden') - paths.back = new Path() - .move(points.point4) - .curve(points.point4, points.point5Cp2, points.point5) - .curve(points.mPoint5Cp2, points.mPoint4, points.mPoint4) - .setText(complete ? '21' : '', textAttribute) - .addClass('hidden') + paths.bottomJaw2 = new Path() + .move(points.mPoint4) + .curve(points.mPoint4Cp2, points.mPoint3Cp1, points.mPoint3) + .curve(points.mPoint3Cp2, points.mPoint2Cp1, points.mPoint2) + .curve(points.mPoint2Cp2, points.mPoint1Cp1, points.mPoint1) + .curve(points.mPoint1Cp2, points.mPoint0Cp1, points.mPoint0) + .curve_(points.mPoint0Cp2, points.point6) + .setText(complete ? 'jawBottom' + ' (15)' : '', textAttribute) + .addClass('hidden') - paths.seam = new Path() - .move(points.point6) - .join(paths.bottomJaw1) - .join(paths.back) - .join(paths.bottomJaw2) - .close() + paths.back = new Path() + .move(points.point4) + .curve(points.point4, points.point5Cp2, points.point5) + .curve(points.mPoint5Cp2, points.mPoint4, points.mPoint4) + .setText(complete ? '21' : '', textAttribute) + .addClass('hidden') - store.set( - 'backOfLowerJaw', - new Path().move(points.point4).curve(points.point4, points.point5Cp2, points.point5).length() - ) + paths.seam = new Path() + .move(points.point6) + .join(paths.bottomJaw1) + .join(paths.back) + .join(paths.bottomJaw2) + .close() + + store.set( + 'backOfLowerJaw', + new Path().move(points.point4).curve(points.point4, points.point5Cp2, points.point5).length() + ) - // Complete? - if (complete) { points.title = points.point6.shiftFractionTowards(points.point5, 0.5) macro('title', { nr: 8, @@ -118,72 +110,77 @@ function draftJawfloor({ if (sa) { paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') } - } - // Paperless? - if (paperless) { macro('hd', { from: points.mPoint0, to: points.mPoint5, y: points.mPoint4.y - sa - 15, + id: 'width', }) macro('hd', { from: points.point4, to: points.point5, y: points.point4.y + sa + 15, + id: 'bottomRightToRight', + noStartMarker: true, + noEndMarker: true, }) macro('hd', { from: points.point2, to: points.point4, y: points.point4.y + sa + 15, + id: 'indentToBottomRight', }) macro('hd', { from: points.point1, to: points.point2, y: points.point4.y + sa + 15, + id: 'outdentToIndent', }) macro('hd', { from: points.point0, to: points.point1, y: points.point4.y + sa + 15, + id: 'leftToOutdent', }) + macro('vd', { from: points.point1, to: points.mPoint1, x: points.mPoint1.x, + id: 'outdentHeight', }) macro('vd', { from: points.point2, to: points.mPoint2, x: points.mPoint2.x, + id: 'indentHeight', }) macro('vd', { from: points.point3, to: points.mPoint3, x: points.mPoint3.x, + id: 'anotherHeight', }) macro('vd', { from: points.point4, to: points.mPoint4, x: points.mPoint4.x, + id: 'totalHeight', }) macro('vd', { from: points.mPoint4, to: points.point5, x: points.point5.x + sa + 15, + id: 'middleToTop', }) macro('vd', { from: points.mPoint5, to: points.point4, x: points.mPoint5.x + sa + 15, + id: 'bottomToMiddle', }) - } - return part -} - -export const jawfloor = { - name: 'jawfloor', - after: [cheek, lowerjaw], - draft: draftJawfloor, + return part + }, } diff --git a/designs/skully/src/lowerjaw.mjs b/designs/skully/src/lowerjaw.mjs index b8ec3725add..cebe56fe938 100644 --- a/designs/skully/src/lowerjaw.mjs +++ b/designs/skully/src/lowerjaw.mjs @@ -1,112 +1,102 @@ import { cheek } from './cheek.mjs' import { uppermouth } from './uppermouth.mjs' -function draftLowerjaw({ - Point, - Path, - points, - paths, - complete, - sa, - log, - store, - paperless, - macro, - part, -}) { - const textAttribute = 'text-xs center' - const sizeFactor = store.get('sizeFactor') +export const lowerjaw = { + name: 'lowerjaw', + after: [cheek, uppermouth], + draft: ({ Point, Path, points, paths, sa, complete, log, store, macro, part }) => { + const textAttribute = 'text-xs center' + const sizeFactor = store.get('sizeFactor') - points.point0 = new Point(0, 0) - points.point1 = points.point0.shift(174.91311161963839, 43.0264648094635 * sizeFactor) - points.point2 = points.point0.shift(240.9901082422603, 82.64382533498798 * sizeFactor) - points.point3 = points.point0.shift(251.1601763775522, 106.01579184725264 * sizeFactor) - points.point4 = points.point0.shift(276.6440430845334, 116.75813357963548 * sizeFactor) - points.point5 = points.point0.shift(264.48800048134507, 50.78381912578058 * sizeFactor) + points.point0 = new Point(0, 0) + points.point1 = points.point0.shift(174.91311161963839, 43.0264648094635 * sizeFactor) + points.point2 = points.point0.shift(240.9901082422603, 82.64382533498798 * sizeFactor) + points.point3 = points.point0.shift(251.1601763775522, 106.01579184725264 * sizeFactor) + points.point4 = points.point0.shift(276.6440430845334, 116.75813357963548 * sizeFactor) + points.point5 = points.point0.shift(264.48800048134507, 50.78381912578058 * sizeFactor) - const mouthTop = store.get('mouthTop') - - points.point0 = new Point(0, 0) - points.point0Cp2 = points.point0.shift(354.9481781658739, 16.659715303689914 * sizeFactor) - points.point1 = points.point0.shift(264.91311161963836, 43.0264648094635 * sizeFactor) - points.point1Cp1 = points.point1.shift(0, 53.02160375733651 * sizeFactor) - points.point2 = points.point0.shift(331.14662128979205, 83.05325951149062 * sizeFactor) - points.point2Cp1 = points.point2.shift(23.491413537740165, 11.818521142681087 * sizeFactor) - points.point2Cp2 = points.point2.shift(203.48599545649284, 6.360957553702122 * sizeFactor) - points.point3 = points.point0.shift(341.2414817357221, 106.45865437980989 * sizeFactor) - points.point3Cp1 = points.point3.shift(83.22770461819215, 15.755934754878917 * sizeFactor) - points.point3Cp2 = points.point3.shift(263.2247839478168, 8.959567958333654 * sizeFactor) - points.point4 = points.point0.shift(6.617587088273078, 117.22282297600707 * sizeFactor) - points.point4Cp1 = points.point4.shift(171.59670910061834, 40.160161877163844 * sizeFactor) - points.point4Cp2 = points.point4.shift(255.77964223723035, 21.208879767682262 * sizeFactor) - points.point5 = points.point0.shift(354.81977589032454, 54.026610044075944 * sizeFactor) - points.point5Cp1 = points.point5.shift(166.25960112580196, 20.659041530160696 * sizeFactor) - points.point5Cp2 = points.point5.shift(76.26126036953632, 34.11095664483535 * sizeFactor) - points.point0 = new Point(0, 0) - - let iterations = 0 - var p - do { - iterations++ + const mouthTop = store.get('mouthTop') + points.point0 = new Point(0, 0) + points.point0Cp2 = points.point0.shift(354.9481781658739, 16.659715303689914 * sizeFactor) + points.point1 = points.point0.shift(264.91311161963836, 43.0264648094635 * sizeFactor) + points.point1Cp1 = points.point1.shift(0, 53.02160375733651 * sizeFactor) + points.point2 = points.point0.shift(331.14662128979205, 83.05325951149062 * sizeFactor) + points.point2Cp1 = points.point2.shift(23.491413537740165, 11.818521142681087 * sizeFactor) + points.point2Cp2 = points.point2.shift(203.48599545649284, 6.360957553702122 * sizeFactor) + points.point3 = points.point0.shift(341.2414817357221, 106.45865437980989 * sizeFactor) + points.point3Cp1 = points.point3.shift(83.22770461819215, 15.755934754878917 * sizeFactor) + points.point3Cp2 = points.point3.shift(263.2247839478168, 8.959567958333654 * sizeFactor) + points.point4 = points.point0.shift(6.617587088273078, 117.22282297600707 * sizeFactor) + points.point4Cp1 = points.point4.shift(171.59670910061834, 40.160161877163844 * sizeFactor) + points.point4Cp2 = points.point4.shift(255.77964223723035, 21.208879767682262 * sizeFactor) + points.point5 = points.point0.shift(354.81977589032454, 54.026610044075944 * sizeFactor) points.point5Cp1 = points.point5.shift(166.25960112580196, 20.659041530160696 * sizeFactor) points.point5Cp2 = points.point5.shift(76.26126036953632, 34.11095664483535 * sizeFactor) - p = new Path().move(points.point5).curve(points.point5Cp1, points.point0Cp2, points.point0) + points.point0 = new Point(0, 0) - points.point5 = points.point5.shift(270, (mouthTop - p.length()) * 0.5) - } while (iterations < 100 && (mouthTop - p.length() > 1 || mouthTop - p.length() < -1)) - if (iterations >= 100) { - log.error('Something is not quite right here!') - } + let iterations = 0 + var p + do { + iterations++ - points.point4 = points.point4.shift( - 355, - store.get('lowerJaw') - - new Path() - .move(points.point4) - .curve(points.point4Cp1, points.point5Cp2, points.point5) - .length() - ) - points.point4Cp1 = points.point4.shift(171.59670910061834, 40.160161877163844 * sizeFactor) - points.point4Cp2 = points.point4.shift(255.77964223723035, 21.208879767682262 * sizeFactor) + points.point5Cp1 = points.point5.shift(166.25960112580196, 20.659041530160696 * sizeFactor) + points.point5Cp2 = points.point5.shift(76.26126036953632, 34.11095664483535 * sizeFactor) + p = new Path().move(points.point5).curve(points.point5Cp1, points.point0Cp2, points.point0) - paths.mouthBottom = new Path() - .move(points.point5) - .curve(points.point5Cp1, points.point0Cp2, points.point0) - .setText(complete ? 'mouthBottom' + ' (13)' : '', textAttribute) - .addClass('hidden') + points.point5 = points.point5.shift(270, (mouthTop - p.length()) * 0.5) + } while (iterations < 100 && (mouthTop - p.length() > 1 || mouthTop - p.length() < -1)) + if (iterations >= 100) { + log.error('Something is not quite right here!') + } - paths.lowerJaw = new Path() - .move(points.point4) - .curve(points.point4Cp1, points.point5Cp2, points.point5) - .setText(complete ? 'lowerJaw' + ' (14)' : '', textAttribute) - .addClass('hidden') + points.point4 = points.point4.shift( + 355, + store.get('lowerJaw') - + new Path() + .move(points.point4) + .curve(points.point4Cp1, points.point5Cp2, points.point5) + .length() + ) + points.point4Cp1 = points.point4.shift(171.59670910061834, 40.160161877163844 * sizeFactor) + points.point4Cp2 = points.point4.shift(255.77964223723035, 21.208879767682262 * sizeFactor) - paths.front = new Path() - .move(points.point0) - .line(points.point1) - .setText(complete ? '12' : '', textAttribute) + paths.mouthBottom = new Path() + .move(points.point5) + .curve(points.point5Cp1, points.point0Cp2, points.point0) + .setText(complete ? 'mouthBottom' + ' (13)' : '', textAttribute) + .addClass('hidden') - paths.bottomJaw = new Path() - .move(points.point1) - .curve(points.point1Cp1, points.point2Cp2, points.point2) - .curve(points.point2Cp1, points.point3Cp2, points.point3) - .curve(points.point3Cp1, points.point4Cp2, points.point4) - .setText(complete ? 'jawBottom' + '(15)' : '', textAttribute) - .addClass('hidden') + paths.lowerJaw = new Path() + .move(points.point4) + .curve(points.point4Cp1, points.point5Cp2, points.point5) + .setText(complete ? 'lowerJaw' + ' (14)' : '', textAttribute) + .addClass('hidden') - paths.seam = new Path() - .move(points.point0) - .join(paths.front) - .join(paths.bottomJaw) - .join(paths.lowerJaw) - .join(paths.mouthBottom) - .close() + paths.front = new Path() + .move(points.point0) + .line(points.point1) + .setText(complete ? '12' : '', textAttribute) - store.set('bottomJaw', paths.bottomJaw.length()) + paths.bottomJaw = new Path() + .move(points.point1) + .curve(points.point1Cp1, points.point2Cp2, points.point2) + .curve(points.point2Cp1, points.point3Cp2, points.point3) + .curve(points.point3Cp1, points.point4Cp2, points.point4) + .setText(complete ? 'jawBottom' + '(15)' : '', textAttribute) + .addClass('hidden') - // Complete? - if (complete) { + paths.seam = new Path() + .move(points.point0) + .join(paths.front) + .join(paths.bottomJaw) + .join(paths.lowerJaw) + .join(paths.mouthBottom) + .close() + + store.set('bottomJaw', paths.bottomJaw.length()) + + points.gridAnchor = points.point5.clone() points.title = points.point1.shiftFractionTowards(points.point4, 0.25) macro('title', { nr: 11, @@ -122,10 +112,7 @@ function draftLowerjaw({ if (sa) { paths.sa = paths.seam.offset(sa).trim().attr('class', 'fabric sa') } - } - // Paperless? - if (paperless) { points.pointY = new Path() .move(points.point4) .curve(points.point4Cp1, points.point5Cp2, points.point5) @@ -135,65 +122,72 @@ function draftLowerjaw({ from: points.point0, to: points.point5, y: points.pointY.y - sa - 15, + id: 'leftTopToTopHook', }) macro('hd', { from: points.pointY, to: points.point4, y: points.pointY.y - sa - 15, + id: 'topToRight', }) macro('hd', { from: points.point1, to: points.point5, y: points.pointY.y - sa - 25, + id: 'leftBottomToTopHook', }) macro('hd', { from: points.point5, to: points.point4, y: points.pointY.y - sa - 25, + id: 'topHookToRight', }) macro('hd', { from: points.point1, to: points.point3, y: points.point1.y + sa + 15, + id: 'bottomLeftToRightCorner', }) macro('hd', { from: points.point3, to: points.point4, y: points.point1.y + sa + 15, + id: 'rightCornerToRight', + noStartMarker: true, + noEndMarker: true, }) macro('vd', { from: points.point1, to: points.point5, x: points.point1.x - sa - 15, + id: 'bottomToTopHook', }) macro('vd', { from: points.point1, to: points.point0, x: points.point1.x - sa - 25, + id: 'bottomToTopLeft', }) macro('vd', { from: points.point1, to: points.pointY, x: points.point1.x - sa - 35, + id: 'totalHeight', }) macro('vd', { from: points.pointY, to: points.point3, x: points.point4.x + sa + 25, + id: 'rightCornerToTop', }) macro('vd', { from: points.point4, to: points.point3, x: points.point4.x + sa + 15, + id: 'rightCornerToRight', }) - } - return part -} - -export const lowerjaw = { - name: 'lowerjaw', - after: [cheek, uppermouth], - draft: draftLowerjaw, + return part + }, } diff --git a/designs/skully/src/lowermouth.mjs b/designs/skully/src/lowermouth.mjs index d013c7cb9c6..fecacec921d 100644 --- a/designs/skully/src/lowermouth.mjs +++ b/designs/skully/src/lowermouth.mjs @@ -1,64 +1,55 @@ import { cheek } from './cheek.mjs' -function draftLowermouth({ - Point, - Path, - points, - paths, - complete, - sa, - store, - paperless, - macro, - part, -}) { - const textAttribute = 'text-xs center' - const sizeFactor = store.get('sizeFactor') +export const lowermouth = { + name: 'lowermouth', + after: cheek, + draft: ({ Point, Path, points, paths, sa, complete, store, macro, part }) => { + const textAttribute = 'text-xs center' + const sizeFactor = store.get('sizeFactor') - points.point0 = new Point(0, 0) - points.point1 = points.point0.shift(270, 66.14600000000002 * sizeFactor) - points.point1Cp1 = points.point1.shift(0, 0 * sizeFactor) - points.point0Cp2 = points.point0.shift(0, 0 * sizeFactor) + points.point0 = new Point(0, 0) + points.point1 = points.point0.shift(270, 66.14600000000002 * sizeFactor) + points.point1Cp1 = points.point1.shift(0, 0 * sizeFactor) + points.point0Cp2 = points.point0.shift(0, 0 * sizeFactor) - points.point2 = points.point0.shift(219.80599709691597, 51.66121657491237 * sizeFactor) + points.point2 = points.point0.shift(219.80599709691597, 51.66121657491237 * sizeFactor) - points.point0 = new Point(0, 0) - points.point0Cp1 = points.point0.shift(0, 0 * sizeFactor) - points.point1 = points.point0.shift(222.41579397130369, 49.03292752740774 * sizeFactor) - points.point2 = points.point0.shift(270, 66.14600000000002 * sizeFactor) - points.point2Cp2 = points.point2.shift(0, 0 * sizeFactor) - points.point1.x = points.point0.x - points.point0.dist(points.point2) / 2 - points.point1Cp1 = points.point1.shift(270, 33.0746752291626 * sizeFactor) - points.point1Cp2 = points.point1.shift(90, 33.0746752291626 * sizeFactor) + points.point0 = new Point(0, 0) + points.point0Cp1 = points.point0.shift(0, 0 * sizeFactor) + points.point1 = points.point0.shift(222.41579397130369, 49.03292752740774 * sizeFactor) + points.point2 = points.point0.shift(270, 66.14600000000002 * sizeFactor) + points.point2Cp2 = points.point2.shift(0, 0 * sizeFactor) + points.point1.x = points.point0.x - points.point0.dist(points.point2) / 2 + points.point1Cp1 = points.point1.shift(270, 33.0746752291626 * sizeFactor) + points.point1Cp2 = points.point1.shift(90, 33.0746752291626 * sizeFactor) - paths.mouth1 = new Path() - .move(points.point0) - .curve(points.point0Cp1, points.point1Cp2, points.point1) - .setText(complete ? 'mouthBottom' + ' (13)' : '', textAttribute) - .addClass('hidden') - paths.mouth2 = new Path() - .move(points.point1) - .curve(points.point1Cp1, points.point2Cp2, points.point2) - .setText(complete ? 'mouthBottom' + ' (13)' : '', textAttribute) - .addClass('hidden') + paths.mouth1 = new Path() + .move(points.point0) + .curve(points.point0Cp1, points.point1Cp2, points.point1) + .setText(complete ? 'mouthBottom' + ' (13)' : '', textAttribute) + .addClass('hidden') + paths.mouth2 = new Path() + .move(points.point1) + .curve(points.point1Cp1, points.point2Cp2, points.point2) + .setText(complete ? 'mouthBottom' + ' (13)' : '', textAttribute) + .addClass('hidden') - paths.backOfMouth = new Path() - .move(points.point2) - .line(points.point0) - .setText(complete ? 'backOfMouth' + ' (11)' : '', textAttribute) - .addClass('hidden') + paths.backOfMouth = new Path() + .move(points.point2) + .line(points.point0) + .setText(complete ? 'backOfMouth' + ' (11)' : '', textAttribute) + .addClass('hidden') - store.set('mouthWidth', points.point0.dist(points.point2)) + store.set('mouthWidth', points.point0.dist(points.point2)) - paths.seam = new Path() - .move(points.point0) - .curve(points.point0Cp1, points.point1Cp2, points.point1) - .curve(points.point1Cp1, points.point2Cp2, points.point2) - .line(points.point0) - .close() + paths.seam = new Path() + .move(points.point0) + .curve(points.point0Cp1, points.point1Cp2, points.point1) + .curve(points.point1Cp1, points.point2Cp2, points.point2) + .line(points.point0) + .close() - // Complete? - if (complete) { + points.gridAnchor = points.point1.clone() points.title = points.point0 .shiftFractionTowards(points.point2, 0.25) .shiftFractionTowards(points.point1, 0.6) @@ -77,27 +68,20 @@ function draftLowermouth({ if (sa) { paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') } - } - // Paperless? - if (paperless) { macro('hd', { from: points.point1, to: points.point0, y: points.point0.y - sa - 15, + id: 'width', }) macro('vd', { from: points.point0, to: points.point2, x: points.point0.x + sa + 15, + id: 'height', }) - } - return part -} - -export const lowermouth = { - name: 'lowermouth', - after: cheek, - draft: draftLowermouth, + return part + }, } diff --git a/designs/skully/src/nose.mjs b/designs/skully/src/nose.mjs index 1a5e23fc969..cf41ed4f559 100644 --- a/designs/skully/src/nose.mjs +++ b/designs/skully/src/nose.mjs @@ -2,85 +2,86 @@ import { cheek } from './cheek.mjs' import { eye } from './eye.mjs' import { forehead } from './forehead.mjs' -function draftNose({ - Point, - Path, - points, - paths, - Snippet, - snippets, - complete, - sa, - log, - store, - paperless, - macro, - part, -}) { - const textAttribute = 'text-xs center' +export const nose = { + name: 'nose', + after: [cheek, forehead, eye], + draft: ({ + Point, + Path, + points, + paths, + Snippet, + snippets, + sa, + complete, + log, + store, + macro, + part, + }) => { + const textAttribute = 'text-xs center' - const noseSide = store.get('noseSide') - const noseHeight = store.get('noseHeight') + const noseSide = store.get('noseSide') + const noseHeight = store.get('noseHeight') - points.point0 = new Point(0, 0) - points.point2 = points.point0.shift(90, noseHeight) - points.point0Cp1 = points.point0.shift(315, noseHeight) - points.point2Cp2 = points.point2.shift(325, noseHeight / 3) + points.point0 = new Point(0, 0) + points.point2 = points.point0.shift(90, noseHeight) + points.point0Cp1 = points.point0.shift(315, noseHeight) + points.point2Cp2 = points.point2.shift(325, noseHeight / 3) - paths.p1 = new Path() - .move(points.point0) - .curve(points.point0Cp1, points.point2Cp2, points.point2) - .hide() - - points.pRotate = points.point0.shift(30, noseHeight) - - paths.p0p1 = new Path().move(points.point0).line(points.point2).setClass('dashed mark') - - points.point1 = points.pRotate.shiftTowards(points.point2, noseHeight * -1) - - points.point1Cp2 = points.point1.shift(points.point1.angle(points.point2) + 55, noseHeight / 3) - - var iterations = 0 - var pl - do { - iterations++ - - points.point1 = points.point1.rotate(-0.5, points.point2) - points.point1Cp2 = points.point1Cp2.rotate(-0.5, points.point2) - points.point0Cp1 = points.point0Cp1.rotate(-0.5, points.point2) paths.p1 = new Path() .move(points.point0) - .curve(points.point0Cp1, points.point1Cp2, points.point1) + .curve(points.point0Cp1, points.point2Cp2, points.point2) + .hide() + + points.pRotate = points.point0.shift(30, noseHeight) + + paths.p0p1 = new Path().move(points.point0).line(points.point2).setClass('dashed mark') + + points.point1 = points.pRotate.shiftTowards(points.point2, noseHeight * -1) + + points.point1Cp2 = points.point1.shift(points.point1.angle(points.point2) + 55, noseHeight / 3) + + var iterations = 0 + var pl + do { + iterations++ + + points.point1 = points.point1.rotate(-0.5, points.point2) + points.point1Cp2 = points.point1Cp2.rotate(-0.5, points.point2) + points.point0Cp1 = points.point0Cp1.rotate(-0.5, points.point2) + paths.p1 = new Path() + .move(points.point0) + .curve(points.point0Cp1, points.point1Cp2, points.point1) + .setText(complete ? 'nose' + ' (10)' : '', textAttribute) + + pl = paths.p1.length() + } while (iterations < 100 && pl - noseSide > 1) + if (iterations >= 100) { + log.error('Generating nose could not be made to fit in 100 iterations!') + } + + points.pMiddle1 = points.point2.shiftFractionTowards(points.point1, 0.5) + + points.point3 = points.point1.flipX() + points.point3Cp1 = points.point1Cp2.flipX() + points.point0Cp2 = points.point0Cp1.flipX() + points.pMiddle2 = points.pMiddle1.flipX() + + paths.p2 = new Path() + .move(points.point3) + .curve(points.point3Cp1, points.point0Cp2, points.point0) .setText(complete ? 'nose' + ' (10)' : '', textAttribute) - pl = paths.p1.length() - } while (iterations < 100 && pl - noseSide > 1) - if (iterations >= 100) { - log.error('Generating nose could not be made to fit in 100 iterations!') - } + paths.seam = new Path() + .move(points.point0) + .join(paths.p1) + .line(points.point2) + .line(points.point3) + .join(paths.p2) + .close() - points.pMiddle1 = points.point2.shiftFractionTowards(points.point1, 0.5) - - points.point3 = points.point1.flipX() - points.point3Cp1 = points.point1Cp2.flipX() - points.point0Cp2 = points.point0Cp1.flipX() - points.pMiddle2 = points.pMiddle1.flipX() - - paths.p2 = new Path() - .move(points.point3) - .curve(points.point3Cp1, points.point0Cp2, points.point0) - .setText(complete ? 'nose' + ' (10)' : '', textAttribute) - - paths.seam = new Path() - .move(points.point0) - .join(paths.p1) - .line(points.point2) - .line(points.point3) - .join(paths.p2) - .close() - - // Complete? - if (complete) { + points.gridAnchor = points.point0.clone() points.title = points.point0.shiftFractionTowards(points.point3, 0.5) macro('title', { nr: 12, @@ -99,13 +100,13 @@ function draftNose({ from: points.point1.shiftFractionTowards(points.point2, 0.25), to: points.point1.shiftFractionTowards(points.point2, 0.75), hinge: true, - prefix: 'st1', + id: 'st1', }) macro('sewtogether', { from: points.point2.shiftFractionTowards(points.point3, 0.25), to: points.point2.shiftFractionTowards(points.point3, 0.75), hinge: true, - prefix: 'st2', + id: 'st2', }) // points.logo = points.topLeft.shiftFractionTowards(points.bottomRight, 0.5) @@ -121,13 +122,13 @@ function draftNose({ .join(paths.p1) .line(points.point2) .offset(sa) - .hide() + .addClass('hidden') const pathSA2 = new Path() .move(points.point2) .line(points.point3) .curve(points.point3Cp1, points.point0Cp2, points.point0) .offset(sa) - .hide() + .addClass('hidden') const pSa1 = pathSA1.intersectsX(0)[0] paths.sa1 = pathSA1.split(pSa1)[1].hide() const pSa2 = pathSA2.intersectsX(0)[0] @@ -139,10 +140,7 @@ function draftNose({ .close() .attr('class', 'fabric sa') } - } - // Paperless? - if (paperless) { points.pointY1 = new Path() .move(points.point0) .curve(points.point0Cp1, points.point1Cp2, points.point1) @@ -156,45 +154,60 @@ function draftNose({ from: points.point2, to: points.point1, x: points.point1.x + sa + 5, + id: 'heightRight', + noStartMarker: true, + noEndMarker: true, }) macro('vd', { from: points.pointY1, to: points.point2, x: points.point3.x - sa - 5, + id: 'heightLeft', + noStartMarker: true, + noEndMarker: true, }) macro('hd', { from: points.point0, to: points.point1, y: points.point2.y - sa - 5, + id: 'widthRight', + noStartMarker: true, + noEndMarker: true, }) macro('hd', { from: points.point3, to: points.point0, y: points.point2.y - sa - 5, + id: 'widthLeft', + noStartMarker: true, + noEndMarker: true, }) macro('hd', { from: points.pointY1, to: points.point1, y: points.pointY2.y + sa + 5, + id: 'bottomToRight', + noStartMarker: true, + noEndMarker: true, }) macro('hd', { from: points.pointY2, to: points.pointY1, y: points.pointY2.y + sa + 5, + id: 'leftToRight', + noStartMarker: true, + noEndMarker: true, }) macro('hd', { from: points.point3, to: points.pointY2, y: points.pointY2.y + sa + 5, + id: 'leftToBottom', + noStartMarker: true, + noEndMarker: true, }) - } - return part -} - -export const nose = { - name: 'nose', - after: [cheek, forehead, eye], - draft: draftNose, + return part + }, } diff --git a/designs/skully/src/uppermouth.mjs b/designs/skully/src/uppermouth.mjs index 80c0c96d67d..0456a9c4890 100644 --- a/designs/skully/src/uppermouth.mjs +++ b/designs/skully/src/uppermouth.mjs @@ -2,189 +2,180 @@ import { cheek } from './cheek.mjs' import { head1 } from './head1.mjs' import { lowermouth } from './lowermouth.mjs' -function draftUppermouth({ - Point, - Path, - points, - paths, - complete, - sa, - store, - paperless, - macro, - part, -}) { - const textAttribute = 'text-xs center' - const sizeFactor = store.get('sizeFactor') +export const uppermouth = { + name: 'uppermouth', + after: [cheek, head1, lowermouth], + draft: ({ Point, Path, points, paths, sa, complete, store, macro, part }) => { + const textAttribute = 'text-xs center' + const sizeFactor = store.get('sizeFactor') - points.point0 = new Point(0, 0) - points.point6 = points.point0.shift(0.11139916029446559, 128.58224303534288 * sizeFactor) - points.point6Cp2 = points.point6.shift(269.8182450112891, 5.359026963917993 * sizeFactor) - points.point5 = points.point0.shift(328.14341716244707, 120.52788940738986 * sizeFactor) - points.point5Cp1 = points.point5.shift(29.114015378370315, 25.571930803128662 * sizeFactor) - points.point4 = points.point0.shift(317.9233666855834, 95.68080416154534 * sizeFactor) - points.point4Cp2 = points.point4.shift(178.12857030706965, 15.433231709528583 * sizeFactor) - points.point3 = points.point0.shift(312.29520434983914, 55.53156468171955 * sizeFactor) - points.point3Cp2 = points.point3.shift(90, 6.745097849549684 * sizeFactor) - points.point3Cp1 = points.point3.shift(270, 23.140963009347697 * sizeFactor) - points.point2 = points.point0.shift(312.62624217423604, 44.01273783803957 * sizeFactor) - points.point2Cp1 = points.point2.shift(358.24231642721344, 5.05337768230318 * sizeFactor) - points.point1 = points.point0.shift(270, 32.77328218228992 * sizeFactor) + points.point0 = new Point(0, 0) + points.point6 = points.point0.shift(0.11139916029446559, 128.58224303534288 * sizeFactor) + points.point6Cp2 = points.point6.shift(269.8182450112891, 5.359026963917993 * sizeFactor) + points.point5 = points.point0.shift(328.14341716244707, 120.52788940738986 * sizeFactor) + points.point5Cp1 = points.point5.shift(29.114015378370315, 25.571930803128662 * sizeFactor) + points.point4 = points.point0.shift(317.9233666855834, 95.68080416154534 * sizeFactor) + points.point4Cp2 = points.point4.shift(178.12857030706965, 15.433231709528583 * sizeFactor) + points.point3 = points.point0.shift(312.29520434983914, 55.53156468171955 * sizeFactor) + points.point3Cp2 = points.point3.shift(90, 6.745097849549684 * sizeFactor) + points.point3Cp1 = points.point3.shift(270, 23.140963009347697 * sizeFactor) + points.point2 = points.point0.shift(312.62624217423604, 44.01273783803957 * sizeFactor) + points.point2Cp1 = points.point2.shift(358.24231642721344, 5.05337768230318 * sizeFactor) + points.point1 = points.point0.shift(270, 32.77328218228992 * sizeFactor) - points.point1 = points.point1.shift( - 90, - points.point0.dist(points.point1) - store.get('mouthWidth') / 2 - ) - points.point2 = points.point2.shift( - 90, - points.point0.dist(points.point1) - store.get('mouthWidth') / 2 - ) - points.point2Cp1 = points.point2.shift(358.24231642721344, 5.05337768230318 * sizeFactor) - points.point3 = points.point3.shift( - 90, - points.point0.dist(points.point1) - store.get('mouthWidth') / 2 - ) - points.point3Cp1 = points.point3.shift(270, 23.140963009347697 * sizeFactor) - points.point3Cp2 = points.point3.shift(90, 6.745097849549684 * sizeFactor) - points.point4 = points.point4.shift( - 90, - points.point0.dist(points.point1) - store.get('mouthWidth') / 2 - ) - points.point4Cp2 = points.point4.shift(178.12857030706965, 15.433231709528583 * sizeFactor) + points.point1 = points.point1.shift( + 90, + points.point0.dist(points.point1) - store.get('mouthWidth') / 2 + ) + points.point2 = points.point2.shift( + 90, + points.point0.dist(points.point1) - store.get('mouthWidth') / 2 + ) + points.point2Cp1 = points.point2.shift(358.24231642721344, 5.05337768230318 * sizeFactor) + points.point3 = points.point3.shift( + 90, + points.point0.dist(points.point1) - store.get('mouthWidth') / 2 + ) + points.point3Cp1 = points.point3.shift(270, 23.140963009347697 * sizeFactor) + points.point3Cp2 = points.point3.shift(90, 6.745097849549684 * sizeFactor) + points.point4 = points.point4.shift( + 90, + points.point0.dist(points.point1) - store.get('mouthWidth') / 2 + ) + points.point4Cp2 = points.point4.shift(178.12857030706965, 15.433231709528583 * sizeFactor) - points.point5 = points.point4.shift( - 0, - store.get('upperJaw') - - new Path() - .move(points.point1) - .line(points.point2) - .curve(points.point2Cp1, points.point3Cp2, points.point3) - .curve(points.point3Cp1, points.point4Cp2, points.point4) - .length() - ) - points.point5Cp1 = points.point5.shift(0, 9 * sizeFactor) + points.point5 = points.point4.shift( + 0, + store.get('upperJaw') - + new Path() + .move(points.point1) + .line(points.point2) + .curve(points.point2Cp1, points.point3Cp2, points.point3) + .curve(points.point3Cp1, points.point4Cp2, points.point4) + .length() + ) + points.point5Cp1 = points.point5.shift(0, 9 * sizeFactor) - points.point6 = new Point(points.point5.x, points.point0.y).shift(0, points.point5.x * 0.2) - points.point6Cp2 = points.point6.shift(270, 5 * sizeFactor) + points.point6 = new Point(points.point5.x, points.point0.y).shift(0, points.point5.x * 0.2) + points.point6Cp2 = points.point6.shift(270, 5 * sizeFactor) - points.pointM1 = points.point0.shift(180, store.get('mouthWidth') / 2) - points.pointM1Cp1 = points.pointM1.shift(270, 33.0746752291626 * sizeFactor) + points.pointM1 = points.point0.shift(180, store.get('mouthWidth') / 2) + points.pointM1Cp1 = points.pointM1.shift(270, 33.0746752291626 * sizeFactor) - paths.backOfUpperJaw = new Path() - .move(points.point5) - .curve(points.point5Cp1, points.point6Cp2, points.point6) - .setText(complete ? 'not sewn' : '', textAttribute) - .addClass('hidden') + paths.backOfUpperJaw = new Path() + .move(points.point5) + .curve(points.point5Cp1, points.point6Cp2, points.point6) + .setText(complete ? 'not sewn' : '', textAttribute) + .addClass('hidden') - points.lowerJaw = paths.backOfUpperJaw.shiftAlong(store.get('upperJawToLowerJaw')) - var ljAngle = points.lowerJaw.angle( - paths.backOfUpperJaw.shiftAlong(store.get('upperJawToLowerJaw') + 1) - ) + points.lowerJaw = paths.backOfUpperJaw.shiftAlong(store.get('upperJawToLowerJaw')) + var ljAngle = points.lowerJaw.angle( + paths.backOfUpperJaw.shiftAlong(store.get('upperJawToLowerJaw') + 1) + ) - store.set('halfOfBack', paths.backOfUpperJaw.length() - store.get('upperJawToLowerJaw')) + store.set('halfOfBack', paths.backOfUpperJaw.length() - store.get('upperJawToLowerJaw')) - points.point2ToLowerJaw = points.point2.shift(0, points.point2.dist(points.lowerJaw) / 2) - points.lowerJawToPoint2 = points.lowerJaw.shift( - ljAngle + 90, - points.point2.dist(points.lowerJaw) / 3 - ) + points.point2ToLowerJaw = points.point2.shift(0, points.point2.dist(points.lowerJaw) / 2) + points.lowerJawToPoint2 = points.lowerJaw.shift( + ljAngle + 90, + points.point2.dist(points.lowerJaw) / 3 + ) - macro('mirror', { - mirror: [points.pointM1, points.point6], - points: [ - points.point0, - points.lowerJaw, - points.lowerJawToPoint2, - points.point2ToLowerJaw, - points.pointM1Cp1, - points.point1, - points.point2, - points.point2Cp1, - points.point3, - points.point3Cp1, - points.point3Cp2, - points.point4, - points.point4Cp2, - points.point5, - points.point5Cp1, - points.point6Cp2, - ], - prefix: 'm', - }) + macro('mirror', { + mirror: [points.pointM1, points.point6], + points: [ + 'point0', + 'lowerJaw', + 'lowerJawToPoint2', + 'point2ToLowerJaw', + 'pointM1Cp1', + 'point1', + 'point2', + 'point2Cp1', + 'point3', + 'point3Cp1', + 'point3Cp2', + 'point4', + 'point4Cp2', + 'point5', + 'point5Cp1', + 'point6Cp2', + ], + prefix: 'm', + }) - paths.upperJaw1 = new Path() - .move(points.point1) - .line(points.point2) - .curve(points.point2Cp1, points.point3Cp2, points.point3) - .curve(points.point3Cp1, points.point4Cp2, points.point4) - .line(points.point5) - .setText(complete ? 'upperJaw' + ' (16)' : '', textAttribute) - .addClass('hidden') + paths.upperJaw1 = new Path() + .move(points.point1) + .line(points.point2) + .curve(points.point2Cp1, points.point3Cp2, points.point3) + .curve(points.point3Cp1, points.point4Cp2, points.point4) + .line(points.point5) + .setText(complete ? 'upperJaw' + ' (16)' : '', textAttribute) + .addClass('hidden') - paths.upperJaw2 = new Path() - .move(points.mPoint5) - .line(points.mPoint4) - .curve(points.mPoint4Cp2, points.mPoint3Cp1, points.mPoint3) - .curve(points.mPoint3Cp2, points.mPoint2Cp1, points.mPoint2) - .line(points.mPoint1) - .setText(complete ? 'upperJaw' + ' (16)' : '', textAttribute) - .addClass('hidden') + paths.upperJaw2 = new Path() + .move(points.mPoint5) + .line(points.mPoint4) + .curve(points.mPoint4Cp2, points.mPoint3Cp1, points.mPoint3) + .curve(points.mPoint3Cp2, points.mPoint2Cp1, points.mPoint2) + .line(points.mPoint1) + .setText(complete ? 'upperJaw' + ' (16)' : '', textAttribute) + .addClass('hidden') - paths.front1 = new Path() - .move(points.pointM1) - .curve_(points.pointM1Cp1, points.point1) - .setText(complete ? '(16)' : '', textAttribute) - .addClass('hidden') + paths.front1 = new Path() + .move(points.pointM1) + .curve_(points.pointM1Cp1, points.point1) + .setText(complete ? '(16)' : '', textAttribute) + .addClass('hidden') - paths.front2 = new Path() - .move(points.mPoint1) - .curve_(points.mPointM1Cp1, points.pointM1) - .setText(complete ? '(16)' : '', textAttribute) - .addClass('hidden') + paths.front2 = new Path() + .move(points.mPoint1) + .curve_(points.mPointM1Cp1, points.pointM1) + .setText(complete ? '(16)' : '', textAttribute) + .addClass('hidden') - paths.backOfUpperJaw.curve(points.mPoint6Cp2, points.mPoint5Cp1, points.mPoint5) + paths.backOfUpperJaw.curve(points.mPoint6Cp2, points.mPoint5Cp1, points.mPoint5) - paths.seam = new Path() - .move(points.point1) - .join(paths.upperJaw1) - .join(paths.backOfUpperJaw) - .join(paths.upperJaw2) - .join(paths.front2) - .join(paths.front1) - .close() + paths.seam = new Path() + .move(points.point1) + .join(paths.upperJaw1) + .join(paths.backOfUpperJaw) + .join(paths.upperJaw2) + .join(paths.front2) + .join(paths.front1) + .close() - paths.backOfMouth = new Path() - .move(points.mPoint1) - .line(points.point1) - .setText(complete ? 'backOfMouth' + ' (11)' : '', textAttribute) - .setClass('dashed') + paths.backOfMouth = new Path() + .move(points.mPoint1) + .line(points.point1) + .setText(complete ? 'backOfMouth' + ' (11)' : '', textAttribute) + .setClass('dashed') - paths.lowerJaw1 = new Path() - .move(points.point2) - .curve(points.point2ToLowerJaw, points.lowerJawToPoint2, points.lowerJaw) - .setText(complete ? 'lowerJaw' + ' (14)' : '', textAttribute) - .setClass('dashed') - paths.lowerJaw2 = new Path() - .move(points.mPoint2) - .curve(points.mPoint2ToLowerJaw, points.mLowerJawToPoint2, points.mLowerJaw) - .setText(complete ? 'lowerJaw' + ' (14)' : '', textAttribute) - .setClass('dashed') + paths.lowerJaw1 = new Path() + .move(points.point2) + .curve(points.point2ToLowerJaw, points.lowerJawToPoint2, points.lowerJaw) + .setText(complete ? 'lowerJaw' + ' (14)' : '', textAttribute) + .setClass('dashed') + paths.lowerJaw2 = new Path() + .move(points.mPoint2) + .curve(points.mPoint2ToLowerJaw, points.mLowerJawToPoint2, points.mLowerJaw) + .setText(complete ? 'lowerJaw' + ' (14)' : '', textAttribute) + .setClass('dashed') - paths.backOfUpperJaw1 = new Path() - .move(points.point5) - .line(points.lowerJaw) - .setText(complete ? '21' : '', textAttribute) - .addClass('hidden') - paths.backOfUpperJaw2 = new Path() - .move(points.mLowerJaw) - .line(points.mPoint5) - .setText(complete ? '21' : '', textAttribute) - .addClass('hidden') + paths.backOfUpperJaw1 = new Path() + .move(points.point5) + .line(points.lowerJaw) + .setText(complete ? '21' : '', textAttribute) + .addClass('hidden') + paths.backOfUpperJaw2 = new Path() + .move(points.mLowerJaw) + .line(points.mPoint5) + .setText(complete ? '21' : '', textAttribute) + .addClass('hidden') - store.set('lowerJaw', paths.lowerJaw1.length() + points.point1.dist(points.point2)) + store.set('lowerJaw', paths.lowerJaw1.length() + points.point1.dist(points.point2)) - // Complete? - if (complete) { + points.gridAnchor = points.point0.clone() points.title = points.pointM1.shiftFractionTowards(points.point6, 0.5) macro('title', { nr: 7, @@ -203,92 +194,110 @@ function draftUppermouth({ // paths.sa = paths.seam.offset(sa).trim().attr('class', 'fabric sa') paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') } - } - // Paperless? - if (paperless) { macro('hd', { from: points.pointM1, to: points.point1, y: points.point5.y + sa + 15, + id: 'leftToBOM', }) macro('hd', { from: points.point1, to: points.point3, y: points.point5.y + sa + 15, + id: 'BOMtoCorner', }) macro('hd', { from: points.point3, to: points.point5, y: points.point5.y + sa + 15, + id: 'cornerToRight', }) macro('hd', { from: points.point5, to: points.point6, y: points.point5.y + sa + 15, + id: 'rightToMiddle', + noStartMarker: true, + noEndMarker: true, }) macro('hd', { from: points.pointM1, to: points.point6, y: points.mPoint5.y - sa - 15, + id: 'totalWidth', }) + macro('vd', { from: points.point6, to: points.point5, x: points.point6.x + sa + 15, + id: 'bottomToMiddle', }) macro('vd', { from: points.mPoint5, to: points.point6, x: points.point6.x + sa + 15, + id: 'middleToTop', }) macro('vd', { from: points.mPoint1, to: points.mPoint5, x: points.pointM1.x - sa - 15, + id: 'topBOMtoTop', + noStartMarker: true, + noEndMarker: true, }) macro('vd', { from: points.point1, to: points.mPoint1, x: points.pointM1.x - sa - 15, + id: 'BOMheight1', }) macro('vd', { from: points.point5, to: points.point1, x: points.pointM1.x - sa - 15, + id: 'bottomToBottomBOM', + noStartMarker: true, + noEndMarker: true, }) macro('vd', { from: points.point2, to: points.mPoint2, x: points.point2.x, + id: 'BOMheight2', }) + macro('ld', { from: points.point5, to: points.lowerJaw, d: 5, + id: 'bottomLowerJawIndicator', + noStartMarker: true, + noEndMarker: true, }) macro('ld', { from: points.lowerJaw, to: points.point6, d: 5, + id: 'bottomLowerJawIndicatorToMiddle', }) macro('ld', { from: points.point6, to: points.mLowerJaw, d: 5, + id: 'topLowerJawIndicatorToMiddle', }) macro('ld', { from: points.mLowerJaw, to: points.mPoint5, d: 5, + id: 'topLowerJawIndicator', + noStartMarker: true, + noEndMarker: true, }) - } - return part -} - -export const uppermouth = { - name: 'uppermouth', - after: [cheek, head1, lowermouth], - draft: draftUppermouth, + return part + }, } diff --git a/markdown/org/docs/designs/skully/cutting/en.md b/markdown/org/docs/designs/skully/cutting/en.md new file mode 100644 index 00000000000..c90f41cda7a --- /dev/null +++ b/markdown/org/docs/designs/skully/cutting/en.md @@ -0,0 +1,16 @@ +--- +title: "Skully: Cutting Instructions" +--- + +- **Main Fabric** + - Cut **2 Cheek** + - Cut **2 Forehead** + - Cut **2 Head part 1** + - Cut **2 Head part 2** + - Cut **2 Head part 3** + - Cut **2 Cheekbone** + - Cut **1 Upper Mouth** + - Cut **1 Jaw Floor** + - Cut **2 Eye ** + - Cut **1 Lower Mouth ** + - Cut **2 Lower Jaw ** diff --git a/markdown/org/docs/designs/skully/en.md b/markdown/org/docs/designs/skully/en.md new file mode 100644 index 00000000000..3f413a0467e --- /dev/null +++ b/markdown/org/docs/designs/skully/en.md @@ -0,0 +1,8 @@ +--- +title: Skully +--- + +import { DesignInfo } from 'shared/components/designs/info.mjs' + + + diff --git a/markdown/org/docs/designs/skully/fabric/en.md b/markdown/org/docs/designs/skully/fabric/en.md new file mode 100644 index 00000000000..671699e4040 --- /dev/null +++ b/markdown/org/docs/designs/skully/fabric/en.md @@ -0,0 +1,15 @@ +--- +title: "Skully: Fabric Options" +--- + +## Main Fabric + +This plush toy is best constructed with a felt type fabric. The thickness and limited stretch of a felt fabric allow the plush toy to better create the shape of skully. + +## Hair + +Skully is supposed to have hair. Embroidery floss is well suited for this. + +## Stuffing + +Since this is a plush toy, it will need to be stuffed with material. Most of the time you'll want to use polyester fiberfill (polyfill), but if you have a lot of fabric scraps, you can use shredded scrap fabric. However this may be heavier and less soft than fiberfill. It's also worth thinking about whether your Hi may be at risk of getting dirty, or want to go for a swim, as not all stuffing options are washable. diff --git a/markdown/org/docs/designs/skully/instructions/en.md b/markdown/org/docs/designs/skully/instructions/en.md new file mode 100644 index 00000000000..5c5b2b9d0ad --- /dev/null +++ b/markdown/org/docs/designs/skully/instructions/en.md @@ -0,0 +1,37 @@ +--- +title: "Skully: Sewing Instructions" +--- + +## Step 1: The eyes + +- Sew the eyes into cones by sewing the Sew-Together side together + +## Step 2: The Nose + +- Do the same with the nose, now doing it twice. You'll end up with two cones joined together + +## Step 3: The darts + +- Close all the darts and remove extra fabric. + +## Step 4: The rest + +- All seams have been numbered. It's best to start at seam 1 and work your way through them. Leave an opening in seam 21 to stuff Skully. + +## Step 5: Hair + +- Now is the time to add hair. Add as much or as little as you like. It's a good idea to put knots in the strands as you sew them, for otherwise it's easy to pull them out. + +## Step 6: Stuffing + +- Fill the plush toy with stuffing through the opening you left in seam 21. +- _Slipsticth_ or _whipstitch_ the opening closed. + +## Step 7: Tweaks + +- Once you have Skully sewn and filled, you can use a long needle to sew the back of the eyes and nose to seam 21. This will keep them from inverting, and can shape the toy better. +- With the same long needle, make stitches from seam 6 to 14, shaping the cheeks more. + +## Step 8: Enjoy! + +That's it you are all done! diff --git a/markdown/org/docs/designs/skully/measurements/en.md b/markdown/org/docs/designs/skully/measurements/en.md new file mode 100644 index 00000000000..6e213b7ebf0 --- /dev/null +++ b/markdown/org/docs/designs/skully/measurements/en.md @@ -0,0 +1,7 @@ +--- +title: "Skully: Optional Measurements" +--- + + +Skully can use your head measurement and the pattern will make a skull of your size. + diff --git a/markdown/org/docs/designs/skully/needs/en.md b/markdown/org/docs/designs/skully/needs/en.md new file mode 100644 index 00000000000..e3b90eb2703 --- /dev/null +++ b/markdown/org/docs/designs/skully/needs/en.md @@ -0,0 +1,19 @@ +--- +title: "Skully: What You Need" +--- + +To make Skully, you will need the following: + +- [Basic sewing supplies](/docs/sewing/basic-sewing-supplies) +- About 0.5 meters (0.6 yards) of a suitable fabric ([see Skully Fabric options](/docs/patterns/skully/fabric/)) +- Stuffing +- Optional: Embroidery floss for hair +- Optional: Long upholstery needle as an accessory + + + +This list is based on a default Skully and you may need less or more fabric dependent on the [size you are making Skully](/docs/patterns/skully/options/size/). + +For instance a 300% Skully will need 1.5 meters. + + diff --git a/markdown/org/docs/designs/skully/notes/en.md b/markdown/org/docs/designs/skully/notes/en.md new file mode 100644 index 00000000000..429e33c2e58 --- /dev/null +++ b/markdown/org/docs/designs/skully/notes/en.md @@ -0,0 +1,6 @@ +--- +title: "Skully: Designer Notes" +--- + +Wouter designed this. They have not written any notes (yet) + diff --git a/markdown/org/docs/designs/skully/options/en.md b/markdown/org/docs/designs/skully/options/en.md new file mode 100644 index 00000000000..5c1b5d5e938 --- /dev/null +++ b/markdown/org/docs/designs/skully/options/en.md @@ -0,0 +1,5 @@ +--- +title: "Skully: Design Options" +--- + + diff --git a/markdown/org/docs/designs/skully/options/size/en.md b/markdown/org/docs/designs/skully/options/size/en.md new file mode 100644 index 00000000000..4ea6e1b0da0 --- /dev/null +++ b/markdown/org/docs/designs/skully/options/size/en.md @@ -0,0 +1,7 @@ +--- +title: "Size" +--- + +Skully can be made in different sizes. The default is about a 16cm high. +This is a percentage of this the head circumference. + From 3c7847307e8be27eab682fd176a3d47fc4c59a08 Mon Sep 17 00:00:00 2001 From: woutervdub Date: Thu, 5 Oct 2023 18:30:32 +0000 Subject: [PATCH 25/27] Cutlist --- designs/skully/src/cheekbone.mjs | 2 ++ designs/skully/src/eye.mjs | 2 ++ designs/skully/src/forehead.mjs | 2 ++ designs/skully/src/head1.mjs | 2 ++ designs/skully/src/head2.mjs | 2 ++ designs/skully/src/head3.mjs | 2 ++ designs/skully/src/jawfloor.mjs | 2 ++ designs/skully/src/lowerjaw.mjs | 2 ++ designs/skully/src/lowermouth.mjs | 2 ++ designs/skully/src/nose.mjs | 2 ++ designs/skully/src/uppermouth.mjs | 2 ++ 11 files changed, 22 insertions(+) diff --git a/designs/skully/src/cheekbone.mjs b/designs/skully/src/cheekbone.mjs index dd370898292..9837c5496ac 100644 --- a/designs/skully/src/cheekbone.mjs +++ b/designs/skully/src/cheekbone.mjs @@ -27,6 +27,8 @@ export const cheekbone = { paths.seam = new Path().move(points.point0).join(paths.seam6).join(paths.seam5).close() + store.cutlist.addCut({ cut: 2, from: 'Fabric' }) + points.gridAnchor = points.point0.clone() points.title = points.point0 .shiftFractionTowards(points.point1, 0.65) diff --git a/designs/skully/src/eye.mjs b/designs/skully/src/eye.mjs index dabd84560d1..e7bf3d7f141 100644 --- a/designs/skully/src/eye.mjs +++ b/designs/skully/src/eye.mjs @@ -85,6 +85,8 @@ export const eye = { points.gridAnchor = points.ps3.clone() + store.cutlist.addCut({ cut: 2, from: 'Fabric' }) + macro('sewtogether', { from: points.ps3a, to: points.ps3b, diff --git a/designs/skully/src/forehead.mjs b/designs/skully/src/forehead.mjs index a578d0ee9f4..ae670636179 100644 --- a/designs/skully/src/forehead.mjs +++ b/designs/skully/src/forehead.mjs @@ -106,6 +106,8 @@ export const forehead = { store.set('eyeTop', paths.eyeTop.length()) + store.cutlist.addCut({ cut: 2, from: 'Fabric' }) + points.gridAnchor = points.point0.clone() points.title = points.point3Cp1.shiftFractionTowards(points.point0, 0.3) macro('title', { diff --git a/designs/skully/src/head1.mjs b/designs/skully/src/head1.mjs index 0481ab72c77..47a4211e50c 100644 --- a/designs/skully/src/head1.mjs +++ b/designs/skully/src/head1.mjs @@ -30,6 +30,8 @@ export const head1 = { points.gridAnchor = points.point0.clone() + store.cutlist.addCut({ cut: 2, from: 'Fabric' }) + store.set( 'upperJawToLowerJaw', paths.firstSeam.length() - store.get('firstSeam') - store.get('templeToJaw') diff --git a/designs/skully/src/head2.mjs b/designs/skully/src/head2.mjs index fe2d5cbb902..ace1dfb29fc 100644 --- a/designs/skully/src/head2.mjs +++ b/designs/skully/src/head2.mjs @@ -101,6 +101,8 @@ export const head2 = { .join(paths.top) .close() + store.cutlist.addCut({ cut: 2, from: 'Fabric' }) + points.gridAnchor = points.dartPoint1.clone() points.title = points.dartPoint1.shiftFractionTowards(points.point2, 0.35) macro('title', { diff --git a/designs/skully/src/head3.mjs b/designs/skully/src/head3.mjs index 5bee65f4ef1..2cad908d99a 100644 --- a/designs/skully/src/head3.mjs +++ b/designs/skully/src/head3.mjs @@ -98,6 +98,8 @@ export const head3 = { .join(paths.bottom) .close() + store.cutlist.addCut({ cut: 2, from: 'Fabric' }) + points.title = points.point4 .shiftFractionTowards(points.point1, 0.25) .shiftFractionTowards(points.point0, 0.25) diff --git a/designs/skully/src/jawfloor.mjs b/designs/skully/src/jawfloor.mjs index a4a4367c83f..810d942ad70 100644 --- a/designs/skully/src/jawfloor.mjs +++ b/designs/skully/src/jawfloor.mjs @@ -95,6 +95,8 @@ export const jawfloor = { new Path().move(points.point4).curve(points.point4, points.point5Cp2, points.point5).length() ) + store.cutlist.addCut({ cut: 1, from: 'Fabric' }) + points.title = points.point6.shiftFractionTowards(points.point5, 0.5) macro('title', { nr: 8, diff --git a/designs/skully/src/lowerjaw.mjs b/designs/skully/src/lowerjaw.mjs index cebe56fe938..8bf9dcfb63b 100644 --- a/designs/skully/src/lowerjaw.mjs +++ b/designs/skully/src/lowerjaw.mjs @@ -96,6 +96,8 @@ export const lowerjaw = { store.set('bottomJaw', paths.bottomJaw.length()) + store.cutlist.addCut({ cut: 2, from: 'Fabric' }) + points.gridAnchor = points.point5.clone() points.title = points.point1.shiftFractionTowards(points.point4, 0.25) macro('title', { diff --git a/designs/skully/src/lowermouth.mjs b/designs/skully/src/lowermouth.mjs index fecacec921d..afee97bbc1b 100644 --- a/designs/skully/src/lowermouth.mjs +++ b/designs/skully/src/lowermouth.mjs @@ -49,6 +49,8 @@ export const lowermouth = { .line(points.point0) .close() + store.cutlist.addCut({ cut: 1, from: 'Fabric' }) + points.gridAnchor = points.point1.clone() points.title = points.point0 .shiftFractionTowards(points.point2, 0.25) diff --git a/designs/skully/src/nose.mjs b/designs/skully/src/nose.mjs index cf41ed4f559..777149852f7 100644 --- a/designs/skully/src/nose.mjs +++ b/designs/skully/src/nose.mjs @@ -81,6 +81,8 @@ export const nose = { .join(paths.p2) .close() + store.cutlist.addCut({ cut: 1, from: 'Fabric' }) + points.gridAnchor = points.point0.clone() points.title = points.point0.shiftFractionTowards(points.point3, 0.5) macro('title', { diff --git a/designs/skully/src/uppermouth.mjs b/designs/skully/src/uppermouth.mjs index 0456a9c4890..c9e3971be2a 100644 --- a/designs/skully/src/uppermouth.mjs +++ b/designs/skully/src/uppermouth.mjs @@ -175,6 +175,8 @@ export const uppermouth = { store.set('lowerJaw', paths.lowerJaw1.length() + points.point1.dist(points.point2)) + store.cutlist.addCut({ cut: 1, from: 'Fabric' }) + points.gridAnchor = points.point0.clone() points.title = points.pointM1.shiftFractionTowards(points.point6, 0.5) macro('title', { From ff7058bdaab1bf4f10867059ba53e233b90bdb75 Mon Sep 17 00:00:00 2001 From: woutervdub Date: Thu, 5 Oct 2023 20:16:57 +0000 Subject: [PATCH 26/27] Implements #5068 --- config/software/designs.json | 2 +- designs/skully/i18n/en.json | 15 +-------------- designs/skully/i18n/uk.json | 31 +++++++++---------------------- designs/skully/src/cheek.mjs | 4 +++- designs/skully/src/cheekbone.mjs | 2 +- designs/skully/src/eye.mjs | 2 +- designs/skully/src/forehead.mjs | 2 +- designs/skully/src/head1.mjs | 2 +- designs/skully/src/head2.mjs | 2 +- designs/skully/src/head3.mjs | 2 +- designs/skully/src/jawfloor.mjs | 2 +- designs/skully/src/lowerjaw.mjs | 2 +- designs/skully/src/lowermouth.mjs | 2 +- designs/skully/src/nose.mjs | 2 +- designs/skully/src/uppermouth.mjs | 2 +- 15 files changed, 25 insertions(+), 49 deletions(-) diff --git a/config/software/designs.json b/config/software/designs.json index 97e7879c091..8faf1c40397 100644 --- a/config/software/designs.json +++ b/config/software/designs.json @@ -340,7 +340,7 @@ "description": "A FreeSewing pattern for skully, our logo, a plushy toy", "code": "Wouter Van Wageningen", "design": "Wouter Van Wageningen", - "difficulty": 5, + "difficulty": 4, "tags": ["accessories", "toys"], "techniques": ["curvedSeam", "precision"] }, diff --git a/designs/skully/i18n/en.json b/designs/skully/i18n/en.json index 1ea48d2aec5..4fdd6b0ccc3 100644 --- a/designs/skully/i18n/en.json +++ b/designs/skully/i18n/en.json @@ -15,20 +15,7 @@ "nose": "Nose", "uppermouth": "Upper Mouth" }, - "s": { - "cheek": "Cheek", - "cheekbone": "Cheekbone", - "eye": "Eye", - "forehead": "Forehead", - "head1": "Head part 1", - "head2": "Head part 2", - "head3": "Head part 3", - "jawfloor": "Jaw floor", - "lowerjaw": "Lower Jaw", - "lowermouth": "Lower Mouth", - "nose": "Nose", - "uppermouth": "Upper Mouth" - }, + "s": {}, "o": { "size": { "t": "Size", diff --git a/designs/skully/i18n/uk.json b/designs/skully/i18n/uk.json index cf2665157a0..4fdd6b0ccc3 100644 --- a/designs/skully/i18n/uk.json +++ b/designs/skully/i18n/uk.json @@ -6,33 +6,20 @@ "cheekbone": "Cheekbone", "eye": "Eye", "forehead": "Forehead", - "head1": "Head1", - "head2": "Head2", - "head3": "Head3", - "jawfloor": "Jawfloor", - "lowerjaw": "Lowerjaw", - "lowermouth": "Lowermouth", + "head1": "Head part 1", + "head2": "Head part 2", + "head3": "Head part 3", + "jawfloor": "Jaw floor", + "lowerjaw": "Lower Jaw", + "lowermouth": "Lower Mouth", "nose": "Nose", - "uppermouth": "Uppermouth" - }, - "s": { - "cheek": "Cheek", - "cheekbone": "Cheekbone", - "eye": "Eye", - "forehead": "Forehead", - "head1": "Head1", - "head2": "Head2", - "head3": "Head3", - "jawfloor": "Jawfloor", - "lowerjaw": "Lowerjaw", - "lowermouth": "Lowermouth", - "nose": "Nose", - "uppermouth": "Uppermouth" + "uppermouth": "Upper Mouth" }, + "s": {}, "o": { "size": { "t": "Size", - "d": "Controls the overall size (value shown is the size of the head)" + "d": "Controls the overall size (value shown is the resulting height of Skully)" } } } diff --git a/designs/skully/src/cheek.mjs b/designs/skully/src/cheek.mjs index 5e8fa8dc73d..46f2aed4285 100644 --- a/designs/skully/src/cheek.mjs +++ b/designs/skully/src/cheek.mjs @@ -1,5 +1,5 @@ export const cheek = { - name: 'cheek', + name: 'skully.cheek', options: { size: { pct: 75, @@ -149,6 +149,8 @@ export const cheek = { store.set('noseSide', paths.nose.length()) store.set('noseHeight', points.point1.dist(points.point2)) + store.cutlist.addCut({ cut: 2, from: 'Fabric' }) + points.title = points.point4Cp2.shiftFractionTowards(points.point0, 0.3) macro('title', { nr: 1, diff --git a/designs/skully/src/cheekbone.mjs b/designs/skully/src/cheekbone.mjs index 9837c5496ac..357b1c37d77 100644 --- a/designs/skully/src/cheekbone.mjs +++ b/designs/skully/src/cheekbone.mjs @@ -1,7 +1,7 @@ import { cheek } from './cheek.mjs' export const cheekbone = { - name: 'cheekbone', + name: 'skully.cheekbone', after: cheek, draft: ({ Point, Path, points, paths, sa, complete, store, macro, part }) => { const textAttribute = 'text-xs center text-decoration="line-through"' diff --git a/designs/skully/src/eye.mjs b/designs/skully/src/eye.mjs index e7bf3d7f141..f3716fd300e 100644 --- a/designs/skully/src/eye.mjs +++ b/designs/skully/src/eye.mjs @@ -2,7 +2,7 @@ import { cheek } from './cheek.mjs' import { forehead } from './forehead.mjs' export const eye = { - name: 'eye', + name: 'skully.eye', after: [cheek, forehead], draft: ({ Point, Path, points, paths, Snippet, snippets, sa, complete, store, macro, part }) => { const textAttribute = 'text-xs center' diff --git a/designs/skully/src/forehead.mjs b/designs/skully/src/forehead.mjs index ae670636179..fb29d67da00 100644 --- a/designs/skully/src/forehead.mjs +++ b/designs/skully/src/forehead.mjs @@ -1,7 +1,7 @@ import { cheek } from './cheek.mjs' export const forehead = { - name: 'forehead', + name: 'skully.forehead', after: cheek, draft: ({ Point, Path, points, paths, Snippet, snippets, sa, complete, store, macro, part }) => { const textAttribute = 'text-xs center' diff --git a/designs/skully/src/head1.mjs b/designs/skully/src/head1.mjs index 47a4211e50c..180a6d86ea3 100644 --- a/designs/skully/src/head1.mjs +++ b/designs/skully/src/head1.mjs @@ -2,7 +2,7 @@ import { cheek } from './cheek.mjs' import { forehead } from './forehead.mjs' export const head1 = { - name: 'head1', + name: 'skully.head1', after: [cheek, forehead], draft: ({ Point, Path, points, paths, Snippet, snippets, sa, complete, store, macro, part }) => { const textAttribute = 'text-xs center' diff --git a/designs/skully/src/head2.mjs b/designs/skully/src/head2.mjs index ace1dfb29fc..675919e4fb0 100644 --- a/designs/skully/src/head2.mjs +++ b/designs/skully/src/head2.mjs @@ -2,7 +2,7 @@ import { cheek } from './cheek.mjs' import { head1 } from './head1.mjs' export const head2 = { - name: 'head2', + name: 'skully.head2', after: [cheek, head1], draft: ({ Point, Path, points, paths, sa, complete, log, store, macro, part }) => { const textAttribute = 'text-xs center' diff --git a/designs/skully/src/head3.mjs b/designs/skully/src/head3.mjs index 2cad908d99a..7d98fe58c53 100644 --- a/designs/skully/src/head3.mjs +++ b/designs/skully/src/head3.mjs @@ -3,7 +3,7 @@ import { head2 } from './head2.mjs' import { jawfloor } from './jawfloor.mjs' export const head3 = { - name: 'head3', + name: 'skully.head3', after: [cheek, head2, jawfloor], draft: ({ Point, Path, points, paths, sa, complete, log, store, macro, utils, part }) => { const textAttribute = 'text-xs center' diff --git a/designs/skully/src/jawfloor.mjs b/designs/skully/src/jawfloor.mjs index 810d942ad70..02e57e54b6e 100644 --- a/designs/skully/src/jawfloor.mjs +++ b/designs/skully/src/jawfloor.mjs @@ -2,7 +2,7 @@ import { cheek } from './cheek.mjs' import { lowerjaw } from './lowerjaw.mjs' export const jawfloor = { - name: 'jawfloor', + name: 'skully.jawfloor', after: [cheek, lowerjaw], draft: ({ Point, Path, points, paths, sa, complete, store, macro, part }) => { const textAttribute = 'text-xs center' diff --git a/designs/skully/src/lowerjaw.mjs b/designs/skully/src/lowerjaw.mjs index 8bf9dcfb63b..ffeddf8e0cb 100644 --- a/designs/skully/src/lowerjaw.mjs +++ b/designs/skully/src/lowerjaw.mjs @@ -2,7 +2,7 @@ import { cheek } from './cheek.mjs' import { uppermouth } from './uppermouth.mjs' export const lowerjaw = { - name: 'lowerjaw', + name: 'skully.lowerjaw', after: [cheek, uppermouth], draft: ({ Point, Path, points, paths, sa, complete, log, store, macro, part }) => { const textAttribute = 'text-xs center' diff --git a/designs/skully/src/lowermouth.mjs b/designs/skully/src/lowermouth.mjs index afee97bbc1b..948c7bda011 100644 --- a/designs/skully/src/lowermouth.mjs +++ b/designs/skully/src/lowermouth.mjs @@ -1,7 +1,7 @@ import { cheek } from './cheek.mjs' export const lowermouth = { - name: 'lowermouth', + name: 'skully.lowermouth', after: cheek, draft: ({ Point, Path, points, paths, sa, complete, store, macro, part }) => { const textAttribute = 'text-xs center' diff --git a/designs/skully/src/nose.mjs b/designs/skully/src/nose.mjs index 777149852f7..5acea1301a6 100644 --- a/designs/skully/src/nose.mjs +++ b/designs/skully/src/nose.mjs @@ -3,7 +3,7 @@ import { eye } from './eye.mjs' import { forehead } from './forehead.mjs' export const nose = { - name: 'nose', + name: 'skully.nose', after: [cheek, forehead, eye], draft: ({ Point, diff --git a/designs/skully/src/uppermouth.mjs b/designs/skully/src/uppermouth.mjs index c9e3971be2a..10f69ff03ec 100644 --- a/designs/skully/src/uppermouth.mjs +++ b/designs/skully/src/uppermouth.mjs @@ -3,7 +3,7 @@ import { head1 } from './head1.mjs' import { lowermouth } from './lowermouth.mjs' export const uppermouth = { - name: 'uppermouth', + name: 'skully.uppermouth', after: [cheek, head1, lowermouth], draft: ({ Point, Path, points, paths, sa, complete, store, macro, part }) => { const textAttribute = 'text-xs center' From e402e73f86c8ab49e8725a6dc7e595aaddd8a9ab Mon Sep 17 00:00:00 2001 From: woutervdub Date: Thu, 5 Oct 2023 20:33:26 +0000 Subject: [PATCH 27/27] Forgotten docs. --- markdown/org/docs/designs/skully/fabric/en.md | 10 +++- .../docs/designs/skully/instructions/en.md | 56 ++++++++++++++----- .../docs/designs/skully/measurements/en.md | 2 +- markdown/org/docs/designs/skully/needs/en.md | 8 +-- .../docs/designs/skully/options/size/en.md | 5 +- 5 files changed, 58 insertions(+), 23 deletions(-) diff --git a/markdown/org/docs/designs/skully/fabric/en.md b/markdown/org/docs/designs/skully/fabric/en.md index 671699e4040..d3361fe60f1 100644 --- a/markdown/org/docs/designs/skully/fabric/en.md +++ b/markdown/org/docs/designs/skully/fabric/en.md @@ -4,12 +4,18 @@ title: "Skully: Fabric Options" ## Main Fabric -This plush toy is best constructed with a felt type fabric. The thickness and limited stretch of a felt fabric allow the plush toy to better create the shape of skully. +This plush toy is best made from a felt type of fabric. This will provide extra rigidity to keep the shape +correct, while still allowing it to be a plush toy. Thin and stretchy fabrics are not well suited, because +the shape will change considerably due to tensions from the stuffing. ## Hair -Skully is supposed to have hair. Embroidery floss is well suited for this. +Skully needs hair. Embrodery floss works very well, and can be had in all colors. ## Stuffing Since this is a plush toy, it will need to be stuffed with material. Most of the time you'll want to use polyester fiberfill (polyfill), but if you have a lot of fabric scraps, you can use shredded scrap fabric. However this may be heavier and less soft than fiberfill. It's also worth thinking about whether your Hi may be at risk of getting dirty, or want to go for a swim, as not all stuffing options are washable. + +## Needle + +Skully has traded his sword for a needle. A needle this size is mostly sold as upholstery needles. This will come in handy when doing some of the touch-ups at the end of the construction. \ No newline at end of file diff --git a/markdown/org/docs/designs/skully/instructions/en.md b/markdown/org/docs/designs/skully/instructions/en.md index 5c5b2b9d0ad..d77de935ce7 100644 --- a/markdown/org/docs/designs/skully/instructions/en.md +++ b/markdown/org/docs/designs/skully/instructions/en.md @@ -2,36 +2,64 @@ title: "Skully: Sewing Instructions" --- -## Step 1: The eyes -- Sew the eyes into cones by sewing the Sew-Together side together + -## Step 2: The Nose +A lot of the smaller seams (eyes, nose) are best sewn by hand. -- Do the same with the nose, now doing it twice. You'll end up with two cones joined together +Most of the seams will benefit from being basted before being sewn. -## Step 3: The darts + -- Close all the darts and remove extra fabric. +## Step 1: The darts -## Step 4: The rest +There are six darts that need to be closed first. One on each, forhead, head2, and head3 parts. Pin and sew them closed, then remove the bulk by trimming the darts and give them a good press. Repeat for the all six darts. -- All seams have been numbered. It's best to start at seam 1 and work your way through them. Leave an opening in seam 21 to stuff Skully. + +## Step 2: The eyes + +Sew together the sides of the eye, so you will make a cone. Trim away any bulk. Repeat for the other eye. + +## Step 3: The nose + +Like the eyes, the nose too has parts that need to be sewn together. There are two of these sides that need to be sew together. This creates two connected cones. This is very finicky, so take your time. + +## Step 4: The head + + + +The Skully pattern is set up to be sewn-by-numbers. Every seam is numbered. Please start at '1', and +keep going until you reach '21'. This is the seam through which you will fill Skully, so only close +it partly. + + + +When you are sewing together the individual parts, you will be making two halves of the skull. + +Sewing the eyes and nose to the cheek and forehead parts is best done by hand. You will have to align the different notches to their corresponding ones on the other part. + +Sewing the lowerJaw to the lowerMouth and upperMouth is challenging. You will first be sewing a normal seam between the lowerJaw parts and the lowerMouth part. You will then have to continue this seam along +the dashed line (14) on the upperMouth part. Basting or lots of pins are your friend. And make sure you +first visualize how this will get together before doing the final sewing. + +The back of the upperMouth is not sewn to anything. It is just there to provide stability. ## Step 5: Hair -- Now is the time to add hair. Add as much or as little as you like. It's a good idea to put knots in the strands as you sew them, for otherwise it's easy to pull them out. +Now is the time to add hair to skully. When putting the embroidery floss in, make sure you add knots on the inside, or else it is very easy to pull Skully's hair out later. ## Step 6: Stuffing -- Fill the plush toy with stuffing through the opening you left in seam 21. +- Fill the plush toy with stuffing through the opening you left, making sure to fill all the parts +well. The areas in the front are the hardest to get to. - _Slipsticth_ or _whipstitch_ the opening closed. ## Step 7: Tweaks -- Once you have Skully sewn and filled, you can use a long needle to sew the back of the eyes and nose to seam 21. This will keep them from inverting, and can shape the toy better. -- With the same long needle, make stitches from seam 6 to 14, shaping the cheeks more. +You can use the long upholstery needle to add some tweaks to Skully. Adding some stitches to attach the back of the eyes to corner of seams 14 and 21 right through the skull will help to keep the eyes from popping out, and can help with giving the head more form. The same applies to the nose. -## Step 8: Enjoy! +It is also a good idea to add stitches between seams 5 and 14, along the length of both seams. This will make the cheek bones more pronounced and adds to the overall shape of the skull. -That's it you are all done! +## Step 7: Enjoy! + +That's it, you are all done. Start planning what pirate sewing ship you'll be joining! \ No newline at end of file diff --git a/markdown/org/docs/designs/skully/measurements/en.md b/markdown/org/docs/designs/skully/measurements/en.md index 6e213b7ebf0..96e37b1b50e 100644 --- a/markdown/org/docs/designs/skully/measurements/en.md +++ b/markdown/org/docs/designs/skully/measurements/en.md @@ -3,5 +3,5 @@ title: "Skully: Optional Measurements" --- -Skully can use your head measurement and the pattern will make a skull of your size. +Skully does not require any measurements, but it can use the head circumference measurement. If used, Skully will be approximately the same size as your head. diff --git a/markdown/org/docs/designs/skully/needs/en.md b/markdown/org/docs/designs/skully/needs/en.md index e3b90eb2703..4d4e8186ec1 100644 --- a/markdown/org/docs/designs/skully/needs/en.md +++ b/markdown/org/docs/designs/skully/needs/en.md @@ -7,13 +7,13 @@ To make Skully, you will need the following: - [Basic sewing supplies](/docs/sewing/basic-sewing-supplies) - About 0.5 meters (0.6 yards) of a suitable fabric ([see Skully Fabric options](/docs/patterns/skully/fabric/)) - Stuffing -- Optional: Embroidery floss for hair -- Optional: Long upholstery needle as an accessory +- Embroidery floss for the hair +- Appropriately sized upholstery needle -This list is based on a default Skully and you may need less or more fabric dependent on the [size you are making Skully](/docs/patterns/skully/options/size/). +This list is based on a default Skully and you may need less or more fabric dependant on the [size you are making Skully](/docs/patterns/skully/options/size/). -For instance a 300% Skully will need 1.5 meters. +For instance a 300% Skully will need 1.5 meters (0.5 meter x 300% = 1.5 meters) and a 50% skully will need 0.25 meters (0.5 meter x 50% = 0.25 meters). diff --git a/markdown/org/docs/designs/skully/options/size/en.md b/markdown/org/docs/designs/skully/options/size/en.md index 4ea6e1b0da0..77bb4ae0f34 100644 --- a/markdown/org/docs/designs/skully/options/size/en.md +++ b/markdown/org/docs/designs/skully/options/size/en.md @@ -2,6 +2,7 @@ title: "Size" --- -Skully can be made in different sizes. The default is about a 16cm high. -This is a percentage of this the head circumference. +Skully can be made in different sizes. The default is about 75% of a normal human head (about 16cm high). +If you set the percentage to 100%, and you enter your own head measurwement, Skully will +be approximately the size of your head. \ No newline at end of file