1
0
Fork 0
freesewing/designs/florent/src/brimtop.mjs

73 lines
1.7 KiB
JavaScript
Raw Normal View History

2022-09-05 12:24:23 -07:00
import { brimBottom } from './brimbottom.mjs'
2023-09-16 19:59:01 +02:00
function draftFlorentBrimTop({ sa, points, macro, paths, Path, store, part }) {
2019-04-07 17:01:58 +02:00
paths.hint = new Path()
.move(points.tipLeft)
.curve(points.tipLeftCp2, points.outerMidCp1, points.outerMid)
.curve(points.outerMidCp2, points.tipRightCp1, points.tipRight)
2019-08-03 15:03:33 +02:00
.attr('class', 'dashed stroke-sm')
paths.rest = new Path()
.move(points.tipRight)
2019-04-07 17:01:58 +02:00
.curve(points.tipRightCp2, points.innerMidCp1, points.innerMid)
.curve(points.innerMidCp2, points.tipLeftCp1, points.tipLeft)
.line(paths.seam.start())
2023-09-16 19:59:01 +02:00
paths.seam = paths.hint.offset(3).join(paths.rest).close().addClass('fabric')
2019-04-07 17:01:58 +02:00
2023-09-16 19:59:01 +02:00
if (sa)
paths.sa = paths.hint
.offset(sa + 3)
.join(paths.rest.offset(sa))
.close()
.addClass('fabric sa')
/*
* Annotations
*/
// Cutlist
store.cutlist.setCut({ cut: 1, from: 'fabric' })
// Grainline
2023-04-30 05:47:24 -07:00
macro('grainline', {
from: points.outerMid,
to: points.innerMid,
})
2023-09-16 19:59:01 +02:00
// Title
points.title = points.innerMid.shiftFractionTowards(points.outerMidCp2, 0.35)
macro('title', {
at: points.title,
nr: 4,
title: 'brimTop',
})
2019-04-07 17:01:58 +02:00
2023-09-16 19:59:01 +02:00
// Dimensions
macro('rmad')
let bottom = paths.seam.edge('bottom')
macro('hd', {
id: 'wFull',
from: paths.seam.edge('left'),
to: paths.seam.edge('right'),
y: points.tipLeft.y - sa - 15,
})
macro('vd', {
id: 'hBrim',
from: bottom,
to: points.innerMid,
x: points.innerMid.x - 15,
})
macro('vd', {
id: 'hFull',
from: bottom,
to: points.tipRight,
x: points.tipRight.x + sa + 18,
})
2019-04-07 17:01:58 +02:00
2019-08-03 15:03:33 +02:00
return part
2019-04-07 17:01:58 +02:00
}
2022-09-05 12:24:23 -07:00
export const brimTop = {
name: 'florent.brimTop',
from: brimBottom,
draft: draftFlorentBrimTop,
}