1
0
Fork 0

chore(hortensia): Port to v3 stage 2

This commit is contained in:
joostdecock 2022-09-11 14:34:00 +02:00
parent 1cd21a38b8
commit c89e5e9569
8 changed files with 91 additions and 72 deletions

View file

@ -1,7 +1,6 @@
import { sidepanel } from './sidepanel.mjs'
function draftHortensiaBottompanel (part) {
let {
function draftHortensiaBottompanel({
store,
options,
Point,
@ -14,8 +13,8 @@ function draftHortensiaBottompanel (part) {
sa,
paperless,
macro,
} = part.shorthand()
part,
}) {
let w = store.get('bottomPanelLength')
let h = store.get('depth')

View file

@ -1,7 +1,6 @@
import { sidepanel } from './sidepanel.mjs'
function draftHortensiaFrontpanel (part) {
let {
function draftHortensiaFrontpanel({
store,
options,
Point,
@ -14,8 +13,8 @@ function draftHortensiaFrontpanel (part) {
sa,
paperless,
macro,
} = part.shorthand()
part,
}) {
let w = store.get('frontPanelLength')
let h = store.get('depth')

View file

@ -11,15 +11,8 @@ import { strap } from './strap.mjs'
// Create new design
const Hortensia = new Design({
data,
parts: [
sidepanel, frontpanel, bottompanel, zipperpanel,
sidepanelreinforcement, strap,
],
parts: [sidepanel, frontpanel, bottompanel, zipperpanel, sidepanelreinforcement, strap],
})
// Named exports
export {
sidepanel, frontpanel, bottompanel, zipperpanel,
sidepanelreinforcement, strap,
Hortensia,
}
export { sidepanel, frontpanel, bottompanel, zipperpanel, sidepanelreinforcement, strap, Hortensia }

View file

@ -1,8 +1,7 @@
import { pluginBundle } from '@freesewing/plugin-bundle'
import { bottomsidepanel } from './bottomsidepanel.mjs'
function draftHortensiaSidepanel (part) {
let {
function draftHortensiaSidepanel({
store,
options,
Point,
@ -15,8 +14,8 @@ function draftHortensiaSidepanel (part) {
sa,
paperless,
macro,
} = part.shorthand()
part,
}) {
const c = 0.551915024494 // circle constant
const phi = 1.6180339887
@ -225,9 +224,11 @@ export const sidepanel = {
width: 230,
height: 330,
size: { pct: 50, min: 20, max: 200, menu: 'style' },
zipperSize: { dflt: '#5',
zipperSize: {
dflt: '#5',
list: ['#3', '#4', '#4.5', '#5', '#6', '#8', '#10', 'Invisible'],
menu: 'style' },
menu: 'style',
},
},
plugins: [pluginBundle],
draft: draftHortensiaSidepanel,

View file

@ -1,9 +1,18 @@
import { sidepanel } from './sidepanel.mjs'
import { bottomsidepanel } from './bottomsidepanel.mjs'
function draftHortensiaSidepanelreinforcement (part) {
let { store, Point, Path, points, paths, complete, sa, paperless, macro } = part.shorthand()
function draftHortensiaSidepanelreinforcement({
store,
Point,
Path,
points,
paths,
complete,
sa,
paperless,
macro,
part,
}) {
const w = store.get('width')
const h = store.get('sidePanelReinforcementHeight')
const sizeRatio = store.get('sizeRatio')

View file

@ -1,9 +1,18 @@
import { sidepanel } from './sidepanel.mjs'
function draftHortensiaStrap (part) {
let { store, options, Point, Path, points, paths, complete, sa, paperless, macro } =
part.shorthand()
function draftHortensiaStrap({
store,
options,
Point,
Path,
points,
paths,
complete,
sa,
paperless,
macro,
part,
}) {
let w = store.get('width') * options.handleWidth
let h = store.get('depth') * options.strapLength
if (sa > w * 0.8) {

View file

@ -1,8 +1,17 @@
import { sidepanel } from './sidepanel.mjs'
function draftHortensiaZipperpanel (part) {
let { store, Point, Path, points, paths, complete, sa, paperless, macro } = part.shorthand()
function draftHortensiaZipperpanel({
store,
Point,
Path,
points,
paths,
complete,
sa,
paperless,
macro,
part,
}) {
let z = store.get('zipperWidth')
let w = (store.get('zipperPanelWidth') - z) / 2
let h = store.get('depth')