diff --git a/notes.md b/notes.md index 07900624..35c79533 100644 --- a/notes.md +++ b/notes.md @@ -2,6 +2,7 @@ ## `C` cosmetic, `F` functional, `P` performance, `B` bug fix +* `F` auto unit conversion in/out of fields so display = pref. but always store mm? * `F` implement an in-app bug reporting system * `F` extend mesh object to store raw + annotations (rot,scale,pos) * share raw data w/ dups, encode/decode diff --git a/src/mode/cam/driver.js b/src/mode/cam/driver.js index 398e39fd..dc5c92d4 100644 --- a/src/mode/cam/driver.js +++ b/src/mode/cam/driver.js @@ -158,6 +158,30 @@ return toolOffset; }; + function getMaxZBetween(terrain, x1, y1, x2, y2, z) { + let maxz = z; + let check = []; + for (let i=0; i p.intersections({x:x1, y:y1},{x:x2, y:y2})).flat(); + if (int.length) { + maxz = Math.max(maxz, data.z); + console.log({z, check, int, maxz, dataz: data.z}); + continue; + } + break; + } + return maxz; + } + /** * find highest z on a line segment * x,y are in platform coodinates @@ -738,6 +762,7 @@ onupdate(0.0 + (index/total) * 0.1, "mapping"); }, genso: true }); let shadowTop = terrain[terrain.length - 1]; + widget.terrain = terrain; console.log({slicer, tzindex, tshadow, terrain}); if (procDrillReg) { @@ -1294,6 +1319,14 @@ } //else (TODO verify no else here b/c above could change isMove) // move over things if ((deltaXY > toolDiam || (deltaZ > toolDiam && deltaXY > tolerance)) && (isMove || absDeltaZ >= tolerance)) { + // let maxz = getMaxZBetween( + // widget.terrain, + // lastPoint.x,// - wmx, + // lastPoint.y,// - wmy, + // point.x,// - wmx, + // point.y,// - wmy, + // Math.min(point.z, lastPoint.z) + // ) + ztOff, let maxz = (toolProfile ? Math.max( getTopoZPathMax( widget,