fixes #72 Z safe distance lifts with multiple objects

This commit is contained in:
Stewart Allen 2020-03-22 21:28:17 -04:00
commit 6c4a81e679
3 changed files with 30 additions and 17 deletions

View file

@ -1252,9 +1252,12 @@ var gs_kiri_cam = exports;
}
function camOut(point, cut) {
let wmx = widget.mesh.position.x;
let wmy = widget.mesh.position.y;
point = point.clone();
point.x += widget.mesh.position.x;
point.y += widget.mesh.position.y;
point.x += wmx;
point.y += wmy;
point.z += zadd;
if (nextIsMove) {
@ -1270,7 +1273,7 @@ var gs_kiri_cam = exports;
isMove = !cut;
// drop points too close together
if (deltaXY < 0.001 && point.z === lastPoint.z) {
// console.trace(["drop dup",lastPoint,point]);
console.trace(["drop dup",lastPoint,point]);
return;
}
if (isMove && deltaXY <= toolDiamMove) {
@ -1291,10 +1294,10 @@ var gs_kiri_cam = exports;
getTopoZPathMax(
widget,
toolProfile,
lastPoint.x,
lastPoint.y,
point.x,
point.y) + zadd,
lastPoint.x - wmx,
lastPoint.y - wmy,
point.x - wmx,
point.y - wmy) + zadd,
point.z,
lastPoint.z) : zmax,
mustGoUp = MAX(maxz - point.z, maxz - lastPoint.z) >= tolerance,

View file

@ -1,7 +1,7 @@
var exports = {
COPYRIGHT:"Copyright (C) Stewart Allen <sa@grid.space> - All Rights Reserved",
LICENSE:"See the license.md file included with the source distribution",
VERSION:"1.7.7"
VERSION:"1.7.8"
};
if (!module) var module = {};
module.exports = exports;

View file

@ -737,7 +737,8 @@ function serveCode(req, res, code) {
********************************************* */
let debug = false,
nolocal = false
nolocal = false,
procexit = false,
port = 8080,
args = process.argv.slice(2);
@ -1190,13 +1191,18 @@ function open_logger(options) {
function close_file_stream() {
if (logstream) {
logstream.end();
logstream.close();
logstream = null;
}
}
function emit_log(obj) {
helper.log(obj);
emit(obj);
}
function emit(obj) {
if (exiting) {
// console.log({dir: opt.dir, exiting_skip_log: obj})
return;
}
let next_pattern = moment().format(pattern);
@ -1216,7 +1222,7 @@ function open_logger(options) {
exits.push(exit);
return { emit, close: close_file_stream };
return { emit, log: emit_log, close: close_file_stream };
}
function processLoad() {
@ -1230,7 +1236,11 @@ function processLoad() {
}
function processExit(code) {
logger.emit({exit: code, registered: exits.length});
if (procexit) {
return;
}
procexit = true;
logger.log({proc_exit: code, registered: exits.length, uptime: time() - startTime});
while (exits.length) {
try {
exits.shift()(code);
@ -1238,7 +1248,9 @@ function processExit(code) {
log({on_exit_fail: e});
}
}
process.exit();
setTimeout(() => {
process.exit();
}, 500);
}
/* *********************************************
@ -1316,14 +1328,12 @@ process.on('beforeExit', processExit);
process.on('exit', processExit);
process.on('SIGINT', function(sig, code) {
helper.log("caught sigint");
logger.emit({signal: sig, code});
logger.log({exit: code, signal: sig});
processExit(code);
});
process.on('SIGHUP', function(sig, code) {
helper.log("caught sighup");
logger.emit({signal: sig, code});
logger.log({exit: code, signal: sig});
processExit(code);
});