allow for reasonable parsing / visualization of large cam gcode files
This commit is contained in:
parent
e973792ef6
commit
017a85f25c
2 changed files with 8 additions and 0 deletions
|
|
@ -548,6 +548,7 @@ kiri.worker = {
|
|||
});
|
||||
}, {
|
||||
fdm: mode === 'FDM',
|
||||
cam: mode === 'CAM',
|
||||
belt: device.bedBelt
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -213,6 +213,7 @@ class Print {
|
|||
|
||||
parseGCode(gcode, offset, progress, done, opts = {}) {
|
||||
const fdm = opts.fdm;
|
||||
const cam = opts.cam;
|
||||
const belt = opts.belt;
|
||||
const lines = gcode
|
||||
.toUpperCase()
|
||||
|
|
@ -468,7 +469,13 @@ class Print {
|
|||
scope.lastPosE = pos.E;
|
||||
}
|
||||
|
||||
const linemod = cam ? Math.ceil(lines.length / 2500) : 0;
|
||||
|
||||
lines.forEach((line, idx) => {
|
||||
if (linemod && idx % linemod === 0) {
|
||||
newlayer = true;
|
||||
autolayer = false;
|
||||
}
|
||||
if (line.indexOf(';LAYER:') === 0) {
|
||||
newlayer = true;
|
||||
autolayer = false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue