Commit b6716e9b authored by Neil Gershenfeld's avatar Neil Gershenfeld
Browse files

ready for tool shape

parent c8ea4dcf
......@@ -24,7 +24,7 @@ var name = 'mill raster 3D (incomplete)'
// initialization
//
var init = function() {
mod.dia_in.value = 0.0156
mod.dia_in.value = 0.125
mod.dia_mm.value = 25.4*parseFloat(mod.dia_in.value)
mod.stepover.value = 0.5
mod.error.value = 0.001
......@@ -265,10 +265,14 @@ function calculate_path() {
// call webworker
//
webworker.postMessage({
h:mod.height,w:mod.width,error:mod.error.value,
height:mod.height,width:mod.width,
error:mod.error.value,
xmin:mod.xmin,xmax:mod.xmax,
ymin:mod.ymin,ymax:mod.ymax,
zmin:mod.zmin,zmax:mod.zmax,
diameter:mod.dia_mm.value,
stepover:mod.stepover.value,
mmunits: mod.mmunits,
map:mod.map})
}
//
......@@ -276,8 +280,8 @@ function calculate_path() {
//
function calculate_path_worker() {
self.addEventListener('message',function(evt) {
var h = evt.data.h
var w = evt.data.w
var h = evt.data.height
var w = evt.data.width
var error = evt.data.error
var xmin = evt.data.xmin
var xmax = evt.data.xmax
......@@ -286,6 +290,10 @@ function calculate_path_worker() {
var zmin = evt.data.zmin
var zmax = evt.data.zmax
var map = evt.data.map
var diameter = evt.data.diameter
var stepover = evt.data.stepover
var mmunits = evt.data.mmunits
var ystep = Math.floor(stepover*diameter*w/(mmunits*(xmax-xmin)))
var path = [[]]
//
// loop over lines
......@@ -335,7 +343,7 @@ function calculate_path_worker() {
if (xcur == (w-1)) {
if (dx == 1) {
dx = 0
dy = -10
dy = -ystep
}
else {
dx = -1
......@@ -345,7 +353,7 @@ function calculate_path_worker() {
else if (xcur == 0) {
if (dx == -1) {
dx = 0
dy = -10
dy = -ystep
}
else {
dx = 1
......
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