1
0
Fork 0

chore(paco): Port to v3 stage 2

This commit is contained in:
joostdecock 2022-09-11 16:11:49 +02:00
parent f3313cdb57
commit 1812f70f3f
8 changed files with 104 additions and 55 deletions

View file

@ -2,7 +2,20 @@ import { back as titanBack } from '@freesewing/titan'
import { pctBasedOn } from '@freesewing/core'
import { elastics, smallSteps } from '@freesewing/snapseries'
function pacoBack(part) {
function pacoBack({
store,
sa,
points,
Path,
paths,
options,
measurements,
complete,
paperless,
macro,
absoluteOptions,
part,
}) {
/*
* Helper method to draw the inseam path
*/
@ -45,21 +58,6 @@ function pacoBack(part) {
.close()
}
// Shorthand call
let {
store,
sa,
points,
Path,
paths,
options,
measurements,
complete,
paperless,
macro,
absoluteOptions,
} = part.shorthand()
// Adapt bottom leg width based on heel & heel ease
let quarterHeel = (measurements.heel * (1 + options.heelEase) * options.legBalance) / 2
points.floorOut = points.floor.shift(0, quarterHeel)

View file

@ -1,9 +1,17 @@
import { back } from './back.mjs'
function pacoBackPocketBag(part) {
const { sa, points, Path, paths, snippets, options, complete, paperless, macro } =
part.shorthand()
function pacoBackPocketBag({
sa,
points,
Path,
paths,
snippets,
options,
complete,
paperless,
macro,
part,
}) {
// Don't bother of we're not drafting back pockets
if (!options.backPockets) {
part.render = false

View file

@ -1,9 +1,18 @@
import { backPocketBag } from './backpocketbag.mjs'
function pacoBackPocketWelt(part) {
const { sa, Point, points, Path, paths, snippets, options, complete, paperless, macro } =
part.shorthand()
function pacoBackPocketWelt({
sa,
Point,
points,
Path,
paths,
snippets,
options,
complete,
paperless,
macro,
part,
}) {
// Don't bother of we're not drafting back pockets
if (!options.backPockets) {
part.render = false

View file

@ -1,8 +1,16 @@
import { backPocketWelt } from './backpocketwelt.mjs'
function pacoBackPocketWeltInterfacing(part) {
const { points, Path, paths, snippets, options, complete, paperless, macro } = part.shorthand()
function pacoBackPocketWeltInterfacing({
points,
Path,
paths,
snippets,
options,
complete,
paperless,
macro,
part,
}) {
// Don't bother of we're not drafting back pockets
if (!options.backPockets) {
part.render = false

View file

@ -1,8 +1,18 @@
import { front } from './front.mjs'
function pacoCuff(part) {
const { store, sa, Point, points, Path, paths, options, complete, paperless, macro } =
part.shorthand()
function pacoCuff({
store,
sa,
Point,
points,
Path,
paths,
options,
complete,
paperless,
macro,
part,
}) {
if (!options.elasticatedHem) {
part.render = false
return part

View file

@ -1,7 +1,22 @@
import { front as titanFront } from '@freesewing/titan'
import { back } from './back.mjs'
function pacoFront(part) {
function pacoFront({
utils,
store,
sa,
Point,
points,
Path,
paths,
options,
measurements,
complete,
paperless,
macro,
absoluteOptions,
part,
}) {
/*
* Helper method to draw the inseam path
*/
@ -54,22 +69,6 @@ function pacoFront(part) {
*/
const outseamDelta = () => drawOutseam(true).length() - store.get('pacoOutseamBack')
let {
utils,
store,
sa,
Point,
points,
Path,
paths,
options,
measurements,
complete,
paperless,
macro,
absoluteOptions,
} = part.shorthand()
// Adapt bottom leg based on heel and heel ease
let quarterHeel = (measurements.heel * (1 + options.heelEase) * (1 - options.legBalance)) / 2
points.floorOut = points.floor.shift(180, quarterHeel)

View file

@ -1,9 +1,17 @@
import { front } from './front.mjs'
function pacoFrontPocketBag(part) {
const { sa, points, Path, paths, snippets, options, complete, paperless, macro } =
part.shorthand()
function pacoFrontPocketBag({
sa,
points,
Path,
paths,
snippets,
options,
complete,
paperless,
macro,
part,
}) {
// Don't bother of we're not drafting front pockets
if (!options.frontPockets) {
part.render = false

View file

@ -1,9 +1,18 @@
import { back } from './back.mjs'
function pacoWaistband(part) {
const { utils, store, sa, Point, points, Path, paths, complete, paperless, macro } =
part.shorthand()
function pacoWaistband({
utils,
store,
sa,
Point,
points,
Path,
paths,
complete,
paperless,
macro,
part,
}) {
points.topLeft = new Point(0, 0)
points.midLeft = new Point(0, store.get('waistbandWidth'))
points.bottomLeft = new Point(0, store.get('waistbandWidth') * 2)