chore(huey): Port to v3 stage 2
This commit is contained in:
parent
c89e5e9569
commit
538fc7f414
9 changed files with 82 additions and 52 deletions
|
@ -2,10 +2,20 @@ import { pluginBundle } from '@freesewing/plugin-bundle'
|
||||||
import { back as brianBack } from '@freesewing/brian'
|
import { back as brianBack } from '@freesewing/brian'
|
||||||
import { sharedDimensions } from './shared.mjs'
|
import { sharedDimensions } from './shared.mjs'
|
||||||
|
|
||||||
function draftHueyBack (part) {
|
function draftHueyBack({
|
||||||
let { store, macro, Path, Point, points, paths, complete, paperless, sa, options, measurements } =
|
store,
|
||||||
part.shorthand()
|
macro,
|
||||||
|
Path,
|
||||||
|
Point,
|
||||||
|
points,
|
||||||
|
paths,
|
||||||
|
complete,
|
||||||
|
paperless,
|
||||||
|
sa,
|
||||||
|
options,
|
||||||
|
measurements,
|
||||||
|
part,
|
||||||
|
}) {
|
||||||
// Clear paths from Brian
|
// Clear paths from Brian
|
||||||
for (let i in paths) {
|
for (let i in paths) {
|
||||||
if (['backArmhole', 'backCollar'].indexOf(i) === -1) delete paths[i]
|
if (['backArmhole', 'backCollar'].indexOf(i) === -1) delete paths[i]
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import { pluginBundle } from '@freesewing/plugin-bundle'
|
import { pluginBundle } from '@freesewing/plugin-bundle'
|
||||||
import { draftRibbing } from './shared.mjs'
|
import { draftRibbing } from './shared.mjs'
|
||||||
|
|
||||||
function draftHueyCuff (part) {
|
function draftHueyCuff({ complete, points, measurements, options, macro, part }) {
|
||||||
let { complete, points, measurements, options, macro } = part.shorthand()
|
|
||||||
if (!options.ribbing) return part
|
if (!options.ribbing) return part
|
||||||
|
|
||||||
draftRibbing(part, measurements.wrist * (1 + options.cuffEase) * (1 - options.ribbingStretch))
|
draftRibbing(part, measurements.wrist * (1 + options.cuffEase) * (1 - options.ribbingStretch))
|
||||||
|
|
|
@ -2,10 +2,20 @@ import { front as brianFront } from '@freesewing/brian'
|
||||||
import { back } from './back.mjs'
|
import { back } from './back.mjs'
|
||||||
import { sharedDimensions } from './shared.mjs'
|
import { sharedDimensions } from './shared.mjs'
|
||||||
|
|
||||||
function draftHueyFront (part) {
|
function draftHueyFront({
|
||||||
let { utils, store, Point, Path, points, paths, complete, paperless, sa, options, measurements } =
|
utils,
|
||||||
part.shorthand()
|
store,
|
||||||
|
Point,
|
||||||
|
Path,
|
||||||
|
points,
|
||||||
|
paths,
|
||||||
|
complete,
|
||||||
|
paperless,
|
||||||
|
sa,
|
||||||
|
options,
|
||||||
|
measurements,
|
||||||
|
part,
|
||||||
|
}) {
|
||||||
// Clear paths from Brian
|
// Clear paths from Brian
|
||||||
for (let i in paths) {
|
for (let i in paths) {
|
||||||
if (['frontArmhole', 'frontCollar'].indexOf(i) === -1) delete paths[i]
|
if (['frontArmhole', 'frontCollar'].indexOf(i) === -1) delete paths[i]
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import { front } from './front.mjs'
|
import { front } from './front.mjs'
|
||||||
import { back } from './back.mjs'
|
import { back } from './back.mjs'
|
||||||
|
|
||||||
function draftHueyHood (part) {
|
function draftHueyHood({
|
||||||
let {
|
|
||||||
store,
|
store,
|
||||||
macro,
|
macro,
|
||||||
Point,
|
Point,
|
||||||
|
@ -16,8 +15,8 @@ function draftHueyHood (part) {
|
||||||
sa,
|
sa,
|
||||||
options,
|
options,
|
||||||
measurements,
|
measurements,
|
||||||
} = part.shorthand()
|
part,
|
||||||
|
}) {
|
||||||
let base = store.get('frontNeckSeamLength') + store.get('backNeckSeamLength')
|
let base = store.get('frontNeckSeamLength') + store.get('backNeckSeamLength')
|
||||||
points.cfBottom = new Point(0, 0)
|
points.cfBottom = new Point(0, 0)
|
||||||
points.cbBottom = points.cfBottom.shift(0, base).rotate(options.hoodAngle, points.cfBottom)
|
points.cbBottom = points.cfBottom.shift(0, base).rotate(options.hoodAngle, points.cfBottom)
|
||||||
|
|
|
@ -12,13 +12,8 @@ import { cuff } from './cuff.mjs'
|
||||||
// Create design
|
// Create design
|
||||||
const Huey = new Design({
|
const Huey = new Design({
|
||||||
data,
|
data,
|
||||||
parts: [
|
parts: [back, front, sleeve, pocket, hood, waistband, cuff],
|
||||||
back, front, sleeve, pocket, hood, waistband, cuff,
|
|
||||||
],
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// Named exports
|
// Named exports
|
||||||
export {
|
export { back, front, sleeve, pocket, hood, waistband, cuff, Huey }
|
||||||
back, front, sleeve, pocket, hood, waistband, cuff,
|
|
||||||
Huey,
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,9 +1,18 @@
|
||||||
import { front } from './front.mjs'
|
import { front } from './front.mjs'
|
||||||
|
|
||||||
function draftHueyPocket (part) {
|
function draftHueyPocket({
|
||||||
let { macro, Path, points, paths, complete, paperless, snippets, Snippet, sa, options } =
|
macro,
|
||||||
part.shorthand()
|
Path,
|
||||||
|
points,
|
||||||
|
paths,
|
||||||
|
complete,
|
||||||
|
paperless,
|
||||||
|
snippets,
|
||||||
|
Snippet,
|
||||||
|
sa,
|
||||||
|
options,
|
||||||
|
part,
|
||||||
|
}) {
|
||||||
if (!options.pocket) return part
|
if (!options.pocket) return part
|
||||||
|
|
||||||
// Clear paths and snippets
|
// Clear paths and snippets
|
||||||
|
|
|
@ -1,10 +1,19 @@
|
||||||
import { sleeve as brianSleeve } from '@freesewing/brian'
|
import { sleeve as brianSleeve } from '@freesewing/brian'
|
||||||
import { back } from './back.mjs'
|
import { back } from './back.mjs'
|
||||||
|
|
||||||
function draftHueySleeve (part) {
|
function draftHueySleeve({
|
||||||
let { Point, Path, points, paths, store, options, complete, sa, paperless, macro } =
|
Point,
|
||||||
part.shorthand()
|
Path,
|
||||||
|
points,
|
||||||
|
paths,
|
||||||
|
store,
|
||||||
|
options,
|
||||||
|
complete,
|
||||||
|
sa,
|
||||||
|
paperless,
|
||||||
|
macro,
|
||||||
|
part,
|
||||||
|
}) {
|
||||||
// Clear paths from Brian, but keep sleevecap
|
// Clear paths from Brian, but keep sleevecap
|
||||||
for (let p of Object.keys(paths)) {
|
for (let p of Object.keys(paths)) {
|
||||||
if (p !== 'sleevecap') delete paths[p]
|
if (p !== 'sleevecap') delete paths[p]
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import { pluginBundle } from '@freesewing/plugin-bundle'
|
import { pluginBundle } from '@freesewing/plugin-bundle'
|
||||||
import { draftRibbing } from './shared.mjs'
|
import { draftRibbing } from './shared.mjs'
|
||||||
|
|
||||||
function draftHueyWaistband (part) {
|
function draftHueyWaistband({ complete, points, measurements, options, macro, part }) {
|
||||||
let { complete, points, measurements, options, macro } = part.shorthand()
|
|
||||||
if (!options.ribbing) return part
|
if (!options.ribbing) return part
|
||||||
|
|
||||||
draftRibbing(part, measurements.hips * (1 + options.hipsEase) * (1 - options.ribbingStretch))
|
draftRibbing(part, measurements.hips * (1 + options.hipsEase) * (1 - options.ribbingStretch))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue