🚧 Moved shorthand to part and improved debug
This commit is contained in:
parent
a357586344
commit
f990e1890a
2 changed files with 45 additions and 27 deletions
22
src/utils.js
22
src/utils.js
|
@ -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) + '"';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue