1
0
Fork 0

chore(florent): Port to v3 stage 2

This commit is contained in:
joostdecock 2022-09-11 14:28:25 +02:00
parent 9206ee4e4c
commit a217074fd7
6 changed files with 60 additions and 31 deletions

View file

@ -1,9 +1,19 @@
import { pluginBundle } from '@freesewing/plugin-bundle'
function draftFlorentBrimBottom (part) {
let { paperless, sa, store, complete, points, options, macro, Point, paths, Path, measurements } =
part.shorthand()
function draftFlorentBrimBottom({
paperless,
sa,
store,
complete,
points,
options,
macro,
Point,
paths,
Path,
measurements,
part,
}) {
let scale = 1
let base = scale * measurements.head * (1 + options.headEase)
@ -85,14 +95,14 @@ function draftFlorentBrimBottom (part) {
export const brimBottom = {
name: 'florent.brimBottom',
measurements: [ 'head' ],
options : {
measurements: ['head'],
options: {
// Constants
topSide: 0.8,
brim: 0,
// Percentages
headEase: { pct: 2, min: 0, max: 5, menu: 'fit' },
},
plugins: [ pluginBundle ],
plugins: [pluginBundle],
draft: draftFlorentBrimBottom,
}

View file

@ -1,8 +1,15 @@
import { brimBottom } from './brimbottom.mjs'
function draftFlorentBrimInterfacing (part) {
let { paperless, sa, complete, points, macro, paths, Path } = part.shorthand()
function draftFlorentBrimInterfacing({
paperless,
sa,
complete,
points,
macro,
paths,
Path,
part,
}) {
paths.hint = paths.seam.clone().attr('class', 'dashed stroke-sm')
paths.outset = new Path()

View file

@ -1,8 +1,6 @@
import { brimBottom } from './brimbottom.mjs'
function draftFlorentBrimTop (part) {
let { paperless, sa, complete, points, macro, paths, Path } = part.shorthand()
function draftFlorentBrimTop({ paperless, sa, complete, points, macro, paths, Path, part }) {
paths.hint = new Path()
.move(points.tipLeft)
.curve(points.tipLeftCp2, points.outerMidCp1, points.outerMid)

View file

@ -10,13 +10,8 @@ import { brimInterfacing } from './briminterfacing.mjs'
// Create new design
const Florent = new Design({
data,
parts: [
top, side, brimBottom, brimTop, brimInterfacing,
]
parts: [top, side, brimBottom, brimTop, brimInterfacing],
})
// Named exports
export {
top, side, brimBottom, brimTop, brimInterfacing,
Florent,
}
export { top, side, brimBottom, brimTop, brimInterfacing, Florent }

View file

@ -1,9 +1,18 @@
import { top } from './top.mjs'
function draftFlorentSide (part) {
let { store, paperless, sa, complete, points, macro, paths, Path, snippets, Snippet } =
part.shorthand()
function draftFlorentSide({
store,
paperless,
sa,
complete,
points,
macro,
paths,
Path,
snippets,
Snippet,
part,
}) {
// Clean up
for (let i of Object.keys(paths)) {
if (i !== 'side') delete paths[i]

View file

@ -1,9 +1,19 @@
import { pluginBundle } from '@freesewing/plugin-bundle'
function draftFlorentTop (part) {
let { paperless, sa, points, macro, Point, Path, paths, snippets, Snippet, complete, store } =
part.shorthand()
function draftFlorentTop({
paperless,
sa,
points,
macro,
Point,
Path,
paths,
snippets,
Snippet,
complete,
store,
part,
}) {
const fitCap = (part, scale) => {
let { points, options, Point, Path, measurements } = part.shorthand()
@ -214,14 +224,14 @@ function draftFlorentTop (part) {
export const top = {
name: 'florent.top',
measurements: [ 'head' ],
options : {
measurements: ['head'],
options: {
// Constants
topSide: 0.8,
brim: 0,
// Percentages
headEase: { pct: 2, min: 0, max: 5, menu: 'fit' },
},
plugins: [ pluginBundle ],
plugins: [pluginBundle],
draft: draftFlorentTop,
}