Commit 5621e00a authored by Neil Gershenfeld's avatar Neil Gershenfeld
Browse files

ready for tool offset

parent c7481008
......@@ -303,7 +303,10 @@ function calculate_path_worker() {
for (var x = 0; x < toolsize; ++x)
for (var y = 0; y < toolsize; ++y) {
var r = Math.sqrt((x-toolsize/2)*(x-toolsize/2)+(y-toolsize/2)*(y-toolsize/2))
tooloffset[y*toolsize+x] = 0
if (r <= toolsize/2)
tooloffset[y*toolsize+x] = 0
else
tooloffset[y*toolsize+x] = Number.MAX_VALUE
}
//
// loop over lines
......@@ -319,13 +322,25 @@ function calculate_path_worker() {
dy = 0
while (1) {
//
// vectorize
// move to next point
//
xnext = xcur+dx
ynext = ycur+dy
znext = Math.floor((map[ynext*w+xnext]-zmax)*w/(xmax-xmin))
if (ynext <= 0)
//
// done
//
break;
//
// find offset at next point
//
for (var x = 0; x < toolsize; ++x)
for (var y = 0; y < toolsize; ++y) {
znext = Math.floor((map[ynext*w+xnext]-zmax)*w/(xmax-xmin))
}
//
// vectorize
//
dxcur = xcur-xstart
dycur = ycur-ystart
dzcur = zcur-zstart
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment