move step over from outline to contour. fix topo y axis overstep

This commit is contained in:
Stewart Allen 2020-06-29 10:10:24 -04:00
commit 343868edb6
3 changed files with 12 additions and 11 deletions

View file

@ -192,14 +192,14 @@
function getMaxTopoToolZ(topo, profile, x, y, floormax) {
let tv, tx, ty, tz, gv, i = 0, mz = -1;
const sx = topo.stepsx, sy = topo.stepsy;
const sx = topo.stepsx, sy = topo.stepsy, xl = sx - 1, yl = sy - 1;
while (i < profile.length) {
// tool profile point x, y, and z offsets
let tx = profile[i++] + x;
let ty = profile[i++] + y;
let tz = profile[i++];
if (tx < 0 || tx >= sx || ty < 0 || ty >= sy) {
if (tx < 0 || tx > xl || ty < 0 || ty > yl) {
// if outside max topo steps, use 0
gv = 0;
} else {
@ -390,7 +390,7 @@
resolution = outp.camTolerance * units,
diameter = getToolDiameter(settings, proc.camOutlineTool),
tool = getToolById(settings, proc.camOutlineTool),
toolStep = diameter * proc.camOutlineOver,
toolStep = diameter * proc.camContourOver,
traceJoin = diameter / 2,
pocketOnly = proc.camOutlinePocket,
bounds = widget.getBoundingBox().clone(),
@ -477,7 +477,7 @@
lines = slice.lines;
gridy = 0;
// slices have x/z swapped
for (y = minY; y <= maxY; y += resolution) {
for (y = minY; y < maxY && gridy < stepsy; y += resolution) {
gridi = gridx * stepsy + gridy;
gridv = data[gridi] || 0;
// strategy using raw lines (faster slice, but more lines)