fix sparse fill for certain values. update n2 profile

This commit is contained in:
Stewart Allen 2017-12-17 14:14:42 -05:00
commit cada414f21
3 changed files with 44 additions and 37 deletions

View file

@ -74,6 +74,7 @@ var gs_kiri_print = exports;
min: { x:Infinity, y:Infinity, z:Infinity}
},
seq = [],
abs = true,
move = false,
E0G0 = false,
G0 = function() {
@ -92,15 +93,23 @@ var gs_kiri_print = exports;
E: 0.0
},
off = {
x: offset ? offset.x || 0 : 0,
y: offset ? offset.y || 0 : 0,
z: offset ? offset.z || 0 : 0
X: offset ? offset.x || 0 : 0,
Y: offset ? offset.y || 0 : 0,
Z: offset ? offset.z || 0 : 0
};
lines.forEach(function(line) {
line = line.split(";")[0].split(" ");
if (line.length < 2) return;
switch (line.shift()) {
case 'G90':
// absolute positioning
abs = true;
break;
case 'G91':
// relative positioning
abs = false;
break;
case 'G0':
G0();
case 'G1':
@ -120,7 +129,7 @@ var gs_kiri_print = exports;
}
addOutput(
seq,
{x:pos.X + off.x, y:pos.Y + off.y, z:pos.Z + off.z},
{x:pos.X + off.X, y:pos.Y + off.Y, z:pos.Z + off.Z},
!move,
pos.F
);

View file

@ -1122,6 +1122,7 @@ var gs_kiri_slice = exports;
bounds = target.bounds(),
even = true,
evenZ = target.zIndex() % 2 === 0,
maxy = bounds.max.y + (vhlen + anylen * 2),
x, y;
if (full || evenZ) {
@ -1131,7 +1132,7 @@ var gs_kiri_slice = exports;
if (!even && x > bounds.max.x + anxlen + spacing) break;
y = bounds.min.y;
target.newline();
while (y < bounds.max.y) {
while (y <= maxy) {
target.emit(x,y);
y += vhlen;
target.emit(x,y);

View file

@ -13,7 +13,6 @@
"G28 Z0",
"G1 Z0.05 F6000.00",
"G92 E0",
";G1 X10 F600",
"G1 F140 E29",
"G1 F600 E28",
"G1 X15 Y15 Z0.02 F2000",
@ -22,18 +21,16 @@
"M1001"
],
"post":[
"G92 E0",
"G91",
"G1 Z10",
"G90",
"M1002",
"M104 T0 S0",
"M104 S0",
"M140 S0",
"G91",
"G1 E-1 F300",
"G1 E-5 X20 Y20 F6000.00",
"G1 Z0.5 X0 Y0",
"G28 X0 Y0",
"M84",
"G90"
"G1 X20 Y20 F6000",
"G1 X0 Y0",
"M84"
],
"cmd":{
"fan_power": "M106 S{fan_speed}"