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

View file

@ -1,4 +1,4 @@
export function bottomsidepanel (points, topMiddle, w, h, sizeRatio) { export function bottomsidepanel(points, topMiddle, w, h, sizeRatio) {
const c = 0.551915024494 // circle constant const c = 0.551915024494 // circle constant
const cornerCP = 20 * sizeRatio const cornerCP = 20 * sizeRatio

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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