0
0
mirror of https://github.com/Doodle3D/doodle3d-client.git synced 2024-12-04 14:04:54 +01:00

Quick test to improve adhesion by printing a circle with brim.

This commit is contained in:
Wouter R 2014-01-31 22:34:40 +01:00
parent 9bad257922
commit 254c2b118b
2 changed files with 22 additions and 6 deletions

View File

@ -1,15 +1,16 @@
var keyboardShortcutsEnabled = true; var keyboardShortcutsEnabled = true;
var keyboardEscapeEnterEnabled = false; var keyboardEscapeEnterEnabled = false;
var wordBuffer = ""; var wordBuffer = "";
var charOffset = -1;
var wordFuncs = { var wordFuncs = {
"idbeholdl": function() { "idbeholdl": function() { //a flashlight for when times get dark...
alert("Light!"); alert("Light!");
}, },
"idspispopd": function() { "idspispopd": function() { //I live!
drawTextOnCanvas("Im in ur kanvas drawin' ur stuffz."); drawTextOnCanvas("Im in ur kanvas drawin' ur stuffz.");
}, },
"dia": function() { "dia": function() { //draw a diamond with a cross onto the sketch shape for calibration purposes
var cx = canvasWidth / 2; var cx = canvasWidth / 2;
var cy = canvasHeight /2; var cy = canvasHeight /2;
drawCircle(cx, cy, 50, 4); drawCircle(cx, cy, 50, 4);
@ -18,11 +19,22 @@ var wordFuncs = {
shapeMoveTo(cx, cy - 20); shapeMoveTo(cx, cy - 20);
shapeLineTo(cx, cy + 20); shapeLineTo(cx, cy + 20);
}, },
"stats": function() { "btest": function() { //brim test (in conjunction with)
var cx = canvasWidth / 2;
var cy = canvasHeight /2;
//for (var i = 45; i <= 51; i += 3) { drawCircle(cx, cy, i, 4); }
var base = 75;
drawCircle(cx, cy, base, 6);
drawCircle(cx, cy, base -3, 6);
drawCircle(cx, cy, base + 3, 6);
// drawCircle(cx, cy, base + 9, 6);
// drawCircle(cx, cy, base + 12, 6);
},
"stats": function() { //show statistics?
var text = "Shape statistics:\nNumber of points: " + _points.length; var text = "Shape statistics:\nNumber of points: " + _points.length;
alert(text); alert(text);
}, },
"pdump": function() { "pdump": function() { //dump points array
console.log("points array: " + _points); console.log("points array: " + _points);
} }
}; };
@ -84,7 +96,9 @@ function initKeyboard() {
} }
function processWords(e) { function processWords(e) {
wordBuffer += String.fromCharCode(e.which); //chrome fills e.which with an alphabetical index somehow, so we add a lowercase 'a'
if (charOffset < 0) charOffset = window.chrome ? 96 : 0;
wordBuffer += String.fromCharCode(charOffset + e.which);
var match = false; var match = false;
for (var k in wordFuncs) { for (var k in wordFuncs) {

View File

@ -140,8 +140,10 @@ function generate_gcode() {
} }
} }
console.log("num paths: " + j);
// loop over the subpaths (the separately drawn lines) // loop over the subpaths (the separately drawn lines)
for (var j = 0; j < paths.length; j++) { // TODO paths > subpaths for (var j = 0; j < paths.length; j++) { // TODO paths > subpaths
//if (layer > 2 && j > 0) continue; //used as rudimentary brim test in conjunction with the 'btest' keyword (see Keyboard.js)
var commands = paths[j]; var commands = paths[j];
// loop over the coordinates of the subpath // loop over the coordinates of the subpath