Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
pub
mods
Commits
c7481008
Commit
c7481008
authored
Jan 25, 2020
by
Neil Gershenfeld
Browse files
flip origin
parent
110ad9cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/processes/mill/raster/3D
View file @
c7481008
...
...
@@ -240,10 +240,10 @@ function calculate_path() {
//
for (var i = 1; i < mod.path[0].length; ++i) {
var ixp = mod.path[0][i-1][0]
var iyp = mod.path[0][i-1][1]
var iyp =
mod.height-1-
mod.path[0][i-1][1]
var izp = 0.1*mod.path[0][i-1][2]
var ix = mod.path[0][i][0]
var iy = mod.path[0][i][1]
var iy =
mod.height-1-
mod.path[0][i][1]
var iz = 0.1*mod.path[0][i][2]
var line = document.createElementNS(
'http://www.w3.org/2000/svg','line')
...
...
@@ -296,12 +296,22 @@ function calculate_path_worker() {
var ystep = Math.floor(stepover*diameter*w/(mmunits*(xmax-xmin)))
var path = [[]]
//
// construct tool offset
//
var toolsize = Math.floor(diameter*w/(mmunits*(xmax-xmin)))
var tooloffset = new Float32Array(toolsize*toolsize)
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
}
//
// loop over lines
//
xstart = 0
ystart = h-1
zstart = Math.floor((map[ystart*w+xstart]-zmax)*w/(xmax-xmin))
path[0].push([xstart,ystart,zstart])
path[0].push([xstart,
h-1-
ystart,zstart])
xcur = 1
ycur = h-1
zcur = Math.floor((map[ycur*w+xcur]-zmax)*w/(xmax-xmin))
...
...
@@ -332,7 +342,7 @@ function calculate_path_worker() {
nznext = dznext/dnext
dot = nxcur*nxnext+nycur*nynext+nzcur*nznext
if (dot <= (1-error)) {
path[0].push([xcur,ycur,zcur])
path[0].push([xcur,
h-1-
ycur,zcur])
xstart = xcur
ystart = ycur
zstart = zcur
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment