allow negative cam export scaling

This commit is contained in:
Stewart Allen 2022-11-07 19:52:21 -05:00
commit b22d2edc5a
2 changed files with 4 additions and 4 deletions

View file

@ -1,4 +1,4 @@
/** Copyright Stewart Allen <sa@grid.space> -- All Rights Reserved */
/** Copyright Stewart Allen -- All Rights Reserved */
"use strict";

View file

@ -330,9 +330,9 @@ CAM.export = function(print, online) {
if (line.indexOf(';; SCALE ') === 0) {
try {
let map = JSON.parse(line.substring(9));
if (map.X > 0) scale.x = map.X;
if (map.Y > 0) scale.y = map.Y;
if (map.Z > 0) scale.z = map.Z;
if (map.X) scale.x = map.X;
if (map.Y) scale.y = map.Y;
if (map.Z) scale.z = map.Z;
console.log('scaling axes', scale);
} catch (e) {
console.log('malformed scale directive', line);