diff --git a/designs/brian/src/sleevecap.mjs b/designs/brian/src/sleevecap.mjs index a24f23b62ed..8ae3c95f3e3 100644 --- a/designs/brian/src/sleevecap.mjs +++ b/designs/brian/src/sleevecap.mjs @@ -177,6 +177,7 @@ export const sleevecap = { for (const path in paths) delete paths[path] delete snippets.logo macro('title', false) + macro('cutonfold', false) store.set('sleeveFactor', 1) let run = 0 diff --git a/packages/core/src/store.mjs b/packages/core/src/store.mjs index f88f0e5f343..4dd1811a477 100644 --- a/packages/core/src/store.mjs +++ b/packages/core/src/store.mjs @@ -38,7 +38,7 @@ export function Store(methods = []) { logs.warning.push(...data) }, error: function (...data) { - if (typeof window !== 'undefined') console.error(...data) + if (typeof window !== 'undefined') console.error(...data[0]) logs.error.push(...data) }, } diff --git a/plugins/plugin-annotations/src/cutlist.mjs b/plugins/plugin-annotations/src/cutlist.mjs index b4068305cc1..6e561457d91 100644 --- a/plugins/plugin-annotations/src/cutlist.mjs +++ b/plugins/plugin-annotations/src/cutlist.mjs @@ -91,7 +91,7 @@ function getCutFabrics(store, settings) { const fabrics = [] list.forEach((partName) => { - if (!cutlist[partName].materials) { + if (!cutlist[partName]?.materials) { return } for (var m in cutlist[partName].materials) { diff --git a/plugins/plugin-mirror/src/index.mjs b/plugins/plugin-mirror/src/index.mjs index d272aa7cf3a..befcc9e6e99 100644 --- a/plugins/plugin-mirror/src/index.mjs +++ b/plugins/plugin-mirror/src/index.mjs @@ -20,7 +20,8 @@ const mirrorGen = (start, end) => { point.y = vNom / denom const mirrorCount = Number(point.attributes.get('data-mirrored')) - if (mirrorCount > 0) + // some points returned by utils do not have logs + if (mirrorCount > 0 && point.log) point.log.warning( `Point ${point.name} was mirrored more than once (${ mirrorCount + 1 diff --git a/sites/shared/components/workbench/layout/cut/plugin-cut-layout.mjs b/sites/shared/components/workbench/layout/cut/plugin-cut-layout.mjs index 71a4f725c84..3a58e19cd61 100644 --- a/sites/shared/components/workbench/layout/cut/plugin-cut-layout.mjs +++ b/sites/shared/components/workbench/layout/cut/plugin-cut-layout.mjs @@ -116,7 +116,7 @@ export const cutLayoutPlugin = function (material, grainAngle) { macro('rotateToGrain', { bias: instruction.bias, grainSpec }) }, // mirror the part across the line indicated by cutonfold - mirrorOnFold: ({ fold }, { paths, snippets, macro }) => { + mirrorOnFold: ({ fold }, { paths, snippets, macro, points, utils, Point }) => { // get all the paths to mirror const mirrorPaths = [] for (const p in paths) { @@ -139,8 +139,10 @@ export const cutLayoutPlugin = function (material, grainAngle) { snippetsByType[snip.def] = snippetsByType[snip.def] || [] // put the anchor on the list to mirror - mirrorPoints.push(snip.anchor) - snippetsByType[snip.def].push(`${prefix}_${anchorNames++}`) + const anchorName = `snippetAnchors_${anchorNames++}` + points[anchorName] = new Point(snip.anchor.x, snip.anchor.y) + mirrorPoints.push(anchorName) + snippetsByType[snip.def].push(`${prefix}${utils.capitalize(anchorName)}`) } // mirror @@ -150,10 +152,6 @@ export const cutLayoutPlugin = function (material, grainAngle) { points: mirrorPoints, mirror: fold, prefix, - nameFormat: () => { - unnamed++ - return `${prefix}_${unnamed}` - }, }) // sprinkle the snippets