chore: Linter run
This commit is contained in:
parent
6bd8a6d3c7
commit
1d3a4acd60
21 changed files with 840 additions and 869 deletions
|
@ -318,7 +318,9 @@ Part.prototype.shorthand = function () {
|
|||
const absoluteOptionsProxy = {
|
||||
get: function (absoluteOptions, name) {
|
||||
if (typeof absoluteOptions[name] === 'undefined')
|
||||
self.context.raise.warning(`Tried to access \`absoluteOptions.${name}\` but it is \`undefined\``)
|
||||
self.context.raise.warning(
|
||||
`Tried to access \`absoluteOptions.${name}\` but it is \`undefined\``
|
||||
)
|
||||
return Reflect.get(...arguments)
|
||||
},
|
||||
set: (absoluteOptions, name, value) => (self.context.settings.absoluteOptions[name] = value),
|
||||
|
|
|
@ -121,26 +121,27 @@ function snappedOption(option, pattern) {
|
|||
const conf = pattern.config.options[option]
|
||||
const abs = conf.toAbs(pattern.settings.options[option], pattern.settings)
|
||||
// Handle units-specific config
|
||||
if (
|
||||
!Array.isArray(conf.snap) &&
|
||||
conf.snap.metric &&
|
||||
conf.snap.imperial
|
||||
) conf.snap = conf.snap[pattern.settings.units]
|
||||
if (!Array.isArray(conf.snap) && conf.snap.metric && conf.snap.imperial)
|
||||
conf.snap = conf.snap[pattern.settings.units]
|
||||
// Simple steps
|
||||
if (typeof conf.snap === 'number') return Math.ceil(abs / conf.snap) * conf.snap
|
||||
// List of snaps
|
||||
if (Array.isArray(conf.snap) && conf.snap.length > 1) {
|
||||
for (const snap of conf.snap.sort((a, b) => a - b).map((snap, i) => {
|
||||
const margin = (i < (conf.snap.length - 1))
|
||||
? (conf.snap[Number(i) + 1] - snap) / 2 // Look forward
|
||||
: (snap - conf.snap[i - 1]) / 2 // Final snap, look backward
|
||||
for (const snap of conf.snap
|
||||
.sort((a, b) => a - b)
|
||||
.map((snap, i) => {
|
||||
const margin =
|
||||
i < conf.snap.length - 1
|
||||
? (conf.snap[Number(i) + 1] - snap) / 2 // Look forward
|
||||
: (snap - conf.snap[i - 1]) / 2 // Final snap, look backward
|
||||
|
||||
return {
|
||||
min: snap - margin,
|
||||
max: snap + Number(margin),
|
||||
snap,
|
||||
}
|
||||
})) if (abs < snap.max && abs >= snap.min) return snap.snap
|
||||
return {
|
||||
min: snap - margin,
|
||||
max: snap + Number(margin),
|
||||
snap,
|
||||
}
|
||||
}))
|
||||
if (abs < snap.max && abs >= snap.min) return snap.snap
|
||||
}
|
||||
// If we end up here, the snap config is wrong
|
||||
pattern.raise.warning(`Invalid snap config for option ${option}`)
|
||||
|
@ -197,8 +198,8 @@ Pattern.prototype.draft = function () {
|
|||
typeof this.config.options[i].snap !== 'undefined' &&
|
||||
this.config.options[i].toAbs instanceof Function
|
||||
) {
|
||||
let abs = this.config.options[i].toAbs(this.settings.options[i], this.settings)
|
||||
this.settings.absoluteOptions[i] = snappedOption(i, this)
|
||||
let abs = this.config.options[i].toAbs(this.settings.options[i], this.settings)
|
||||
this.settings.absoluteOptions[i] = snappedOption(i, this)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -356,7 +356,6 @@ export { Bezier }
|
|||
export function pctBasedOn(measurement) {
|
||||
return {
|
||||
toAbs: (val, { measurements }) => measurements[measurement] * val,
|
||||
fromAbs: (val, { measurements }) => Math.round( ( 10 * val) / measurements[measurement]) / 10
|
||||
fromAbs: (val, { measurements }) => Math.round((10 * val) / measurements[measurement]) / 10,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ applyThisLayout: Dieses Layout anwenden
|
|||
areYouSureYouWantToContinue: Bist du sicher, dass du fortfahren möchtest?
|
||||
askForHelp: Nach Hilfe fragen
|
||||
automatic: Automatisch
|
||||
averagePeopleDoNotExist: "Durchschnittliche Menschen existieren nicht"
|
||||
averagePeopleDoNotExist: 'Durchschnittliche Menschen existieren nicht'
|
||||
awesome: Großartig
|
||||
back: Zurück
|
||||
becauseThatWouldBeReallyHelpful: Weil das wirklich hilfreich wäre.
|
||||
|
@ -72,7 +72,7 @@ drafts: Entwürfe
|
|||
draftSettings: Entwurfseinstellungen
|
||||
dragAndDropImageHere: Du kannst das Bild hier per Drag-and-Drop ablegen oder es unten manuell auswählen
|
||||
emailAddress: E-Mail-Adresse
|
||||
emailWorksToo: "Falls du deinen Benutzername nicht weißt: deine E-Mail-Adresse funktioniert auch"
|
||||
emailWorksToo: 'Falls du deinen Benutzername nicht weißt: deine E-Mail-Adresse funktioniert auch'
|
||||
enterEmailPickPassword: Gib deine E-Mail Adresse ein und wähle ein Passwort
|
||||
export: Exportieren
|
||||
exportTiledPDF: Exportieren als paginiertes PDF
|
||||
|
@ -81,7 +81,7 @@ fieldRemoved: '{field} entfernt'
|
|||
fieldSaved: '{field} gespeichert'
|
||||
filterByPattern: Filtern nach Schnittmuster
|
||||
filterPatterns: Schnittmuster filtern
|
||||
forgotLoginInstructions: "Wenn du dein Passwort nicht mehr weißt: Benutzername oder E-Mail-Adresse eingeben und den <b>Passwort zurücksetzen</b> Knopf drücken"
|
||||
forgotLoginInstructions: 'Wenn du dein Passwort nicht mehr weißt: Benutzername oder E-Mail-Adresse eingeben und den <b>Passwort zurücksetzen</b> Knopf drücken'
|
||||
freesewing: Freesewing
|
||||
freesewingOnGithub: Freesewing auf GitHub
|
||||
github: GitHub
|
||||
|
@ -156,7 +156,7 @@ remove: Entfernen
|
|||
removeThing: '{thing} entfernen'
|
||||
reportThisOnGithub: Melde dies auf GitHub
|
||||
requiredMeasurements: Erforderliche Maße
|
||||
resendActivationEmailMessage: "Trage die E-Mail-Adresse ein, mit der du dich angemeldet hast, und wir senden dir eine neue Bestätigungsnachricht."
|
||||
resendActivationEmailMessage: 'Trage die E-Mail-Adresse ein, mit der du dich angemeldet hast, und wir senden dir eine neue Bestätigungsnachricht.'
|
||||
resendActivationEmail: Aktivierungs-E-Mail erneut senden
|
||||
resetPassword: Passwort zurücksetzen
|
||||
reset: Zurücksetzen
|
||||
|
@ -198,7 +198,7 @@ twitter: Twitter
|
|||
txt-footer: Freesewing wird erstellt von einer Gemeinschaft von Mitwirkenden<br />mit der finanziellen Unterstützung unserer Förderer/-innen
|
||||
txt-tier2: Unsere Kategorie mit dem demokratischsten Preis. Es ist vielleicht weniger als der Preis eines Lattes, aber deine Unterstützung bedeutet uns sehr viel.
|
||||
txt-tier4: Wähle diese Stufe, und wir senden dir etwas von unserem heiß begehrten Freesewing-Swag nach Hause. Egal, wo in der Welt das auch sein mag.
|
||||
txt-tier8: "Wenn du uns nicht nur unterstützen möchtest, sondern Freesewing zum Gedeihen bringen willst, ist das die Stufe für dich. Außerdem: extra Swag!"
|
||||
txt-tier8: 'Wenn du uns nicht nur unterstützen möchtest, sondern Freesewing zum Gedeihen bringen willst, ist das die Stufe für dich. Außerdem: extra Swag!'
|
||||
txt-tiers: 'FreeSewing wird durch ein freiwilliges Abonnement-Modell unterstützt'
|
||||
unitsInfo: Freesewing unterstützt sowohl das metrische System als auch imperiale Einheiten. Wähle einfach aus, was von beiden du hier verwenden möchtest. (Standardmäßig werden die in deinem Account konfigurierten Einheiten verwendet).
|
||||
updated: Aktualisiert
|
||||
|
@ -240,8 +240,8 @@ noPattern: Du hast (noch) keine Schnittmuster. Erstelle ein neues Schnittmuster
|
|||
modelFirst: Beginne damit, Maße hinzuzufügen
|
||||
noModel: Du hast (noch) keine Maße hinzugefügt. FreeSewing kann maßgeschneiderte Schnittmuster erzeugen. Dafür benötigen wir jedoch Maße.
|
||||
noModel2: Das erste, was du tun solltest, ist, eine Person hinzuzufügen und das Maßband auszupacken.
|
||||
noUserBrowsingTitle: "Du kannst nicht einfach alle Benutzer durchsuchen"
|
||||
noUserBrowsingText: "Wir haben Tausende von ihnen. Sicher gibt es Interessanteres auf unserer Seite zu tun?"
|
||||
noUserBrowsingTitle: 'Du kannst nicht einfach alle Benutzer durchsuchen'
|
||||
noUserBrowsingText: 'Wir haben Tausende von ihnen. Sicher gibt es Interessanteres auf unserer Seite zu tun?'
|
||||
usePatternMeasurements: 'Verwende die Maße des Originalschnittmusters'
|
||||
createReplica: Duplikat erstellen
|
||||
showDetails: Details anzeigen
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
txt-blog: Neuigkeiten, Updates und Ankündigungen des Freesewing-Teams
|
||||
txt-community: 'Alles wird von freiwilligen Mitwirkenden am Leben erhalten. Es existieren keine kommerziellen Absichten im Zusammenhang mit diesem Projekt.'
|
||||
txt-different: Was uns von anderen unterscheidet
|
||||
txt-draft: "Wähle eines deiner Schnittmuster, wähle ein Modell und lege die Optionen fest. Den Rest erledigen wir."
|
||||
txt-draft: 'Wähle eines deiner Schnittmuster, wähle ein Modell und lege die Optionen fest. Den Rest erledigen wir.'
|
||||
txt-how: So funktioniert es
|
||||
txt-join: Schließe dich Tausenden anderer an und erstelle einen kostenlosen Account auf freesewing.org.
|
||||
txt-model: Alle unsere Schnittmuster werden nach individuellen Maßen gefertigt. Nimm daher zuallererst das Maßband zur Hand.
|
||||
txt-newHere: "Wenn du hier neu bist, ist unsere Demo der beste Startpunkt:"
|
||||
txt-newHere: 'Wenn du hier neu bist, ist unsere Demo der beste Startpunkt:'
|
||||
txt-opensource: 'Unsere Plattform, unsere Schnittmuster und sogar diese Website: Unser gesamter Code ist auf GitHub zugänglich. Pull-Requests sind jederzeit herzlich willkommen!'
|
||||
txt-patrons: Freesewing wird durch die finanzielle Unterstützung unserer Förderer/-innen überhaupt erst ermöglicht. Scrolle nach unten, um mehr über unser Abonnementmodell zu erfahren.
|
||||
txt-showcase: Abgeschlossene Projekte aus der Freesewing-Community
|
||||
|
|
|
@ -6,5 +6,5 @@ bio: Erzähle uns ein wenig über dich
|
|||
social: Lass uns wissen, wo wir dir folgen können
|
||||
newsletter: Teile uns deine Newsletter-Präferenz mit
|
||||
letUsSetupYourAccount: Lass uns deinen Account einrichten.
|
||||
walkYouThrough: "Wir führen dich durch die folgenden Schritte:"
|
||||
walkYouThrough: 'Wir führen dich durch die folgenden Schritte:'
|
||||
someOptional: Obwohl alle diese Schritte optional sind, empfehlen wir dir sie durchzugehen, um das Beste aus FreeSewing herauszuholen.
|
||||
|
|
|
@ -19,31 +19,34 @@ export default {
|
|||
'parametric design',
|
||||
'pattern',
|
||||
'sewing',
|
||||
'sewing pattern'
|
||||
'sewing pattern',
|
||||
],
|
||||
optionGroups: {
|
||||
fit:
|
||||
['headRatio','neckRatio']
|
||||
,
|
||||
style: ['lengthBonus','widthBonus',
|
||||
'length',]
|
||||
fit: ['headRatio', 'neckRatio'],
|
||||
style: ['lengthBonus', 'widthBonus', 'length'],
|
||||
},
|
||||
measurements: ['waistToKnee','waistToUpperLeg','waistToFloor','hpsToWaistBack','neck','shoulderToShoulder','shoulderToElbow','waistToHips'],
|
||||
measurements: [
|
||||
'waistToKnee',
|
||||
'waistToUpperLeg',
|
||||
'waistToFloor',
|
||||
'hpsToWaistBack',
|
||||
'neck',
|
||||
'shoulderToShoulder',
|
||||
'shoulderToElbow',
|
||||
'waistToHips',
|
||||
],
|
||||
dependencies: {},
|
||||
inject: {},
|
||||
hide: [],
|
||||
parts: ['lacerna'],
|
||||
options: {
|
||||
headRatio: {pct: 100, min: 80, max: 120},
|
||||
lengthBonus:{ pct: 105, min: 60, max: 130 },
|
||||
widthBonus: {pct: 100, min:50, max: 130},
|
||||
length: {
|
||||
list: ['ToKnee',
|
||||
'ToBelowKnee',
|
||||
'ToHips',
|
||||
'ToUpperLeg','ToFloor'],
|
||||
dflt: 'ToBelowKnee'
|
||||
},
|
||||
neckRatio: {pct: 115, min: 95, max: 130},
|
||||
}
|
||||
headRatio: { pct: 100, min: 80, max: 120 },
|
||||
lengthBonus: { pct: 105, min: 60, max: 130 },
|
||||
widthBonus: { pct: 100, min: 50, max: 130 },
|
||||
length: {
|
||||
list: ['ToKnee', 'ToBelowKnee', 'ToHips', 'ToUpperLeg', 'ToFloor'],
|
||||
dflt: 'ToBelowKnee',
|
||||
},
|
||||
neckRatio: { pct: 115, min: 95, max: 130 },
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,17 +1,6 @@
|
|||
export default function (part) {
|
||||
const {
|
||||
options,
|
||||
Point,
|
||||
Path,
|
||||
points,
|
||||
paths,
|
||||
Snippet,
|
||||
snippets,
|
||||
complete,
|
||||
sa,
|
||||
paperless,
|
||||
macro
|
||||
} = part.shorthand()
|
||||
const { options, Point, Path, points, paths, Snippet, snippets, complete, sa, paperless, macro } =
|
||||
part.shorthand()
|
||||
|
||||
const w = 500 * options.size
|
||||
points.topLeft = new Point(0, 0)
|
||||
|
@ -47,12 +36,12 @@ export default function (part) {
|
|||
macro('hd', {
|
||||
from: points.bottomLeft,
|
||||
to: points.bottomRight,
|
||||
y: points.bottomLeft.y + sa + 15
|
||||
y: points.bottomLeft.y + sa + 15,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.bottomRight,
|
||||
to: points.topRight,
|
||||
x: points.topRight.x + sa + 15
|
||||
x: points.topRight.x + sa + 15,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -1,155 +1,159 @@
|
|||
export default function(part) {
|
||||
let {
|
||||
Point,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
measurements,
|
||||
options,
|
||||
macro,
|
||||
complete,
|
||||
snippets,
|
||||
Snippet,
|
||||
sa,
|
||||
paperless,
|
||||
store
|
||||
} = part.shorthand();
|
||||
|
||||
export default function (part) {
|
||||
let {
|
||||
Point,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
measurements,
|
||||
options,
|
||||
macro,
|
||||
complete,
|
||||
snippets,
|
||||
Snippet,
|
||||
sa,
|
||||
paperless,
|
||||
store,
|
||||
} = part.shorthand()
|
||||
|
||||
// set different lengths of lacerna
|
||||
let hem_pos
|
||||
if (options.length === 'ToKnee'){hem_pos = measurements.waistToKnee}
|
||||
if (options.length === 'ToBelowKnee'){hem_pos = 1.3*measurements.waistToKnee}
|
||||
if (options.length === 'ToHips'){hem_pos = measurements.waistToHips}
|
||||
if (options.length === 'ToUpperLeg'){hem_pos = measurements.waistToUpperLeg}
|
||||
if (options.length === 'ToFloor'){hem_pos = measurements.waistToFloor}
|
||||
// define some variables
|
||||
// let hwidth = (measurements.shoulderToShoulder/2 + measurements.shoulderToElbow) * options.widthBonus
|
||||
let length = (measurements.hpsToWaistBack + hem_pos) * options.lengthBonus
|
||||
let hneck = (measurements.neck/2)*1.1*options.neckRatio
|
||||
let width = (0.6*measurements.shoulderToShoulder + 1.8*measurements.shoulderToElbow) * options.widthBonus
|
||||
let leftLength = measurements.hpsToWaistBack+measurements.waistToHips
|
||||
|
||||
// make points
|
||||
points.top = new Point(0,0)
|
||||
points.bottom = new Point(0,length)
|
||||
points.topLeft = points.top.shift(180,width)
|
||||
points.bottomLeft = points.topLeft.shift(-90,points.top.dy(points.bottom))
|
||||
//points.topRight = points.topLeft.flipX()
|
||||
//points.bottomRight = points.bottomLeft.flipX()
|
||||
// set different lengths of lacerna
|
||||
let hem_pos
|
||||
if (options.length === 'ToKnee') {
|
||||
hem_pos = measurements.waistToKnee
|
||||
}
|
||||
if (options.length === 'ToBelowKnee') {
|
||||
hem_pos = 1.3 * measurements.waistToKnee
|
||||
}
|
||||
if (options.length === 'ToHips') {
|
||||
hem_pos = measurements.waistToHips
|
||||
}
|
||||
if (options.length === 'ToUpperLeg') {
|
||||
hem_pos = measurements.waistToUpperLeg
|
||||
}
|
||||
if (options.length === 'ToFloor') {
|
||||
hem_pos = measurements.waistToFloor
|
||||
}
|
||||
// define some variables
|
||||
// let hwidth = (measurements.shoulderToShoulder/2 + measurements.shoulderToElbow) * options.widthBonus
|
||||
let length = (measurements.hpsToWaistBack + hem_pos) * options.lengthBonus
|
||||
let hneck = (measurements.neck / 2) * 1.1 * options.neckRatio
|
||||
let width =
|
||||
(0.6 * measurements.shoulderToShoulder + 1.8 * measurements.shoulderToElbow) *
|
||||
options.widthBonus
|
||||
let leftLength = measurements.hpsToWaistBack + measurements.waistToHips
|
||||
|
||||
points.middleLeft = points.topLeft.shift(-90,leftLength)
|
||||
|
||||
points.topShoulder = points.top.shift(180,width - 1.2*measurements.shoulderToElbow)
|
||||
points.bottomShoulder = points.topShoulder.shift(-90,points.top.dy(points.bottom))
|
||||
points.bottomShoulderCp = points.bottomLeft.copy().shiftFractionTowards(points.top,0.05)
|
||||
|
||||
paths.fold = new Path()
|
||||
.move(points.bottom)
|
||||
.line(points.top)
|
||||
// make points
|
||||
points.top = new Point(0, 0)
|
||||
points.bottom = new Point(0, length)
|
||||
points.topLeft = points.top.shift(180, width)
|
||||
points.bottomLeft = points.topLeft.shift(-90, points.top.dy(points.bottom))
|
||||
//points.topRight = points.topLeft.flipX()
|
||||
//points.bottomRight = points.bottomLeft.flipX()
|
||||
|
||||
paths.seam = new Path()
|
||||
.move(points.top)
|
||||
.line(points.topLeft)
|
||||
points.middleLeft = points.topLeft.shift(-90, leftLength)
|
||||
|
||||
paths.hem = new Path()
|
||||
.move(points.topLeft)
|
||||
.line(points.middleLeft)
|
||||
.curve_(points.bottomShoulderCp,points.bottomShoulder)
|
||||
.line(points.bottom)
|
||||
points.topShoulder = points.top.shift(180, width - 1.2 * measurements.shoulderToElbow)
|
||||
points.bottomShoulder = points.topShoulder.shift(-90, points.top.dy(points.bottom))
|
||||
points.bottomShoulderCp = points.bottomLeft.copy().shiftFractionTowards(points.top, 0.05)
|
||||
|
||||
// draw other paths
|
||||
|
||||
|
||||
// Complete?
|
||||
|
||||
if (complete) {
|
||||
snippets.shoulder = new Snippet('notch', points.topShoulder)
|
||||
paths.fold = new Path().move(points.bottom).line(points.top)
|
||||
|
||||
// cut on fold
|
||||
macro('cutonfold', {
|
||||
from: points.bottom,
|
||||
to: points.top,
|
||||
grainline: true,
|
||||
})
|
||||
paths.seam = new Path().move(points.top).line(points.topLeft)
|
||||
|
||||
// logo & title
|
||||
points.logo = points.top.shift(45,points.bottom.dy(points.top)/3);
|
||||
snippets.logo = new Snippet("logo", points.logo);
|
||||
points.title = points.logo.shift(90, points.bottom.dy(points.top)/4);
|
||||
macro("title", {
|
||||
at: points.title,
|
||||
nr: 1,
|
||||
title: "lacerna"
|
||||
})
|
||||
points.__titleNr.attr('data-text-class', 'center')
|
||||
points.__titleName.attr('data-text-class', 'center')
|
||||
points.__titlePattern.attr('data-text-class', 'center')
|
||||
paths.hem = new Path()
|
||||
.move(points.topLeft)
|
||||
.line(points.middleLeft)
|
||||
.curve_(points.bottomShoulderCp, points.bottomShoulder)
|
||||
.line(points.bottom)
|
||||
|
||||
// scalebox
|
||||
points.scalebox = points.title.shift(90, points.bottom.dy(points.top)/5)
|
||||
macro("scalebox", { at: points.scalebox })
|
||||
// draw other paths
|
||||
|
||||
// seam allowance
|
||||
if (sa) {
|
||||
paths.sa = paths.seam.offset(sa)
|
||||
.join(paths.hem.offset(sa * 1.5))
|
||||
.close()
|
||||
.attr('class', 'fabric sa')
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
macro("hd", {
|
||||
from: points.topLeft,
|
||||
to: points.top,
|
||||
y: points.top.y - 20
|
||||
})
|
||||
macro("vd", {
|
||||
from: points.top,
|
||||
to: points.bottom,
|
||||
x: points.top.x +10
|
||||
})
|
||||
macro("hd", {
|
||||
from: points.topLeft,
|
||||
to: points.topShoulder,
|
||||
y: points.top.y - 10
|
||||
})
|
||||
macro("hd", {
|
||||
from: points.topShoulder,
|
||||
to: points.top,
|
||||
y: points.top.y - 10
|
||||
})
|
||||
macro("hd", {
|
||||
from: points.bottomShoulder,
|
||||
to: points.bottom,
|
||||
y: points.bottom.y + 10
|
||||
})
|
||||
macro("hd", {
|
||||
from: points.bottomShoulder,
|
||||
to: points.bottomLeft,
|
||||
y: points.bottom.y + 10
|
||||
})
|
||||
macro("vd", {
|
||||
from: points.topLeft,
|
||||
to: points.middleLeft,
|
||||
x: points.topLeft.x - 10
|
||||
})
|
||||
macro("ld", {
|
||||
from: points.middleLeft,
|
||||
to: points.bottomShoulder,
|
||||
d: 0
|
||||
})
|
||||
// Complete?
|
||||
|
||||
macro("vd", {
|
||||
from: points.middleLeft,
|
||||
to: points.bottomLeft,
|
||||
x: points.bottomLeft.x - 10
|
||||
})
|
||||
if (complete) {
|
||||
snippets.shoulder = new Snippet('notch', points.topShoulder)
|
||||
|
||||
// cut on fold
|
||||
macro('cutonfold', {
|
||||
from: points.bottom,
|
||||
to: points.top,
|
||||
grainline: true,
|
||||
})
|
||||
|
||||
// logo & title
|
||||
points.logo = points.top.shift(45, points.bottom.dy(points.top) / 3)
|
||||
snippets.logo = new Snippet('logo', points.logo)
|
||||
points.title = points.logo.shift(90, points.bottom.dy(points.top) / 4)
|
||||
macro('title', {
|
||||
at: points.title,
|
||||
nr: 1,
|
||||
title: 'lacerna',
|
||||
})
|
||||
points.__titleNr.attr('data-text-class', 'center')
|
||||
points.__titleName.attr('data-text-class', 'center')
|
||||
points.__titlePattern.attr('data-text-class', 'center')
|
||||
|
||||
}
|
||||
// scalebox
|
||||
points.scalebox = points.title.shift(90, points.bottom.dy(points.top) / 5)
|
||||
macro('scalebox', { at: points.scalebox })
|
||||
|
||||
// seam allowance
|
||||
if (sa) {
|
||||
paths.sa = paths.seam
|
||||
.offset(sa)
|
||||
.join(paths.hem.offset(sa * 1.5))
|
||||
.close()
|
||||
.attr('class', 'fabric sa')
|
||||
}
|
||||
return part;
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
macro('hd', {
|
||||
from: points.topLeft,
|
||||
to: points.top,
|
||||
y: points.top.y - 20,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.top,
|
||||
to: points.bottom,
|
||||
x: points.top.x + 10,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.topLeft,
|
||||
to: points.topShoulder,
|
||||
y: points.top.y - 10,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.topShoulder,
|
||||
to: points.top,
|
||||
y: points.top.y - 10,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.bottomShoulder,
|
||||
to: points.bottom,
|
||||
y: points.bottom.y + 10,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.bottomShoulder,
|
||||
to: points.bottomLeft,
|
||||
y: points.bottom.y + 10,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.topLeft,
|
||||
to: points.middleLeft,
|
||||
x: points.topLeft.x - 10,
|
||||
})
|
||||
macro('ld', {
|
||||
from: points.middleLeft,
|
||||
to: points.bottomShoulder,
|
||||
d: 0,
|
||||
})
|
||||
|
||||
macro('vd', {
|
||||
from: points.middleLeft,
|
||||
to: points.bottomLeft,
|
||||
x: points.bottomLeft.x - 10,
|
||||
})
|
||||
}
|
||||
}
|
||||
return part
|
||||
}
|
||||
|
|
|
@ -98,12 +98,14 @@ export default {
|
|||
// Elastic
|
||||
waistbandWidth: { pct: 3, min: 1, max: 6, snap: 5 },
|
||||
ankleElastic: {
|
||||
pct: 5, min: 1, max: 13,
|
||||
pct: 5,
|
||||
min: 1,
|
||||
max: 13,
|
||||
snap: {
|
||||
metric: [ 5, 10, 12, 20, 25, 30, 40, 50, 80 ],
|
||||
imperial: [ 6.35, 9.525, 12.7, 15.24, 19.05, 25.4, 30.48, 50.8, 76.2],
|
||||
metric: [5, 10, 12, 20, 25, 30, 40, 50, 80],
|
||||
imperial: [6.35, 9.525, 12.7, 15.24, 19.05, 25.4, 30.48, 50.8, 76.2],
|
||||
},
|
||||
...pctBasedOn('waistToFloor')
|
||||
...pctBasedOn('waistToFloor'),
|
||||
},
|
||||
heelEase: { pct: 5, min: 0, max: 50 },
|
||||
|
||||
|
|
|
@ -42,8 +42,19 @@ export default function (part) {
|
|||
}
|
||||
|
||||
// Shorthand call
|
||||
let { store, sa, points, Path, paths, options, measurements, complete, paperless, macro, absoluteOptions } =
|
||||
part.shorthand()
|
||||
let {
|
||||
store,
|
||||
sa,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
options,
|
||||
measurements,
|
||||
complete,
|
||||
paperless,
|
||||
macro,
|
||||
absoluteOptions,
|
||||
} = part.shorthand()
|
||||
|
||||
// Adapt bottom leg width based on heel & heel ease
|
||||
let quarterHeel = (measurements.heel * (1 + options.heelEase) * options.legBalance) / 2
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
// Common width for elastics
|
||||
export const elastics = {
|
||||
metric: [3.5, 5, 10, 12, 20, 25, 30, 40, 50, 60, 80, 100, 120],
|
||||
imperial: [3.175, 6.35, 9.525, 12.7, 15.875, 19.05, 25.4, 31.75, 38.1, 44.45, 50.8, 76.2, 101.6, 127],
|
||||
imperial: [
|
||||
3.175, 6.35, 9.525, 12.7, 15.875, 19.05, 25.4, 31.75, 38.1, 44.45, 50.8, 76.2, 101.6, 127,
|
||||
],
|
||||
}
|
||||
|
|
|
@ -10,66 +10,63 @@ export default {
|
|||
department: 'tops',
|
||||
type: 'pattern',
|
||||
difficulty: 1,
|
||||
tags: [
|
||||
'freesewing',
|
||||
'design',
|
||||
'diy',
|
||||
'fashion',
|
||||
'made to measure',
|
||||
'parametric design',
|
||||
'pattern',
|
||||
'sewing',
|
||||
'sewing pattern',
|
||||
tags: [
|
||||
'freesewing',
|
||||
'design',
|
||||
'diy',
|
||||
'fashion',
|
||||
'made to measure',
|
||||
'parametric design',
|
||||
'pattern',
|
||||
'sewing',
|
||||
'sewing pattern',
|
||||
],
|
||||
optionGroups: {
|
||||
fit:
|
||||
['headRatio','armholeDrop']
|
||||
,
|
||||
style: ['lengthBonus','widthBonus',
|
||||
{clavi: ['clavi','clavusPosBonus','clavusWidth', ]},
|
||||
'length',
|
||||
'width',
|
||||
],
|
||||
advanced: ['forceWidth']
|
||||
|
||||
},
|
||||
measurements: [
|
||||
'head',
|
||||
'shoulderToElbow',
|
||||
'shoulderToShoulder',
|
||||
'biceps',
|
||||
'hpsToWaistBack',
|
||||
'waistToKnee',
|
||||
'waist',
|
||||
'chest',
|
||||
'seat',
|
||||
'hips',
|
||||
'waistToFloor',
|
||||
'waistToUpperLeg'
|
||||
fit: ['headRatio', 'armholeDrop'],
|
||||
style: [
|
||||
'lengthBonus',
|
||||
'widthBonus',
|
||||
{ clavi: ['clavi', 'clavusPosBonus', 'clavusWidth'] },
|
||||
'length',
|
||||
'width',
|
||||
],
|
||||
advanced: ['forceWidth'],
|
||||
},
|
||||
measurements: [
|
||||
'head',
|
||||
'shoulderToElbow',
|
||||
'shoulderToShoulder',
|
||||
'biceps',
|
||||
'hpsToWaistBack',
|
||||
'waistToKnee',
|
||||
'waist',
|
||||
'chest',
|
||||
'seat',
|
||||
'hips',
|
||||
'waistToFloor',
|
||||
'waistToUpperLeg',
|
||||
],
|
||||
dependencies: {},
|
||||
inject: {},
|
||||
hide: [],
|
||||
parts: ['tunica',
|
||||
],
|
||||
hide: [],
|
||||
parts: ['tunica'],
|
||||
options: {
|
||||
headRatio: {pct: 100, min: 80, max: 120},
|
||||
armholeDrop: { pct: 110, min: 100, max: 150 },
|
||||
lengthBonus:{ pct: 90, min: 60, max: 130 },
|
||||
widthBonus: {pct: 100, min:50, max: 130},
|
||||
clavi: {bool: false},
|
||||
clavusPosBonus: {pct: 105, min: 90, max: 130},
|
||||
clavusWidth: {pct: 100, min: 50, max: 150},
|
||||
length: {
|
||||
list: ['ToKnee',
|
||||
'ToMidLeg','ToFloor'],
|
||||
dflt: 'ToKnee'
|
||||
},
|
||||
width: {
|
||||
list: ['ToElbow', 'ToShoulder', 'ToMidArm'],
|
||||
dflt: 'ToMidArm'
|
||||
},
|
||||
// advanced
|
||||
forceWidth: {bool: false}
|
||||
headRatio: { pct: 100, min: 80, max: 120 },
|
||||
armholeDrop: { pct: 110, min: 100, max: 150 },
|
||||
lengthBonus: { pct: 90, min: 60, max: 130 },
|
||||
widthBonus: { pct: 100, min: 50, max: 130 },
|
||||
clavi: { bool: false },
|
||||
clavusPosBonus: { pct: 105, min: 90, max: 130 },
|
||||
clavusWidth: { pct: 100, min: 50, max: 150 },
|
||||
length: {
|
||||
list: ['ToKnee', 'ToMidLeg', 'ToFloor'],
|
||||
dflt: 'ToKnee',
|
||||
},
|
||||
width: {
|
||||
list: ['ToElbow', 'ToShoulder', 'ToMidArm'],
|
||||
dflt: 'ToMidArm',
|
||||
},
|
||||
// advanced
|
||||
forceWidth: { bool: false },
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,17 +1,6 @@
|
|||
export default function (part) {
|
||||
const {
|
||||
options,
|
||||
Point,
|
||||
Path,
|
||||
points,
|
||||
paths,
|
||||
Snippet,
|
||||
snippets,
|
||||
complete,
|
||||
sa,
|
||||
paperless,
|
||||
macro
|
||||
} = part.shorthand()
|
||||
const { options, Point, Path, points, paths, Snippet, snippets, complete, sa, paperless, macro } =
|
||||
part.shorthand()
|
||||
|
||||
const w = 500 * options.size
|
||||
points.topLeft = new Point(0, 0)
|
||||
|
@ -47,12 +36,12 @@ export default function (part) {
|
|||
macro('hd', {
|
||||
from: points.bottomLeft,
|
||||
to: points.bottomRight,
|
||||
y: points.bottomLeft.y + sa + 15
|
||||
y: points.bottomLeft.y + sa + 15,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.bottomRight,
|
||||
to: points.topRight,
|
||||
x: points.topRight.x + sa + 15
|
||||
x: points.topRight.x + sa + 15,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -8,5 +8,4 @@ const Pattern = new freesewing.Design(config, plugins)
|
|||
|
||||
Pattern.prototype.draftTunica = draftTunica
|
||||
|
||||
|
||||
export default Pattern
|
||||
|
|
|
@ -1,195 +1,205 @@
|
|||
export default function(part) {
|
||||
let {
|
||||
Point,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
measurements,
|
||||
options,
|
||||
macro,
|
||||
complete,
|
||||
snippets,
|
||||
Snippet,
|
||||
sa,
|
||||
paperless,
|
||||
} = part.shorthand();
|
||||
|
||||
// define some variables
|
||||
export default function (part) {
|
||||
let {
|
||||
Point,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
measurements,
|
||||
options,
|
||||
macro,
|
||||
complete,
|
||||
snippets,
|
||||
Snippet,
|
||||
sa,
|
||||
paperless,
|
||||
} = part.shorthand()
|
||||
|
||||
let width
|
||||
if (options.width === 'ToElbow'){width = measurements.shoulderToElbow}
|
||||
if (options.width === 'ToMidArm'){width = measurements.shoulderToElbow/2}
|
||||
if (options.width === 'ToShoulder'){width = 0} // careful! takes other measurements if those are bigger to ensure that the tunica actually fits your body, use forceWidth if you know what you're doing
|
||||
// define some variables
|
||||
|
||||
let hem_pos
|
||||
if (options.length === 'ToKnee'){hem_pos = measurements.waistToKnee}
|
||||
if (options.length === 'ToMidLeg'){hem_pos = measurements.waistToKnee/1.3}//UpperLeg}
|
||||
if (options.length === 'ToFloor'){hem_pos = measurements.waistToFloor*0.95}
|
||||
|
||||
let hwidth = (measurements.shoulderToShoulder/2 + width) * options.widthBonus
|
||||
let length = (measurements.hpsToWaistBack + hem_pos) * options.lengthBonus
|
||||
let hhead = (measurements.head/4)*options.headRatio
|
||||
let armhole = measurements.biceps/2*1.3*options.armholeDrop
|
||||
let clavusPos = hhead*options.clavusPosBonus
|
||||
let clavusWidth = options.clavusWidth*hwidth/13/options.widthBonus
|
||||
let width
|
||||
if (options.width === 'ToElbow') {
|
||||
width = measurements.shoulderToElbow
|
||||
}
|
||||
if (options.width === 'ToMidArm') {
|
||||
width = measurements.shoulderToElbow / 2
|
||||
}
|
||||
if (options.width === 'ToShoulder') {
|
||||
width = 0
|
||||
} // careful! takes other measurements if those are bigger to ensure that the tunica actually fits your body, use forceWidth if you know what you're doing
|
||||
|
||||
// some checks, can be circumvented with forceWidth
|
||||
if (options.forceWidth === false ){
|
||||
if (hwidth < measurements.waist/4)
|
||||
{hwidth = measurements.waist/4*options.widthBonus}
|
||||
if (hwidth < measurements.hips/4)
|
||||
{hwidth = measurements.hips/4*options.widthBonus}
|
||||
if (hwidth < measurements.chest/4)
|
||||
{hwidth = measurements.chest/4*options.widthBonus}
|
||||
if (hwidth < measurements.seat/4)
|
||||
{hwidth = measurements.seat/4*options.widthBonus}
|
||||
let hem_pos
|
||||
if (options.length === 'ToKnee') {
|
||||
hem_pos = measurements.waistToKnee
|
||||
}
|
||||
if (options.length === 'ToMidLeg') {
|
||||
hem_pos = measurements.waistToKnee / 1.3
|
||||
} //UpperLeg}
|
||||
if (options.length === 'ToFloor') {
|
||||
hem_pos = measurements.waistToFloor * 0.95
|
||||
}
|
||||
|
||||
let hwidth = (measurements.shoulderToShoulder / 2 + width) * options.widthBonus
|
||||
let length = (measurements.hpsToWaistBack + hem_pos) * options.lengthBonus
|
||||
let hhead = (measurements.head / 4) * options.headRatio
|
||||
let armhole = (measurements.biceps / 2) * 1.3 * options.armholeDrop
|
||||
let clavusPos = hhead * options.clavusPosBonus
|
||||
let clavusWidth = (options.clavusWidth * hwidth) / 13 / options.widthBonus
|
||||
|
||||
// some checks, can be circumvented with forceWidth
|
||||
if (options.forceWidth === false) {
|
||||
if (hwidth < measurements.waist / 4) {
|
||||
hwidth = (measurements.waist / 4) * options.widthBonus
|
||||
}
|
||||
|
||||
if (hwidth < measurements.hips / 4) {
|
||||
hwidth = (measurements.hips / 4) * options.widthBonus
|
||||
}
|
||||
if (hwidth < measurements.chest / 4) {
|
||||
hwidth = (measurements.chest / 4) * options.widthBonus
|
||||
}
|
||||
if (hwidth < measurements.seat / 4) {
|
||||
hwidth = (measurements.seat / 4) * options.widthBonus
|
||||
}
|
||||
}
|
||||
|
||||
// make points
|
||||
points.top = new Point(0, 0)
|
||||
points.bottom = new Point(0, length)
|
||||
points.topLeft = points.top.shift(0, -hwidth)
|
||||
points.bottomLeft = points.bottom.shift(0, points.bottom.dx(points.topLeft))
|
||||
points.headLeft = points.top.shift(180, hhead)
|
||||
points.armholeLeft = points.topLeft.shift(-90, armhole)
|
||||
|
||||
// draw paths
|
||||
paths.seam = new Path()
|
||||
.move(points.top)
|
||||
.line(points.topLeft)
|
||||
.line(points.bottomLeft)
|
||||
.attr('class', 'fabric')
|
||||
|
||||
paths.hem = new Path().move(points.bottomLeft).line(points.bottom).attr('class', 'fabric')
|
||||
|
||||
paths.fold = new Path().move(points.bottom).line(points.top).attr('class', 'fabric')
|
||||
|
||||
// clavi
|
||||
if (options.clavi) {
|
||||
// make points
|
||||
points.top = new Point(0,0)
|
||||
points.bottom = new Point(0,length)
|
||||
points.topLeft = points.top.shift(0,-hwidth)
|
||||
points.bottomLeft = points.bottom.shift(0,points.bottom.dx(points.topLeft))
|
||||
points.headLeft = points.top.shift(180, hhead)
|
||||
points.armholeLeft = points.topLeft.shift(-90,armhole)
|
||||
points.clavusTopRight = points.top.shift(180, clavusPos)
|
||||
points.clavusBottomRight = points.bottom.shift(0, points.top.dx(points.clavusTopRight))
|
||||
points.clavusTopLeft = points.clavusTopRight.shift(180, clavusWidth)
|
||||
points.clavusBottomLeft = points.bottom.shift(0, points.top.dx(points.clavusTopLeft))
|
||||
|
||||
// draw paths
|
||||
paths.seam = new Path()
|
||||
.move(points.top)
|
||||
.line(points.topLeft)
|
||||
.line(points.bottomLeft)
|
||||
.attr('class', 'fabric')
|
||||
|
||||
paths.hem = new Path()
|
||||
.move(points.bottomLeft)
|
||||
.line(points.bottom)
|
||||
.attr('class', 'fabric')
|
||||
|
||||
paths.fold = new Path()
|
||||
.move(points.bottom)
|
||||
.line(points.top)
|
||||
.attr('class', 'fabric')
|
||||
paths.clavusRight = new Path()
|
||||
.move(points.clavusTopRight)
|
||||
.line(points.clavusBottomRight)
|
||||
.attr('class', 'various dashed')
|
||||
paths.clavusLeft = new Path()
|
||||
.move(points.clavusTopLeft)
|
||||
.line(points.clavusBottomLeft)
|
||||
.attr('class', 'various dashed')
|
||||
.attr('data-text', 'BiasTape')
|
||||
.attr('data-text-class', 'center fill-various')
|
||||
}
|
||||
|
||||
// clavi
|
||||
if (options.clavi) {
|
||||
|
||||
// make points
|
||||
points.clavusTopRight = points.top.shift(180, clavusPos)
|
||||
points.clavusBottomRight = points.bottom.shift(0,points.top.dx(points.clavusTopRight))
|
||||
points.clavusTopLeft = points.clavusTopRight.shift(180,clavusWidth)
|
||||
points.clavusBottomLeft = points.bottom.shift(0,points.top.dx(points.clavusTopLeft))
|
||||
// Complete?
|
||||
if (complete) {
|
||||
// notches
|
||||
snippets.hl = new Snippet('notch', points.headLeft)
|
||||
snippets.al = new Snippet('notch', points.armholeLeft)
|
||||
|
||||
// draw paths
|
||||
paths.clavusRight = new Path()
|
||||
.move(points.clavusTopRight)
|
||||
.line(points.clavusBottomRight)
|
||||
.attr("class", "various dashed")
|
||||
paths.clavusLeft = new Path()
|
||||
.move(points.clavusTopLeft)
|
||||
.line(points.clavusBottomLeft)
|
||||
.attr("class", "various dashed")
|
||||
.attr("data-text", "BiasTape")
|
||||
.attr("data-text-class", "center fill-various")
|
||||
// cut on fold
|
||||
macro('cutonfold', {
|
||||
from: points.bottom,
|
||||
to: points.top,
|
||||
grainline: true,
|
||||
})
|
||||
|
||||
// logo & title
|
||||
points.logo = points.top.shift(45, points.bottom.dy(points.top) / 3)
|
||||
snippets.logo = new Snippet('logo', points.logo)
|
||||
points.title = points.logo.shift(90, points.bottom.dy(points.top) / 4)
|
||||
macro('title', {
|
||||
at: points.title,
|
||||
nr: 1,
|
||||
title: 'tunica',
|
||||
})
|
||||
points.__titleNr.attr('data-text-class', 'center')
|
||||
points.__titleName.attr('data-text-class', 'center')
|
||||
points.__titlePattern.attr('data-text-class', 'center')
|
||||
|
||||
// scalebox
|
||||
points.scalebox = points.title.shift(90, points.bottom.dy(points.top) / 5)
|
||||
macro('scalebox', { at: points.scalebox })
|
||||
|
||||
// seam allowance
|
||||
if (sa) {
|
||||
paths.sa = paths.seam
|
||||
.offset(sa)
|
||||
.join(paths.hem.offset(sa * 2.5))
|
||||
.close()
|
||||
.attr('class', 'fabric sa')
|
||||
}
|
||||
|
||||
// Complete?
|
||||
if (complete) {
|
||||
// notches
|
||||
snippets.hl = new Snippet('notch', points.headLeft)
|
||||
snippets.al = new Snippet('notch', points.armholeLeft)
|
||||
|
||||
// cut on fold
|
||||
macro('cutonfold', {
|
||||
from: points.bottom,
|
||||
to: points.top,
|
||||
grainline: true,
|
||||
})
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
macro('vd', {
|
||||
from: points.top,
|
||||
to: points.bottom,
|
||||
x: points.bottomLeft.x + 10,
|
||||
})
|
||||
|
||||
// logo & title
|
||||
points.logo = points.top.shift(45,points.bottom.dy(points.top)/3)
|
||||
snippets.logo = new Snippet("logo", points.logo)
|
||||
points.title = points.logo.shift(90, points.bottom.dy(points.top)/4)
|
||||
macro("title", {
|
||||
at: points.title,
|
||||
nr: 1,
|
||||
title: "tunica"
|
||||
})
|
||||
points.__titleNr.attr('data-text-class', 'center')
|
||||
points.__titleName.attr('data-text-class', 'center')
|
||||
points.__titlePattern.attr('data-text-class', 'center')
|
||||
macro('vd', {
|
||||
from: points.armholeLeft,
|
||||
to: points.bottomLeft,
|
||||
x: points.armholeLeft.x - 15,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.topLeft,
|
||||
to: points.armholeLeft,
|
||||
x: points.armholeLeft.x - 15,
|
||||
})
|
||||
|
||||
// scalebox
|
||||
points.scalebox = points.title.shift(90, points.bottom.dy(points.top)/5)
|
||||
macro("scalebox", { at: points.scalebox })
|
||||
macro('hd', {
|
||||
from: points.topLeft,
|
||||
to: points.top,
|
||||
y: points.top.y + 15,
|
||||
})
|
||||
|
||||
// seam allowance
|
||||
if (sa) {
|
||||
paths.sa = paths.seam.offset(sa)
|
||||
.join(paths.hem.offset(sa * 2.5))
|
||||
.close()
|
||||
.attr('class', 'fabric sa')
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
macro("vd", {
|
||||
from: points.top,
|
||||
to: points.bottom,
|
||||
x: points.bottomLeft.x+10
|
||||
});
|
||||
|
||||
macro("vd", {
|
||||
from: points.armholeLeft,
|
||||
to: points.bottomLeft,
|
||||
x: points.armholeLeft.x - 15
|
||||
});
|
||||
macro("vd", {
|
||||
from: points.topLeft,
|
||||
to: points.armholeLeft,
|
||||
x: points.armholeLeft.x - 15
|
||||
});
|
||||
|
||||
macro("hd", {
|
||||
from: points.topLeft,
|
||||
to: points.top,
|
||||
y: points.top.y + 15
|
||||
});
|
||||
|
||||
macro("hd", {
|
||||
from: points.headLeft,
|
||||
to: points.top,
|
||||
y: points.top.y - 15
|
||||
});
|
||||
macro("hd", {
|
||||
from: points.topLeft,
|
||||
to: points.headLeft,
|
||||
y: points.top.y - 15
|
||||
});
|
||||
macro('hd', {
|
||||
from: points.headLeft,
|
||||
to: points.top,
|
||||
y: points.top.y - 15,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.topLeft,
|
||||
to: points.headLeft,
|
||||
y: points.top.y - 15,
|
||||
})
|
||||
|
||||
// for clavi
|
||||
if (options.clavi){
|
||||
macro("hd", {
|
||||
from: points.clavusTopLeft,
|
||||
to: points.clavusTopRight,
|
||||
y: points.clavusTopLeft.y + 25
|
||||
});
|
||||
macro("hd", {
|
||||
from: points.clavusTopRight,
|
||||
to: points.headLeft,
|
||||
y: points.clavusTopRight.y + 25
|
||||
});
|
||||
macro("hd", {
|
||||
from: points.topLeft,
|
||||
to: points.clavusTopLeft,
|
||||
y: points.clavusTopLeft.y + 25
|
||||
});
|
||||
macro("hd", {
|
||||
from: points.clavusTopRight,
|
||||
to: points.top,
|
||||
y: points.clavusTopLeft.y + 30
|
||||
});
|
||||
}
|
||||
}
|
||||
// for clavi
|
||||
if (options.clavi) {
|
||||
macro('hd', {
|
||||
from: points.clavusTopLeft,
|
||||
to: points.clavusTopRight,
|
||||
y: points.clavusTopLeft.y + 25,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.clavusTopRight,
|
||||
to: points.headLeft,
|
||||
y: points.clavusTopRight.y + 25,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.topLeft,
|
||||
to: points.clavusTopLeft,
|
||||
y: points.clavusTopLeft.y + 25,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.clavusTopRight,
|
||||
to: points.top,
|
||||
y: points.clavusTopLeft.y + 30,
|
||||
})
|
||||
}
|
||||
}
|
||||
return part;
|
||||
}
|
||||
return part
|
||||
}
|
||||
|
|
|
@ -10,65 +10,63 @@ export default {
|
|||
department: 'tops',
|
||||
type: 'pattern',
|
||||
difficulty: 1,
|
||||
tags: [
|
||||
'freesewing',
|
||||
'design',
|
||||
'diy',
|
||||
'fashion',
|
||||
'made to measure',
|
||||
'parametric design',
|
||||
'pattern',
|
||||
'sewing',
|
||||
'sewing pattern',
|
||||
tags: [
|
||||
'freesewing',
|
||||
'design',
|
||||
'diy',
|
||||
'fashion',
|
||||
'made to measure',
|
||||
'parametric design',
|
||||
'pattern',
|
||||
'sewing',
|
||||
'sewing pattern',
|
||||
],
|
||||
optionGroups: {
|
||||
fit:
|
||||
['headRatio']
|
||||
,
|
||||
style: ['lengthBonus','widthBonus',
|
||||
'length',
|
||||
'neckoRatio',
|
||||
// 'width',
|
||||
'hipLengthBonus',
|
||||
'neckline'
|
||||
],
|
||||
},
|
||||
measurements: [
|
||||
'head',
|
||||
'neck',
|
||||
// 'shoulderToElbow',
|
||||
'shoulderToShoulder',
|
||||
// 'biceps',
|
||||
'hpsToWaistBack',
|
||||
'waistToKnee',
|
||||
'waistToHips',
|
||||
// 'waist',
|
||||
// 'chest',
|
||||
// 'seat',
|
||||
// 'hips',
|
||||
'waistToFloor',
|
||||
'waistToUpperLeg'
|
||||
fit: ['headRatio'],
|
||||
style: [
|
||||
'lengthBonus',
|
||||
'widthBonus',
|
||||
'length',
|
||||
'neckoRatio',
|
||||
// 'width',
|
||||
'hipLengthBonus',
|
||||
'neckline',
|
||||
],
|
||||
dependencies: {front: 'base',
|
||||
back: 'base'},
|
||||
inject: {
|
||||
front: 'base',
|
||||
back: 'base'
|
||||
},
|
||||
hide: ['base',],
|
||||
},
|
||||
measurements: [
|
||||
'head',
|
||||
'neck',
|
||||
// 'shoulderToElbow',
|
||||
'shoulderToShoulder',
|
||||
// 'biceps',
|
||||
'hpsToWaistBack',
|
||||
'waistToKnee',
|
||||
'waistToHips',
|
||||
// 'waist',
|
||||
// 'chest',
|
||||
// 'seat',
|
||||
// 'hips',
|
||||
'waistToFloor',
|
||||
'waistToUpperLeg',
|
||||
],
|
||||
dependencies: { front: 'base', back: 'base' },
|
||||
inject: {
|
||||
front: 'base',
|
||||
back: 'base',
|
||||
},
|
||||
hide: ['base'],
|
||||
options: {
|
||||
headRatio: {pct: 100, min: 80, max: 120},
|
||||
lengthBonus:{ pct: 85, min: 60, max: 130 },
|
||||
widthBonus: {pct: 95, min:50, max: 130},
|
||||
length: {
|
||||
list: ['ToKnee',
|
||||
'ToMidLeg','ToFloor'],
|
||||
dflt: 'ToKnee'
|
||||
},
|
||||
neckline: {bool: true},
|
||||
neckoRatio: {pct: 100, min:10, max:190},
|
||||
hipLengthBonus: {pct:95, min:80, max:120 }
|
||||
// advanced
|
||||
// forceWidth: {bool: false}
|
||||
headRatio: { pct: 100, min: 80, max: 120 },
|
||||
lengthBonus: { pct: 85, min: 60, max: 130 },
|
||||
widthBonus: { pct: 95, min: 50, max: 130 },
|
||||
length: {
|
||||
list: ['ToKnee', 'ToMidLeg', 'ToFloor'],
|
||||
dflt: 'ToKnee',
|
||||
},
|
||||
neckline: { bool: true },
|
||||
neckoRatio: { pct: 100, min: 10, max: 190 },
|
||||
hipLengthBonus: { pct: 95, min: 80, max: 120 },
|
||||
// advanced
|
||||
// forceWidth: {bool: false}
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,40 +1,37 @@
|
|||
export default function(part) {
|
||||
let {
|
||||
Point,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
measurements,
|
||||
options,
|
||||
macro,
|
||||
complete,
|
||||
snippets,
|
||||
Snippet,
|
||||
sa,
|
||||
paperless,
|
||||
} = part.shorthand();
|
||||
export default function (part) {
|
||||
let {
|
||||
Point,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
measurements,
|
||||
options,
|
||||
macro,
|
||||
complete,
|
||||
snippets,
|
||||
Snippet,
|
||||
sa,
|
||||
paperless,
|
||||
} = part.shorthand()
|
||||
|
||||
// Complete?
|
||||
if (complete) {
|
||||
// Complete?
|
||||
if (complete) {
|
||||
// logo & title
|
||||
points.logo = points.top.shift(45, points.bottom.dy(points.top) / 5)
|
||||
snippets.logo = new Snippet('logo', points.logo)
|
||||
points.title = points.logo.shift(90, points.bottom.dy(points.top) / 4)
|
||||
macro('title', {
|
||||
at: points.title,
|
||||
nr: 2,
|
||||
title: 'back',
|
||||
})
|
||||
points.__titleNr.attr('data-text-class', 'center')
|
||||
points.__titleName.attr('data-text-class', 'center')
|
||||
points.__titlePattern.attr('data-text-class', 'center')
|
||||
|
||||
|
||||
// logo & title
|
||||
points.logo = points.top.shift(45,points.bottom.dy(points.top)/5)
|
||||
snippets.logo = new Snippet("logo", points.logo)
|
||||
points.title = points.logo.shift(90, points.bottom.dy(points.top)/4)
|
||||
macro("title", {
|
||||
at: points.title,
|
||||
nr: 2,
|
||||
title: "back"
|
||||
})
|
||||
points.__titleNr.attr('data-text-class', 'center')
|
||||
points.__titleName.attr('data-text-class', 'center')
|
||||
points.__titlePattern.attr('data-text-class', 'center')
|
||||
|
||||
// scalebox
|
||||
points.scalebox = points.title.shift(90, points.bottom.dy(points.top)/5)
|
||||
macro("scalebox", { at: points.scalebox })
|
||||
|
||||
}
|
||||
return part;
|
||||
// scalebox
|
||||
points.scalebox = points.title.shift(90, points.bottom.dy(points.top) / 5)
|
||||
macro('scalebox', { at: points.scalebox })
|
||||
}
|
||||
return part
|
||||
}
|
||||
|
|
|
@ -1,201 +1,189 @@
|
|||
export default function(part) {
|
||||
let {
|
||||
Point,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
measurements,
|
||||
options,
|
||||
macro,
|
||||
complete,
|
||||
snippets,
|
||||
Snippet,
|
||||
sa,
|
||||
paperless,
|
||||
store,
|
||||
utils
|
||||
} = part.shorthand();
|
||||
|
||||
// define some variables
|
||||
export default function (part) {
|
||||
let {
|
||||
Point,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
measurements,
|
||||
options,
|
||||
macro,
|
||||
complete,
|
||||
snippets,
|
||||
Snippet,
|
||||
sa,
|
||||
paperless,
|
||||
store,
|
||||
utils,
|
||||
} = part.shorthand()
|
||||
|
||||
// let width
|
||||
//if (options.width === 'ToElbow'){width = measurements.shoulderToElbow}
|
||||
//if (options.width === 'ToMidArm'){width = measurements.shoulderToElbow/2}
|
||||
// if (options.width === 'ToShoulder'){width = 0} // careful! takes other measurements if those are bigger to ensure that the tunica actually fits your body, use forceWidth if you know what you're doing
|
||||
// define some variables
|
||||
|
||||
let hem_pos
|
||||
if (options.length === 'ToKnee'){hem_pos = measurements.waistToKnee}
|
||||
if (options.length === 'ToMidLeg'){hem_pos = measurements.waistToKnee/1.3}//UpperLeg}
|
||||
if (options.length === 'ToFloor'){hem_pos = measurements.waistToFloor*0.95}
|
||||
// let width
|
||||
//if (options.width === 'ToElbow'){width = measurements.shoulderToElbow}
|
||||
//if (options.width === 'ToMidArm'){width = measurements.shoulderToElbow/2}
|
||||
// if (options.width === 'ToShoulder'){width = 0} // careful! takes other measurements if those are bigger to ensure that the tunica actually fits your body, use forceWidth if you know what you're doing
|
||||
|
||||
let hiplength = (measurements.hpsToWaistBack + measurements.waistToHips)*options.hipLengthBonus
|
||||
let hwidth = (measurements.shoulderToShoulder/2) * options.widthBonus
|
||||
let length = (measurements.hpsToWaistBack + hem_pos) * options.lengthBonus
|
||||
let hhead = (measurements.head/4)*options.headRatio
|
||||
let hem_pos
|
||||
if (options.length === 'ToKnee') {
|
||||
hem_pos = measurements.waistToKnee
|
||||
}
|
||||
if (options.length === 'ToMidLeg') {
|
||||
hem_pos = measurements.waistToKnee / 1.3
|
||||
} //UpperLeg}
|
||||
if (options.length === 'ToFloor') {
|
||||
hem_pos = measurements.waistToFloor * 0.95
|
||||
}
|
||||
|
||||
let goldenRatio = 1.618033
|
||||
let hiplength = (measurements.hpsToWaistBack + measurements.waistToHips) * options.hipLengthBonus
|
||||
let hwidth = (measurements.shoulderToShoulder / 2) * options.widthBonus
|
||||
let length = (measurements.hpsToWaistBack + hem_pos) * options.lengthBonus
|
||||
let hhead = (measurements.head / 4) * options.headRatio
|
||||
|
||||
|
||||
store.set('hhead',hhead)
|
||||
store.set('goldenRatio',goldenRatio)
|
||||
let goldenRatio = 1.618033
|
||||
|
||||
//let armhole = measurements.biceps/2*1.3*options.armholeDrop
|
||||
|
||||
// make points
|
||||
points.top = new Point(0,0)
|
||||
points.bottom = new Point(0,length)
|
||||
points.topLeft = points.top.shift(0,-hwidth)
|
||||
points.bottomLeft = points.bottom.shift(0,points.bottom.dx(points.topLeft))
|
||||
points.headLeft = points.top.shift(180, hhead)
|
||||
//points.armholeLeft = points.topLeft.shift(-90,armhole)
|
||||
points.bottomMiddle = points.bottom.shiftFractionTowards(points.bottomLeft,.5)
|
||||
points.hips = points.top.shift(-90,hiplength)
|
||||
points.hipsLeft = points.hips.shift(0,points.bottom.dx(points.bottomLeft))
|
||||
store.set('hhead', hhead)
|
||||
store.set('goldenRatio', goldenRatio)
|
||||
|
||||
//let armhole = measurements.biceps/2*1.3*options.armholeDrop
|
||||
|
||||
points.triangle = points.bottom.shift(90,points.bottomLeft.dx(points.bottom)/goldenRatio) // golderatio proportinal to width
|
||||
// points.triangle = points.hips.shift(-90,points.hips.dy(points.bottom)/goldenRatio) // with GoldenRation between vertical lengths
|
||||
points.triangleLeft = points.triangle.shift(0,points.bottom.dx(points.bottomLeft))
|
||||
// make points
|
||||
points.top = new Point(0, 0)
|
||||
points.bottom = new Point(0, length)
|
||||
points.topLeft = points.top.shift(0, -hwidth)
|
||||
points.bottomLeft = points.bottom.shift(0, points.bottom.dx(points.topLeft))
|
||||
points.headLeft = points.top.shift(180, hhead)
|
||||
//points.armholeLeft = points.topLeft.shift(-90,armhole)
|
||||
points.bottomMiddle = points.bottom.shiftFractionTowards(points.bottomLeft, 0.5)
|
||||
points.hips = points.top.shift(-90, hiplength)
|
||||
points.hipsLeft = points.hips.shift(0, points.bottom.dx(points.bottomLeft))
|
||||
|
||||
points.triangle = points.bottom.shift(90, points.bottomLeft.dx(points.bottom) / goldenRatio) // golderatio proportinal to width
|
||||
// points.triangle = points.hips.shift(-90,points.hips.dy(points.bottom)/goldenRatio) // with GoldenRation between vertical lengths
|
||||
points.triangleLeft = points.triangle.shift(0, points.bottom.dx(points.bottomLeft))
|
||||
|
||||
// draw paths
|
||||
paths.seam = new Path()
|
||||
.move(points.top)
|
||||
.line(points.topLeft)
|
||||
.line(points.triangleLeft)
|
||||
.line(points.bottomMiddle)
|
||||
.line(points.triangle)
|
||||
// .line(points.bottomLeft)
|
||||
.attr('class', 'fabric')
|
||||
|
||||
|
||||
// draw paths
|
||||
paths.seam = new Path()
|
||||
.move(points.top)
|
||||
.line(points.topLeft)
|
||||
.line(points.triangleLeft)
|
||||
.line(points.bottomMiddle)
|
||||
.line(points.triangle)
|
||||
// .line(points.bottomLeft)
|
||||
.attr('class', 'fabric')
|
||||
|
||||
// paths.hem = new Path()
|
||||
// .move(points.bottomLeft)
|
||||
// .line(points.bottom)
|
||||
// .attr('class', 'fabric')
|
||||
|
||||
paths.fold = new Path()
|
||||
.move(points.triangle)
|
||||
.line(points.top)
|
||||
.attr('class', 'fabric')
|
||||
// .move(points.bottomLeft)
|
||||
// .line(points.bottom)
|
||||
// .attr('class', 'fabric')
|
||||
|
||||
|
||||
// Complete?
|
||||
if (complete) {
|
||||
// notches
|
||||
if (options.neckline === false){
|
||||
snippets.hl = new Snippet('notch', points.headLeft)
|
||||
}
|
||||
|
||||
// cut on fold
|
||||
|
||||
macro('cutonfold', {
|
||||
from: points.triangle,
|
||||
to: points.top,
|
||||
grainline: true,
|
||||
})
|
||||
paths.fold = new Path().move(points.triangle).line(points.top).attr('class', 'fabric')
|
||||
|
||||
// logo & title
|
||||
points.logo = points.top.shift(45,points.bottom.dy(points.top)/5)
|
||||
snippets.logo = new Snippet("logo", points.logo)
|
||||
points.title = points.logo.shift(90, points.bottom.dy(points.top)/4)
|
||||
macro("title", {
|
||||
at: points.title,
|
||||
nr: 1,
|
||||
title: "wappenrock-front"
|
||||
})
|
||||
points.__titleNr.attr('data-text-class', 'center')
|
||||
points.__titleName.attr('data-text-class', 'center')
|
||||
points.__titlePattern.attr('data-text-class', 'center')
|
||||
|
||||
// scalebox
|
||||
points.scalebox = points.title.shift(90, points.bottom.dy(points.top)/5)
|
||||
macro("scalebox", { at: points.scalebox })
|
||||
|
||||
// seam allowance
|
||||
if (sa) {
|
||||
|
||||
|
||||
|
||||
paths.sa = paths.seam.offset(sa)
|
||||
// .join(paths.hem.offset(sa * 2.5))
|
||||
.close()
|
||||
.attr('class', 'fabric sa')
|
||||
|
||||
// make sa correct for corners
|
||||
points.samod = points.triangle.shiftFractionTowards(points.top,-0.1)
|
||||
paths.samod = new Path()
|
||||
.move(points.triangle)
|
||||
.line(points.samod)
|
||||
.setRender(false)
|
||||
|
||||
let sasplit = paths.samod.intersects(paths.sa)
|
||||
points.sasplit = sasplit[0]
|
||||
|
||||
let sahalves = paths.sa.split(points.sasplit)
|
||||
paths.sa = sahalves[0]
|
||||
.close()
|
||||
.attr('class', 'fabric sa')
|
||||
|
||||
|
||||
// paths.saadd = new Path()
|
||||
// .move(points.sasplit)
|
||||
// .line(points.top)
|
||||
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
macro("vd", {
|
||||
from: points.top,
|
||||
to: points.bottom,
|
||||
x: points.bottom.x+10
|
||||
});
|
||||
macro("vd", {
|
||||
from: points.triangleLeft,
|
||||
to: points.bottomLeft,
|
||||
x: points.bottomLeft.x-10
|
||||
});
|
||||
|
||||
macro("vd", {
|
||||
from: points.topLeft,
|
||||
to: points.triangleLeft,
|
||||
x: points.bottomLeft.x-10
|
||||
});
|
||||
|
||||
|
||||
macro("hd", {
|
||||
from: points.topLeft,
|
||||
to: points.top,
|
||||
y: points.top.y + 15
|
||||
});
|
||||
|
||||
macro("hd", {
|
||||
from: points.headLeft,
|
||||
to: points.top,
|
||||
y: points.top.y - 15
|
||||
});
|
||||
macro("hd", {
|
||||
from: points.topLeft,
|
||||
to: points.headLeft,
|
||||
y: points.top.y - 15
|
||||
});
|
||||
macro("hd", {
|
||||
from: points.triangleLeft,
|
||||
to: points.bottomMiddle,
|
||||
y: points.triangleLeft.y
|
||||
});
|
||||
macro("vd", {
|
||||
from: points.hipsLeft,
|
||||
to: points.triangleLeft,
|
||||
x: points.triangleLeft.x + 5
|
||||
});
|
||||
macro("ld", {
|
||||
from: points.triangleLeft,
|
||||
to: points.bottomMiddle,
|
||||
d: -10
|
||||
});
|
||||
}
|
||||
// Complete?
|
||||
if (complete) {
|
||||
// notches
|
||||
if (options.neckline === false) {
|
||||
snippets.hl = new Snippet('notch', points.headLeft)
|
||||
}
|
||||
return part;
|
||||
|
||||
// cut on fold
|
||||
|
||||
macro('cutonfold', {
|
||||
from: points.triangle,
|
||||
to: points.top,
|
||||
grainline: true,
|
||||
})
|
||||
|
||||
// logo & title
|
||||
points.logo = points.top.shift(45, points.bottom.dy(points.top) / 5)
|
||||
snippets.logo = new Snippet('logo', points.logo)
|
||||
points.title = points.logo.shift(90, points.bottom.dy(points.top) / 4)
|
||||
macro('title', {
|
||||
at: points.title,
|
||||
nr: 1,
|
||||
title: 'wappenrock-front',
|
||||
})
|
||||
points.__titleNr.attr('data-text-class', 'center')
|
||||
points.__titleName.attr('data-text-class', 'center')
|
||||
points.__titlePattern.attr('data-text-class', 'center')
|
||||
|
||||
// scalebox
|
||||
points.scalebox = points.title.shift(90, points.bottom.dy(points.top) / 5)
|
||||
macro('scalebox', { at: points.scalebox })
|
||||
|
||||
// seam allowance
|
||||
if (sa) {
|
||||
paths.sa = paths.seam
|
||||
.offset(sa)
|
||||
// .join(paths.hem.offset(sa * 2.5))
|
||||
.close()
|
||||
.attr('class', 'fabric sa')
|
||||
|
||||
// make sa correct for corners
|
||||
points.samod = points.triangle.shiftFractionTowards(points.top, -0.1)
|
||||
paths.samod = new Path().move(points.triangle).line(points.samod).setRender(false)
|
||||
|
||||
let sasplit = paths.samod.intersects(paths.sa)
|
||||
points.sasplit = sasplit[0]
|
||||
|
||||
let sahalves = paths.sa.split(points.sasplit)
|
||||
paths.sa = sahalves[0].close().attr('class', 'fabric sa')
|
||||
|
||||
// paths.saadd = new Path()
|
||||
// .move(points.sasplit)
|
||||
// .line(points.top)
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
macro('vd', {
|
||||
from: points.top,
|
||||
to: points.bottom,
|
||||
x: points.bottom.x + 10,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.triangleLeft,
|
||||
to: points.bottomLeft,
|
||||
x: points.bottomLeft.x - 10,
|
||||
})
|
||||
|
||||
macro('vd', {
|
||||
from: points.topLeft,
|
||||
to: points.triangleLeft,
|
||||
x: points.bottomLeft.x - 10,
|
||||
})
|
||||
|
||||
macro('hd', {
|
||||
from: points.topLeft,
|
||||
to: points.top,
|
||||
y: points.top.y + 15,
|
||||
})
|
||||
|
||||
macro('hd', {
|
||||
from: points.headLeft,
|
||||
to: points.top,
|
||||
y: points.top.y - 15,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.topLeft,
|
||||
to: points.headLeft,
|
||||
y: points.top.y - 15,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.triangleLeft,
|
||||
to: points.bottomMiddle,
|
||||
y: points.triangleLeft.y,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.hipsLeft,
|
||||
to: points.triangleLeft,
|
||||
x: points.triangleLeft.x + 5,
|
||||
})
|
||||
macro('ld', {
|
||||
from: points.triangleLeft,
|
||||
to: points.bottomMiddle,
|
||||
d: -10,
|
||||
})
|
||||
}
|
||||
}
|
||||
return part
|
||||
}
|
||||
|
|
|
@ -1,62 +1,55 @@
|
|||
export default function(part) {
|
||||
let {
|
||||
Point,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
measurements,
|
||||
options,
|
||||
macro,
|
||||
complete,
|
||||
snippets,
|
||||
Snippet,
|
||||
sa,
|
||||
paperless,
|
||||
store
|
||||
} = part.shorthand();
|
||||
export default function (part) {
|
||||
let {
|
||||
Point,
|
||||
points,
|
||||
Path,
|
||||
paths,
|
||||
measurements,
|
||||
options,
|
||||
macro,
|
||||
complete,
|
||||
snippets,
|
||||
Snippet,
|
||||
sa,
|
||||
paperless,
|
||||
store,
|
||||
} = part.shorthand()
|
||||
|
||||
let head = store.get('hhead') * 2
|
||||
let goldenRatio = store.get('goldenRatio')
|
||||
let ratio = goldenRatio * options.neckoRatio
|
||||
|
||||
let head = store.get('hhead')*2
|
||||
let goldenRatio = store.get('goldenRatio')
|
||||
let ratio = goldenRatio*options.neckoRatio
|
||||
|
||||
|
||||
if (options.neckline === true){
|
||||
|
||||
if (options.neckline === true) {
|
||||
// calculate neck opening
|
||||
let neckotop
|
||||
let neckomid// = hhead - neckotop
|
||||
// let necko = neckotop + neckomid
|
||||
let neckomid // = hhead - neckotop
|
||||
// let necko = neckotop + neckomid
|
||||
|
||||
// actual formula for triangle, from golden Ratio, measurement and Pythagoras
|
||||
neckotop = (1/4)*(-(ratio**2)*head+Math.sqrt(4*(head**2)*(ratio**2)+(head**2)*(ratio**4)))
|
||||
neckotop =
|
||||
(1 / 4) *
|
||||
(-(ratio ** 2) * head + Math.sqrt(4 * head ** 2 * ratio ** 2 + head ** 2 * ratio ** 4))
|
||||
|
||||
neckomid = (2*neckotop)/ratio
|
||||
|
||||
// points.anchor = new Point(100, 50)
|
||||
// .attr("data-text", neckotop)
|
||||
// .attr("data-text", head)
|
||||
// .attr("data-text", goldenRatio)
|
||||
// .attr("data-text-class", "center");
|
||||
neckomid = (2 * neckotop) / ratio
|
||||
|
||||
// checks to ensure that neck opening does not become too small
|
||||
if (neckotop < measurements.neck/4)
|
||||
{neckotop = measurements.neck/4,
|
||||
neckomid = (2*measurements.neck/4)/goldenRatio
|
||||
// points.anchor = new Point(100, 50)
|
||||
// .attr("data-text", neckotop)
|
||||
// .attr("data-text", head)
|
||||
// .attr("data-text", goldenRatio)
|
||||
// .attr("data-text-class", "center");
|
||||
|
||||
// checks to ensure that neck opening does not become too small
|
||||
if (neckotop < measurements.neck / 4) {
|
||||
;(neckotop = measurements.neck / 4), (neckomid = (2 * measurements.neck) / 4 / goldenRatio)
|
||||
}
|
||||
if (neckomid < measurements.neck/4)
|
||||
{neckomid = measurements.neck/4,
|
||||
neckotop = ((measurements.neck/4)*goldenRatio)/2
|
||||
if (neckomid < measurements.neck / 4) {
|
||||
;(neckomid = measurements.neck / 4), (neckotop = ((measurements.neck / 4) * goldenRatio) / 2)
|
||||
}
|
||||
|
||||
points.neckotop = points.top.shift(0, -neckotop)
|
||||
points.neckomid = points.top.shift(-90, neckomid)
|
||||
|
||||
points.neckotop = points.top.shift(0,-neckotop)
|
||||
points.neckomid = points.top.shift(-90,neckomid)
|
||||
|
||||
|
||||
paths.neck = new Path()
|
||||
.move(points.neckomid)
|
||||
.line(points.neckotop)
|
||||
paths.neck = new Path().move(points.neckomid).line(points.neckotop)
|
||||
|
||||
let halvesseam = paths.seam.split(points.neckotop)
|
||||
paths.half = halvesseam[0]
|
||||
|
@ -64,101 +57,89 @@ export default function(part) {
|
|||
delete paths.seam
|
||||
|
||||
paths.seam = paths.neck.join(halvesseam[1])
|
||||
|
||||
|
||||
let halvesmid = paths.fold.split(points.neckomid)
|
||||
paths.half = halvesmid[1]
|
||||
delete paths.half
|
||||
delete paths.fold
|
||||
paths.fold = halvesmid[0]
|
||||
}
|
||||
|
||||
// Complete?
|
||||
if (complete) {
|
||||
// cut on fold
|
||||
|
||||
if (options.neckline === true) {
|
||||
delete paths.cutonfold // delete inherited path from base
|
||||
macro('cutonfold', {
|
||||
from: points.triangle,
|
||||
to: points.neckomid,
|
||||
grainline: true,
|
||||
})
|
||||
}
|
||||
|
||||
// Complete?
|
||||
if (complete) {
|
||||
|
||||
// logo & title
|
||||
points.logo = points.top.shift(45, points.bottom.dy(points.top) / 5)
|
||||
snippets.logo = new Snippet('logo', points.logo)
|
||||
points.title = points.logo.shift(90, points.bottom.dy(points.top) / 4)
|
||||
macro('title', {
|
||||
at: points.title,
|
||||
nr: 1,
|
||||
title: 'front',
|
||||
})
|
||||
points.__titleNr.attr('data-text-class', 'center')
|
||||
points.__titleName.attr('data-text-class', 'center')
|
||||
points.__titlePattern.attr('data-text-class', 'center')
|
||||
|
||||
// cut on fold
|
||||
// scalebox
|
||||
points.scalebox = points.title.shift(90, points.bottom.dy(points.top) / 5)
|
||||
macro('scalebox', { at: points.scalebox })
|
||||
|
||||
if (options.neckline === true){
|
||||
delete paths.cutonfold // delete inherited path from base
|
||||
macro('cutonfold', {
|
||||
from: points.triangle,
|
||||
to: points.neckomid,
|
||||
grainline: true,
|
||||
})
|
||||
}
|
||||
|
||||
// logo & title
|
||||
points.logo = points.top.shift(45,points.bottom.dy(points.top)/5)
|
||||
snippets.logo = new Snippet("logo", points.logo)
|
||||
points.title = points.logo.shift(90, points.bottom.dy(points.top)/4)
|
||||
macro("title", {
|
||||
at: points.title,
|
||||
nr: 1,
|
||||
title: "front"
|
||||
})
|
||||
points.__titleNr.attr('data-text-class', 'center')
|
||||
points.__titleName.attr('data-text-class', 'center')
|
||||
points.__titlePattern.attr('data-text-class', 'center')
|
||||
if (sa) {
|
||||
if (options.neckline === true) {
|
||||
delete paths.sa
|
||||
paths.sa = paths.seam
|
||||
.offset(sa)
|
||||
// .join(paths.hem.offset(sa * 2.5))
|
||||
.close()
|
||||
.attr('class', 'fabric sa')
|
||||
|
||||
// scalebox
|
||||
points.scalebox = points.title.shift(90, points.bottom.dy(points.top)/5)
|
||||
macro("scalebox", { at: points.scalebox })
|
||||
paths.samod = new Path().move(points.bottom).line(points.top).setRender(false)
|
||||
|
||||
if (sa) {
|
||||
if (options.neckline === true){
|
||||
let sasplit = paths.samod.intersects(paths.sa)
|
||||
points.sasplit2 = sasplit[0]
|
||||
|
||||
|
||||
delete paths.sa
|
||||
paths.sa = paths.seam.offset(sa)
|
||||
// .join(paths.hem.offset(sa * 2.5))
|
||||
.close()
|
||||
.attr('class', 'fabric sa')
|
||||
//for (let p of sasplit){
|
||||
// let sahalves = paths.sa.split(p)
|
||||
//paths.sa = sahalves[0]
|
||||
//}
|
||||
|
||||
paths.samod = new Path()
|
||||
.move(points.bottom)
|
||||
.line(points.top)
|
||||
.setRender(false)
|
||||
|
||||
let sasplit = paths.samod.intersects(paths.sa)
|
||||
points.sasplit2 = sasplit[0]
|
||||
|
||||
//for (let p of sasplit){
|
||||
// let sahalves = paths.sa.split(p)
|
||||
//paths.sa = sahalves[0]
|
||||
//}
|
||||
|
||||
let sahalves = paths.sa.split(points.sasplit)
|
||||
paths.sa = sahalves[0]
|
||||
let sahalves2 = paths.sa.split(points.sasplit2)
|
||||
paths.sa = sahalves2[1]
|
||||
.close()
|
||||
.attr('class', 'fabric sa')
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
macro("ld", {
|
||||
from: points.neckotop,
|
||||
to: points.neckomid,
|
||||
d: 0
|
||||
});
|
||||
macro("hd", {
|
||||
from: points.top,
|
||||
to: points.neckotop,
|
||||
d: 5
|
||||
});
|
||||
macro("vd", {
|
||||
from: points.top,
|
||||
to: points.neckomid,
|
||||
d: 5
|
||||
});
|
||||
}
|
||||
let sahalves = paths.sa.split(points.sasplit)
|
||||
paths.sa = sahalves[0]
|
||||
let sahalves2 = paths.sa.split(points.sasplit2)
|
||||
paths.sa = sahalves2[1].close().attr('class', 'fabric sa')
|
||||
}
|
||||
}
|
||||
|
||||
return part;
|
||||
|
||||
// Paperless?
|
||||
if (paperless) {
|
||||
macro('ld', {
|
||||
from: points.neckotop,
|
||||
to: points.neckomid,
|
||||
d: 0,
|
||||
})
|
||||
macro('hd', {
|
||||
from: points.top,
|
||||
to: points.neckotop,
|
||||
d: 5,
|
||||
})
|
||||
macro('vd', {
|
||||
from: points.top,
|
||||
to: points.neckomid,
|
||||
d: 5,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
return part
|
||||
}
|
||||
|
|
|
@ -12,5 +12,4 @@ Pattern.prototype.draftBase = draftBase
|
|||
Pattern.prototype.draftFront = draftFront
|
||||
Pattern.prototype.draftBack = draftBack
|
||||
|
||||
|
||||
export default Pattern
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue