2022-09-05 12:24:23 -07:00
|
|
|
import { top } from './top.mjs'
|
|
|
|
|
2022-09-11 14:28:25 +02:00
|
|
|
function draftFlorentSide({
|
|
|
|
store,
|
|
|
|
paperless,
|
|
|
|
sa,
|
|
|
|
complete,
|
|
|
|
points,
|
|
|
|
macro,
|
|
|
|
paths,
|
|
|
|
Path,
|
|
|
|
snippets,
|
|
|
|
Snippet,
|
|
|
|
part,
|
|
|
|
}) {
|
2019-04-07 17:01:58 +02:00
|
|
|
// Clean up
|
2019-04-08 08:05:26 +02:00
|
|
|
for (let i of Object.keys(paths)) {
|
2019-08-03 15:03:33 +02:00
|
|
|
if (i !== 'side') delete paths[i]
|
2019-04-08 08:05:26 +02:00
|
|
|
}
|
2019-04-07 17:01:58 +02:00
|
|
|
|
2021-01-31 09:22:15 +01:00
|
|
|
paths.seam = paths.side.clone().line(points.foldTop).attr('class', 'fabric')
|
2022-09-18 17:01:19 +02:00
|
|
|
paths.seam.unhide()
|
2019-04-07 17:01:58 +02:00
|
|
|
|
|
|
|
if (complete) {
|
2021-05-23 19:44:15 +02:00
|
|
|
if (points.__miniscaleMetric) delete points.__miniscaleMetric
|
|
|
|
if (points.__miniscaleImperial) delete points.__miniscaleImperial
|
2021-05-23 13:10:03 +02:00
|
|
|
for (let s in snippets) delete snippets[s]
|
2019-08-03 15:03:33 +02:00
|
|
|
points.title = points.innerGuide.shiftFractionTowards(points.outerGuide, 0.5)
|
|
|
|
macro('title', {
|
2019-04-08 08:05:26 +02:00
|
|
|
at: points.title,
|
|
|
|
nr: 2,
|
2021-04-24 10:16:31 +02:00
|
|
|
title: 'side',
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
points.logo = points.tipCp2.shiftFractionTowards(points.outerTopCp1, 0.5)
|
|
|
|
snippets.logo = new Snippet('logo', points.logo).attr('data-scale', 0.75)
|
|
|
|
macro('cutonfold', {
|
2019-04-08 08:05:26 +02:00
|
|
|
from: points.foldBottom,
|
|
|
|
to: points.foldTop,
|
|
|
|
offset: 15,
|
2021-04-24 10:16:31 +02:00
|
|
|
grainline: true,
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
2021-05-23 13:10:03 +02:00
|
|
|
points.notch1 = new Path()
|
|
|
|
.move(points.tip)
|
|
|
|
.curve(points.tipCp1, points.outerTopCp2, points.outerTop)
|
|
|
|
.shiftAlong(store.get('topDistanceToFirstNotch'))
|
|
|
|
points.notch2 = new Path()
|
|
|
|
.move(points.tip)
|
|
|
|
.curve(points.tipCp1, points.outerTopCp2, points.outerTop)
|
|
|
|
.curve(points.outerTopCp1, points.outerGuideCp2, points.outerGuide)
|
|
|
|
.shiftAlong(store.get('topDistanceToSecondNotch'))
|
|
|
|
macro('sprinkle', {
|
|
|
|
snippet: 'notch',
|
2021-08-30 11:40:16 +02:00
|
|
|
on: ['notch1', 'notch2'],
|
2021-05-23 13:10:03 +02:00
|
|
|
})
|
2019-04-08 08:05:26 +02:00
|
|
|
|
2019-04-07 17:01:58 +02:00
|
|
|
if (sa) {
|
2019-04-08 08:05:26 +02:00
|
|
|
paths.sa = new Path()
|
|
|
|
.move(points.foldTop)
|
|
|
|
.line(points.foldTop.shift(180, sa))
|
|
|
|
.join(paths.side.offset(sa))
|
|
|
|
.line(points.foldBottom)
|
2019-08-03 15:03:33 +02:00
|
|
|
.attr('class', 'fabric sa')
|
2019-04-07 17:01:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (paperless) {
|
2019-08-03 15:03:33 +02:00
|
|
|
macro('vd', {
|
2019-04-08 08:05:26 +02:00
|
|
|
from: points.tip,
|
|
|
|
to: points.foldBottom,
|
2021-04-24 10:16:31 +02:00
|
|
|
x: points.tip.x + sa + 15,
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('vd', {
|
2019-04-08 08:05:26 +02:00
|
|
|
from: points.outerTop,
|
|
|
|
to: points.foldBottom,
|
2021-04-24 10:16:31 +02:00
|
|
|
x: points.tip.x + sa + 30,
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('hd', {
|
2019-04-08 08:05:26 +02:00
|
|
|
from: points.foldTop,
|
|
|
|
to: points.foldBottom,
|
2021-04-24 10:16:31 +02:00
|
|
|
y: points.foldTop.y - 15,
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('hd', {
|
2019-04-08 08:05:26 +02:00
|
|
|
from: points.foldTop,
|
|
|
|
to: points.outerTop,
|
2021-04-24 10:16:31 +02:00
|
|
|
y: points.outerTop.y + sa + 15,
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
|
|
|
macro('hd', {
|
2019-04-08 08:05:26 +02:00
|
|
|
from: points.foldTop,
|
|
|
|
to: points.tip,
|
2021-04-24 10:16:31 +02:00
|
|
|
y: points.outerTop.y + sa + 30,
|
2019-08-03 15:03:33 +02:00
|
|
|
})
|
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 side = {
|
|
|
|
name: 'florent.side',
|
|
|
|
from: top,
|
|
|
|
draft: draftFlorentSide,
|
|
|
|
}
|