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
184c9d04
Commit
184c9d04
authored
Mar 3, 2019
by
Neil Gershenfeld
Browse files
Options
Downloads
Patches
Plain Diff
wip
parent
f782bb1d
No related branches found
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/2.5D
+14
-13
14 additions, 13 deletions
modules/processes/mill/raster/2.5D
with
14 additions
and
13 deletions
modules/processes/mill/raster/2.5D
+
14
−
13
View file @
184c9d04
...
@@ -57,9 +57,9 @@ var inputs = {
...
@@ -57,9 +57,9 @@ var inputs = {
// calculation in progress, show and accumulate
// calculation in progress, show and accumulate
//
//
draw_path(evt.detail)
draw_path(evt.detail)
accumulate_
path
(evt.detail)
accumulate_
layer
(evt.detail)
mod.offsetCount += 1
mod.offsetCount += 1
if ((mod.offsetCount != parseInt(mod.number.value))
if ((mod.offsetCount !=
1+
parseInt(mod.number.value))
&& (evt.detail.length > 0)) {
&& (evt.detail.length > 0)) {
//
//
// layer detail present and offset not complete
// layer detail present and offset not complete
...
@@ -72,6 +72,10 @@ var inputs = {
...
@@ -72,6 +72,10 @@ var inputs = {
//
//
// layer loop not complete
// layer loop not complete
//
//
merge_layer()
clear_layer()
draw_path(mod.path)
draw_connections()
console.log('depth '+mod.depth)
console.log('depth '+mod.depth)
mod.depth += parseFloat(mod.cut_mm.value)
mod.depth += parseFloat(mod.cut_mm.value)
if (mod.depth > parseFloat(mod.max_mm.value)) {
if (mod.depth > parseFloat(mod.max_mm.value)) {
...
@@ -97,10 +101,6 @@ var inputs = {
...
@@ -97,10 +101,6 @@ var inputs = {
//
//
mod.label.nodeValue = 'calculate'
mod.label.nodeValue = 'calculate'
mod.labelspan.style.fontWeight = 'normal'
mod.labelspan.style.fontWeight = 'normal'
merge_path()
clear_path()
draw_path(mod.path)
draw_connections()
outputs.toolpath.event()
outputs.toolpath.event()
}
}
}
}
...
@@ -326,7 +326,7 @@ var interface = function(div){
...
@@ -326,7 +326,7 @@ var interface = function(div){
mod.path = []
mod.path = []
mods.output(mod,'offset','')
mods.output(mod,'offset','')
mods.output(mod,'depth',{depthmm:mod.depth})
mods.output(mod,'depth',{depthmm:mod.depth})
clear_
path
()
clear_
layer
()
outputs.diameter.event()
outputs.diameter.event()
outputs.offset.event()
outputs.offset.event()
})
})
...
@@ -407,9 +407,10 @@ function set_values(settings) {
...
@@ -407,9 +407,10 @@ function set_values(settings) {
}
}
}
}
//
//
// clear_
path
// clear_
layer
//
//
function clear_path() {
function clear_layer() {
mod.path = []
var svg = document.getElementById(mod.div.id+'svg')
var svg = document.getElementById(mod.div.id+'svg')
svg.setAttribute('viewBox',"0 0 "+(mod.img.width-1)+" "+(mod.img.height-1))
svg.setAttribute('viewBox',"0 0 "+(mod.img.width-1)+" "+(mod.img.height-1))
var g = document.getElementById(mod.div.id+'g')
var g = document.getElementById(mod.div.id+'g')
...
@@ -419,11 +420,11 @@ function clear_path() {
...
@@ -419,11 +420,11 @@ function clear_path() {
svg.appendChild(g)
svg.appendChild(g)
}
}
//
//
// accumulate_
path
// accumulate_
layer
// todo: replace inefficient insertion sort
// todo: replace inefficient insertion sort
// todo: move sort out of main thread
// todo: move sort out of main thread
//
//
function accumulate_
path
(path) {
function accumulate_
layer
(path) {
var forward = mod.forward.checked
var forward = mod.forward.checked
var conventional = mod.conventional.checked
var conventional = mod.conventional.checked
var sort = mod.sort.checked
var sort = mod.sort.checked
...
@@ -462,9 +463,9 @@ function accumulate_path(path) {
...
@@ -462,9 +463,9 @@ function accumulate_path(path) {
}
}
}
}
//
//
// merge_
path
// merge_
layer
//
//
function merge_
path
() {
function merge_
layer
() {
var dmerge = mod.dpi*parseFloat(mod.merge.value)*parseFloat(mod.dia_in.value)
var dmerge = mod.dpi*parseFloat(mod.merge.value)*parseFloat(mod.dia_in.value)
var seg = 0
var seg = 0
while (seg < (mod.path.length-1)) {
while (seg < (mod.path.length-1)) {
...
...
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
sign in
to comment