1
0
Fork 0

🚧 Moved shorthand to part and improved debug

This commit is contained in:
Joost De Cock 2018-08-08 14:02:06 +02:00
parent a357586344
commit f990e1890a
2 changed files with 45 additions and 27 deletions

View file

@ -66,28 +66,6 @@ export function beamCrossesY(from, to, y) {
return beamsCross(from, to, left, right);
}
/** Returns an object with shorthand access for pattern design */
export function shorthand(part) {
let final = part.context.settings.mode === "draft" ? true : false;
let paperless = part.context.settings.paperless === true ? true : false;
return {
sa: part.context.settings.sa || 0,
measurements: part.context.settings.measurements || {},
options: part.context.options || {},
store: part.context.store,
points: part.points || {},
paths: part.paths || {},
snippets: part.snippets || {},
macro: part.macroRunner(),
Point: part.Point,
Path: part.Path,
Snippet: part.Snippet,
final,
paperless,
debug: part.debug
};
}
/** Convert value in mm to cm or imperial units */
export function units(value, to = "metric") {
if (to === "imperial") return round(value / 25.4) + '"';