1
0
Fork 0

chore(shin): Port to v3 stage 2

This commit is contained in:
joostdecock 2022-09-11 16:40:43 +02:00
parent 42b8207079
commit 495e8d24a1
3 changed files with 48 additions and 51 deletions

View file

@ -2,24 +2,23 @@ import { pctBasedOn } from '@freesewing/core'
import { elastics } from '@freesewing/snapseries' import { elastics } from '@freesewing/snapseries'
import { pluginBundle } from '@freesewing/plugin-bundle' import { pluginBundle } from '@freesewing/plugin-bundle'
function shinBack(part) { function shinBack({
const { store,
store, macro,
macro, Point,
Point, Path,
Path, points,
points, paths,
paths, complete,
complete, paperless,
paperless, snippets,
snippets, Snippet,
Snippet, sa,
sa, options,
options, measurements,
measurements, utils,
utils, part,
} = part.shorthand() }) {
// Store some helper variables // Store some helper variables
store.set('hips', (measurements.hips / 2) * utils.stretchToScale(options.stretch)) store.set('hips', (measurements.hips / 2) * utils.stretchToScale(options.stretch))
store.set('hipFront', store.get('hips') * options.frontFactor) store.set('hipFront', store.get('hips') * options.frontFactor)

View file

@ -1,23 +1,22 @@
import { back } from './back.mjs' import { back } from './back.mjs'
function shinFront(part) { function shinFront({
const { store,
store, macro,
macro, Point,
Point, Path,
Path, points,
points, paths,
paths, complete,
complete, paperless,
paperless, snippets,
snippets, Snippet,
Snippet, sa,
sa, options,
options, measurements,
measurements, utils,
utils, part,
} = part.shorthand() }) {
let angle = -12 let angle = -12
let bulge = (measurements.waistToUpperLeg - measurements.waistToHips) * options.bulge let bulge = (measurements.waistToUpperLeg - measurements.waistToHips) * options.bulge
points.hipSide = new Point(0, 0) points.hipSide = new Point(0, 0)

View file

@ -1,20 +1,19 @@
import { back } from './back.mjs' import { back } from './back.mjs'
function shinWaistband(part) { function shinWaistband({
const { store,
store, macro,
macro, Point,
Point, Path,
Path, points,
points, paths,
paths, complete,
complete, paperless,
paperless, sa,
sa, utils,
utils, absoluteOptions,
absoluteOptions, part,
} = part.shorthand() }) {
const height = absoluteOptions.elasticWidth * 2 const height = absoluteOptions.elasticWidth * 2
points.topLeft = new Point(0, 0) points.topLeft = new Point(0, 0)
points.bottomLeft = new Point(0, height) points.bottomLeft = new Point(0, height)