Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mods
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
mods
Commits
c7481008
Commit
c7481008
authored
Jan 25, 2020
by
Neil Gershenfeld
Browse files
Options
Downloads
Patches
Plain Diff
flip origin
parent
110ad9cb
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/processes/mill/raster/3D
+14
-4
14 additions, 4 deletions
modules/processes/mill/raster/3D
with
14 additions
and
4 deletions
modules/processes/mill/raster/3D
+
14
−
4
View file @
c7481008
...
@@ -240,10 +240,10 @@ function calculate_path() {
...
@@ -240,10 +240,10 @@ function calculate_path() {
//
//
for (var i = 1; i < mod.path[0].length; ++i) {
for (var i = 1; i < mod.path[0].length; ++i) {
var ixp = mod.path[0][i-1][0]
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 izp = 0.1*mod.path[0][i-1][2]
var ix = mod.path[0][i][0]
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 iz = 0.1*mod.path[0][i][2]
var line = document.createElementNS(
var line = document.createElementNS(
'http://www.w3.org/2000/svg','line')
'http://www.w3.org/2000/svg','line')
...
@@ -296,12 +296,22 @@ function calculate_path_worker() {
...
@@ -296,12 +296,22 @@ function calculate_path_worker() {
var ystep = Math.floor(stepover*diameter*w/(mmunits*(xmax-xmin)))
var ystep = Math.floor(stepover*diameter*w/(mmunits*(xmax-xmin)))
var path = [[]]
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
// loop over lines
//
//
xstart = 0
xstart = 0
ystart = h-1
ystart = h-1
zstart = Math.floor((map[ystart*w+xstart]-zmax)*w/(xmax-xmin))
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
xcur = 1
ycur = h-1
ycur = h-1
zcur = Math.floor((map[ycur*w+xcur]-zmax)*w/(xmax-xmin))
zcur = Math.floor((map[ycur*w+xcur]-zmax)*w/(xmax-xmin))
...
@@ -332,7 +342,7 @@ function calculate_path_worker() {
...
@@ -332,7 +342,7 @@ function calculate_path_worker() {
nznext = dznext/dnext
nznext = dznext/dnext
dot = nxcur*nxnext+nycur*nynext+nzcur*nznext
dot = nxcur*nxnext+nycur*nynext+nzcur*nznext
if (dot <= (1-error)) {
if (dot <= (1-error)) {
path[0].push([xcur,ycur,zcur])
path[0].push([xcur,
h-1-
ycur,zcur])
xstart = xcur
xstart = xcur
ystart = ycur
ystart = ycur
zstart = zcur
zstart = zcur
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment