Created
April 27, 2014 07:04
-
-
Save tmpvar/11339347 to your computer and use it in GitHub Desktop.
gcode generator for a 6.35mm sheet of aluminum for a printerbotjr v1 (mounting holes not included)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gcode = []; | |
var G1 = function(obj) { | |
gcode.push('G1 ' + Object.keys(obj).map(function(a) { | |
return a.toUpperCase() + Number(obj[a]).toFixed(3); | |
}).join(' ')); | |
}; | |
G1({z: 5}); | |
var offset = 6.35; | |
for (var i = 0.2; i>=-6.4; i-=.2) { | |
G1({ x: 0, y: 0, z: i-.05}); | |
G1({ x: 175+offset, y: 0, z: i-.1}); | |
G1({ x: 175+offset, y: 120 + offset, z: i-.15}); | |
G1({ x: 0, y: 120 + offset, z: i-.2}); | |
G1({ x: 0, y: 0}); | |
} | |
console.log(gcode.join('\n')); | |
G1({z: 5}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment