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