diff --git a/files.html b/files.html index fecd43d624211b7d5a41975ef57aca0823061dc6..efdf1174396f7e749f4d762336e489e86cf9e015 100644 --- a/files.html +++ b/files.html @@ -116,8 +116,6 @@ <a href='./modules/toolpath/machines/ShopBot'>ShopBot</a><br> <i> laser cutter</i><br> <a href='./modules/toolpath/machines/laser%20cutter/Epilog'>Epilog</a><br> - <a href='./modules/toolpath/machines/laser%20cutter/GCC'>GCC</a><br> - <a href='./modules/toolpath/machines/laser%20cutter/Trotec'>Trotec</a><br> <a href='./modules/toolpath/view'>view</a><br> <i> ui</i><br> <a href='./modules/ui/button'>button</a><br> diff --git a/modules/index.html b/modules/index.html index b2c8f388271b146b52f7512af81e80cf7ee45fb5..d025632959a5b97ebd9425af95e5ef3d194c0f86 100644 --- a/modules/index.html +++ b/modules/index.html @@ -94,8 +94,6 @@ <a href="javascript:handler('modules/toolpath/machines/ShopBot')">ShopBot</a><br> <i> laser cutter</i><br> <a href="javascript:handler('modules/toolpath/machines/laser%20cutter/Epilog')">Epilog</a><br> - <a href="javascript:handler('modules/toolpath/machines/laser%20cutter/GCC')">GCC</a><br> - <a href="javascript:handler('modules/toolpath/machines/laser%20cutter/Trotec')">Trotec</a><br> <a href="javascript:handler('modules/toolpath/view')">view</a><br> <i>ui</i><br> <a href="javascript:handler('modules/ui/button')">button</a><br> diff --git a/modules/toolpath/machines/laser cutter/GCC b/modules/toolpath/machines/laser cutter/GCC deleted file mode 100644 index 5f510cf86d5ab00a1e2a0ad8eefc4f33272512ed..0000000000000000000000000000000000000000 --- a/modules/toolpath/machines/laser cutter/GCC +++ /dev/null @@ -1,173 +0,0 @@ -// -// GCC laser cutter -// -// Neil Gershenfeld -// (c) Massachusetts Institute of Technology 2017 -// -// This work may be reproduced, modified, distributed, performed, and -// displayed for any purpose, but must acknowledge the mods -// project. Copyright is retained and must be preserved. The work is -// provided as is; no warranty is provided, and users accept all -// liability. -// -// closure -// -(function(){ -// -// module globals -// -var mod = {} -// -// name -// -var name = 'GCC laser cutter' -// -// initialization -// -var init = function() { - mod.force.value = 50 - mod.speed.value = 2 - } -// -// inputs -// -var inputs = { - toolpath:{type:'object', - event:function(evt){ - mod.name = evt.detail.name - mod.path = evt.detail.path - mod.dpi = evt.detail.dpi - mod.width = evt.detail.width - mod.height = evt.detail.height - make_path() - }}} -// -// outputs -// -var outputs = { - file:{type:'object', - event:function(str){ - obj = {} - obj.type = 'file' - obj.name = mod.name+'.camm' - obj.contents = str - mods.output(mod,'file',obj) - }}} -// -// interface -// -var interface = function(div){ - mod.div = div - div.appendChild(document.createTextNode('force (g): ')) - var input = document.createElement('input') - input.type = 'text' - input.size = 6 - div.appendChild(input) - mod.force = input - div.appendChild(document.createElement('br')) - div.appendChild(document.createTextNode('speed (cm/s): ')) - var input = document.createElement('input') - input.type = 'text' - input.size = 6 - div.appendChild(input) - mod.speed = input - div.appendChild(document.createElement('br')) - div.appendChild(document.createTextNode('origin:')) - div.appendChild(document.createElement('br')) - var input = document.createElement('input') - input.type = 'radio' - input.name = mod.div.id+'origin' - input.id = mod.div.id+'topleft' - div.appendChild(input) - mod.topleft = input - div.appendChild(document.createTextNode(' left \u00A0\u00A0 top \u00A0\u00A0 right ')) - var input = document.createElement('input') - input.type = 'radio' - input.name = mod.div.id+'origin' - input.id = mod.div.id+'topright' - div.appendChild(input) - mod.topright = input - div.appendChild(document.createElement('br')) - var input = document.createElement('input') - input.type = 'radio' - input.name = mod.div.id+'origin' - input.id = mod.div.id+'botleft' - input.checked = true - div.appendChild(input) - mod.botleft = input - div.appendChild(document.createTextNode(' left bottom right ')) - var input = document.createElement('input') - input.type = 'radio' - input.name = mod.div.id+'origin' - input.id = mod.div.id+'botright' - div.appendChild(input) - mod.botright = input - } -// -// local functions -// -function make_path() { - var dx = 25.4*mod.width/mod.dpi - var dy = 25.4*mod.height/mod.dpi - var nx = mod.width - var ny = mod.height - var force = parseFloat(mod.force.value) - var speed = parseFloat(mod.speed.value) - var str = "PA;PA;!ST1;!FS"+force+";VS"+speed+";\n" - var scale = 40.0*dx/(nx-1.0) // 40/mm - var ox = 0 - var oy = 0 - if (mod.botleft.checked) { - var xoffset = 40.0*ox - var yoffset = 40.0*oy - } - else if (mod.botright.checked) { - var xoffset = 40.0*(ox-dx) - var yoffset = 40.0*oy - } - else if (mod.topleft.checked) { - var xoffset = 40.0*ox - var yoffset = 40.0*(oy-dy) - } - else if (mod.topright.checked) { - var xoffset = 40.0*(ox-dx) - var yoffset = 40.0*(oy-dy) - } - // - // loop over segments - // - for (var seg = 0; seg < mod.path.length; ++seg) { - x = xoffset+scale*mod.path[seg][0][0] - y = yoffset+scale*mod.path[seg][0][1] - str += "PU"+x.toFixed(0)+","+y.toFixed(0)+";\n" // move up to start point - //str += "PU"+x.toFixed(0)+","+y.toFixed(0)+";\n" // hack: repeat in case comm dropped - str += "PD"+x.toFixed(0)+","+y.toFixed(0)+";\n" // move down - //str += "PD"+x.toFixed(0)+","+y.toFixed(0)+";\n" // hack: repeat in case comm dropped - // - // loop over points - // - for (var pt = 1; pt < mod.path[seg].length; ++pt) { - x = xoffset+scale*mod.path[seg][pt][0] - y = yoffset+scale*mod.path[seg][pt][1] - str += "PD"+x.toFixed(0)+","+y.toFixed(0)+";\n" // move down - //str += "PD"+x.toFixed(0)+","+y.toFixed(0)+";\n" // hack: repeat in case comm dropped - } - str += "PU"+x.toFixed(0)+","+y.toFixed(0)+";\n" // move up at last point - //str += "PU"+x.toFixed(0)+","+y.toFixed(0)+";\n" // hack: repeat in case comm dropped - } - str += "PU0,0;\n" // pen up to origin - //str += "PU0,0;\n" // hack: repeat in case comm dropped - outputs.file.event(str) - } - -// -// return values -// -return ({ - name:name, - init:init, - inputs:inputs, - outputs:outputs, - interface:interface - }) -}()) diff --git a/modules/toolpath/machines/laser cutter/Trotec b/modules/toolpath/machines/laser cutter/Trotec deleted file mode 100644 index c2a600023e29422f770faefbb7a7f8458d591a54..0000000000000000000000000000000000000000 --- a/modules/toolpath/machines/laser cutter/Trotec +++ /dev/null @@ -1,173 +0,0 @@ -// -// Trotec laser cutter -// -// Neil Gershenfeld -// (c) Massachusetts Institute of Technology 2017 -// -// This work may be reproduced, modified, distributed, performed, and -// displayed for any purpose, but must acknowledge the mods -// project. Copyright is retained and must be preserved. The work is -// provided as is; no warranty is provided, and users accept all -// liability. -// -// closure -// -(function(){ -// -// module globals -// -var mod = {} -// -// name -// -var name = 'Trotec laser cutter' -// -// initialization -// -var init = function() { - mod.force.value = 50 - mod.speed.value = 2 - } -// -// inputs -// -var inputs = { - toolpath:{type:'object', - event:function(evt){ - mod.name = evt.detail.name - mod.path = evt.detail.path - mod.dpi = evt.detail.dpi - mod.width = evt.detail.width - mod.height = evt.detail.height - make_path() - }}} -// -// outputs -// -var outputs = { - file:{type:'object', - event:function(str){ - obj = {} - obj.type = 'file' - obj.name = mod.name+'.camm' - obj.contents = str - mods.output(mod,'file',obj) - }}} -// -// interface -// -var interface = function(div){ - mod.div = div - div.appendChild(document.createTextNode('force (g): ')) - var input = document.createElement('input') - input.type = 'text' - input.size = 6 - div.appendChild(input) - mod.force = input - div.appendChild(document.createElement('br')) - div.appendChild(document.createTextNode('speed (cm/s): ')) - var input = document.createElement('input') - input.type = 'text' - input.size = 6 - div.appendChild(input) - mod.speed = input - div.appendChild(document.createElement('br')) - div.appendChild(document.createTextNode('origin:')) - div.appendChild(document.createElement('br')) - var input = document.createElement('input') - input.type = 'radio' - input.name = mod.div.id+'origin' - input.id = mod.div.id+'topleft' - div.appendChild(input) - mod.topleft = input - div.appendChild(document.createTextNode(' left \u00A0\u00A0 top \u00A0\u00A0 right ')) - var input = document.createElement('input') - input.type = 'radio' - input.name = mod.div.id+'origin' - input.id = mod.div.id+'topright' - div.appendChild(input) - mod.topright = input - div.appendChild(document.createElement('br')) - var input = document.createElement('input') - input.type = 'radio' - input.name = mod.div.id+'origin' - input.id = mod.div.id+'botleft' - input.checked = true - div.appendChild(input) - mod.botleft = input - div.appendChild(document.createTextNode(' left bottom right ')) - var input = document.createElement('input') - input.type = 'radio' - input.name = mod.div.id+'origin' - input.id = mod.div.id+'botright' - div.appendChild(input) - mod.botright = input - } -// -// local functions -// -function make_path() { - var dx = 25.4*mod.width/mod.dpi - var dy = 25.4*mod.height/mod.dpi - var nx = mod.width - var ny = mod.height - var force = parseFloat(mod.force.value) - var speed = parseFloat(mod.speed.value) - var str = "PA;PA;!ST1;!FS"+force+";VS"+speed+";\n" - var scale = 40.0*dx/(nx-1.0) // 40/mm - var ox = 0 - var oy = 0 - if (mod.botleft.checked) { - var xoffset = 40.0*ox - var yoffset = 40.0*oy - } - else if (mod.botright.checked) { - var xoffset = 40.0*(ox-dx) - var yoffset = 40.0*oy - } - else if (mod.topleft.checked) { - var xoffset = 40.0*ox - var yoffset = 40.0*(oy-dy) - } - else if (mod.topright.checked) { - var xoffset = 40.0*(ox-dx) - var yoffset = 40.0*(oy-dy) - } - // - // loop over segments - // - for (var seg = 0; seg < mod.path.length; ++seg) { - x = xoffset+scale*mod.path[seg][0][0] - y = yoffset+scale*mod.path[seg][0][1] - str += "PU"+x.toFixed(0)+","+y.toFixed(0)+";\n" // move up to start point - //str += "PU"+x.toFixed(0)+","+y.toFixed(0)+";\n" // hack: repeat in case comm dropped - str += "PD"+x.toFixed(0)+","+y.toFixed(0)+";\n" // move down - //str += "PD"+x.toFixed(0)+","+y.toFixed(0)+";\n" // hack: repeat in case comm dropped - // - // loop over points - // - for (var pt = 1; pt < mod.path[seg].length; ++pt) { - x = xoffset+scale*mod.path[seg][pt][0] - y = yoffset+scale*mod.path[seg][pt][1] - str += "PD"+x.toFixed(0)+","+y.toFixed(0)+";\n" // move down - //str += "PD"+x.toFixed(0)+","+y.toFixed(0)+";\n" // hack: repeat in case comm dropped - } - str += "PU"+x.toFixed(0)+","+y.toFixed(0)+";\n" // move up at last point - //str += "PU"+x.toFixed(0)+","+y.toFixed(0)+";\n" // hack: repeat in case comm dropped - } - str += "PU0,0;\n" // pen up to origin - //str += "PU0,0;\n" // hack: repeat in case comm dropped - outputs.file.event(str) - } - -// -// return values -// -return ({ - name:name, - init:init, - inputs:inputs, - outputs:outputs, - interface:interface - }) -}())